Public report of nexu-io/open-design, published 26 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). 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, 26 October 2026, 12:45 UTC · Survey ID cd_e584aed921374e6badac613b283da2e4
nexu-io/open-design
Measured 26 October 2026, 12:31 UTC, at code version 26d6029
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
CAI scoreAt riskDown 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 928,785 lines of product code in 29 projects, tests not counted · Estimated rebuild effort: about 9.5 person-years · Weakest lens: Production Readiness, 36
Findings by how serious they are
598 critical4593 serious734 minor
13 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 12:31 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
89of 89 dimensions measured by tools.
5883of 5925 findings point to an exact file and line, so you can open each one in the code. The other 42 concern the repository as a whole, such as missing documentation.
89dimensions across 7 lenses, read from 928,785 lines of product code in 29 projects.
nexu-io/open-design is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because three passwords or keys sit in the current code and we found no automated security scanning of the code, its secrets or its dependencies. It scores 43 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Production Readiness, at 36, is the weakest lens and counts most in the score. The best first step is replacing the three exposed passwords or keys and switching the old ones off, worth about 7 points. Adding automated security scanning comes next, worth about 5 points. Raising Production Readiness to 62 would lift the score to about 49.
365 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Thirty-three known security holes in the packages the code depends on can be used by attackers, and twenty-eight weaknesses in the code could be used by an attacker. Pinning each tool to an exact version, updating the vulnerable packages and fixing the weaknesses the scanner points to would close these risks. Passing outside input through environment variables would fix the 24 pipeline steps that put outside input straight into a shell command, and limiting each secret to its own step would deal with the seven secrets exposed to more of the pipeline than needed. The 38 parts of the code nobody has worked on for a long time need someone to learn and document them before anyone changes them.
The product code is 928,785 lines, about €1,400,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 Production Readiness rose from 36 to 62, the lowest score rated Strong, the score would rise from 43 to about 49.
Code composition: what the lines of code are
Product code 53%Tests 47%
New since the last survey: 828 findings
These 828 critical or serious findings weren't in the previous survey, on 12 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 8795 findings
These 8795 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one. The first 100 are listed here.
€460,000 to €2,300,000, for 7,635 to 24,222 hours of work, about 9.5 person-years for 5 to 18 engineers
Difficulty of the problem
Low, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 43. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 928,785 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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2), REDACTED.
Raises the score by about 7 points · Low effort · Secret Scanning
2
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €1,400,000 to build again, about 9.5 person-years of work. Its weakest lens is Production Readiness, at 36 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 3 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 7 points for low effort, because it clears the 3 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 1,538,547 lines over the last 90 days, which is about 6,239,663 lines a year. At that pace, the extra work comes to an estimated 780.8 to 4685.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — 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.
1574 modules, with 1917 dependencies between them. 2 loops run through 14 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1534 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.
apps.daemon.src.services uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break apps.daemon.src.services, while a change to apps.daemon.src.services can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: apps.daemon.src.services uses a module listed above it, which is the healthy direction.
apps.daemon.src.services uses packages.contracts.src.analytics.events.shared-enums, so a change to packages.contracts.src.analytics.events.shared-enums can break apps.daemon.src.services, while a change to apps.daemon.src.services can't break packages.contracts.src.analytics.events.shared-enums.
Position
Below the diagonal: apps.daemon.src.services uses a module listed above it, which is the healthy direction.
111 pairs of types, where a type in packages.contracts.src.analytics.events.result-events uses a type in packages.contracts.src.analytics.events.shared-enums. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
packages.contracts.src.analytics.events.result-events uses packages.contracts.src.analytics.events.shared-enums, so a change to packages.contracts.src.analytics.events.shared-enums can break packages.contracts.src.analytics.events.result-events, while a change to packages.contracts.src.analytics.events.result-events can't break packages.contracts.src.analytics.events.shared-enums.
Position
Below the diagonal: packages.contracts.src.analytics.events.result-events uses a module listed above it, which is the healthy direction.
packages.contracts.src.analytics.events.result-events uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break packages.contracts.src.analytics.events.result-events, while a change to packages.contracts.src.analytics.events.result-events can't break packages.contracts.src.api.files.
Position
Below the diagonal: packages.contracts.src.analytics.events.result-events uses a module listed above it, which is the healthy direction.
17→32 packages.contracts.src.analytics.events.result-events uses packages.contracts.src.api.registrypart of a loop✕
Connections
2 pairs of types, where a type in packages.contracts.src.analytics.events.result-events uses a type in packages.contracts.src.api.registry.
packages.contracts.src.analytics.events.result-events uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break packages.contracts.src.analytics.events.result-events, while a change to packages.contracts.src.analytics.events.result-events can't break packages.contracts.src.api.registry.
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.
packages.contracts.src.api.collab uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break packages.contracts.src.api.collab, while a change to packages.contracts.src.api.collab can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: packages.contracts.src.api.collab uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.collab uses packages.contracts.src.api.comments, so a change to packages.contracts.src.api.comments can break packages.contracts.src.api.collab, while a change to packages.contracts.src.api.collab can't break packages.contracts.src.api.comments.
Position
Below the diagonal: packages.contracts.src.api.collab uses a module listed above it, which is the healthy direction.
scripts uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break scripts, while a change to scripts can't break packages.contracts.src.api.files.
Position
Below the diagonal: scripts uses a module listed above it, which is the healthy direction.
apps.daemon.src.integrations uses packages.contracts.src.api.collab, so a change to packages.contracts.src.api.collab can break apps.daemon.src.integrations, while a change to apps.daemon.src.integrations can't break packages.contracts.src.api.collab.
Position
Below the diagonal: apps.daemon.src.integrations uses a module listed above it, which is the healthy direction.
packages.contracts.src.api uses packages.contracts.src.api.collab, so a change to packages.contracts.src.api.collab can break packages.contracts.src.api, while a change to packages.contracts.src.api can't break packages.contracts.src.api.collab.
Position
Below the diagonal: packages.contracts.src.api uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.chat uses apps.daemon.src.db, so a change to apps.daemon.src.db can break packages.contracts.src.api.chat, while a change to packages.contracts.src.api.chat can't break apps.daemon.src.db.
Position
Below the diagonal: packages.contracts.src.api.chat uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.chat uses packages.contracts.src.analytics.events.shared-enums, so a change to packages.contracts.src.analytics.events.shared-enums can break packages.contracts.src.api.chat, while a change to packages.contracts.src.api.chat can't break packages.contracts.src.analytics.events.shared-enums.
Position
Below the diagonal: packages.contracts.src.api.chat uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.chat uses packages.contracts.src.api.comments, so a change to packages.contracts.src.api.comments can break packages.contracts.src.api.chat, while a change to packages.contracts.src.api.chat can't break packages.contracts.src.api.comments.
Position
Below the diagonal: packages.contracts.src.api.chat uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.chat uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break packages.contracts.src.api.chat, while a change to packages.contracts.src.api.chat can't break packages.contracts.src.api.files.
Position
Below the diagonal: packages.contracts.src.api.chat uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.chat uses packages.contracts.src.analytics.events.result-events, so a change to packages.contracts.src.analytics.events.result-events can break packages.contracts.src.api.chat, while a change to packages.contracts.src.api.chat can't break packages.contracts.src.analytics.events.result-events.
Position
Below the diagonal: packages.contracts.src.api.chat uses a module listed above it, which is the healthy direction.
apps.daemon.src.chat-artifacts uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break apps.daemon.src.chat-artifacts, while a change to apps.daemon.src.chat-artifacts can't break packages.contracts.src.api.files.
Position
Below the diagonal: apps.daemon.src.chat-artifacts uses a module listed above it, which is the healthy direction.
apps.daemon.src.chat-artifacts uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break apps.daemon.src.chat-artifacts, while a change to apps.daemon.src.chat-artifacts can't break packages.contracts.src.api.chat.
Position
Below the diagonal: apps.daemon.src.chat-artifacts uses a module listed above it, which is the healthy direction.
apps.web.src.analytics uses packages.contracts.src.analytics.events.shared-enums, so a change to packages.contracts.src.analytics.events.shared-enums can break apps.web.src.analytics, while a change to apps.web.src.analytics can't break packages.contracts.src.analytics.events.shared-enums.
Position
Below the diagonal: apps.web.src.analytics uses a module listed above it, which is the healthy direction.
35 pairs of types, where a type in apps.web.src.analytics uses a type in packages.contracts.src.analytics.events.result-events. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
apps.web.src.analytics uses packages.contracts.src.analytics.events.result-events, so a change to packages.contracts.src.analytics.events.result-events can break apps.web.src.analytics, while a change to apps.web.src.analytics can't break packages.contracts.src.analytics.events.result-events.
Position
Below the diagonal: apps.web.src.analytics uses a module listed above it, which is the healthy direction.
apps.web.src.analytics uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break apps.web.src.analytics, while a change to apps.web.src.analytics can't break packages.contracts.src.api.chat.
Position
Below the diagonal: apps.web.src.analytics uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.projects uses apps.daemon.src.db, so a change to apps.daemon.src.db can break packages.contracts.src.api.projects, while a change to packages.contracts.src.api.projects can't break apps.daemon.src.db.
Position
Below the diagonal: packages.contracts.src.api.projects uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.projects uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break packages.contracts.src.api.projects, while a change to packages.contracts.src.api.projects can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: packages.contracts.src.api.projects uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.projects uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break packages.contracts.src.api.projects, while a change to packages.contracts.src.api.projects can't break packages.contracts.src.api.chat.
Position
Below the diagonal: packages.contracts.src.api.projects uses a module listed above it, which is the healthy direction.
apps.daemon.src.collab uses packages.contracts.src.api.comments, so a change to packages.contracts.src.api.comments can break apps.daemon.src.collab, while a change to apps.daemon.src.collab can't break packages.contracts.src.api.comments.
Position
Below the diagonal: apps.daemon.src.collab uses a module listed above it, which is the healthy direction.
apps.daemon.src.collab uses packages.contracts.src.api.collab, so a change to packages.contracts.src.api.collab can break apps.daemon.src.collab, while a change to apps.daemon.src.collab can't break packages.contracts.src.api.collab.
Position
Below the diagonal: apps.daemon.src.collab uses a module listed above it, which is the healthy direction.
apps.daemon.src.collab uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.daemon.src.collab, while a change to apps.daemon.src.collab can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.daemon.src.collab uses a module listed above it, which is the healthy direction.
apps.daemon.src.plugins uses apps.daemon.src.routes.plugins.marketplaces, so a change to apps.daemon.src.routes.plugins.marketplaces can break apps.daemon.src.plugins, while a change to apps.daemon.src.plugins can't break apps.daemon.src.routes.plugins.marketplaces.
Position
Below the diagonal: apps.daemon.src.plugins uses a module listed above it, which is the healthy direction.
apps.daemon.src.plugins uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.daemon.src.plugins, while a change to apps.daemon.src.plugins can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.daemon.src.plugins uses a module listed above it, which is the healthy direction.
apps.web.src.collab uses packages.contracts.src.api.collab, so a change to packages.contracts.src.api.collab can break apps.web.src.collab, while a change to apps.web.src.collab can't break packages.contracts.src.api.collab.
Position
Below the diagonal: apps.web.src.collab uses a module listed above it, which is the healthy direction.
apps.web.src.collab uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.web.src.collab, while a change to apps.web.src.collab can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.web.src.collab uses a module listed above it, which is the healthy direction.
apps.web.src.runtime.chat uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break apps.web.src.runtime.chat, while a change to apps.web.src.runtime.chat can't break packages.contracts.src.api.chat.
Position
Below the diagonal: apps.web.src.runtime.chat uses a module listed above it, which is the healthy direction.
apps.web.src.runtime.chat uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.web.src.runtime.chat, while a change to apps.web.src.runtime.chat can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.web.src.runtime.chat uses a module listed above it, which is the healthy direction.
apps.web.src.types uses apps.daemon.src.live-artifacts.schema, so a change to apps.daemon.src.live-artifacts.schema can break apps.web.src.types, while a change to apps.web.src.types can't break apps.daemon.src.live-artifacts.schema.
Position
Below the diagonal: apps.web.src.types uses a module listed above it, which is the healthy direction.
apps.web.src.types uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break apps.web.src.types, while a change to apps.web.src.types can't break packages.contracts.src.api.files.
Position
Below the diagonal: apps.web.src.types uses a module listed above it, which is the healthy direction.
apps.web.src.types uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.web.src.types, while a change to apps.web.src.types can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.web.src.types uses a module listed above it, which is the healthy direction.
apps.web.src.lib uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break apps.web.src.lib, while a change to apps.web.src.lib can't break packages.contracts.src.api.files.
Position
Below the diagonal: apps.web.src.lib uses a module listed above it, which is the healthy direction.
apps.web.src.lib uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.web.src.lib, while a change to apps.web.src.lib can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.web.src.lib uses a module listed above it, which is the healthy direction.
apps.web.src.lib uses apps.web.src.types, so a change to apps.web.src.types can break apps.web.src.lib, while a change to apps.web.src.lib can't break apps.web.src.types.
Position
Below the diagonal: apps.web.src.lib uses a module listed above it, which is the healthy direction.
packages.contracts.src.api.registry uses apps.web.src.types, so a change to apps.web.src.types can break packages.contracts.src.api.registry, while a change to packages.contracts.src.api.registry can't break apps.web.src.types.
Position
Below the diagonal: packages.contracts.src.api.registry uses a module listed above it, which is the healthy direction.
32→33 packages.contracts.src.api.registry uses apps.daemon.src.design-systemspart of a loop✕
Connections
2 pairs of types, where a type in packages.contracts.src.api.registry uses a type in apps.daemon.src.design-systems.
packages.contracts.src.api.registry uses apps.daemon.src.design-systems, so a change to apps.daemon.src.design-systems can break packages.contracts.src.api.registry, while a change to packages.contracts.src.api.registry can't break apps.daemon.src.design-systems.
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.
apps.daemon.src.design-systems uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break apps.daemon.src.design-systems, while a change to apps.daemon.src.design-systems can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: apps.daemon.src.design-systems uses a module listed above it, which is the healthy direction.
apps.daemon.src.design-systems uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break apps.daemon.src.design-systems, while a change to apps.daemon.src.design-systems can't break packages.contracts.src.api.registry.
Position
Below the diagonal: apps.daemon.src.design-systems uses a module listed above it, which is the healthy direction.
apps.daemon.src.routes uses apps.daemon.src.routes.host-tools, so a change to apps.daemon.src.routes.host-tools can break apps.daemon.src.routes, while a change to apps.daemon.src.routes can't break apps.daemon.src.routes.host-tools.
Position
Below the diagonal: apps.daemon.src.routes uses a module listed above it, which is the healthy direction.
apps.daemon.src.routes uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break apps.daemon.src.routes, while a change to apps.daemon.src.routes can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: apps.daemon.src.routes uses a module listed above it, which is the healthy direction.
apps.daemon.src.routes uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break apps.daemon.src.routes, while a change to apps.daemon.src.routes can't break packages.contracts.src.api.files.
Position
Below the diagonal: apps.daemon.src.routes uses a module listed above it, which is the healthy direction.
apps.daemon.src.routes uses packages.contracts.src.api.collab, so a change to packages.contracts.src.api.collab can break apps.daemon.src.routes, while a change to apps.daemon.src.routes can't break packages.contracts.src.api.collab.
Position
Below the diagonal: apps.daemon.src.routes uses a module listed above it, which is the healthy direction.
apps.daemon.src.routes uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break apps.daemon.src.routes, while a change to apps.daemon.src.routes can't break packages.contracts.src.api.registry.
Position
Below the diagonal: apps.daemon.src.routes uses a module listed above it, which is the healthy direction.
apps.daemon.src.runtimes uses apps.daemon.src.routes.host-tools, so a change to apps.daemon.src.routes.host-tools can break apps.daemon.src.runtimes, while a change to apps.daemon.src.runtimes can't break apps.daemon.src.routes.host-tools.
Position
Below the diagonal: apps.daemon.src.runtimes uses a module listed above it, which is the healthy direction.
apps.daemon.src.runtimes uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break apps.daemon.src.runtimes, while a change to apps.daemon.src.runtimes can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: apps.daemon.src.runtimes uses a module listed above it, which is the healthy direction.
apps.daemon.src.runtimes uses packages.contracts.src.analytics.events.shared-enums, so a change to packages.contracts.src.analytics.events.shared-enums can break apps.daemon.src.runtimes, while a change to apps.daemon.src.runtimes can't break packages.contracts.src.analytics.events.shared-enums.
Position
Below the diagonal: apps.daemon.src.runtimes uses a module listed above it, which is the healthy direction.
apps.daemon.src.runtimes uses packages.contracts.src.analytics.events.result-events, so a change to packages.contracts.src.analytics.events.result-events can break apps.daemon.src.runtimes, while a change to apps.daemon.src.runtimes can't break packages.contracts.src.analytics.events.result-events.
Position
Below the diagonal: apps.daemon.src.runtimes uses a module listed above it, which is the healthy direction.
apps.daemon.src.runtimes uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break apps.daemon.src.runtimes, while a change to apps.daemon.src.runtimes can't break packages.contracts.src.api.chat.
Position
Below the diagonal: apps.daemon.src.runtimes uses a module listed above it, which is the healthy direction.
apps.daemon.src.runtimes uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break apps.daemon.src.runtimes, while a change to apps.daemon.src.runtimes can't break packages.contracts.src.api.registry.
Position
Below the diagonal: apps.daemon.src.runtimes uses a module listed above it, which is the healthy direction.
apps.web.src.components uses apps.daemon.src.live-artifacts.schema, so a change to apps.daemon.src.live-artifacts.schema can break apps.web.src.components, while a change to apps.web.src.components can't break apps.daemon.src.live-artifacts.schema.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break apps.web.src.components, while a change to apps.web.src.components can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
104 pairs of types, where a type in apps.web.src.components uses a type in apps.web.src.components.Icon. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
apps.web.src.components uses apps.web.src.components.Icon, so a change to apps.web.src.components.Icon can break apps.web.src.components, while a change to apps.web.src.components can't break apps.web.src.components.Icon.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses packages.contracts.src.analytics.events.shared-enums, so a change to packages.contracts.src.analytics.events.shared-enums can break apps.web.src.components, while a change to apps.web.src.components can't break packages.contracts.src.analytics.events.shared-enums.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses packages.contracts.src.api.comments, so a change to packages.contracts.src.api.comments can break apps.web.src.components, while a change to apps.web.src.components can't break packages.contracts.src.api.comments.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break apps.web.src.components, while a change to apps.web.src.components can't break packages.contracts.src.api.files.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses packages.contracts.src.analytics.events.result-events, so a change to packages.contracts.src.analytics.events.result-events can break apps.web.src.components, while a change to apps.web.src.components can't break packages.contracts.src.analytics.events.result-events.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses packages.contracts.src.api.collab, so a change to packages.contracts.src.api.collab can break apps.web.src.components, while a change to apps.web.src.components can't break packages.contracts.src.api.collab.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break apps.web.src.components, while a change to apps.web.src.components can't break packages.contracts.src.api.chat.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.web.src.components, while a change to apps.web.src.components can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses apps.web.src.types, so a change to apps.web.src.types can break apps.web.src.components, while a change to apps.web.src.components can't break apps.web.src.types.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break apps.web.src.components, while a change to apps.web.src.components can't break packages.contracts.src.api.registry.
Position
Below the diagonal: apps.web.src.components uses a module listed above it, which is the healthy direction.
apps.web.src.components.home-hero uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break apps.web.src.components.home-hero, while a change to apps.web.src.components.home-hero can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: apps.web.src.components.home-hero uses a module listed above it, which is the healthy direction.
apps.web.src.components.home-hero uses apps.web.src.components.Icon, so a change to apps.web.src.components.Icon can break apps.web.src.components.home-hero, while a change to apps.web.src.components.home-hero can't break apps.web.src.components.Icon.
Position
Below the diagonal: apps.web.src.components.home-hero uses a module listed above it, which is the healthy direction.
apps.web.src.components.home-hero uses apps.web.src.types, so a change to apps.web.src.types can break apps.web.src.components.home-hero, while a change to apps.web.src.components.home-hero can't break apps.web.src.types.
Position
Below the diagonal: apps.web.src.components.home-hero uses a module listed above it, which is the healthy direction.
apps.web.src.components.home-hero uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break apps.web.src.components.home-hero, while a change to apps.web.src.components.home-hero can't break packages.contracts.src.api.registry.
Position
Below the diagonal: apps.web.src.components.home-hero uses a module listed above it, which is the healthy direction.
apps.web.src.runtime uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break apps.web.src.runtime, while a change to apps.web.src.runtime can't break packages.contracts.src.api.files.
Position
Below the diagonal: apps.web.src.runtime uses a module listed above it, which is the healthy direction.
apps.web.src.runtime uses packages.contracts.src.api.collab, so a change to packages.contracts.src.api.collab can break apps.web.src.runtime, while a change to apps.web.src.runtime can't break packages.contracts.src.api.collab.
Position
Below the diagonal: apps.web.src.runtime uses a module listed above it, which is the healthy direction.
apps.web.src.runtime uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break apps.web.src.runtime, while a change to apps.web.src.runtime can't break packages.contracts.src.api.chat.
Position
Below the diagonal: apps.web.src.runtime uses a module listed above it, which is the healthy direction.
apps.web.src.runtime uses apps.web.src.types, so a change to apps.web.src.types can break apps.web.src.runtime, while a change to apps.web.src.runtime can't break apps.web.src.types.
Position
Below the diagonal: apps.web.src.runtime uses a module listed above it, which is the healthy direction.
apps.web.src.runtime uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break apps.web.src.runtime, while a change to apps.web.src.runtime can't break packages.contracts.src.api.registry.
Position
Below the diagonal: apps.web.src.runtime uses a module listed above it, which is the healthy direction.
apps.daemon.src uses apps.daemon.src.db, so a change to apps.daemon.src.db can break apps.daemon.src, while a change to apps.daemon.src can't break apps.daemon.src.db.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses apps.daemon.src.live-artifacts.schema, so a change to apps.daemon.src.live-artifacts.schema can break apps.daemon.src, while a change to apps.daemon.src can't break apps.daemon.src.live-artifacts.schema.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses apps.daemon.src.routes.host-tools, so a change to apps.daemon.src.routes.host-tools can break apps.daemon.src, while a change to apps.daemon.src can't break apps.daemon.src.routes.host-tools.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses apps.daemon.src.runtimes.chat-run-records, so a change to apps.daemon.src.runtimes.chat-run-records can break apps.daemon.src, while a change to apps.daemon.src can't break apps.daemon.src.runtimes.chat-run-records.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses packages.contracts.src.analytics.events.shared-enums, so a change to packages.contracts.src.analytics.events.shared-enums can break apps.daemon.src, while a change to apps.daemon.src can't break packages.contracts.src.analytics.events.shared-enums.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses packages.contracts.src.api.comments, so a change to packages.contracts.src.api.comments can break apps.daemon.src, while a change to apps.daemon.src can't break packages.contracts.src.api.comments.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break apps.daemon.src, while a change to apps.daemon.src can't break packages.contracts.src.api.files.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses packages.contracts.src.api.collab, so a change to packages.contracts.src.api.collab can break apps.daemon.src, while a change to apps.daemon.src can't break packages.contracts.src.api.collab.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break apps.daemon.src, while a change to apps.daemon.src can't break packages.contracts.src.api.chat.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.daemon.src, while a change to apps.daemon.src can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break apps.daemon.src, while a change to apps.daemon.src can't break packages.contracts.src.api.registry.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.daemon.src uses apps.daemon.src.design-systems, so a change to apps.daemon.src.design-systems can break apps.daemon.src, while a change to apps.daemon.src can't break apps.daemon.src.design-systems.
Position
Below the diagonal: apps.daemon.src uses a module listed above it, which is the healthy direction.
apps.web.src.providers uses apps.daemon.src.live-artifacts.schema, so a change to apps.daemon.src.live-artifacts.schema can break apps.web.src.providers, while a change to apps.web.src.providers can't break apps.daemon.src.live-artifacts.schema.
Position
Below the diagonal: apps.web.src.providers uses a module listed above it, which is the healthy direction.
apps.web.src.providers uses packages.contracts.src.api.comments, so a change to packages.contracts.src.api.comments can break apps.web.src.providers, while a change to apps.web.src.providers can't break packages.contracts.src.api.comments.
Position
Below the diagonal: apps.web.src.providers uses a module listed above it, which is the healthy direction.
apps.web.src.providers uses packages.contracts.src.api.files, so a change to packages.contracts.src.api.files can break apps.web.src.providers, while a change to apps.web.src.providers can't break packages.contracts.src.api.files.
Position
Below the diagonal: apps.web.src.providers uses a module listed above it, which is the healthy direction.
apps.web.src.providers uses packages.contracts.src.api.chat, so a change to packages.contracts.src.api.chat can break apps.web.src.providers, while a change to apps.web.src.providers can't break packages.contracts.src.api.chat.
Position
Below the diagonal: apps.web.src.providers uses a module listed above it, which is the healthy direction.
apps.web.src.providers uses packages.contracts.src.api.projects, so a change to packages.contracts.src.api.projects can break apps.web.src.providers, while a change to apps.web.src.providers can't break packages.contracts.src.api.projects.
Position
Below the diagonal: apps.web.src.providers uses a module listed above it, which is the healthy direction.
apps.web.src.providers uses apps.web.src.types, so a change to apps.web.src.types can break apps.web.src.providers, while a change to apps.web.src.providers can't break apps.web.src.types.
Position
Below the diagonal: apps.web.src.providers uses a module listed above it, which is the healthy direction.
apps.web.src.providers uses packages.contracts.src.api.registry, so a change to packages.contracts.src.api.registry can break apps.web.src.providers, while a change to apps.web.src.providers can't break packages.contracts.src.api.registry.
Position
Below the diagonal: apps.web.src.providers uses a module listed above it, which is the healthy direction.
apps.web.src.providers uses apps.daemon.src.design-systems, so a change to apps.daemon.src.design-systems can break apps.web.src.providers, while a change to apps.web.src.providers can't break apps.daemon.src.design-systems.
Position
Below the diagonal: apps.web.src.providers uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 53% · 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
786
High / Critical
A03:2025 — Software Supply Chain Failures
57
High / Critical
A02:2025 — Security Misconfiguration
34
High / Critical
A07:2025 — Authentication Failures
3
High / Critical
Roadmap
Immediately resolve the three leaked secrets in REDACTED and REDACTED, then integrate a SAST step into CI to prevent future security regressions. Clean up the dependency tree by removing unused packages and explicitly declaring imports, while ensuring all custom controls are fully keyboard-operable. Finally, harden outbound HTTP calls by enforcing timeouts, adding retry logic, and implementing circuit breakers to improve system resilience.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2), REDACTED.
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
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.
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
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 — 598
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 — 4593
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 — 734
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 13
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 89 of 89 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 89 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, 5883 of 5925 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not included — the JavaScript/TypeScript suite (vitest via `pnpm install --frozen-lockfile --ignore-scripts` in apps/closure/ (0 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in apps/daemon/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in apps/desktop/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in apps/packaged/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in apps/web/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in e2e/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/agui-adapter/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/components/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/contracts/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/diagnostics/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/download/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/dsh-runtime/) did not finish re-running within its budget: too large to re-run within its budget.
D12 Dependency Hygiene — 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. This repository's 3 shipped Python distribution(s) across 1 manifest(s) WERE read; what went unanswered is the currency half, because it grades an EXACT pin against the newest release and every declaration here is a floor or a range — which installs the newest release it admits and so cannot be behind one. So pypi.org was never asked. This is a true statement about the repository, and the healthy one, NOT a gap on our side: no reader we could write would find a currency question here.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D28 Secrets (history) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `gitleaks` TIMED OUT after 101.6s against a 101.6s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. Nothing about this repository is asserted by the absence of a result; the budget is ours to raise, and raising it is our backlog item, not an action for this repository's owner.
D31 IaC & Container Security — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `.github/scripts/lib/feishu/release.ts`, `apps/daemon/src/analytics.ts`, `apps/daemon/src/chat-artifacts/store.ts`, `apps/daemon/src/collab/project-content-transfer-state.ts`, `apps/daemon/src/collab/team-resource-list-cache.ts`, … (+112 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.
D41 Kernel & Syscall Confinement — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Charts/open-design/templates/deployment.yaml:2, REDACTED:2 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
AC1 Text alternatives — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 11 script file(s) building 44 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. REDACTED, apps/web/src/components/ChatComposer.tsx, apps/web/src/components/ChatPane.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 2419 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC2 Forms & labels — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 11 script file(s) building 44 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. REDACTED, apps/web/src/components/ChatComposer.tsx, apps/web/src/components/ChatPane.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 2419 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC2 Forms & labels — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 67 further occurrence(s) are not listed individually; the score already reflects all 107.
AC3 Page structure — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 11 script file(s) building 44 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. REDACTED, apps/web/src/components/ChatComposer.tsx, apps/web/src/components/ChatPane.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 2419 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC3 Page structure — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1499 further occurrence(s) are not listed individually; the score already reflects all 1539.
AC4 Keyboard semantics — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 11 script file(s) building 44 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. REDACTED, apps/web/src/components/ChatComposer.tsx, apps/web/src/components/ChatPane.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 2419 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC4 Keyboard semantics — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 4206 further occurrence(s) are not listed individually; the score already reflects all 4246.
AC5 ARIA correctness — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 11 script file(s) building 44 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. REDACTED, apps/web/src/components/ChatComposer.tsx, apps/web/src/components/ChatPane.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 2419 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC6 Visual & motion safety — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex').
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in packages/contracts/src/agent-tools/registry.ts, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 15 — the compose project is invalid) — service "open-design" has neither an image nor a build context specified: invalid compose project; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (apps/daemon/src/agent-session-resume.ts:3), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (apps/daemon/src/agent-session-resume.ts:3), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (apps/daemon/src/agent-session-resume.ts:3), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (apps/daemon/src/agent-session-resume.ts:3), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 237 further occurrence(s) are not listed individually; the score already reflects all 277.
IC1 Incompleteness & stubs — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P2 Observability — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 266 further occurrence(s) are not listed individually; the score already reflects all 306.
P7 Outbound HTTP resilience — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 155 further occurrence(s) are not listed individually; the score already reflects all 195.
PF3 Async & latency hygiene — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 55 further occurrence(s) are not listed individually; the score already reflects all 95.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 2062 further occurrence(s) are not listed individually; the score already reflects all 2102.
R3 Large Files — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 340 further occurrence(s) are not listed individually; the score already reflects all 380.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 83 further occurrence(s) are not listed individually; the score already reflects all 123.
R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 186 further occurrence(s) are not listed individually; the score already reflects all 226.
X2 Cancellation propagation — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 340 further occurrence(s) are not listed individually; the score already reflects all 380.
X24 Document value interpolated into markup unescaped — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 56 further occurrence(s) are not listed individually; the score already reflects all 96.
X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 902 further occurrence(s) are not listed individually; the score already reflects all 942.
X6 Hand-rolled structured-format parsing — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 26 further occurrence(s) are not listed individually; the score already reflects all 66.
X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 108 further occurrence(s) are not listed individually; the score already reflects all 148.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
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.
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.
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.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D42 Runtime Threat Enforcement: Runtime enforcement is read from committed policy files — a Tetragon/Falco/Kyverno stack installed cluster-wide (Helm release, platform add-on) with no in-repo trace can't be credited, and a committed policy is declared intent, not proof the engine is running and blocking in the live cluster.
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.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
1250 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ProjectView.ProjectView at 1776. A further 53 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 cli.runPlugin at 38 — they are counted neither in the figure above nor in this dimension's score. 16 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: apps/web/src/components/plugins-home/subfacetLabel.ts (subfacetLabel.pluginSubfacetLabel at 25), packages/contracts/src/api/share.ts (share.isShareBridgeViewportRect at 25), apps/daemon/src/collab/public-file-publication-store.ts (public-file-publication-store.createPublicFileStopStartup at 23), apps/web/src/runtime/amr-auth-retry-continuation.ts (amr-auth-retry-continuation.canConsumeAmrAuthRetryContinuation at 22), apps/daemon/src/mcp-agent-install.ts (mcp-agent-install.planAgentInstall at 21), and 11 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.
+ 1198 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 126 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with ProjectView.ProjectView (cyclomatic 1776), App.AppInner (cyclomatic 830), FileViewer.HtmlViewer (cyclomatic 615). — 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 126 together lifts Cyclomatic Complexity from 2.0 to about 4.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 1456 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 180 bodies over 60 down to 60 or less in Cognitive Complexity — start with ProjectView.ProjectView (cognitive 2274), App.AppInner (cognitive 775), FileViewer.HtmlViewer (cognitive 767). — 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 180 together lifts Cognitive Complexity from 2.0 to about 3.4/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.1 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 369 FunctionTooLong finding(s) in God Classes — start with cli.ts (18), REDACTED (9), ChatComposer.tsx (8). — One of this dimension's main actionable groups (369 warning-level).
Resolve the 202 FileTooLong finding(s) in God Classes — start with REDACTED (8), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (202 warning-level).
Resolve the 33 ClassTooLong finding(s) in God Classes — start with ProjectView.tsx, ChatPane.tsx, HomeView.tsx. — One of this dimension's main actionable groups (33 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
17 duplicated block group(s) detected. Measured on part of this repository only: .ts, .tsx (99% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with release.py, generate_pet_images.py. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with release.py, pet_job_status.py. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Duplicated block (37–40 lines × 2) finding(s) in Code Duplication — start with rerun_infra_cancel.py. — One of this dimension's main actionable groups (1 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling6.8 / 10Adequate✓ 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.
27 production modules (npm), 0 dependency cycle(s), 3 unstable depended-on module(s). Read from the build's own module declarations; 8 module(s) off the main sequence.
Off the main sequence: @open-design/platform · ×7
Unstable project @open-design/daemon
Unstable project @open-design/desktop
Unstable project @open-design/web
Off the main sequence: @open-design/contracts
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Unstable project @open-design/daemon finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project @open-design/desktop finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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.
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).
Resolve the 1 Classify ADR enforcement finding(s) in Architectural Integrity — start with 0001-centralize-daemon-startup.md. — One of this dimension's main actionable groups (1 recommendation-level).
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution9.4 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
27571 test methods: 26273 unit, 0 integration, 0 BDD, 1298 e2e. The JavaScript/TypeScript suite contributes 27565 `it`/`test` case(s) across 2881 test file(s) declaring at least one; its tier split is read from package names and paths only. The Python suite contributes 6 test function(s) across 1 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 28 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
75 skipped (58 with a documented reason), 8 zero-assertion, 3 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 27565 tests.
Skipped test: [P0] @critical deleting the active conversation selects the remaining conversation in history · ×17e2e/ui/app-restoration.test.ts:745
No assertions: accepts v3 evidence without retiring v2 or requiring new fields on legacy events · ×8packages/contracts/tests/analytics-run-finished-contract.test.ts:44
Fixed-sleep synchronisation: renews a long maintenance lease so a competing sweep cannot steal it · ×3packages/standalone/tests/blob.test.ts:85
Mock-dominated test: posts run correlation fields and reports run metadata callbacks · ×127apps/web/tests/providers/sse.test.ts:2229
Resolve the 17 Skipped test finding(s) in Test Quality — start with real-daemon-run.test.ts (6), DesignSystemFlow.test.tsx (6), app-restoration.test.ts. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 8 No assertions finding(s) in Test Quality — start with visual-workspace.test.ts (2), relogin-required.test.ts (2), analytics-run-finished-contract.test.ts. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 3 Fixed-sleep synchronisation finding(s) in Test Quality — start with blob.test.ts, collab-sync-routes.test.ts, vela.routes.test.ts. — One of this dimension's main actionable groups (3 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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 3 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 3 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (0 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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: REDACTED (120×2306=276720); apps/web/src/components/ProjectView.tsx (71×1776=126096); REDACTED (46×2347=107962) Repeated repair below the complexity floor: packages/contracts/src/api/chat.ts (16 of 31 changes were fixes); apps/daemon/src/strategies/od-next/coordinator.ts (7 of 9 changes were fixes); apps/daemon/src/tool-tokens.ts (5 of 9 changes were fixes)
Resolve the 199 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (5), session.ts (3), REDACTED (3). — One of this dimension's main actionable groups (199 warning-level).
Resolve the 21 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), REDACTED, coordinator.ts. — One of this dimension's main actionable groups (21 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.0 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
147 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is apps/web/src/components/remix-icon-paths.ts. Counted over 1531 of the 2074 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×7
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_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.
16 deducted task-comment markers across 867117 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.
Resolve the 14 TodoComment finding(s) in Explicit Debt — start with LexicalComposerInput.test.tsx (2), run-failure-agent-reply-incomplete.test.ts, ProjectView.run-cleanup.test.tsx. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 1 FixmeComment finding(s) in Explicit Debt — start with workspace-multi-client-collab.test.ts. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 XxxComment finding(s) in Explicit Debt — start with conversation-fork-title-numbering.test.ts. — One of this dimension's main actionable groups (1 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
0 of 1 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question). How well each record argues its case is not measured.
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.
42 domain type(s) cross context boundaries across 25 contexts.
Cross-context type LifecycleStatus (web → standalone) · ×16packages/standalone/src/launcher.ts:25
Cross-context type Platform (daemon → platform) · ×5REDACTED:79
Cross-context type Platform (daemon → packaged) · ×3apps/packaged/src/sidecars.ts:474
Cross-context type PluginShareAction (daemon → contracts) · ×2packages/contracts/src/plugins/share-actions.ts:16
Cross-context type Platform (daemon → sidecar) · ×2packages/sidecar/src/stamp.ts:160
+ 14 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 16 Cross-context type LifecycleStatus (web → standalone) finding(s) in Boundary Type-Coupling — start with launcher.ts (13), shared-lifecycle.ts (2), REDACTED. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 5 Cross-context type Platform (daemon → platform) finding(s) in Boundary Type-Coupling — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 warning-level).
Resolve the 3 Cross-context type Platform (daemon → packaged) finding(s) in Boundary Type-Coupling — start with managed-headless.ts (2), sidecars.ts. — One of this dimension's main actionable groups (3 warning-level).
Enforce Boundary Type-Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d23_recommendation.md · top locations in Appendix A, every location in findings.md.
5 of 29 build units (Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
789 finding(s): 0 critical, 430 high, 344 medium, 15 low. 355 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 195 file(s) — `.claude/skills/od-contribute/scripts/discover-doc-gaps.sh` (line 77, line 78), `.claude/skills/od-contribute/scripts/setup-workspace.sh` (line 16), `.claude/skills/od-contribute/scripts/validate-markdown.sh` (line 49, line 82, line 110, …), `.github/scripts/agent-pr-explore-sandbox.sh` (line 65), `.github/scripts/lib/feishu/release.ts` (line 416), … (+190 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 22 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
+ 24 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 10 REDACTED finding(s) charged to Static Analysis (SAST) — the other 355 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (365 issue-level, 10 of them charged here).
Resolve the 23 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (10), REDACTED (6), REDACTED (3). — One of this dimension's main actionable groups (23 issue-level).
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 30 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (23), REDACTED (7). — One of this dimension's main actionable groups (30 issue-level).
Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 6 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED, REDACTED. — One of this dimension's main actionable groups (6 issue-level).
Resolve the 1 Critical IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 9 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 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.
299 of 1531 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is apps/web/src/i18n/content.th.ts. Counted over 1531 of the 2074 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 38 Orphaned knowledge finding(s) in Knowledge Freshness — start with content.th.ts, content.uk.ts, content.fa.ts. — One of this dimension's main actionable groups (38 issue-level).
Resolve the 261 Orphaned file finding(s) in Knowledge Freshness — start with types.ts (4), events.ts (3), schema.ts (2). — One of this dimension's main actionable groups (261 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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 11 Change coupling finding(s) in Change Coupling — start with en.ts (2), HomeView.tsx (2), content.fr.ts. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with REDACTED. — 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.
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
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).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
What it measures: Whether the Kubernetes deployment wires runtime threat enforcement — a detection engine (Tetragon/Falco) and/or an admission-control policy gate (Kyverno / OPA Gatekeeper / PodSecurity). Presence of committed policy, not a runtime guarantee.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a runtime threat-detection engine (Tetragon TracingPolicy / Falco) and an admission-control policy (Kyverno / OPA Gatekeeper / PodSecurity). Reward-leaning; NotApplicable without workloads. Deterministic.
Resolve the 1 No runtime threat detection finding(s) in Runtime Threat Enforcement. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d42_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
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 24 platform declaration(s) and 3 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 alternatives4.9 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×2) — apps/daemon/src/brands/index.ts:1957, apps/daemon/src/brands/index.ts:1959
Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). (×5) — apps/web/src/components/DesignSystemAssetDropzone.tsx:386, REDACTED:19510, apps/web/src/components/HomeHero.tsx:2642, …
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×29) — REDACTED:1282, apps/web/src/components/home-hero/PixelScanLogo.tsx:66, design-templates/flowai-live-dashboard-template/assets/template.html:132, …
Video with no captions <track> offers no captions. Add a <track kind="captions"> pointing at a WebVTT file for this video (or confirm captions are provided another way). (×2) — skills/8-bit-orbit-video-template/example.html:39, skills/weread-year-in-review-video-template/example.html:59
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels7.7 / 10Strong✓ 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 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. (×23) — REDACTED:4279, apps/web/src/components/BrandReferencePicker.tsx:283, apps/web/src/components/BrandsTab.tsx:187, …
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×11) — apps/web/src/components/DesignFilesPanel.tsx:976, apps/web/src/components/DesignFilesPanel.tsx:1124, apps/web/src/components/DesignSystemAssetDropzone.tsx:466, …
This <article> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — REDACTED:20601
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. (×5) — apps/web/src/components/GenUISurfaceRenderer.tsx:747, apps/web/src/components/MemorySection.tsx:2035, apps/web/src/components/MemorySection.tsx:2050, …
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.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×8) — apps/web/app/layout.tsx:44, assets/frames/android-pixel.html:6, assets/frames/browser-chrome.html:6, …
An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label. (×8) — apps/web/src/components/DesignSystemAssetDropzone.tsx:363, apps/web/src/components/DesignsTab.tsx:858, apps/web/src/components/FileWorkspace.tsx:8108, …
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×20) — apps/web/src/components/PluginDetailView.tsx:397, design-systems/agentic/components.html:142, design-systems/agentic/system/artifacts/deck.html:127, …
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×2) — clipper/capture.js:555, clipper/store/assets/screenshot-frame.html:1
A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. (×2) — clipper/capture.js:555, clipper/store/assets/screenshot-frame.html:1
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
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".
This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×7) — apps/web/src/collab/PresenceBar.tsx:186, apps/web/src/components/BrandPickerModal.tsx:68, apps/web/src/components/ChatComposer.tsx:4717, …
This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×7) — apps/web/src/components/AvatarMenu.tsx:585, REDACTED:2369, apps/web/src/components/DesignKitView.tsx:1691, …
This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. (×10) — apps/web/src/components/BoardComposerPopover.tsx:403, apps/web/src/components/ChatComposer.tsx:3420, apps/web/src/components/ChatComposer.tsx:3480, …
This <section role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×2) — apps/web/src/components/CommunityTemplatePreview.tsx:317, apps/web/src/components/FileWorkspace.tsx:8321
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/CommunityView.tsx:415
This <aside role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — apps/web/src/components/ConnectorsBrowser.tsx:1374
This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. — apps/web/src/components/ContextChipHoverCard.tsx:25
The repo's own CSS styles .context-chip-strip__body with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/ContextChipStrip.tsx:96
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}. (×4) — apps/web/src/components/DesignFilesPanel.tsx:966, apps/web/src/components/DesignFilesPanel.tsx:1024, apps/web/src/components/DesignFilesPanel.tsx:1030, …
The repo's own CSS styles .df-row-check with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/DesignFilesPanel.tsx:1282
The repo's own CSS styles .ds-source-link-open with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/DesignSystemFlow.tsx:1187
The repo's own CSS styles .toggle-slider with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/DesignSystemsSection.tsx:603
The repo's own CSS styles .file-ops-toggle with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/FileOpsSummary.tsx:334
The repo's own CSS styles .title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — REDACTED:4156
An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action. — apps/web/src/components/FileWorkspace.tsx:4681
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 2419 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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 the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. 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.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
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.
Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
What to do
Name the access rules — roles/permissions declared once (a @Roles/@Permissions decorator with its guard, a CASL ability, a casbin model, or Supabase CREATE POLICY) and consulted where access is checked, so the rule set is reviewable and testable on its own.
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 ("## RULE 3 — TodoWrite the plan, then liv…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/daemon/src/prompts/discovery.ts:132
A placeholder string ("rounds the orchestrator applies the fall…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/daemon/src/prompts/panel.ts:209
A placeholder string ("استخدم قالب Magazine Article لتحويل محتو…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:50
A placeholder string ("استخدم قالب Twitter Share Card لتحويل مح…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:92
A placeholder string ("استخدم قالب Xiaohongshu Card لتحويل محتو…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:98
A placeholder string ("استخدم قالب Data Visualization Report لت…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:134
A placeholder string ("استخدم قالب Guizang Editorial E-Ink Deck…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:140
A placeholder string ("استخدم قالب Open-Slide 1920 Canvas Deck …") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:146
A placeholder string ("استخدم قالب Swiss International Deck لتح…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:152
A placeholder string ("استخدم قالب Kami Parchment Document لتحو…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:194
A placeholder string ("استخدم قالب NYT-Style Data Chart Frame ل…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:374
A placeholder string ("استخدم قالب Sticky Flowchart Frame لتحوي…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:380
A placeholder string ("استخدم قالب Glitch Title Frame لتحويل مح…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:386
A placeholder string ("استخدم قالب Light-Leak Cinematic Frame ل…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:392
A placeholder string ("استخدم قالب Liquid Background Hero لتحوي…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:398
A placeholder string ("استخدم قالب Logo Outro Frame لتحويل محتو…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:404
A placeholder string ("استخدم قالب macOS Notification Banner لت…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:410
A placeholder string ("استخدم قالب Device 3D Showcase لتحويل مح…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:596
A placeholder string ("استخدم قالب الملصق التسويقي لتحويل محتوا…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:644
A placeholder string ("استخدم قالب الشرائح بنمط Keynote لتحويل …") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:650
A placeholder string ("استخدم قالب السيرة الذاتية العصرية لتحوي…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:716
A placeholder string ("استخدم قالب بطاقة منشور Reddit لتحويل مح…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:758
A placeholder string ("استخدم قالب بطاقة Spotify Now-Playing لت…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:764
A placeholder string ("استخدم قالب بطاقة منشور X / Twitter لتحو…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:770
A placeholder string ("استخدم قالب VFX Text Cursor لتحويل محتوا…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:890
A placeholder string ("استخدم قالب Hyperframes Video لتحويل محت…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.ar.ts:902
A placeholder string ("Usa la plantilla Magazine Article para c…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:50
A placeholder string ("Usa la plantilla Twitter Share Card para…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:92
A placeholder string ("Usa la plantilla Xiaohongshu Card para c…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:98
A placeholder string ("Usa la plantilla Data Visualization Repo…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:134
A placeholder string ("Usa la plantilla Guizang Editorial E-Ink…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:140
A placeholder string ("Usa la plantilla Open-Slide 1920 Canvas …") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:146
A placeholder string ("Usa la plantilla Swiss International Dec…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:152
A placeholder string ("Usa la plantilla Kami Parchment Document…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:194
A placeholder string ("Usa la plantilla NYT-Style Data Chart Fr…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:374
A placeholder string ("Usa la plantilla Sticky Flowchart Frame …") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:380
A placeholder string ("Usa la plantilla Glitch Title Frame para…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:386
A placeholder string ("Usa la plantilla Light-Leak Cinematic Fr…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:392
A placeholder string ("Usa la plantilla Liquid Background Hero …") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:398
A placeholder string ("Usa la plantilla Logo Outro Frame para c…") is still in shipped code — typical of generated boilerplate that was never filled in. — apps/web/src/i18n/content.es-ES.ts:404
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.
The guard above `return undefined;` also returns `undefined`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — apps/daemon/src/connectors/composio.ts:1347
The guard above `return 'en';` also returns `'en'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — apps/daemon/src/mcp-brief.ts:532
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. (×2) — apps/daemon/src/media/config.ts:285, tools/release/src/catalog/entry-assets.ts:44
The guard above `return false;` also returns `false`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — apps/daemon/src/memory-connectors.ts:350
The `if` and its `else` contain the same statements, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body. — apps/daemon/src/plugins/export.ts:76
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. (×4) — apps/daemon/src/plugins/validate.ts:91, REDACTED:2851, REDACTED:18499, …
`folderLooksLikePlugin` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — apps/daemon/src/services/plugin-installation.ts:85
`onRemoveMember` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it. — REDACTED:2410
`onDeleteConversation` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it. — apps/web/src/components/DesignSystemFlow.tsx:2877
`onViewAll` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it. — apps/web/src/components/EntryShell.tsx:2241
The guard above `return 'file';` also returns `'file'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — apps/web/src/components/FileWorkspace.tsx:8783
The guard above `return 'history';` also returns `'history'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — apps/web/src/components/TasksView.tsx:280
The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — tools/pack/src/cache/lock.ts:40
`exportCatalogFromEnv` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — tools/release/src/catalog/export-catalog.ts:66
A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead. (×19) — apps/daemon/src/agents.ts:1, apps/daemon/src/brands/engine/build.ts:1, apps/daemon/src/brands/engine/derive.ts:1, …
A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. — apps/daemon/tests/opend-2623-form-answer-constraint-carriage.test.ts:57
`reportChange` has an empty body — confirm it's an intentional no-op and not an unfinished method. — apps/web/src/collab/collab-context.tsx:42
`requestPublish` has an empty body — confirm it's an intentional no-op and not an unfinished method. — apps/web/src/collab/collab-context.tsx:43
What to do
Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add a README to the 22 of 27 project(s) that lack one — worth up to 1.6 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
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 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.
Only 4/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `apps/web`, `packages/sidecar`.
`apps/daemon/src/agent-companion-setup.ts` reports through `console.*` at line 236 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/agent-companion-setup.ts:236
`apps/daemon/src/app-config.ts` reports through `console.*` at line 851 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/app-config.ts:851
`apps/daemon/src/app-config.ts` reports through `console.*` at line 857 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/app-config.ts:857
`REDACTED` reports through `console.*` at line 299 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:299
`REDACTED` reports through `console.*` at line 309 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:309
`REDACTED` reports through `console.*` at line 469 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:469
`REDACTED` reports through `console.*` at line 482 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:482
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 653 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:653
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 919 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:919
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1050 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1050
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1061 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1061
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1196 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1196
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1236 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1236
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1486 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1486
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1520 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1520
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1590 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1590
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1628 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1628
`apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1641 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/byok-tools.ts:1641
`REDACTED` reports through `console.*` at line 324 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:324
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 424 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:424
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1694 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1694
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1710 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1710
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1730 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1730
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1753 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1753
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1772 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1772
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1795 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1795
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1812 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1812
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1816 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1816
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1842 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1842
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1857 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:1857
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2444 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2444
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2461 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2461
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2465 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2465
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2497 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2497
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2509 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2509
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2522 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2522
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2541 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2541
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2567 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2567
`apps/daemon/src/connectionTest.ts` reports through `console.*` at line 2750 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — apps/daemon/src/connectionTest.ts:2750
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.
No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 718557 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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 & Backup7.0 / 10Strong✓ 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.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
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. (×40) — apps/daemon/src/byok-tools.ts:511, apps/daemon/src/byok-tools.ts:659, apps/daemon/src/byok-tools.ts:834, …
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 the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`fs.mkdtempSync` in `buildFromUrl` 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. — apps/daemon/src/brands/engine/build.ts:422
`fs.readFileSync` in `buildFromUrl` 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) — apps/daemon/src/brands/engine/build.ts:439, apps/daemon/src/brands/engine/build.ts:442, apps/daemon/src/brands/engine/build.ts:453, …
`fs.rmSync` in `buildFromUrl` 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. — apps/daemon/src/brands/engine/build.ts:470
`fs.existsSync` in `harvestFonts` 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. — apps/daemon/src/brands/fonts.ts:273
`fs.mkdirSync` in `harvestFonts` 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. — apps/daemon/src/brands/fonts.ts:276
`fs.writeFileSync` in `harvestFonts` 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. — apps/daemon/src/brands/fonts.ts:277
`fs.mkdirSync` in `harvestSiteImagery` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:369
`fs.existsSync` in `harvestSiteImagery` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:383
`fs.writeFileSync` in `harvestSiteImagery` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:386
`fs.rmSync` in `rollbackBrandExtractionStartup` 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. — apps/daemon/src/brands/index.ts:249
`fs.statSync` in `brandExtractionProducedFiles` 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. — apps/daemon/src/brands/index.ts:1222
`fs.readFileSync` in `writeOptionalFileToProject` 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. — apps/daemon/src/brands/index.ts:2131
`fs.readFileSync` in `copyDirectoryToProject` 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. — apps/daemon/src/brands/index.ts:2154
`fs.mkdirSync` in `writeAsset` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:198
`fs.existsSync` in `writeAsset` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:200
`fs.writeFileSync` in `writeAsset` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:201
`fs.writeFileSync` in `fetchServiceFavicons` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:589
`fs.mkdirSync` in `harvestFromHtml` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:904, REDACTED:949
`fs.writeFileSync` in `harvestFromHtml` 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. (×5) — REDACTED:910, REDACTED:925, REDACTED:1031, …
`fs.rmSync` in `rebuildSystem` 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. — apps/daemon/src/brands/system.ts:153
`fs.mkdirSync` in `rebuildSystem` 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. — apps/daemon/src/brands/system.ts:154
`fs.rmSync` in `close` 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. — apps/daemon/src/browser-sessions.ts:99
`fs.mkdtempSync` in `create` 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. — apps/daemon/src/browser-sessions.ts:112
`fs.rmSync` in `callback to catch` 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. — apps/daemon/src/browser-sessions.ts:156
`fs.rmSync` in `child.once("exit")` 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. — apps/daemon/src/browser-sessions.ts:165
`renameSync` in `applyOwnedProjectContent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — apps/daemon/src/collab/owned-content-files.ts:164, apps/daemon/src/collab/owned-content-files.ts:165, apps/daemon/src/collab/owned-content-files.ts:177
`fs.chmodSync` in `writeDeployConfigFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:177
`fs.existsSync` in `resolveCurrentArtifact` 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) — apps/daemon/src/design/finalize-design.ts:188, apps/daemon/src/design/finalize-design.ts:196
`fs.existsSync` in `callback to files.map` 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. — apps/daemon/src/design/finalize-design.ts:217
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.8 / 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.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
143 duplicated blocks under apps/ have copies in at least two of the sibling directories daemon, desktop, packaged, web — 70 of them are reported below, and 73 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 143 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 143 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 143 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. — apps/daemon/src/runtimes/chat-run-messages.ts:546
129 duplicated blocks under the repository root have copies in at least two of the sibling directories apps, clipper, design-templates, packages, scripts, shells (+2 more sibling(s) not listed) — 58 of them are reported below, and 71 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 129 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 129 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 129 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — REDACTED:941
110 duplicated blocks under apps/daemon/src/ have copies in at least two of the sibling directories agent-protocol, artifacts, automations, brands, chat-artifacts, collab (+22 more sibling(s) not listed) — 59 of them are reported below, and 51 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 110 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 110 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 110 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. — apps/daemon/src/design-systems/workspace-team-binding.ts:7
74 duplicated blocks under apps/web/src/ have copies in at least two of the sibling directories analytics, artifacts, collab, comments, components, edit-mode (+8 more sibling(s) not listed) — 49 of them are reported below, and 25 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 74 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 74 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 74 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. — apps/web/src/components/Theater/state/sse.ts:115
21 duplicated blocks under tools/pack/src/ have copies in at least two of the sibling directories mac, win — 17 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 21 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 21 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 21 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. — tools/pack/src/mac/app.ts:51
18 duplicated blocks under packages/ have copies in at least two of the sibling directories agui-adapter, contracts, download, host, launcher-proto, platform (+6 more sibling(s) not listed) — 13 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 18 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 18 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 18 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/host/esbuild.config.mjs:3
8 duplicated blocks under apps/web/src/components/ have copies in at least two of the sibling directories chat, composer, entry-nav-rail, home-hero, pet, plugin-details (+2 more sibling(s) not listed) — 3 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 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 8 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. — apps/web/src/components/entry-nav-rail/RailRecentRow.tsx:238
7 duplicated blocks under packages/contracts/src/ have copies in at least two of the sibling directories analytics, api, artifacts, observability, plugins — 3 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 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 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 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/contracts/src/analytics/events/result-events.ts:480
6 duplicated blocks under tools/release/src/ have copies in at least two of the sibling directories catalog, notifications, release-note, report, storage — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — tools/release/src/catalog/pack.ts:42
REDACTED:941 · REDACTED:318 — the two spans are one implementation copied and then locally edited — 2428 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:941
REDACTED:52 · REDACTED:52 · REDACTED:52 · REDACTED:52 · +4 more site(s) not listed — these 8 files are line-for-line copies of one another — 232 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — REDACTED:52
apps/daemon/src/community-pets-sync.ts:81 · scripts/sync-community-pets.ts:133 — the two spans are one implementation copied and then locally edited — 1260 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. — apps/daemon/src/community-pets-sync.ts:81
apps/daemon/src/prompts/directions.ts:25 · packages/contracts/src/prompts/directions.ts:25 — these 2 files are line-for-line copies of one another — 131 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — apps/daemon/src/prompts/directions.ts:25
apps/daemon/src/integrations/xai-tokens.ts:23 · apps/daemon/src/mcp-tokens.ts:26 — the two spans are one implementation copied and then locally edited — 902 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/daemon/src/integrations/xai-tokens.ts:23
apps/daemon/src/design-systems/frontmatter.ts:7 · packages/plugin-runtime/src/parsers/frontmatter.ts:15 — these 2 files are line-for-line copies of one another — 124 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — apps/daemon/src/design-systems/frontmatter.ts:7
apps/daemon/src/live-artifacts/schema.ts:4 · packages/contracts/src/api/live-artifacts.ts:5 — the two spans are one implementation copied and then locally edited — 479 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. — apps/daemon/src/live-artifacts/schema.ts:4
apps/web/src/components/ProductionCampaignBadge.tsx:97 · apps/web/src/components/ProductionCampaignModal.tsx:418 — the two spans are one implementation copied and then locally edited — 469 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. — apps/web/src/components/ProductionCampaignBadge.tsx:97
REDACTED:227 · REDACTED:376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:227
tools/pack/src/mac/app.ts:51 · tools/pack/src/win/app.ts:293 — 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. — tools/pack/src/mac/app.ts:51
apps/daemon/src/design-systems/preview.ts:301 · apps/daemon/src/design-systems/showcase.ts:643 — the two spans are one implementation copied and then locally edited — 860 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. — apps/daemon/src/design-systems/preview.ts:301
apps/web/src/providers/registry.ts:899 · apps/web/src/providers/registry.ts:1045 — the two spans are one implementation copied and then locally edited — 483 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/web/src/providers/registry.ts:899
REDACTED:2050 · apps/daemon/src/routes/handoff.ts:48 — the two spans are one implementation copied and then locally edited — 545 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:2050
apps/daemon/src/runtimes/mmd-routes.ts:13 · apps/daemon/src/runtimes/qwen-settings.ts:19 — the two spans are one implementation copied and then locally edited — 622 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. — apps/daemon/src/runtimes/mmd-routes.ts:13
apps/web/src/components/McpClientSection.tsx:1189 · apps/web/src/components/XaiOAuthControl.tsx:152 — the two spans are one implementation copied and then locally edited — 447 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/web/src/components/McpClientSection.tsx:1189
REDACTED:293 · REDACTED:463 — the two spans are one implementation copied and then locally edited — 556 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:293
apps/daemon/src/tools-deliverable-syntax-cli.ts:40 · apps/daemon/src/tools-design-systems-cli.ts:32 — the two spans are one implementation copied and then locally edited — 636 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. — apps/daemon/src/tools-deliverable-syntax-cli.ts:40
apps/web/src/components/Theater/state/sse.ts:115 · apps/web/src/providers/project-events.ts:113 — the two spans are one implementation copied and then locally edited — 454 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. — apps/web/src/components/Theater/state/sse.ts:115
apps/daemon/src/runtimes/chat-run-messages.ts:546 · apps/web/src/providers/daemon.ts:2538 — the two spans are one implementation copied and then locally edited — 560 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. — apps/daemon/src/runtimes/chat-run-messages.ts:546
packages/contracts/src/prompts/canonical-xml.ts:57 · packages/contracts/src/prompts/od-next-prompt-bundle.ts:43 — the two spans are one implementation copied and then locally edited — 494 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/contracts/src/prompts/canonical-xml.ts:57
tools/release/src/release-note/publication.ts:37 · tools/release/src/release-note/source.ts:40 — the two spans are one implementation copied and then locally edited — 508 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. — tools/release/src/release-note/publication.ts:37
apps/daemon/src/http/oauth-result-page.ts:7 · apps/daemon/src/mcp-routes.ts:414 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — apps/daemon/src/http/oauth-result-page.ts:7
tools/pack/src/mac/builder.ts:29 · tools/pack/src/win/builder.ts:91 — the two spans are one implementation copied and then locally edited — 381 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. — tools/pack/src/mac/builder.ts:29
apps/web/src/components/AmrLoginPill.tsx:554 · apps/web/src/components/InlineModelSwitcher.tsx:390 — the two spans are one implementation copied and then locally edited — 336 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. — apps/web/src/components/AmrLoginPill.tsx:554
apps/daemon/src/tools-design-systems-cli.ts:25 · apps/daemon/src/tools-live-artifacts-cli.ts:40 — the two spans are one implementation copied and then locally edited — 664 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. — apps/daemon/src/tools-design-systems-cli.ts:25
apps/web/src/components/ProjectView.tsx:10614 · apps/web/src/components/ProjectView.tsx:10863 — the two spans are one implementation copied and then locally edited — 364 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — apps/web/src/components/ProjectView.tsx:10614
REDACTED:2138 · REDACTED:1084 — 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. — REDACTED:2138
apps/daemon/src/tools-connectors-cli.ts:1398 · apps/daemon/src/tools-connectors-cli.ts:1475 — 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. — apps/daemon/src/tools-connectors-cli.ts:1398
apps/daemon/src/brands/engine/seed.ts:69 · apps/daemon/src/brands/seed.ts:36 — the two spans are one implementation copied and then locally edited — 470 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. — apps/daemon/src/brands/engine/seed.ts:69
tools/pack/src/mac/prebundle.ts:96 · tools/pack/src/win/prebundle.ts:85 — 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. — tools/pack/src/mac/prebundle.ts:96
apps/web/src/components/ChatComposer.tsx:4783 · apps/web/src/components/ChatPane.tsx:7124 — 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. — apps/web/src/components/ChatComposer.tsx:4783
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.
apps/daemon/src/media/hyperframes-scaffold.ts:112 imports gsap/dist/gsap.min.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — apps/daemon/src/media/hyperframes-scaffold.ts:112
design-systems/_schema/tokens.schema.ts:1 reaches into another package with a relative path (../../packages/contracts/src/design-systems/token-schema.ts) — import the package by name instead. — design-systems/_schema/tokens.schema.ts:1
e2e/tests/amr/acp-url-tool-path.test.ts:5 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/agent-protocol/acp/session.ts) — 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/tests/amr/acp-url-tool-path.test.ts:5
e2e/tests/amr/acp-url-tool-path.test.ts:6 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/runtimes/chat-run-messages.ts) — 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/tests/amr/acp-url-tool-path.test.ts:6
e2e/tests/amr/vela-contract.test.ts:12 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/agent-protocol/acp/session.ts) — 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/tests/amr/vela-contract.test.ts:12
e2e/tests/amr/vela-contract.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/run-diagnostics.ts) — 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/tests/amr/vela-contract.test.ts:13
e2e/tests/amr/vela-contract.test.ts:14 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/run-retry-policy.ts) — 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/tests/amr/vela-contract.test.ts:14
e2e/tests/packaged/codex-fixture.test.ts:15 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/agent-protocol/codex-app-server/session.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/tests/packaged/codex-fixture.test.ts:15
e2e/tests/plugins/motion-template-package.test.ts:10 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/strategies/od-next/frozen-skill-package.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/tests/plugins/motion-template-package.test.ts:10
e2e/tests/question-form-parity.test.ts:54 reaches past another workspace package's public entry into its internals with a relative path (../../apps/daemon/src/question-form-detect.ts) — 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/tests/question-form-parity.test.ts:54
e2e/tests/scripts/check-design-system-manifests.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../../packages/contracts/src/design-systems/derived-token-outputs.ts) — 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/tests/scripts/check-design-system-manifests.test.ts:13
e2e/tests/scripts/check-design-system-manifests.test.ts:18 reaches past another workspace package's public entry into its internals with a relative path (../../../packages/contracts/src/design-systems/components-manifest.ts) — 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/tests/scripts/check-design-system-manifests.test.ts:18
e2e/tests/tools-dev/release-channel.test.ts:23 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/app-version.ts) — 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/tests/tools-dev/release-channel.test.ts:23
e2e/tests/tools-dev/release-channel.test.ts:24 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/services/whats-new.ts) — 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/tests/tools-dev/release-channel.test.ts:24
scripts/check-components-manifest-extraction.ts:5 reaches into another package with a relative path (../packages/contracts/src/design-systems/components-manifest.ts) — import the package by name instead. — scripts/check-components-manifest-extraction.ts:5
scripts/check-design-system-flag-parity.ts:42 reaches into another package with a relative path (../REDACTED) — import the package by name instead. — scripts/check-design-system-flag-parity.ts:42
scripts/check-design-system-flag-parity.ts:46 reaches into another package with a relative path (../REDACTED) — import the package by name instead. — scripts/check-design-system-flag-parity.ts:46
scripts/check-design-system-manifests.ts:20 reaches into another package with a relative path (../packages/contracts/src/design-systems/components-manifest.ts) — import the package by name instead. — scripts/check-design-system-manifests.ts:20
scripts/check-design-system-manifests.ts:21 reaches into another package with a relative path (../packages/contracts/src/design-systems/derived-token-outputs.ts) — import the package by name instead. — scripts/check-design-system-manifests.ts:21
scripts/check-design-system-package-quality.ts:7 reaches into another package with a relative path (../packages/contracts/src/design-systems/components-manifest.ts) — import the package by name instead. — scripts/check-design-system-package-quality.ts:7
scripts/check-whats-new-document.ts:35 reaches into another package with a relative path (../apps/daemon/src/services/whats-new.ts) — import the package by name instead. — scripts/check-whats-new-document.ts:35
scripts/extract-components-manifest.ts:5 reaches into another package with a relative path (../packages/contracts/src/design-systems/components-manifest.ts) — import the package by name instead. — scripts/extract-components-manifest.ts:5
scripts/i18n-check.ts:3 reaches into another package with a relative path (../apps/web/src/i18n/types.ts) — import the package by name instead. — scripts/i18n-check.ts:3
scripts/i18n-coverage-report.ts:31 reaches into another package with a relative path (../apps/web/src/i18n/types.ts) — import the package by name instead. — scripts/i18n-coverage-report.ts:31
scripts/lint-craft-references.ts:5 reaches into another package with a relative path (../packages/plugin-runtime/src/parsers/frontmatter.ts) — import the package by name instead. — scripts/lint-craft-references.ts:5
tools/dev/bin/tools-dev.mjs:6 reaches into another package with a relative path (../../../packages/metatool/src/index.ts) — import the package by name instead. — tools/dev/bin/tools-dev.mjs:6
tools/pack/bin/tools-pack.mjs:6 reaches into another package with a relative path (../../../packages/metatool/src/index.ts) — import the package by name instead. — tools/pack/bin/tools-pack.mjs:6
tools/pack/src/config/index.ts:382 imports electron-builder/out/cli/cli.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — tools/pack/src/config/index.ts:382
tools/release/bin/tools-release.mjs:6 reaches into another package with a relative path (../../../packages/metatool/src/index.ts) — import the package by name instead. — tools/release/bin/tools-release.mjs:6
tools/serve/bin/tools-serve.mjs:6 reaches into another package with a relative path (../../../packages/metatool/src/index.ts) — import the package by name instead. — tools/serve/bin/tools-serve.mjs:6
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.
HtmlViewer has cyclomatic complexity 660 and cognitive complexity 546; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:7238
startChatRun has cyclomatic complexity 508 and cognitive complexity 639; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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:11395
(anonymous) has cyclomatic complexity 415 and cognitive complexity 424; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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:1339
handleRunCreate has cyclomatic complexity 385 and cognitive complexity 511; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/daemon/src/routes/runs.ts:1393
AppInner has cyclomatic complexity 228 and cognitive complexity 209; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/web/src/App.tsx:982
ProjectView has cyclomatic complexity 226 and cognitive complexity 183; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/web/src/components/ProjectView.tsx:2168
(anonymous) has cyclomatic complexity 212 and cognitive complexity 309; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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:16572
parseLayeredBackgroundProbe has cyclomatic complexity 184 and cognitive complexity 181; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/desktop/tests/main/pptx-layered-background.test.ts:3232
SettingsDialog has cyclomatic complexity 182 and cognitive complexity 170; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — apps/web/src/components/SettingsDialog.tsx:1502
composeDaemonSystemPrompt has cyclomatic complexity 176 and cognitive complexity 271; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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:10334
runAutomation has cyclomatic complexity 167 and cognitive complexity 303; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/daemon/src/cli.ts:12098
(anonymous) has cyclomatic complexity 167 and cognitive complexity 225; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/web/src/components/ProjectView.tsx:8712
runProject has cyclomatic complexity 166 and cognitive complexity 264; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/daemon/src/cli.ts:7528
(anonymous) has cyclomatic complexity 158 and cognitive complexity 194; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:3948
(anonymous) has cyclomatic complexity 148 and cognitive complexity 283; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/daemon/src/agent-protocol/acp/session.ts:1041
composeSystemPrompt has cyclomatic complexity 148 and cognitive complexity 157; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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:899
attachRecoverableRuns has cyclomatic complexity 143 and cognitive complexity 210; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/web/src/components/ProjectView.tsx:6748
DesignKitViewInner has cyclomatic complexity 136 and cognitive complexity 131; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — apps/web/src/components/DesignKitView.tsx:313
generateMedia has cyclomatic complexity 135 and cognitive complexity 151; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/daemon/src/media/index.ts:351
consumeDaemonPhysicalRun has cyclomatic complexity 132 and cognitive complexity 318; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/web/src/providers/daemon.ts:1764
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files2.1 / 10Critical✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
REDACTED has 20090 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 18268 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
apps/web/src/components/ProjectView.tsx has 15962 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/ProjectView.tsx:1
apps/daemon/src/cli.ts has 12218 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/cli.ts:1
apps/web/src/components/SettingsDialog.tsx has 9032 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/SettingsDialog.tsx:1
apps/web/src/components/FileWorkspace.tsx has 8556 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/FileWorkspace.tsx:1
REDACTED has 8001 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
apps/web/src/components/ChatPane.tsx has 7010 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/ChatPane.tsx:1
apps/web/src/components/ChatComposer.tsx has 6633 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/ChatComposer.tsx:1
apps/web/src/App.tsx has 6065 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/App.tsx:1
apps/daemon/src/db.ts has 5618 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/db.ts:1
apps/web/src/components/DesignSystemFlow.tsx has 5580 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/DesignSystemFlow.tsx:1
apps/web/src/components/HomeHero.tsx has 5229 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/HomeHero.tsx:1
apps/web/src/components/EntryShell.tsx has 4710 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/EntryShell.tsx:1
REDACTED has 4343 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 4304 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 4180 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
apps/daemon/src/media/index.ts has 4170 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/media/index.ts:1
REDACTED has 3994 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
apps/web/src/providers/registry.ts has 3958 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/providers/registry.ts:1
apps/web/src/components/HomeView.tsx has 3748 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/HomeView.tsx:1
REDACTED has 3718 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
apps/daemon/src/mcp.ts has 3454 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/mcp.ts:1
apps/daemon/src/routes/runs.ts has 3337 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/routes/runs.ts:1
apps/web/src/components/NewProjectPanel.tsx has 3180 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/NewProjectPanel.tsx:1
apps/daemon/src/langfuse-trace.ts has 3168 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/langfuse-trace.ts:1
apps/web/src/components/QuestionForm.tsx has 3087 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/QuestionForm.tsx:1
apps/daemon/src/connectionTest.ts has 3082 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/connectionTest.ts:1
apps/desktop/src/main/deck-capture.ts has 3075 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/desktop/src/main/deck-capture.ts:1
REDACTED has 2995 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 2905 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
apps/web/src/components/EntryNavRail.tsx has 2813 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/EntryNavRail.tsx:1
apps/web/src/state/projects.ts has 2789 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/state/projects.ts:1
apps/web/src/components/WorkspaceTabsBar.tsx has 2739 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/WorkspaceTabsBar.tsx:1
apps/web/src/providers/daemon.ts has 2672 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/providers/daemon.ts:1
apps/daemon/src/tools-connectors-cli.ts has 2640 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/tools-connectors-cli.ts:1
apps/web/src/components/MemorySection.tsx has 2629 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/MemorySection.tsx:1
apps/daemon/src/runtimes/runs.ts has 2557 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/daemon/src/runtimes/runs.ts:1
apps/web/src/components/RecentProjectsStrip.tsx has 2412 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/RecentProjectsStrip.tsx:1
apps/web/src/components/DesignFilesPanel.tsx has 2345 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/DesignFilesPanel.tsx: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 Coverage9.4 / 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. (×40) — clipper/brand-capture.js:1, clipper/content.js:1, scripts/seed-curated-design-skills.ts:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
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 REDACTED 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: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code8.0 / 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 859 application, 107 tooling and 3062 test entry point(s) detected in this repo. Gate removals on `pnpm run typecheck` — an undetected custom entry would make these reachable.
no import path from any entry point (859 application, 107 tooling, 3062 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×13) — apps/desktop/src/main/preload.cts, scripts/generate-design-system-system-assets.ts, scripts/refresh-slide-template-commercialization.ts, …
no import path from any entry point (859 application, 107 tooling, 3062 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (plugins/_official/video-templates/frame-data-rollup/source/Root.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — plugins/_official/video-templates/frame-data-rollup/source/DataRollup.tsx
no import path from any entry point (859 application, 107 tooling, 3062 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/web/src/components/ProjectActionsToolbar.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — apps/web/src/components/FinalizeDesignButton.tsx
no import path from any entry point (859 application, 107 tooling, 3062 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (plugins/_official/video-templates/frame-data-rollup/source/entry.ts) — 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 — plugins/_official/video-templates/frame-data-rollup/source/Root.tsx
Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/agent-protocol/dsh-profile/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 apps/daemon/src/agent-protocol/dsh-profile/index.ts in the same commit, or the barrel will import a name that no longer exists. (×3) — apps/daemon/src/agent-protocol/dsh-profile/stream.ts:14, apps/daemon/src/agent-protocol/dsh-profile/types.ts:9, apps/daemon/src/agent-protocol/dsh-profile/types.ts:30
Nothing imports this binding — it is safe to review for removal. (×16) — apps/daemon/src/artifacts/deliverable-syntax-finalization.ts:29, apps/daemon/src/artifacts/deliverable-syntax-finalization.ts:30, apps/daemon/src/artifacts/text-suppression.ts:261, …
Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/brands/engine/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 apps/daemon/src/brands/engine/index.ts in the same commit, or the barrel will import a name that no longer exists. — apps/daemon/src/brands/engine/build.ts:421
Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/genui/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 apps/daemon/src/genui/index.ts in the same commit, or the barrel will import a name that no longer exists. (×2) — apps/daemon/src/genui/events.ts:50, apps/daemon/src/genui/store.ts:252
Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/http/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 apps/daemon/src/http/index.ts in the same commit, or the barrel will import a name that no longer exists. — apps/daemon/src/http/parse.ts:13
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.
Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. (×5) — scripts/bake-plugin-previews.mjs:803, apps/packaged/src/prewarm.ts:143, e2e/tests/motion-audio-player.test.ts:18, …
Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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. Markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository.
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.
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. (×13) — REDACTED:378, apps/daemon/src/plugins/atoms/diff-review.ts:232, apps/daemon/src/plugins/atoms/figma-extract.ts:429, …
`https://unpkg.com/react@18.3.1/umd/react.development.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 46 such include(s) across the repository's markup. — apps/daemon/src/tools-connectors-cli.ts:76
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 13 sites, not one: `REDACTED:378` (createHash("sha1")), `apps/daemon/src/plugins/atoms/diff-review.ts:232` (createHash("sha1")), `apps/daemon/src/plugins/atoms/figma-extract.ts:429` (createHash("sha1")), `apps/daemon/src/plugins/atoms/rewrite-plan.ts:264` (createHash("sha1")), `apps/daemon/src/plugins/atoms/token-map.ts:411` (createHash("sha1")), `REDACTED:6404` (createHash("sha1")), `apps/daemon/src/run-artifact-fs.ts:130` (createHash("sha1")), `apps/daemon/src/run-artifact-fs.ts:148` (createHash("sha1")), and 5 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
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.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
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 document3.0 / 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.
`canonicalJson` is exported, takes a document from its caller (line 104) and hands it to `canonicalValue`, which calls itself at line 96 (`canonicalValue`) with a piece of `value` (and at line 99) — and nowhere in `canonicalValue` 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 `canonicalValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:96
`redactJsonValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 29 (`redactJsonValue`) with a piece of `value` (and at line 36) — and nowhere in `redactJsonValue` 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 `redactJsonValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/diagnostics/src/redaction.ts:29
`to_dict` is public, takes a document from its caller (line 175) and hands it to `_drop_none`, which calls itself at line 15 (`_drop_none`) with a piece of `value` (and at line 20) — and nowhere in `_drop_none` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_drop_none` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — design-templates/last30days/scripts/lib/schema.py:15
`focusWebTouchpointModal` is exported, takes a document from its caller (line 704) and hands it to `composedFocusableElements`, which calls itself at line 654 (`composedFocusableElements`) with a piece of `root` (and at line 655) — and nowhere in `composedFocusableElements` 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 `composedFocusableElements` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — apps/web/src/components/touchpoint-component.ts:654
`isLoopbackPeerAddress` is exported and takes `address: unknown` from its caller, and it calls itself at line 48 (`isLoopbackPeerAddress`) with a piece of `address` — and nowhere in `isLoopbackPeerAddress` 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 `isLoopbackPeerAddress` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:48
`schemaDigest` is exported, takes a document from its caller (line 43) and hands it to `canonicalize`, which calls itself at line 50 (`canonicalize`) with a piece of `value` (and at line 54) — and nowhere in `canonicalize` 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 `canonicalize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — apps/daemon/src/genui/registry.ts:50
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 151/530 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`verifyPublicLatest` 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 })`. — tools/release/src/storage/rollback-latest.ts:360
`signedFetchWithRetry` 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 })`. — tools/release/src/storage/s3-upload.ts:113
`post` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — tools/release/src/notifications/feishu-notice.ts:75, tools/release/src/notifications/feishu.ts:235
`probeMetadata` 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 })`. — tools/release/src/notifications/prerelease-fallback-notice.ts:74
`probePipeline` 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 })`. — tools/release/src/notifications/prerelease-fallback-notice.ts:93
`githubJson` 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 })`. — tools/release/src/notifications/prerelease-progress-card.ts:224
`verifyDownloadUrl` 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 })`. — tools/release/src/notifications/prerelease-progress-card.ts:336
`fetchText` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — skills/web-clone/scripts/sourcemap-hunt.mjs:50, scripts/import-prompt-templates.mjs:83
`close` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:425
`createPage` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:481
`connectOverDaemon` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:513
`readUrl` 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 })`. — shells/terminal/runtime/fossil.mjs:82
`fetchPetDetail` 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 })`. — scripts/bake-community-pets.ts:99
`downloadBinary` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — scripts/bake-community-pets.ts:110, scripts/sync-community-pets.ts:276
`hogql` 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 })`. — scripts/refresh-plugin-popularity.ts:57
`listPetSharePets` 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 })`. — scripts/sync-community-pets.ts:179
`listHatcheryPets` 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 })`. — scripts/sync-community-pets.ts:241
`discoverIds` 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 })`. — scripts/bake-plugin-previews.mjs:212
`loadPreviewOptions` 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 })`. — scripts/bake-plugin-previews.mjs:229
`processOne` 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 })`. — scripts/bake-plugin-previews.mjs:838
`waitForHttpOk` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/platform/src/http.ts:28
`target` 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 })`. (×6) — docs/design/chat-mirror/check-fonts.mjs:148, docs/design/chat-mirror/diff-cells.mjs:279, docs/design/chat-mirror/film.mjs:43, …
`api` 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 })`. — docs/design/chat-mirror/shoot-live.mjs:37
`callFalGptImage` 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 })`. — design-templates/open-design-landing/scripts/imagegen.ts:192
`probe` 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 })`. — clipper/background.js:30
`ingest` 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 })`. — clipper/background.js:40
`fetchAsDataUri` 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 })`. — clipper/background.js:208
`cropToRect` 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 })`. — clipper/background.js:446
`isAmrLoggedIn` 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 })`. — apps/web/src/message-center-client.ts:112
`pullMessageCenter` 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 })`. — apps/web/src/message-center-client.ts:123
`markAccountMessageRead` 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 })`. — apps/web/src/message-center-client.ts:158
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 a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
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 unescaped5.5 / 10Adequate✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`esc(opts.value)` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — apps/daemon/src/brands/engine/kit.ts:360
`esc(opts.label)` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — apps/daemon/src/brands/engine/kit.ts:365
`payload` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — apps/daemon/src/brands/index.ts:1030
`connectorIdJson` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — REDACTED:502
`connectorLabelJson` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — REDACTED:503
`escapeHtmlAttribute(normalized)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — REDACTED:1814
`indentCss(tokensCss,6)` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — apps/daemon/src/design-systems/import.ts:606
`escapeHtml(value)` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/import.ts:771, REDACTED:4038
`bg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:61, apps/daemon/src/design-systems/showcase.ts:118
`fg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:62, apps/daemon/src/design-systems/showcase.ts:119
`accent` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:63, apps/daemon/src/design-systems/showcase.ts:120
`muted` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:64, apps/daemon/src/design-systems/showcase.ts:124
`border` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:65, apps/daemon/src/design-systems/showcase.ts:125
`surface` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:66, apps/daemon/src/design-systems/showcase.ts:126
`display` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:67, apps/daemon/src/design-systems/showcase.ts:127
`body` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:68, apps/daemon/src/design-systems/showcase.ts:128
`mono` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/design-systems/preview.ts:69, apps/daemon/src/design-systems/showcase.ts:129
`pickReadableForeground(accent)` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — apps/daemon/src/design-systems/preview.ts:192
`accentFg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — apps/daemon/src/design-systems/showcase.ts:121
`accent2` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — apps/daemon/src/design-systems/showcase.ts:122
`accent2Fg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — apps/daemon/src/design-systems/showcase.ts:123
`JSON.stringify(payload)` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. (×2) — apps/daemon/src/http/oauth-result-page.ts:64, apps/daemon/src/mcp-routes.ts:471
`result.url` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:920
`html.slice(0,htmlEnd+1)` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:1778
`html.slice(0,openTagEnd+1)` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:1795
`withSlides.slice(0,range.start)` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:1511
`withSlides.slice(range.end)` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:1512
`escapeAttr(baseHref)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — apps/desktop/src/main/artifact-export.ts:288
`escapeHtmlAttribute(baseHref)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — apps/desktop/src/main/deck-capture.ts:1995
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
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.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
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.
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×7) — tools/release/src/storage/s3-upload.ts:124, skills/web-clone/scripts/asset-harvest.mjs:251, skills/web-clone/scripts/interaction-probe.mjs:201, …
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. (×25) — tools/release/src/notifications/feishu-app.ts:92, tools/release/src/notifications/feishu-notice.ts:96, tools/release/src/notifications/feishu.ts:256, …
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×8) — tools/pack/src/web-sourcemaps.ts:83, tools/pack/src/workspace-build.ts:289, tools/pack/src/workspace-build.ts:330, …
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
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 `REDACTED` 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.
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.
50/52 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
~0.9 `!` null assertions per 1k TypeScript source lines — 776 assertion(s) across the 869738 source line(s) of the 1980 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: apps/daemon/src/observability/task-observation-rollout.ts (21), apps/web/src/components/ProjectView.tsx (20), REDACTED (17). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 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 — 5 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 — 17 observation(s) recorded · Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'better-sqlite3' (apps/daemon/src/agent-session-resume.ts:3) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'better-sqlite3' (apps/daemon/src/agent-session-resume.ts:3) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'better-sqlite3' (apps/daemon/src/agent-session-resume.ts:3) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 35 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.
AC6 Visual & motion safety — Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
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 function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — service "open-design" has neither an image nor a build context specified: invalid compose project; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: this repository stores data through 'better-sqlite3' (apps/daemon/src/agent-session-resume.ts:3) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
D11 Test Reliability — Test reliability not included
D12 Dependency Hygiene — Dependency currency not established — no declaration carries an exact pin to grade
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Python, TypeScript, html not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed TypeScript surface was not measured.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .cts, .py, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — None of 1 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.mjs,.ts), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D28 Secrets (history) — gitleaks killed before it finished — this repository's working tree not scanned
D32 Data Compliance (PII/GDPR) — 117 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — apps/closure/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 12 value object(s); 9 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
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 — no coverage report found on disk — produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a REDACTED, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not applicable: TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
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.
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.
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.
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.
Orphaned knowledge apps/web/src/i18n/content.th.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.uk.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.fa.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.ar.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.ja.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.ko.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.hu.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.es-ES.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.pl.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.pt-BR.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.tr.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.it.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/web/src/i18n/content.id.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge design-templates/last30days/scripts/lib/render.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/daemon/src/brands/engine/kit.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/daemon/src/memory-connectors.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge design-templates/last30days/scripts/lib/pipeline.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge design-templates/last30days/scripts/last30days.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge design-templates/last30days/scripts/lib/github.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge design-templates/last30days/scripts/lib/youtube_yt.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge REDACTED:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge apps/daemon/src/design-systems/shadcn-import.ts:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge design-templates/last30days/scripts/lib/planner.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge design-templates/last30days/scripts/lib/polymarket.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
AC2 · Forms & labels· <input> without a programmatic label · ×24
<input> without a programmatic label apps/web/src/components/BrandReferencePicker.tsx:283— 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 apps/web/src/components/BrandsTab.tsx:187— 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 apps/web/src/components/DesignFilesPanel.tsx:976— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label apps/web/src/components/DesignFilesPanel.tsx:1124— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label apps/web/src/components/DesignSystemAssetDropzone.tsx:466— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label apps/web/src/components/DesignSystemFlow.tsx:1120— 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 apps/web/src/components/DesignSystemFlow.tsx:1378— 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 apps/web/src/components/DesignSystemPicker.tsx:322— 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 apps/web/src/components/DesignSystemSwitchPicker.tsx:124— 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 apps/web/src/components/DesignSystemsSection.tsx:436— 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 apps/web/src/components/DesignSystemsSection.tsx:488— 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 apps/web/src/components/DesignSystemsTab.tsx:1057— 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 apps/web/src/components/DesignsTab.tsx:664— 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 apps/web/src/components/FigmaImportModal.tsx:221— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label apps/web/src/components/FigmaImportModal.tsx:234— 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 apps/web/src/components/GenUISurfaceRenderer.tsx:807— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label apps/web/src/components/GenUISurfaceRenderer.tsx:850— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label apps/web/src/components/InviteDialog.tsx:400— 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 apps/web/src/components/LibrarySection.tsx:1159— 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 apps/web/src/components/ManualEditPanel.tsx:1194— 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 apps/web/src/components/McpClientSection.tsx:675— 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 apps/web/src/components/McpClientSection.tsx:798— 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 apps/web/src/components/MemorySection.tsx:2038— 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 apps/web/src/components/MemorySection.tsx:2075— 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.
AC4 · Keyboard semantics· Hover-only interaction on <div> · ×10
Hover-only interaction on <div> apps/web/src/components/BoardComposerPopover.tsx:403— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/ChatComposer.tsx:3420— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/ChatComposer.tsx:3480— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/ChatComposer.tsx:5525— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/ChatComposer.tsx:5572— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/ComposerPlusMenu.tsx:988— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/ComposerPlusMenu.tsx:1008— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/DesignFilesPanel.tsx:935— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/EntryNavRail.tsx:1665— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <div> apps/web/src/components/ExamplesTab.tsx:591— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
AC3 · Page structure· <iframe> without a title · ×8
<iframe> without a title apps/web/src/components/DesignSystemAssetDropzone.tsx:363— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title apps/web/src/components/DesignsTab.tsx:858— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title apps/web/src/components/FileWorkspace.tsx:8108— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title apps/web/src/components/FileWorkspace.tsx:8122— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title apps/web/src/components/RecentProjectsStrip.tsx:2154— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title apps/web/src/components/RecentProjectsStrip.tsx:2271— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title REDACTED:209— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<iframe> without a title apps/web/src/components/project-cover.tsx:366— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
AC2 · Forms & labels· <textarea> without a programmatic label · ×7
<textarea> without a programmatic label REDACTED:4279— 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.
<textarea> without a programmatic label apps/web/src/components/DesignSystemFlow.tsx:1295— 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.
<textarea> without a programmatic label apps/web/src/components/FigmaImportModal.tsx:247— 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.
<textarea> without a programmatic label apps/web/src/components/GenUISurfaceRenderer.tsx:470— 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.
<textarea> without a programmatic label apps/web/src/components/GenUISurfaceRenderer.tsx:833— 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 apps/web/src/components/GenUISurfaceRenderer.tsx:882— 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 apps/web/src/components/MemorySection.tsx:2089— 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.
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×6
Clickable element isn't keyboard-operable apps/web/src/components/ContextChipStrip.tsx:96— The repo's own CSS styles .context-chip-strip__body with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable apps/web/src/components/DesignFilesPanel.tsx:1282— The repo's own CSS styles .df-row-check with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable apps/web/src/components/DesignSystemFlow.tsx:1187— The repo's own CSS styles .ds-source-link-open with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable apps/web/src/components/DesignSystemsSection.tsx:603— The repo's own CSS styles .toggle-slider with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable apps/web/src/components/FileOpsSummary.tsx:334— The repo's own CSS styles .file-ops-toggle with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable REDACTED:4156— The repo's own CSS styles .title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
AC2 · Forms & labels· <label> that labels no control · ×5
<label> that labels no control apps/web/src/components/GenUISurfaceRenderer.tsx:747— 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 apps/web/src/components/MemorySection.tsx:2035— 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 apps/web/src/components/MemorySection.tsx:2050— 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 apps/web/src/components/MemorySection.tsx:2072— 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 apps/web/src/components/MemorySection.tsx:2086— 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.
AC2 · Forms & labels· <select> without a programmatic label · ×3
<select> without a programmatic label apps/web/src/components/DesignSystemsTab.tsx:1113— 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 apps/web/src/components/GenUISurfaceRenderer.tsx:793— 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 apps/web/src/components/MemorySection.tsx:2053— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×3
Click handler on a non-interactive <span> apps/web/src/components/DesignFilesPanel.tsx:966— 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 <span> apps/web/src/components/DesignFilesPanel.tsx:1024— 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 <span> apps/web/src/components/DesignFilesPanel.tsx:1030— 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}.
AC1 · Text alternatives· <img> without a text alternative · ×2
<img> without a text alternative apps/daemon/src/brands/index.ts:1957— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative apps/daemon/src/brands/index.ts:1959— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<html> without a lang clipper/capture.js:555— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang clipper/store/assets/screenshot-frame.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure· Document without a <title> · ×2
Document without a <title> clipper/capture.js:555— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Document without a <title> clipper/store/assets/screenshot-frame.html:1— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
AC4 · Keyboard semantics· Click handler on a non-interactive <article> · ×2
Click handler on a non-interactive <article> apps/web/src/components/CommunityView.tsx:415— 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 <article> REDACTED:20601— 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}.
Unlisted import 'electron' tools/dev/src/config.ts:77— Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
Unlisted import 'electron' tools/pack/src/config/index.ts:376— Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
AC2 · Forms & labels· Custom control with no accessible name on <article> · ×1
Custom control with no accessible name on <article> REDACTED:20601— This <article> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC4 · Keyboard semantics· Hover-only interaction on <span> · ×1
Hover-only interaction on <span> apps/web/src/components/ContextChipHoverCard.tsx:25— This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Unlisted import 'puppeteer-core' scripts/bake-plugin-previews.mjs:803— Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
Unlisted import 'next' apps/packaged/src/prewarm.ts:143— Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
Unlisted import 'gsap' e2e/tests/motion-audio-player.test.ts:18— Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
FunctionTooLong: ProjectView.ProjectView apps/web/src/components/ProjectView.tsx:2168— FunctionTooLong — ProjectView runs 8426 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8326 over it, 84.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: App.AppInner apps/web/src/App.tsx:982— FunctionTooLong — AppInner runs 3632 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3532 over it, 36.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: index.registerProjectRoutes REDACTED:2232— FunctionTooLong — registerProjectRoutes runs 2461 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2361 over it, 24.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.
FunctionTooLong: ChatPane.ChatPane apps/web/src/components/ChatPane.tsx:1322— FunctionTooLong — ChatPane runs 2051 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1951 over it, 20.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: HomeView.HomeView apps/web/src/components/HomeView.tsx:498— FunctionTooLong — HomeView runs 1950 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1850 over it, 19.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: runs.registerRunRoutes apps/daemon/src/routes/runs.ts:943— FunctionTooLong — registerRunRoutes runs 1803 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1703 over it, 18.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: MemorySection.MemorySection apps/web/src/components/MemorySection.tsx:728— FunctionTooLong — MemorySection runs 1716 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1616 over it, 17.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: index.registerProjectFileRoutes REDACTED:5911— FunctionTooLong — registerProjectFileRoutes runs 1616 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1516 over it, 16.16× 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: chat.registerChatRoutes REDACTED:67— FunctionTooLong — registerChatRoutes runs 1597 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1497 over it, 15.97× 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: DesignBrowserPanel.DesignBrowserPanel REDACTED:912— FunctionTooLong — DesignBrowserPanel runs 1464 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1364 over it, 14.64× 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: proactive-content-pull.createProactiveContentPull apps/daemon/src/collab/proactive-content-pull.ts:492— FunctionTooLong — createProactiveContentPull runs 1410 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1310 over it, 14.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: RecentProjectsStrip.RecentProjectsStrip apps/web/src/components/RecentProjectsStrip.tsx:360— FunctionTooLong — RecentProjectsStrip runs 1399 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1299 over it, 13.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: EntryShell.OnboardingView apps/web/src/components/EntryShell.tsx:2291— FunctionTooLong — OnboardingView runs 1322 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1222 over it, 13.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: runs.createChatRunService apps/daemon/src/runtimes/runs.ts:724— FunctionTooLong — createChatRunService runs 1306 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1206 over it, 13.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: PluginsView.ExtensionsMarketplace REDACTED:1034— FunctionTooLong — ExtensionsMarketplace runs 1286 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1186 over it, 12.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: PreviewDrawOverlay.PreviewDrawOverlay REDACTED:128— FunctionTooLong — PreviewDrawOverlay runs 1273 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1173 over it, 12.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: InlineModelSwitcher.InlineModelSwitcher apps/web/src/components/InlineModelSwitcher.tsx:177— FunctionTooLong — InlineModelSwitcher runs 1258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1158 over it, 12.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: DesignFilesPanel.DesignFilesPanel apps/web/src/components/DesignFilesPanel.tsx:485— FunctionTooLong — DesignFilesPanel runs 1237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1137 over it, 12.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: DesignSystemFlow.DesignSystemDetailView apps/web/src/components/DesignSystemFlow.tsx:1633— FunctionTooLong — DesignSystemDetailView runs 1159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1059 over it, 11.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.
FunctionTooLong: EntryShell.EntryShell apps/web/src/components/EntryShell.tsx:633— FunctionTooLong — EntryShell runs 1150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1050 over it, 11.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: DesignsTab.DesignsTab apps/web/src/components/DesignsTab.tsx:129— FunctionTooLong — DesignsTab runs 1006 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 906 over it, 10.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: session.attachAcpSession apps/daemon/src/agent-protocol/acp/session.ts:200— FunctionTooLong — attachAcpSession runs 958 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 858 over it, 9.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: static-resource.registerStaticResourceRoutes REDACTED:116— FunctionTooLong — registerStaticResourceRoutes runs 941 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 841 over it, 9.41× 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: DesignSystemFlow.DesignSystemCreationFlow apps/web/src/components/DesignSystemFlow.tsx:343— FunctionTooLong — DesignSystemCreationFlow runs 925 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 825 over it, 9.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: collab-cloud-service.createCollabCloudService apps/daemon/src/collab/collab-cloud-service.ts:443— FunctionTooLong — createCollabCloudService runs 889 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 789 over it, 8.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.
FileTooLong: REDACTED REDACTED— FileTooLong — 15976 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 15476 over it, 31.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: REDACTED REDACTED— FileTooLong — 12529 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 12029 over it, 25.06× 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: components/ProjectView.tsx apps/web/src/components/ProjectView.tsx— FileTooLong — 11017 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: ProjectView (2168-14743). The bar is 500 significant lines; this is 10517 over it, 22.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/cli.ts apps/daemon/src/cli.ts— FileTooLong — 9648 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 9148 over it, 19.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/SettingsDialog.tsx apps/web/src/components/SettingsDialog.tsx— FileTooLong — 7247 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6747 over it, 14.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/FileWorkspace.tsx apps/web/src/components/FileWorkspace.tsx— FileTooLong — 7065 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6565 over it, 14.13× 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 — 5914 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5414 over it, 11.83× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/ChatComposer.tsx apps/web/src/components/ChatComposer.tsx— FileTooLong — 5135 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4635 over it, 10.27× 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: components/DesignSystemFlow.tsx apps/web/src/components/DesignSystemFlow.tsx— FileTooLong — 4721 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4221 over it, 9.44× 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: components/ChatPane.tsx apps/web/src/components/ChatPane.tsx— FileTooLong — 4589 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4089 over it, 9.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/App.tsx apps/web/src/App.tsx— FileTooLong — 4341 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: AppInner (982-6235). The bar is 500 significant lines; this is 3841 over it, 8.68× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/db.ts apps/daemon/src/db.ts— FileTooLong — 4209 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3709 over it, 8.42× 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: components/HomeHero.tsx apps/web/src/components/HomeHero.tsx— FileTooLong — 4119 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3619 over it, 8.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: components/EntryShell.tsx apps/web/src/components/EntryShell.tsx— FileTooLong — 3666 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3166 over it, 7.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 3586 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3086 over it, 7.17× 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 — 3178 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2678 over it, 6.36× 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 — 3118 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2618 over it, 6.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: REDACTED REDACTED— FileTooLong — 2814 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2314 over it, 5.63× 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: providers/registry.ts apps/web/src/providers/registry.ts— FileTooLong — 2797 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2297 over it, 5.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: media/index.ts apps/daemon/src/media/index.ts— FileTooLong — 2780 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2280 over it, 5.56× 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: components/NewProjectPanel.tsx apps/web/src/components/NewProjectPanel.tsx— FileTooLong — 2669 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2169 over it, 5.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: routes/runs.ts apps/daemon/src/routes/runs.ts— FileTooLong — 2523 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: registerRunRoutes (943-3401). The bar is 500 significant lines; this is 2023 over it, 5.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: components/HomeView.tsx apps/web/src/components/HomeView.tsx— FileTooLong — 2500 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: HomeView (498-3467). The bar is 500 significant lines; this is 2000 over it, 5.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: src/langfuse-trace.ts apps/daemon/src/langfuse-trace.ts— FileTooLong — 2480 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1980 over it, 4.96× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/mcp.ts apps/daemon/src/mcp.ts— FileTooLong — 2475 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1975 over it, 4.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.
Hotspot: REDACTED REDACTED:3194— REDACTED changed 120 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 2306 in server.startServer at line 3194. 86 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apps/web/src/components/ProjectView.tsx apps/web/src/components/ProjectView.tsx:2168— apps/web/src/components/ProjectView.tsx changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 1776 in ProjectView.ProjectView at line 2168. 51 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/ProjectView.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: REDACTED REDACTED:7238— REDACTED changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 2347 in FileViewer.HtmlViewer at line 7238. 27 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apps/web/src/App.tsx apps/web/src/App.tsx:982— apps/web/src/App.tsx changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 830 in App.AppInner at line 982. 27 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/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.
Hotspot: apps/daemon/src/routes/runs.ts apps/daemon/src/routes/runs.ts:943— apps/daemon/src/routes/runs.ts changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 582 in runs.registerRunRoutes at line 943. 22 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/routes/runs.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:2232— REDACTED changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 696 in index.registerProjectRoutes at line 2232. 15 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apps/web/src/components/ChatPane.tsx apps/web/src/components/ChatPane.tsx:1322— apps/web/src/components/ChatPane.tsx changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 384 in ChatPane.ChatPane at line 1322. 23 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/ChatPane.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: apps/web/src/components/EntryShell.tsx apps/web/src/components/EntryShell.tsx:2291— apps/web/src/components/EntryShell.tsx changed 49 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 295 in EntryShell.OnboardingView at line 2291. 24 of those changes were fix/bug commits, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/EntryShell.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: apps/web/src/components/SettingsDialog.tsx apps/web/src/components/SettingsDialog.tsx:1502— apps/web/src/components/SettingsDialog.tsx changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 716 in SettingsDialog.SettingsDialog at line 1502. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/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: apps/web/src/components/FileWorkspace.tsx apps/web/src/components/FileWorkspace.tsx:1334— apps/web/src/components/FileWorkspace.tsx changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 612 in FileWorkspace.FileWorkspace at line 1334. 9 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-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/FileWorkspace.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: apps/web/src/components/HomeView.tsx apps/web/src/components/HomeView.tsx:498— apps/web/src/components/HomeView.tsx changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 444 in HomeView.HomeView at line 498. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/HomeView.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: apps/web/src/components/ChatComposer.tsx apps/web/src/components/ChatComposer.tsx:593— apps/web/src/components/ChatComposer.tsx changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 493 in ChatComposer.ChatComposer at line 593. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/ChatComposer.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: REDACTED REDACTED:403— REDACTED changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 203 in AssistantMessage.AssistantMessageImpl at line 403. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apps/daemon/src/cli.ts apps/daemon/src/cli.ts:7528— apps/daemon/src/cli.ts changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 130 in cli.runProject at line 7528. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/cli.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apps/web/src/components/HomeHero.tsx apps/web/src/components/HomeHero.tsx:354— apps/web/src/components/HomeHero.tsx changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 277 in HomeHero.HomeHero at line 354. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/HomeHero.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: apps/web/src/components/InlineModelSwitcher.tsx apps/web/src/components/InlineModelSwitcher.tsx:177— apps/web/src/components/InlineModelSwitcher.tsx changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 237 in InlineModelSwitcher.InlineModelSwitcher at line 177. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/InlineModelSwitcher.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: apps/web/src/components/RecentProjectsStrip.tsx apps/web/src/components/RecentProjectsStrip.tsx:360— apps/web/src/components/RecentProjectsStrip.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 282 in RecentProjectsStrip.RecentProjectsStrip at line 360. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/RecentProjectsStrip.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: REDACTED REDACTED:233— REDACTED changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 254 in media.registerMediaRoutes at line 233. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apps/web/src/providers/daemon.ts apps/web/src/providers/daemon.ts:1764— apps/web/src/providers/daemon.ts changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 136 in daemon.consumeDaemonPhysicalRun at line 1764. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/providers/daemon.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:758— REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 280 in collab-sync.registerCollabSyncRoutes at line 758. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apps/daemon/src/agent-protocol/acp/session.ts apps/daemon/src/agent-protocol/acp/session.ts:1041— apps/daemon/src/agent-protocol/acp/session.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 141 in session.attachAcpSession.parser at line 1041. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/agent-protocol/acp/session.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: apps/web/src/components/EntryNavRail.tsx apps/web/src/components/EntryNavRail.tsx:1076— apps/web/src/components/EntryNavRail.tsx changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 99 in EntryNavRail.EntryTopRightCluster at line 1076. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/EntryNavRail.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: REDACTED REDACTED:643— REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 243 in import-export-routes.registerProjectExportRoutes at line 643. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:899— REDACTED changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 137 in system.composeSystemPrompt at line 899. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: apps/web/src/components/DesignFilesPanel.tsx apps/web/src/components/DesignFilesPanel.tsx:485— apps/web/src/components/DesignFilesPanel.tsx changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 234 in DesignFilesPanel.DesignFilesPanel at line 485. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/DesignFilesPanel.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.
Outbound HTTP without resilience apps/daemon/src/byok-tools.ts:511— `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 apps/daemon/src/byok-tools.ts:659— `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 apps/daemon/src/byok-tools.ts:834— `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 apps/daemon/src/byok-tools.ts:875— `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 apps/daemon/src/byok-tools.ts:1058— `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 apps/daemon/src/byok-tools.ts:1065— `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 apps/daemon/src/byok-tools.ts:1199— `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 apps/daemon/src/byok-tools.ts:1240— `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 apps/daemon/src/byok-tools.ts:1525— `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 apps/daemon/src/byok-tools.ts:1553— `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 apps/daemon/src/byok-tools.ts:1669— `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 apps/daemon/src/cli.ts:528— `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 apps/daemon/src/cli.ts:543— `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 apps/daemon/src/cli.ts:559— `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 apps/daemon/src/cli.ts:712— `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 apps/daemon/src/cli.ts:757— `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 apps/daemon/src/cli.ts:991— `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 apps/daemon/src/cli.ts:1310— `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 apps/daemon/src/cli.ts:1324— `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 apps/daemon/src/cli.ts:1331— `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 apps/daemon/src/cli.ts:1353— `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 apps/daemon/src/cli.ts:1358— `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 apps/daemon/src/cli.ts:1787— `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 apps/daemon/src/cli.ts:1823— `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 apps/daemon/src/cli.ts:1845— `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.
Sync-over-async blocking apps/daemon/src/brands/engine/build.ts:422— `fs.mkdtempSync` in `buildFromUrl` 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 apps/daemon/src/brands/engine/build.ts:439— `fs.readFileSync` in `buildFromUrl` 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 apps/daemon/src/brands/engine/build.ts:442— `fs.readFileSync` in `buildFromUrl` 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 apps/daemon/src/brands/engine/build.ts:453— `fs.readFileSync` in `buildFromUrl` 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 apps/daemon/src/brands/engine/build.ts:461— `fs.readFileSync` in `buildFromUrl` 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 apps/daemon/src/brands/engine/build.ts:470— `fs.rmSync` in `buildFromUrl` 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 apps/daemon/src/brands/fonts.ts:273— `fs.existsSync` in `harvestFonts` 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 apps/daemon/src/brands/fonts.ts:276— `fs.mkdirSync` in `harvestFonts` 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 apps/daemon/src/brands/fonts.ts:277— `fs.writeFileSync` in `harvestFonts` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:369— `fs.mkdirSync` in `harvestSiteImagery` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:383— `fs.existsSync` in `harvestSiteImagery` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:386— `fs.writeFileSync` in `harvestSiteImagery` 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 apps/daemon/src/brands/index.ts:249— `fs.rmSync` in `rollbackBrandExtractionStartup` 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 apps/daemon/src/brands/index.ts:1222— `fs.statSync` in `brandExtractionProducedFiles` 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 apps/daemon/src/brands/index.ts:2131— `fs.readFileSync` in `writeOptionalFileToProject` 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 apps/daemon/src/brands/index.ts:2154— `fs.readFileSync` in `copyDirectoryToProject` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:198— `fs.mkdirSync` in `writeAsset` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:200— `fs.existsSync` in `writeAsset` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:201— `fs.writeFileSync` in `writeAsset` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:589— `fs.writeFileSync` in `fetchServiceFavicons` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:904— `fs.mkdirSync` in `harvestFromHtml` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:910— `fs.writeFileSync` in `harvestFromHtml` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:925— `fs.writeFileSync` in `harvestFromHtml` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:949— `fs.mkdirSync` in `harvestFromHtml` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:1031— `fs.writeFileSync` in `harvestFromHtml` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file clipper/brand-capture.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file clipper/content.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file scripts/seed-curated-design-skills.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file scripts/seed-test-projects.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 scripts/batch-design-system-test.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 clipper/background.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file clipper/i18n.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file design-templates/hyperframes/scripts/animation-map.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file clipper/capture.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file skills/oil-motion/assets/interactive-motion.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 scripts/source-check.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 apps/web/src/components/PluginLoopHome.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file scripts/normalize-plugin-scenarios.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 skills/oil-motion/assets/chroma-video-renderer.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 apps/desktop/src/main/preload.cts: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.
+ 15 more in this group — see findings.md.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×40
Untrusted text written into markup unescaped apps/daemon/src/brands/engine/kit.ts:360— `esc(opts.value)` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped apps/daemon/src/brands/engine/kit.ts:365— `esc(opts.label)` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped apps/daemon/src/brands/index.ts:1030— `payload` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped REDACTED:502— `connectorIdJson` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped REDACTED:503— `connectorLabelJson` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped REDACTED:1814— `escapeHtmlAttribute(normalized)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/import.ts:606— `indentCss(tokensCss,6)` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/import.ts:771— `escapeHtml(value)` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped REDACTED:4038— `escapeHtml(value)` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:61— `bg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:62— `fg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:63— `accent` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:64— `muted` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:65— `border` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:66— `surface` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:67— `display` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:68— `body` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:69— `mono` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/preview.ts:192— `pickReadableForeground(accent)` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/showcase.ts:118— `bg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/showcase.ts:119— `fg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/showcase.ts:120— `accent` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/showcase.ts:121— `accentFg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/showcase.ts:122— `accent2` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
Untrusted text written into markup unescaped apps/daemon/src/design-systems/showcase.ts:123— `accent2Fg` is text this program did not author, and it is written into a script or style context through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
X2 · Cancellation propagation· Async function without AbortSignal · ×39
Async function without AbortSignal: verifyPublicLatest tools/release/src/storage/rollback-latest.ts:360— `verifyPublicLatest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: signedFetchWithRetry tools/release/src/storage/s3-upload.ts:113— `signedFetchWithRetry` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: post tools/release/src/notifications/feishu-notice.ts:75— `post` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: post tools/release/src/notifications/feishu.ts:235— `post` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: probeMetadata tools/release/src/notifications/prerelease-fallback-notice.ts:74— `probeMetadata` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: probePipeline tools/release/src/notifications/prerelease-fallback-notice.ts:93— `probePipeline` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: githubJson tools/release/src/notifications/prerelease-progress-card.ts:224— `githubJson` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: verifyDownloadUrl tools/release/src/notifications/prerelease-progress-card.ts:336— `verifyDownloadUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchText skills/web-clone/scripts/sourcemap-hunt.mjs:50— `fetchText` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: close REDACTED:425— `close` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: createPage REDACTED:481— `createPage` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: connectOverDaemon REDACTED:513— `connectOverDaemon` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: readUrl shells/terminal/runtime/fossil.mjs:82— `readUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchPetDetail scripts/bake-community-pets.ts:99— `fetchPetDetail` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: downloadBinary scripts/bake-community-pets.ts:110— `downloadBinary` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: hogql scripts/refresh-plugin-popularity.ts:57— `hogql` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: listPetSharePets scripts/sync-community-pets.ts:179— `listPetSharePets` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: listHatcheryPets scripts/sync-community-pets.ts:241— `listHatcheryPets` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: downloadBinary scripts/sync-community-pets.ts:276— `downloadBinary` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: discoverIds scripts/bake-plugin-previews.mjs:212— `discoverIds` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: loadPreviewOptions scripts/bake-plugin-previews.mjs:229— `loadPreviewOptions` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: processOne scripts/bake-plugin-previews.mjs:838— `processOne` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: fetchText scripts/import-prompt-templates.mjs:83— `fetchText` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: waitForHttpOk packages/platform/src/http.ts:28— `waitForHttpOk` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: target docs/design/chat-mirror/check-fonts.mjs:148— `target` 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 })`.
ClassTooLong: ProjectView apps/web/src/components/ProjectView.tsx:1— ClassTooLong — 8426 significant lines (blank, comment-only and punctuation-only lines excluded), 183 methods. The bar is 400 significant lines; this is 8026 over it, 21.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.
ClassTooLong: ChatPane apps/web/src/components/ChatPane.tsx:1— ClassTooLong — 2051 significant lines (blank, comment-only and punctuation-only lines excluded), 67 methods. The bar is 400 significant lines; this is 1651 over it, 5.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HomeView apps/web/src/components/HomeView.tsx:1— ClassTooLong — 1950 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 1550 over it, 4.88× 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: MemorySection apps/web/src/components/MemorySection.tsx:1— ClassTooLong — 1716 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 1316 over it, 4.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: DesignBrowserPanel REDACTED:1— ClassTooLong — 1464 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 400 significant lines; this is 1064 over it, 3.66× 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: RecentProjectsStrip apps/web/src/components/RecentProjectsStrip.tsx:1— ClassTooLong — 1399 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 999 over it, 3.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PreviewDrawOverlay REDACTED:1— ClassTooLong — 1273 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 873 over it, 3.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: InlineModelSwitcher apps/web/src/components/InlineModelSwitcher.tsx:1— ClassTooLong — 1258 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 858 over it, 3.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: DesignFilesPanel apps/web/src/components/DesignFilesPanel.tsx:1— ClassTooLong — 1237 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 837 over it, 3.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EntryShell apps/web/src/components/EntryShell.tsx:1— ClassTooLong — 1150 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 750 over it, 2.88× 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: DesignsTab apps/web/src/components/DesignsTab.tsx:1— ClassTooLong — 1006 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 606 over it, 2.52× 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: PetSettings apps/web/src/components/pet/PetSettings.tsx:1— ClassTooLong — 823 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 423 over it, 2.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Icon apps/web/src/components/Icon.tsx:1— ClassTooLong — 819 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 419 over it, 2.05× 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: DesignSystemsTab apps/web/src/components/DesignSystemsTab.tsx:1— ClassTooLong — 818 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 418 over it, 2.05× 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: WorkspaceBillingRuntimeCoordinator apps/daemon/src/collab/workspace-billing-runtime.ts:182— ClassTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 333 over it, 1.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: LibrarySection apps/web/src/components/LibrarySection.tsx:1— ClassTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 331 over it, 1.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: NewProjectPanel apps/web/src/components/NewProjectPanel.tsx:1— ClassTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 326 over it, 1.82× 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: PreviewModal apps/web/src/components/PreviewModal.tsx:1— ClassTooLong — 698 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 298 over it, 1.75× 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: NextStepActions apps/web/src/components/NextStepActions.tsx:1— ClassTooLong — 635 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 235 over it, 1.59× 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: AvatarMenu apps/web/src/components/AvatarMenu.tsx:1— ClassTooLong — 611 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 211 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StandaloneBundler REDACTED:133— ClassTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 182 over it, 1.46× 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: NewAutomationModal apps/web/src/components/NewAutomationModal.tsx:1— ClassTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 165 over it, 1.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: TasksView apps/web/src/components/TasksView.tsx:1— ClassTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 155 over it, 1.39× 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: SkillsSection apps/web/src/components/SkillsSection.tsx:1— ClassTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 155 over it, 1.39× 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: ComposioConnectorProvider apps/daemon/src/connectors/composio.ts:441— ClassTooLong — 543 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 143 over it, 1.36× 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) tools/release/src/storage/s3-upload.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) tools/release/src/notifications/feishu-app.ts:92— 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) tools/release/src/notifications/feishu-notice.ts:96— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) tools/release/src/notifications/feishu.ts:256— 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) tools/release/src/catalog/export-catalog.ts:21— 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) tools/release/src/catalog/export-catalog.ts:59— 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) tools/release/src/catalog/export.ts:123— 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) tools/release/src/catalog/pack-catalog.ts:18— 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) tools/release/src/catalog/pack.ts:119— 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) tools/release/src/catalog/render-previews.ts:462— 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) tools/pack/src/node-pty-runtime.ts: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) tools/pack/src/win/builder.ts:318— 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) tools/pack/src/win/custom-installer.ts:335— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) tools/pack/src/win/payload.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) tools/pack/src/win/registry.ts: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) tools/pack/src/resources/index.ts:24— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) tools/pack/src/mac/fs.ts:70— 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) skills/web-clone/scripts/asset-harvest.mjs:117— 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) skills/web-clone/scripts/asset-harvest.mjs:242— 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) skills/web-clone/scripts/asset-harvest.mjs:251— `.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) skills/web-clone/scripts/asset-harvest.mjs:284— 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) skills/web-clone/scripts/interaction-probe.mjs:201— `.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) skills/web-clone/scripts/mirror-site.mjs:72— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) skills/web-clone/scripts/network-capture.mjs:106— `.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) skills/web-clone/scripts/od-preview-rewrite.mjs:92— 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.
Boundary violation [package:third-party-deep-import] apps/daemon/src/media/hyperframes-scaffold.ts:112— apps/daemon/src/media/hyperframes-scaffold.ts:112 imports gsap/dist/gsap.min.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:relative-cross-package] design-systems/_schema/tokens.schema.ts:1— design-systems/_schema/tokens.schema.ts:1 reaches into another package with a relative path (../../packages/contracts/src/design-systems/token-schema.ts) — import the package by name instead.
Boundary violation [package:test-cross-package-internals] e2e/tests/amr/acp-url-tool-path.test.ts:5— e2e/tests/amr/acp-url-tool-path.test.ts:5 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/agent-protocol/acp/session.ts) — 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/tests/amr/acp-url-tool-path.test.ts:6— e2e/tests/amr/acp-url-tool-path.test.ts:6 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/runtimes/chat-run-messages.ts) — 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/tests/amr/vela-contract.test.ts:12— e2e/tests/amr/vela-contract.test.ts:12 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/agent-protocol/acp/session.ts) — 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/tests/amr/vela-contract.test.ts:13— e2e/tests/amr/vela-contract.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/run-diagnostics.ts) — 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/tests/amr/vela-contract.test.ts:14— e2e/tests/amr/vela-contract.test.ts:14 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/run-retry-policy.ts) — 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/tests/packaged/codex-fixture.test.ts:15— e2e/tests/packaged/codex-fixture.test.ts:15 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/agent-protocol/codex-app-server/session.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/tests/plugins/motion-template-package.test.ts:10— e2e/tests/plugins/motion-template-package.test.ts:10 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/strategies/od-next/frozen-skill-package.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/tests/question-form-parity.test.ts:54— e2e/tests/question-form-parity.test.ts:54 reaches past another workspace package's public entry into its internals with a relative path (../../apps/daemon/src/question-form-detect.ts) — 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/tests/scripts/check-design-system-manifests.test.ts:13— e2e/tests/scripts/check-design-system-manifests.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../../packages/contracts/src/design-systems/derived-token-outputs.ts) — 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/tests/scripts/check-design-system-manifests.test.ts:18— e2e/tests/scripts/check-design-system-manifests.test.ts:18 reaches past another workspace package's public entry into its internals with a relative path (../../../packages/contracts/src/design-systems/components-manifest.ts) — 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/tests/tools-dev/release-channel.test.ts:23— e2e/tests/tools-dev/release-channel.test.ts:23 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/app-version.ts) — 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/tests/tools-dev/release-channel.test.ts:24— e2e/tests/tools-dev/release-channel.test.ts:24 reaches past another workspace package's public entry into its internals with a relative path (../../../apps/daemon/src/services/whats-new.ts) — 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:relative-cross-package] scripts/check-components-manifest-extraction.ts:5— scripts/check-components-manifest-extraction.ts:5 reaches into another package with a relative path (../packages/contracts/src/design-systems/components-manifest.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/check-design-system-flag-parity.ts:42— scripts/check-design-system-flag-parity.ts:42 reaches into another package with a relative path (../REDACTED) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/check-design-system-flag-parity.ts:46— scripts/check-design-system-flag-parity.ts:46 reaches into another package with a relative path (../REDACTED) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/check-design-system-manifests.ts:20— scripts/check-design-system-manifests.ts:20 reaches into another package with a relative path (../packages/contracts/src/design-systems/components-manifest.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/check-design-system-manifests.ts:21— scripts/check-design-system-manifests.ts:21 reaches into another package with a relative path (../packages/contracts/src/design-systems/derived-token-outputs.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/check-design-system-package-quality.ts:7— scripts/check-design-system-package-quality.ts:7 reaches into another package with a relative path (../packages/contracts/src/design-systems/components-manifest.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/check-whats-new-document.ts:35— scripts/check-whats-new-document.ts:35 reaches into another package with a relative path (../apps/daemon/src/services/whats-new.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/extract-components-manifest.ts:5— scripts/extract-components-manifest.ts:5 reaches into another package with a relative path (../packages/contracts/src/design-systems/components-manifest.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/i18n-check.ts:3— scripts/i18n-check.ts:3 reaches into another package with a relative path (../apps/web/src/i18n/types.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/i18n-coverage-report.ts:31— scripts/i18n-coverage-report.ts:31 reaches into another package with a relative path (../apps/web/src/i18n/types.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/lint-craft-references.ts:5— scripts/lint-craft-references.ts:5 reaches into another package with a relative path (../packages/plugin-runtime/src/parsers/frontmatter.ts) — import the package by name instead.
+ 5 more in this group — see findings.md.
AC1 · Text alternatives· <canvas> without a text alternative · ×29
<canvas> without a text alternative REDACTED:1282— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative apps/web/src/components/home-hero/PixelScanLogo.tsx:66— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/flowai-live-dashboard-template/assets/template.html:132— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/flowai-live-dashboard-template/assets/template.html:141— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/flowai-live-dashboard-template/assets/template.html:158— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/guizang-ppt/assets/template.html:413— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/guizang-ppt/assets/template.html:414— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/assets/template.html:458— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/assets/template.html:468— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/assets/template.html:476— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/assets/template.html:501— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/assets/template.html:509— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/assets/template.html:514— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/assets/template.html:519— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/example.html:458— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/example.html:468— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/example.html:476— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/example.html:501— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/example.html:509— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/example.html:514— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/social-media-matrix-tracker-template/example.html:519— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/webgl-experience/example.html:41— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative design-templates/worker-visualizer/example.html:33— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative skills/data-report/example.html:47— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative skills/data-report/example.html:53— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
Repeated repair: packages/contracts/src/api/chat.ts packages/contracts/src/api/chat.ts:1357— packages/contracts/src/api/chat.ts changed 31 times in last 90 days and 16 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 chat.chatArtifactStaticCoverUrl at line 1357), 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: “[OPEND-2800][OPEND-4117] feat(od-next): integrate Discovery delivery and validated prototype fixes (#8804)”; “fix(daemon,web): forward pure plugin applies and honor persisted capability grants (#7597)”; “fix(daemon): bound stored run events and keep crashed runs from acting on truncated prompts (#8170)”; “fix(chat): restore next steps for successful image deliveries (#8057)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- packages/contracts/src/api/chat.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: apps/daemon/src/strategies/od-next/coordinator.ts apps/daemon/src/strategies/od-next/coordinator.ts:50— apps/daemon/src/strategies/od-next/coordinator.ts changed 9 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 5 (its worst body is coordinator.prepareStrategyIntake at line 50), 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(od-next): remove output-contract gates and unblock continuation (#8356)”; “fix(od-next): recover planning replies that repeat the runtime state block (#8520)”; “fix(chat): preserve planning-only intent after clarification (#8172)”; “fix(daemon): accept a clarification turn whose Runtime State names the wrong stage (#7980)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/strategies/od-next/coordinator.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: apps/daemon/src/tool-tokens.ts apps/daemon/src/tool-tokens.ts:161— apps/daemon/src/tool-tokens.ts changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ToolTokenRegistry.mint at line 161), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(daemon): finalize deliverable syntax without agent turns (#7801)”; “revert(design-systems): remove structured runtime workflow (#7110)”; “fix daemon HyperFrames scaffold and runtime (#7030)”; “fix(release): harden prerelease E2E validation (#6755)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/tool-tokens.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/contracts/src/plugins/strategy-v2.ts packages/contracts/src/plugins/strategy-v2.ts:88— packages/contracts/src/plugins/strategy-v2.ts changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is strategy-v2.findForbiddenStrategyKey at line 88), 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: “[OPEND-2800][OPEND-4117] feat(od-next): integrate Discovery delivery and validated prototype fixes (#8804)”; “fix(od-next): remove output-contract gates and unblock continuation (#8356)”; “fix(chat): keep live strategy continuations in their original task (#8195)”; “fix(chat): preserve planning-only intent after clarification (#8172)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- packages/contracts/src/plugins/strategy-v2.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: apps/daemon/src/strategies/od-next/automatic-simple-production.ts apps/daemon/src/strategies/od-next/automatic-simple-production.ts:27— apps/daemon/src/strategies/od-next/automatic-simple-production.ts changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is automatic-simple-production.projectStrategyTask at line 27), 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(od-next): restore production follow-up host instructions (#8770)”; “fix(od-next): remove output-contract gates and unblock continuation (#8356)”; “fix(chat): keep live strategy continuations in their original task (#8195)”; “fix(chat): preserve planning-only intent after clarification (#8172)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/strategies/od-next/automatic-simple-production.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: apps/daemon/src/runtimes/chat-run-records.ts apps/daemon/src/runtimes/chat-run-records.ts:55— apps/daemon/src/runtimes/chat-run-records.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 4 (its worst body is chat-run-records.toJsonRecord at line 55), 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(chat): preserve planning-only intent after clarification (#8172)”; “fix(daemon,web): stop a delivered OD Next turn reporting as failed, and name the real gate (#7931)”; “fix(daemon): finalize deliverable syntax without agent turns (#7801)”; “fix(daemon): preserve terminal delivery lifecycle evidence (#7679)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/runtimes/chat-run-records.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: apps/web/src/components/workspace/SideChatTab.tsx apps/web/src/components/workspace/SideChatTab.tsx:110— apps/web/src/components/workspace/SideChatTab.tsx 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 8 (its worst body is SideChatTab.SideChatTab at line 110), 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(web): align ChatPanel failures with approved product copy (#8140)”; “fix(chat): make the failure card, the queued action and the fork note stop disappearing (#7871)”; “fix: derive workspace authority from project bindings (#6989)”; “fix(web): hide stale run recovery cards after success (#6748)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/workspace/SideChatTab.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: apps/web/src/analytics/error-tracking.ts apps/web/src/analytics/error-tracking.ts:506— apps/web/src/analytics/error-tracking.ts changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is error-tracking.buildExceptionList at line 506), 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: “[OPEND-4220] fix(telemetry): hold first-session stability events until the installation id exists (#8991)”; “fix(web): stamp platform metadata on safety telemetry (#7944)”; “fix(observability): add canonical client monitoring kinds (#7945)”; “fix(web): bound and scrub resource error telemetry (#7501)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/analytics/error-tracking.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: apps/packaged/src/protocol.ts apps/packaged/src/protocol.ts:350— apps/packaged/src/protocol.ts changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is protocol.fetchOdTargetWithTransientRetry at line 350), 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(packaged): treat Chromium ERR_NO_BUFFER_SPACE as local resource exhaustion (#8283)”; “fix(updater): make payload runtime handoff atomic (#8348)”; “fix(packaged): fail od:// proxy fast on local resource exhaustion (#6530)”; “fix(packaged): recover od:// after web sidecar exits (#6364)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/packaged/src/protocol.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: apps/daemon/src/artifacts/successful-run-deliverable-finalization.ts apps/daemon/src/artifacts/successful-run-deliverable-finalization.ts:35— apps/daemon/src/artifacts/successful-run-deliverable-finalization.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is successful-run-deliverable-finalization.finalizeSuccessfulRunDeliverable at line 35), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[OPEND-2800][OPEND-4117] feat(od-next): integrate Discovery delivery and validated prototype fixes (#8804)”; “fix(od-next): remove output-contract gates and unblock continuation (#8356)”; “fix(daemon): recognize linked prototype page delivery (#7949)”; “fix(daemon): deliver artifacts with syntax warning telemetry (#7925)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/artifacts/successful-run-deliverable-finalization.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: apps/daemon/src/collab/created-project-workspace.ts apps/daemon/src/collab/created-project-workspace.ts:53— apps/daemon/src/collab/created-project-workspace.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is created-project-workspace.localProjectWorkspaceAttribution at line 53), 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(collab): keep workspace projects usable during outages and first open (#7027)”; “fix: complete AMR environment switching (#6991)”; “fix(web): streamline Home submit preflight (#6756)”; “fix(amr): recover expired cloud sessions (#6786)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/collab/created-project-workspace.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: apps/daemon/src/runtimes/defs/deepseek-harness.ts apps/daemon/src/runtimes/defs/deepseek-harness.ts:11— apps/daemon/src/runtimes/defs/deepseek-harness.ts changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is deepseek-harness.parseModels at line 11), 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(dsh): support DeepSeek Harness 0.1.2-rc.1, now npm's latest (#7825)”; “fix(runtimes): support the dsh release line users are actually served (#7339)”; “fix(runtimes): reach a working agent CLI past a broken shim (#7153)”; “fix: install DSH companion from a shell-safe profile path (#6905)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/runtimes/defs/deepseek-harness.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: REDACTED REDACTED:526— REDACTED changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is server.proxyHttpRequest at line 526), 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: “revert(sidecar): defer convergence until after weekly release (#7634)”; “fix(web): answer /api paths with a connection failure when no daemon origin is configured (#7399)”; “fix(collab): quell the packaged-client cloud 502 storm (heartbeat backoff, upstream error relay, proxy replay) (#6521)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: REDACTED REDACTED:51— REDACTED 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 5 (its worst body is deck-stage-fallback.legacyDeckScreenNumber at line 51), 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(deck): make legacy thumbnail navigation instant (#7568)”; “fix(community): make deck remix previews reliable (#6996)”; “fix(web): make deck thumbnails drive deck-stage previews (#6950)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/contracts/src/prompts/od-next-intent-resolution.ts packages/contracts/src/prompts/od-next-intent-resolution.ts:49— packages/contracts/src/prompts/od-next-intent-resolution.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 2 (its worst body is od-next-intent-resolution.parseOdNextIntentResolutionTurnV1 at line 49), 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: “[OPEND-2800][OPEND-4117] feat(od-next): integrate Discovery delivery and validated prototype fixes (#8804)”; “fix(od-next): remove output-contract gates and unblock continuation (#8356)”; “fix(od-next): recover planning replies that repeat the runtime state block (#8520)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- packages/contracts/src/prompts/od-next-intent-resolution.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/contracts/src/prompts/chat-turn-host-protocol.ts packages/contracts/src/prompts/chat-turn-host-protocol.ts:23— packages/contracts/src/prompts/chat-turn-host-protocol.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 3 (its worst body is chat-turn-host-protocol.odNextStageGate at line 23), 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(od-next): restore production follow-up host instructions (#8770)”; “fix(od-next): remove output-contract gates and unblock continuation (#8356)”; “fix(prompts): write next-step suggestions in the run's UI locale (#7920)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- packages/contracts/src/prompts/chat-turn-host-protocol.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: apps/daemon/src/strategies/od-next/protocol.ts apps/daemon/src/strategies/od-next/protocol.ts:16— apps/daemon/src/strategies/od-next/protocol.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 14 (its worst body is LegacyBlockFilter.push at line 16), 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(od-next): remove output-contract gates and unblock continuation (#8356)”; “fix(od-next): recover planning replies that repeat the runtime state block (#8520)”; “fix(chat): preserve planning-only intent after clarification (#8172)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/strategies/od-next/protocol.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: apps/web/src/runtime/strategy-question-continuation.ts apps/web/src/runtime/strategy-question-continuation.ts:86— apps/web/src/runtime/strategy-question-continuation.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 5 (its worst body is strategy-question-continuation.strategyTaskRunIndex at line 86), 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(od-next): remove output-contract gates and unblock continuation (#8356)”; “fix(chat): keep live strategy continuations in their original task (#8195)”; “fix(web): stop replaying OD Next turns parked on the user (#8250)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/runtime/strategy-question-continuation.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/sidecar/src/stamp.ts packages/sidecar/src/stamp.ts:95— packages/sidecar/src/stamp.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 8 (its worst body is stamp.readSupervisedSidecarContext at line 95), 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(sidecar): bound macOS private IPC socket paths (#8002)”; “fix(packaged): let a macOS headless runtime become the desktop in place (#8398)”; “revert(sidecar): defer convergence until after weekly release (#7634)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- packages/sidecar/src/stamp.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: apps/daemon/src/runtimes/defs/antigravity.ts apps/daemon/src/runtimes/defs/antigravity.ts:156— apps/daemon/src/runtimes/defs/antigravity.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 7 (its worst body is antigravity.waitForAgyToReadModel at line 156), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(daemon): drive Antigravity through agy's stream-json stdin channel (Windows ENAMETOOLONG) (#8594)”; “fix(daemon): pass noninteractive permission bypass to Antigravity (#7316)”; “fix(runtimes): pass Antigravity prompt via -p argument (#7205)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/daemon/src/runtimes/defs/antigravity.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: apps/web/src/components/WorkbenchCampaignBadge.tsx apps/web/src/components/WorkbenchCampaignBadge.tsx:33— apps/web/src/components/WorkbenchCampaignBadge.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 5 (its worst body is WorkbenchCampaignBadge.WorkbenchCampaignBadge at line 33), 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(desktop,web): packaged-only opendesign:// registration, signed-in-only campaign badge (#7479)”; “fix(web): hide Go campaign touchpoints (#7361)”; “fix(i18n): preserve locale in Pricing handoff (#7197)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 02:57:10 +00:00' --until='2026-10-26 02:57:10 +00:00' --full-history --no-merges -- apps/web/src/components/WorkbenchCampaignBadge.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.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×20
Heading level jumps from h1 to h3 apps/web/src/components/PluginDetailView.tsx:397— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/components.html:142— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/system/artifacts/deck.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/system/artifacts/form.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/system/artifacts/landing.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/system/artifacts/newsletter.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/system/artifacts/poster.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/system/index.html:118— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/system/kit.dark.html:128— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/agentic/system/kit.html:128— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airbnb/system/artifacts/deck.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airbnb/system/artifacts/form.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airbnb/system/artifacts/landing.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airbnb/system/artifacts/newsletter.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airbnb/system/artifacts/poster.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airbnb/system/index.html:118— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airbnb/system/kit.dark.html:128— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airbnb/system/kit.html:128— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airtable/system/artifacts/deck.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 design-systems/airtable/system/artifacts/form.html:127— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×17
Modal dialog does not manage focus apps/web/src/collab/PresenceBar.tsx:186— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/AvatarMenu.tsx:585— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/BrandPickerModal.tsx:68— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/ChatComposer.tsx:4717— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/CommunityTemplatePreview.tsx:317— This <section role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/ConnectorsBrowser.tsx:1374— This <aside role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus REDACTED:2369— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus REDACTED:2939— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/DesignKitView.tsx:1691— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/DesignKitView.tsx:1761— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/DesignKitView.tsx:1801— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/DesignKitView.tsx:1832— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/DesignKitView.tsx:1874— This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/DesignSystemAssetDropzone.tsx:533— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/EntryNavRail.tsx:1544— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/FigmaHelpModal.tsx:28— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Modal dialog does not manage focus apps/web/src/components/FileWorkspace.tsx:8321— This <section role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Skipped test: [P0] @critical deleting the active conversation selects the remaining conversation in history e2e/ui/app-restoration.test.ts:745— Skipped — switched off by test.skip
Skipped test: [P2] a streaming chat log stays reachable by a real wheel e2e/ui/chat-scroll-wheel-reach.test.ts:112— Skipped — switched off by test.skip
Skipped test: (unnamed test) e2e/ui/real-daemon-run.test.ts:167— Skipped — switched off by test.skip
Skipped test: (unnamed test) e2e/ui/real-daemon-run.test.ts:219— Skipped — switched off by test.skip
Skipped test: (unnamed test) e2e/ui/real-daemon-run.test.ts:244— Skipped — switched off by test.skip
Skipped test: (unnamed test) e2e/ui/real-daemon-run.test.ts:269— Skipped — switched off by test.skip
Skipped test: (unnamed test) e2e/ui/real-daemon-run.test.ts:301— Skipped — switched off by test.skip
Skipped test: (unnamed test) e2e/ui/real-daemon-run.test.ts:353— Skipped — switched off by test.skip
Skipped test: [P1] lets the daily main build recover a shared beta advanced by a feature branch e2e/tests/packaged-smoke-workflow.test.ts:2692— Skipped — switched off by it.skip
Skipped test: opens the project as soon as the workspace exists and prepares the first chat task afterward apps/web/tests/components/DesignSystemFlow.test.tsx:799— Skipped — switched off by it.skip
Skipped test: creates a project-backed design system and hands the first task to the normal project chat apps/web/tests/components/DesignSystemFlow.test.tsx:888— Skipped — switched off by it.skip
Skipped test: infers a product title from a GitHub URL instead of the URL protocol apps/web/tests/components/DesignSystemFlow.test.tsx:1993— Skipped — switched off by it.skip
Skipped test: adds website source links with Enter and keeps them out of GitHub intake apps/web/tests/components/DesignSystemFlow.test.tsx:2065— Skipped — switched off by it.skip
Skipped test: allows GitHub repo links without Composio by using local GitHub intake apps/web/tests/components/DesignSystemFlow.test.tsx:2145— Skipped — switched off by it.skip
Skipped test: keeps GitHub repo links available and shows connected connector status apps/web/tests/components/DesignSystemFlow.test.tsx:2238— Skipped — switched off by it.skip
Skipped test: dismisses tab search when a blank page area handles the mouse down apps/web/tests/components/WorkspaceTabsBar.test.tsx:922— Skipped — switched off by it.skip
Skipped test: does NOT call onEnterSend when Enter fires during IME composition (#2851 guard) apps/web/tests/components/composer/LexicalComposerInput.test.tsx:455— Skipped — switched off by it.skip
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:25— LifecycleStatus (context web) is exposed in standalone's public surface via LifecyclePort.start — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:27— LifecycleStatus (context web) is exposed in standalone's public surface via LifecyclePort.heartbeat — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:28— LifecycleStatus (context web) is exposed in standalone's public surface via LifecyclePort.release — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:29— LifecycleStatus (context web) is exposed in standalone's public surface via LifecyclePort.status — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:30— LifecycleStatus (context web) is exposed in standalone's public surface via LifecyclePort.stop — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:47— LifecycleStatus (context web) is exposed in standalone's public surface via StandaloneGenerationHandoffPort.start — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:83— LifecycleStatus (context web) is exposed in standalone's public surface via VersionedLauncher.start — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:87— LifecycleStatus (context web) is exposed in standalone's public surface via VersionedLauncher.startDuringTransition — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:133— LifecycleStatus (context web) is exposed in standalone's public surface via VersionedLauncher.heartbeat — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:134— LifecycleStatus (context web) is exposed in standalone's public surface via VersionedLauncher.release — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:135— LifecycleStatus (context web) is exposed in standalone's public surface via VersionedLauncher.status — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:149— LifecycleStatus (context web) is exposed in standalone's public surface via VersionedLauncher.stop — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/launcher.ts:162— LifecycleStatus (context web) is exposed in standalone's public surface via FossilBootloader.start — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/shared-lifecycle.ts:114— LifecycleStatus (context web) is exposed in standalone's public surface via shared-lifecycle.projectSharedLifecycleStatus — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) packages/standalone/src/shared-lifecycle.ts:131— LifecycleStatus (context web) is exposed in standalone's public surface via shared-lifecycle.sharedLifecycleTransitionBlockers — couples the contexts.
Cross-context type LifecycleStatus (web → standalone) REDACTED:137— LifecycleStatus (context web) is exposed in standalone's public surface via StandaloneUpdater.activateOnColdStart — couples the contexts.
P12 · CI test-gate honesty· Workspace package's tests never run by CI · ×15
Workspace package's tests never run by CI REDACTED:16— `apps/closure` is a workspace package with 4 test(s) in 1 file(s) (e.g. `apps/closure/tests/closure.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 REDACTED:28— `apps/web` is a workspace package with 12510 test(s) in 1370 file(s) (e.g. `apps/web/tests/App.test.ts`, `apps/web/tests/all-projects-list.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 packages/agui-adapter/package.json:20— `packages/agui-adapter` is a workspace package with 12 test(s) in 1 file(s) (e.g. `packages/agui-adapter/tests/encode.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 packages/components/package.json:23— `packages/components` is a workspace package with 10 test(s) in 2 file(s) (e.g. `packages/components/tests/Button.test.tsx`, `packages/components/tests/Dialog.test.tsx`), 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 packages/diagnostics/package.json:20— `packages/diagnostics` is a workspace package with 33 test(s) in 5 file(s) (e.g. `packages/diagnostics/tests/agent-logs.test.ts`, `packages/diagnostics/tests/automatic.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 packages/download/package.json:19— `packages/download` is a workspace package with 17 test(s) in 1 file(s) (e.g. `packages/download/tests/index.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 packages/dsh-runtime/package.json:41— `packages/dsh-runtime` is a workspace package with 12 test(s) in 1 file(s) (e.g. `packages/dsh-runtime/tests/protocol.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 packages/launcher-proto/package.json:19— `packages/launcher-proto` is a workspace package with 18 test(s) in 1 file(s) (e.g. `packages/launcher-proto/tests/index.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 packages/metatool/package.json:20— `packages/metatool` is a workspace package with 2 test(s) in 1 file(s) (e.g. `packages/metatool/tests/build-metadata.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 packages/plugin-runtime/package.json:20— `packages/plugin-runtime` is a workspace package with 69 test(s) in 10 file(s) (e.g. `packages/plugin-runtime/tests/adapter-agent-skill.test.ts`, `packages/plugin-runtime/tests/digest.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 packages/registry-protocol/package.json:20— `packages/registry-protocol` is a workspace package with 3 test(s) in 1 file(s) (e.g. `packages/registry-protocol/tests/backend.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 packages/release/package.json:22— `packages/release` is a workspace package with 6 test(s) in 1 file(s) (e.g. `packages/release/tests/index.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 packages/standalone/package.json:18— `packages/standalone` is a workspace package with 33 test(s) in 5 file(s) (e.g. `packages/standalone/tests/blob.test.ts`, `packages/standalone/tests/bootloader-handoff.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 shells/terminal/package.json:10— `shells/terminal` is a workspace package with 24 test(s) in 7 file(s) (e.g. `shells/terminal/tests/bootloader-handoff.test.ts`, `shells/terminal/tests/contract.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 tools/serve/package.json:12— `tools/serve` is a workspace package with 31 test(s) in 6 file(s) (e.g. `tools/serve/tests/beta-version-reservation.test.ts`, `tools/serve/tests/collab-cloud-fixture.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.
TodoComment apps/web/tests/runtime/run-failure-agent-reply-incomplete.test.ts:82— // 「零 TODO 零占位」:这三种是最常见的没写完的痕迹。 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/tests/components/ProjectView.run-cleanup.test.tsx:731— // TODO(reconcile): re-add the three unit tests for — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/tests/components/composer/LexicalComposerInput.test.tsx:446— // TODO(lexical-jsdom): jsdom can't make `editor.isComposing()` return true. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/tests/components/composer/LexicalComposerInput.test.tsx:456— // Intentionally skipped — see TODO above. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/tests/components/chat/thinking-embedded.test.tsx:215— // todo 段里也要出「思考过程」那一格 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/tests/components/chat/w85-orb-mark-say-term.test.tsx:253— // 「todo 外的 toolrow…不要有任何的缩进了」:行盒往左探出 7px,补回来正好落在壳的内容边 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/src/lib/build-clipboard-prompt.ts:3— // The trailing TODO is the "blank task slot" the issue body specifies — — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/src/components/SettingsDialog.tsx:8160— // TODO(i18n): inline English placeholders; promote to locale — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/src/components/ToolCard.tsx:270— // todo list to expanded while there is in-progress work or anything — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/src/components/XaiOAuthControl.tsx:11— // TODO(i18n): the visible strings are hardcoded English for the PoC; — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment apps/web/src/components/chat/ExecutionShell.tsx:926— // Todo content is its identity (D17). Local text indices repeat in — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment REDACTED:273— // TODO(native-session-clone): Add a runtime-capability-gated adapter contract — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment REDACTED:12— // TODO before stable release: apply for our own client_id from xAI. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Weak hash algorithm REDACTED:378— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm apps/daemon/src/plugins/atoms/diff-review.ts:232— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm apps/daemon/src/plugins/atoms/figma-extract.ts:429— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm apps/daemon/src/plugins/atoms/rewrite-plan.ts:264— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm apps/daemon/src/plugins/atoms/token-map.ts:411— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm REDACTED:6404— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm apps/daemon/src/run-artifact-fs.ts:130— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm apps/daemon/src/run-artifact-fs.ts:148— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm skills/web-clone/scripts/asset-harvest.mjs:98— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm skills/web-clone/scripts/interaction-probe.mjs:41— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm skills/web-clone/scripts/network-capture.mjs:33— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm skills/web-clone/scripts/route-crawl.mjs:64— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm skills/web-clone/scripts/sourcemap-hunt.mjs:40— 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.
D30 · Dependency Vulnerabilities· Medium CVE · ×11
Change coupling: content.fr.ts ↔ content.ru.ts apps/web/src/i18n/content.fr.ts:1— `apps/web/src/i18n/content.fr.ts` and `apps/web/src/i18n/content.ru.ts` change together 96% of the time (27 of the 28 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 27 shared commits counted here, the most recent 3 are `ec524986` chore(plugins): remove html-ppt-dir-key-nav-minimal and html-ppt-xhs-…; `5254559c` Add WeRead year-in-review HyperFrames template (#2131); `d5812ee5` feat: add FAQ page skill (#1162) — run `git show` on any of them.
Change coupling: en.ts ↔ zh-CN.ts apps/web/src/i18n/locales/en.ts:1— `apps/web/src/i18n/locales/en.ts` and `apps/web/src/i18n/locales/zh-CN.ts` change together 89% of the time (34 of the 38 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 34 shared commits counted here, the most recent 3 are `8a14c188` feat(web): unify design-system pickers and add "No design system" cho…; `d0d9c027` feat(web): Manus-style second-level category rail on Home composer (#…; `0767948f` fix(web): tighten preview workspace panels (#3643) — run `git show` on any of them.
Change coupling: en.ts ↔ zh-TW.ts apps/web/src/i18n/locales/en.ts:1— `apps/web/src/i18n/locales/en.ts` and `apps/web/src/i18n/locales/zh-TW.ts` change together 71% of the time (12 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `0767948f` fix(web): tighten preview workspace panels (#3643); `e56ae87c` fix(web): localize scheduled routine empty-output errors (#3022); `9c6a6949` fix(web): localize mention picker copy (#3255) — run `git show` on any of them.
Change coupling: HomeView.tsx ↔ PluginsHomeSection.tsx apps/web/src/components/HomeView.tsx:1— `apps/web/src/components/HomeView.tsx` and `apps/web/src/components/PluginsHomeSection.tsx` change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `844a0c0a` fix(web): scope Use actions to the plugin detail modal and decouple t…; `3aeb3a12` feat(web): live-preview Community gallery + redesigned plugin detail …; `10e11531` Improve deck home previews and plugin gallery performance (#2698) — run `git show` on any of them.
Change coupling: file-viewer-render-mode.ts ↔ REDACTED apps/web/src/components/file-viewer-render-mode.ts:1— `apps/web/src/components/file-viewer-render-mode.ts` and `REDACTED` 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 `f92c2d95` fix(viewer): stabilize Electron HTML previews (#7336); `b5d9a12f` fix(web): break redirect-loop scripts that freeze the HTML preview (#…; `b22c7713` fix(web): prevent preview iframe from stealing focus on load (#2792) — run `git show` on any of them.
Change coupling: REDACTED ↔ ToolCard.tsx REDACTED:1— `REDACTED` and `apps/web/src/components/ToolCard.tsx` 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 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 7 shared commits counted here, the most recent 3 are `8552237f` Fix duplicate tool call rendering (#4385); `6e10fa48` feat: stream agent questions token-by-token (#3582); `dc2cb6b3` feat(web): render code comment directives (#2871) — run `git show` on any of them.
Change coupling: cli.ts ↔ media-contract.ts apps/daemon/src/cli.ts:1— `apps/daemon/src/cli.ts` and `apps/daemon/src/prompts/media-contract.ts` 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 — 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 `3662637d` fix(media): surface concrete image-generation failure reasons (#7118); `3395d2c8` feat(daemon): implement fal.ai renderer for image + video generation …; `c847ace5` Add run-scoped media execution policy (#3106) — run `git show` on any of them.
Change coupling: HomeView.tsx ↔ REDACTED apps/web/src/components/HomeView.tsx:1— `apps/web/src/components/HomeView.tsx` and `REDACTED` change together 57% of the time (12 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `0390de94` refactor(components): share composable dialog primitives for web dial…; `0e592c3b` feat(analytics): fill tracking gaps (popovers, questions form, refere…; `1d59ffac` fix(web): localize entry i18n gaps (#2060) — run `git show` on any of them.
Change coupling: run-terminal-reconciliation.ts ↔ runs.ts apps/daemon/src/runtimes/run-terminal-reconciliation.ts:1— `apps/daemon/src/runtimes/run-terminal-reconciliation.ts` and `apps/daemon/src/runtimes/runs.ts` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `f10efc52` fix(daemon): preserve terminal delivery lifecycle evidence (#7679); `db9ebb7b` fix(daemon): preserve run version across restart (#7500); `3c05f82c` fix(daemon): report terminal AMR Runs to Vela (#7424) — run `git show` on any of them.
Change coupling: AvatarMenu.tsx ↔ InlineModelSwitcher.tsx apps/web/src/components/AvatarMenu.tsx:1— `apps/web/src/components/AvatarMenu.tsx` and `apps/web/src/components/InlineModelSwitcher.tsx` change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `f86adccf` fix(web): reveal full model names on hover in model pickers (#8409); `9ce7b3ae` fix(byok): restore BYOK model switching in the home and composer pick…; `1dd813f0` fix(byok): preserve provider model order (#5774) — run `git show` on any of them.
Change coupling: provider-models.ts ↔ REDACTED apps/daemon/src/integrations/provider-models.ts:1— `apps/daemon/src/integrations/provider-models.ts` and `REDACTED` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `dde62281` feat(daemon): add OD_ALLOWED_INTERNAL_HOSTS allowlist for internal pr…; `e75cb416` [codex] Add BYOK provider presets (#4902); `338cb4d4` fix(platform): support live system proxy changes (#3093) (at that commit the files were still `apps/daemon/src/providerModels.ts` and `apps/daemon/src/chat-routes.ts`) — run `git show` on any of them.
AC3 · Page structure· Page without a main landmark · ×8
Page without a main landmark apps/web/app/layout.tsx:44— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark assets/frames/android-pixel.html:6— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark assets/frames/browser-chrome.html:6— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark assets/frames/ipad-pro.html:6— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark assets/frames/iphone-15-pro.html:8— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark assets/frames/macbook.html:8— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark clipper/capture.js:555— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark clipper/store/assets/screenshot-frame.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
server.startServer::startChatRun (cyclomatic 458) REDACTED:11395— server.startServer::startChatRun has cyclomatic complexity 458 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::syncSharedTeamPlugin, server.startServer::syncSharedTeamSkill, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::composeDaemonSystemPrompt (cyclomatic 156) REDACTED:10334— server.startServer::composeDaemonSystemPrompt has cyclomatic complexity 156 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::syncSharedTeamPlugin, server.startServer::syncSharedTeamSkill, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::finishWithRetryDecision (cyclomatic 46) REDACTED:13493— server.startServer::startChatRun::finishWithRetryDecision 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. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::syncSharedTeamPlugin, server.startServer::syncSharedTeamSkill, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::send (cyclomatic 42) REDACTED:13116— server.startServer::startChatRun::send has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::syncSharedTeamPlugin, server.startServer::syncSharedTeamSkill, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::sendAgentEvent (cyclomatic 20) REDACTED:15794— server.startServer::startChatRun::sendAgentEvent has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::syncSharedTeamPlugin, server.startServer::syncSharedTeamSkill, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::failForInactivity (cyclomatic 19) REDACTED:14515— server.startServer::startChatRun::failForInactivity has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::syncSharedTeamPlugin, server.startServer::syncSharedTeamSkill, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::syncSharedTeamPlugin (cyclomatic 17) REDACTED:7198— server.startServer::syncSharedTeamPlugin 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. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::syncSharedTeamSkill, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::syncSharedTeamSkill (cyclomatic 17) REDACTED:7474— server.startServer::syncSharedTeamSkill 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. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::syncSharedTeamPlugin, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
No assertions: accepts v3 evidence without retiring v2 or requiring new fields on legacy events packages/contracts/tests/analytics-run-finished-contract.test.ts:44— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: [P2] captures the project workspace surface e2e/ui/visual-workspace.test.ts:27— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: [P2] captures the avatar menu surface e2e/ui/visual-workspace.test.ts:290— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: uses configured AMR profile env for pre-run login status e2e/tests/amr/relogin-required.test.ts:64— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: uses daemon AMR runtime credentials for pre-run login status e2e/tests/amr/relogin-required.test.ts:111— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: renders the personal share-stopped copy when shareStopped is true apps/web/tests/components/share/CommentSyncBanner.test.tsx:79— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: preserves inline and fenced examples containing complete nested forms verbatim apps/web/tests/components/chat/hidden-card-question-form-ownership.test.tsx:149— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: still emits events when the watch root is itself nested under .od/ (production layout) apps/daemon/tests/project-watchers.test.ts:248— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
server.startServer::startChatRun (cognitive 553) REDACTED:11395— server.startServer::startChatRun has cognitive complexity 553 (threshold 15). Drivers by points: if/else 121 (183 pts), ternaries 108 (181 pts), boolean chains 135, error handling 24 (50 pts), loops 2 (4 pts) (nesting depth added 163). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::collectBundledScenarios, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::composeDaemonSystemPrompt (cognitive 240) REDACTED:10334— server.startServer::composeDaemonSystemPrompt has cognitive complexity 240 (threshold 15). Drivers by points: if/else 41 (105 pts), ternaries 45 (57 pts), boolean chains 40, loops 5 (20 pts), error handling 10 (18 pts) (nesting depth added 99). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::collectBundledScenarios, server.startServer::startChatRun, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::send (cognitive 38) REDACTED:13116— server.startServer::startChatRun::send has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 10, ternaries 4 (10 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::collectBundledScenarios, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::finishWithRetryDecision (cognitive 30) REDACTED:13493— server.startServer::startChatRun::finishWithRetryDecision has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts), ternaries 7 (10 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::collectBundledScenarios, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::sendAgentEvent (cognitive 26) REDACTED:15794— server.startServer::startChatRun::sendAgentEvent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (7 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::collectBundledScenarios, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::failForInactivity (cognitive 24) REDACTED:14515— server.startServer::startChatRun::failForInactivity has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::collectBundledScenarios, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::startChatRun::summarizeAgentEventForInactivity (cognitive 17) REDACTED:14432— server.startServer::startChatRun::summarizeAgentEventForInactivity has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4, 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. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::collectBundledScenarios, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
server.startServer::collectBundledScenarios (cognitive 16) REDACTED:10077— server.startServer::collectBundledScenarios has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, 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. This shape REPEATS in the file: 8 other methods here (server.startServer, server.startServer::composeDaemonSystemPrompt, server.startServer::startChatRun, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
IC1 · Incompleteness & stubs· Guard cannot change the result · ×8
Guard cannot change the result — returns what the code already falls through to apps/daemon/src/connectors/composio.ts:1347— The guard above `return undefined;` also returns `undefined`, 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 apps/daemon/src/mcp-brief.ts:532— The guard above `return 'en';` also returns `'en'`, 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 apps/daemon/src/media/config.ts:285— 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 apps/daemon/src/memory-connectors.ts:350— The guard above `return false;` also returns `false`, 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 apps/web/src/components/FileWorkspace.tsx:8783— The guard above `return 'file';` also returns `'file'`, 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 apps/web/src/components/TasksView.tsx:280— The guard above `return 'history';` also returns `'history'`, 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 tools/pack/src/cache/lock.ts:40— The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Guard cannot change the result — returns what the code already falls through to tools/release/src/catalog/entry-assets.ts:44— 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.
Swallowed exception (caught, then discarded) tools/pack/src/web-sourcemaps.ts:83— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) tools/pack/src/workspace-build.ts:289— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) tools/pack/src/workspace-build.ts:330— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) tools/pack/src/win/registry.ts:87— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) tools/pack/resources/web-standalone-after-pack.cjs:309— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) tools/pack/resources/web-standalone-after-pack.cjs:472— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) skills/web-clone/scripts/recon-site.mjs:236— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:43— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
AC1 · Text alternatives· <video> without a captions track · ×7
<video> without a captions track apps/web/src/components/DesignSystemAssetDropzone.tsx:386— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track REDACTED:19510— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track apps/web/src/components/HomeHero.tsx:2642— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track apps/web/src/components/LibraryPreviewModal.tsx:158— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track apps/web/src/components/plugin-details/PluginMediaDetail.tsx:138— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track skills/8-bit-orbit-video-template/example.html:39— Video with no captions <track> offers no captions. Add a <track kind="captions"> pointing at a WebVTT file for this video (or confirm captions are provided another way).
<video> without a captions track skills/weread-year-in-review-video-template/example.html:59— Video with no captions <track> offers no captions. Add a <track kind="captions"> pointing at a WebVTT file for this video (or confirm captions are provided another way).
Off the main sequence: @open-design/platform — @open-design/platform: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: @open-design/release — @open-design/release: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
Off the main sequence: @open-design/sidecar-proto — @open-design/sidecar-proto: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
Off the main sequence: @open-design/diagnostics — @open-design/diagnostics: abstractness 0.14, instability 0.00, distance 0.86 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: @open-design/sidecar — @open-design/sidecar: abstractness 0.00, instability 0.14, distance 0.86 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: @open-design/components — @open-design/components: abstractness 0.17, instability 0.00, distance 0.83 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: @open-design/launcher-proto — @open-design/launcher-proto: abstractness 0.00, instability 0.29, distance 0.71 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
FileViewer.HtmlViewer::publishCurrentFilePublic (cyclomatic 25) REDACTED:8213— FileViewer.HtmlViewer::publishCurrentFilePublic has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 6 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::updateCurrentFilePublic, FileViewer.HtmlViewer::loadCloudflareZones, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
FileViewer.HtmlViewer::applyManualEdit (cyclomatic 25) REDACTED:13884— FileViewer.HtmlViewer::applyManualEdit has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 6 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
FileViewer.HtmlViewer::updateCurrentFilePublic (cyclomatic 24) REDACTED:8331— FileViewer.HtmlViewer::updateCurrentFilePublic 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. This shape REPEATS in the file: 6 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::loadCloudflareZones, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
FileViewer.HtmlViewer::deployToSelectedProvider (cyclomatic 23) REDACTED:14979— FileViewer.HtmlViewer::deployToSelectedProvider has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 6 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
FileViewer.HtmlViewer::sendBoardBatch (cyclomatic 17) REDACTED:15524— FileViewer.HtmlViewer::sendBoardBatch 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. This shape REPEATS in the file: 6 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
FileViewer.HtmlViewer::loadCloudflareZones (cyclomatic 16) REDACTED:9814— FileViewer.HtmlViewer::loadCloudflareZones has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 6 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
deck-capture.runDomToPptx::preserveLayeredGradientBackgrounds (cognitive 72) apps/desktop/src/main/deck-capture.ts:2597— deck-capture.runDomToPptx::preserveLayeredGradientBackgrounds has cognitive complexity 72 (threshold 15). Drivers by points: if/else 20 (42 pts), ternaries 4 (14 pts), boolean chains 13, loops 3 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 5 other methods here (deck-capture.runDomToPptx::importedFontFaceCss, deck-capture.runDomToPptx::splitCssBackgroundLayers, deck-capture.runDomToPptx::setCaptureBoxStyles, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds (cognitive 30) apps/desktop/src/main/deck-capture.ts:2477— deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (10 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: 5 other methods here (deck-capture.runDomToPptx::importedFontFaceCss, deck-capture.runDomToPptx::splitCssBackgroundLayers, deck-capture.runDomToPptx::setCaptureBoxStyles, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.runDomToPptx::splitCssBackgroundLayers (cognitive 24) apps/desktop/src/main/deck-capture.ts:2356— deck-capture.runDomToPptx::splitCssBackgroundLayers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 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. This shape REPEATS in the file: 5 other methods here (deck-capture.runDomToPptx::importedFontFaceCss, deck-capture.runDomToPptx::setCaptureBoxStyles, deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.runDomToPptx::importedFontFaceCss (cognitive 23) apps/desktop/src/main/deck-capture.ts:2156— deck-capture.runDomToPptx::importedFontFaceCss has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 3 (6 pts), boolean chains 5, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (deck-capture.runDomToPptx::splitCssBackgroundLayers, deck-capture.runDomToPptx::setCaptureBoxStyles, deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.runDomToPptx::setCaptureBoxStyles (cognitive 22) apps/desktop/src/main/deck-capture.ts:2434— deck-capture.runDomToPptx::setCaptureBoxStyles has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. To reduce it, name the conditions: bind each compound test to a 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: 5 other methods here (deck-capture.runDomToPptx::importedFontFaceCss, deck-capture.runDomToPptx::splitCssBackgroundLayers, deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.runDomToPptx::promoteCjkTypefaces (cognitive 21) apps/desktop/src/main/deck-capture.ts:2861— deck-capture.runDomToPptx::promoteCjkTypefaces has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (deck-capture.runDomToPptx::importedFontFaceCss, deck-capture.runDomToPptx::splitCssBackgroundLayers, deck-capture.runDomToPptx::setCaptureBoxStyles, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×6
Recursive walk over a caller-supplied document has no depth cap REDACTED:96— `canonicalJson` is exported, takes a document from its caller (line 104) and hands it to `canonicalValue`, which calls itself at line 96 (`canonicalValue`) with a piece of `value` (and at line 99) — and nowhere in `canonicalValue` 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 `canonicalValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/diagnostics/src/redaction.ts:29— `redactJsonValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 29 (`redactJsonValue`) with a piece of `value` (and at line 36) — and nowhere in `redactJsonValue` 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 `redactJsonValue` 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 design-templates/last30days/scripts/lib/schema.py:15— `to_dict` is public, takes a document from its caller (line 175) and hands it to `_drop_none`, which calls itself at line 15 (`_drop_none`) with a piece of `value` (and at line 20) — and nowhere in `_drop_none` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_drop_none` 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 apps/web/src/components/touchpoint-component.ts:654— `focusWebTouchpointModal` is exported, takes a document from its caller (line 704) and hands it to `composedFocusableElements`, which calls itself at line 654 (`composedFocusableElements`) with a piece of `root` (and at line 655) — and nowhere in `composedFocusableElements` 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 `composedFocusableElements` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap REDACTED:48— `isLoopbackPeerAddress` is exported and takes `address: unknown` from its caller, and it calls itself at line 48 (`isLoopbackPeerAddress`) with a piece of `address` — and nowhere in `isLoopbackPeerAddress` 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 `isLoopbackPeerAddress` 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 apps/daemon/src/genui/registry.ts:50— `schemaDigest` is exported, takes a document from its caller (line 43) and hands it to `canonicalize`, which calls itself at line 50 (`canonicalize`) with a piece of `value` (and at line 54) — and nowhere in `canonicalize` 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 `canonicalize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
HomeView.HomeView::submit (cyclomatic 71) apps/web/src/components/HomeView.tsx:2790— HomeView.HomeView::submit 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. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::usePlugin, HomeView.HomeView::routePluginUse, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::usePlugin (cyclomatic 29) apps/web/src/components/HomeView.tsx:1446— HomeView.HomeView::usePlugin has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::routePluginUse, HomeView.HomeView::pickChip, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::routePluginUse (cyclomatic 25) apps/web/src/components/HomeView.tsx:1749— HomeView.HomeView::routePluginUse has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::usePlugin, HomeView.HomeView::pickChip, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::submitScenario (cyclomatic 18) apps/web/src/components/HomeView.tsx:2734— HomeView.HomeView::submitScenario has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::usePlugin, HomeView.HomeView::routePluginUse, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::pickChip (cyclomatic 16) apps/web/src/components/HomeView.tsx:2524— HomeView.HomeView::pickChip has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::usePlugin, HomeView.HomeView::routePluginUse, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::handleFetchProviderModels (cyclomatic 32) apps/web/src/components/SettingsDialog.tsx:2757— SettingsDialog.SettingsDialog::handleFetchProviderModels has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleTestProvider, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::renderAgentModelConfig (cyclomatic 31) apps/web/src/components/SettingsDialog.tsx:3983— SettingsDialog.SettingsDialog::renderAgentModelConfig 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. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleTestProvider, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::renderTestMessage (cyclomatic 30) apps/web/src/components/SettingsDialog.tsx:2950— SettingsDialog.SettingsDialog::renderTestMessage has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleTestProvider, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::handleTestProvider (cyclomatic 29) apps/web/src/components/SettingsDialog.tsx:2604— SettingsDialog.SettingsDialog::handleTestProvider has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleFetchProviderModels, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::handleTestAgent (cyclomatic 19) apps/web/src/components/SettingsDialog.tsx:2530— SettingsDialog.SettingsDialog::handleTestAgent has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestProvider, SettingsDialog.SettingsDialog::handleFetchProviderModels, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::submit (cognitive 84) apps/web/src/components/HomeView.tsx:2790— HomeView.HomeView::submit has cognitive complexity 84 (threshold 15). Drivers by points: ternaries 32 (45 pts), boolean chains 19, if/else 15 (19 pts), error handling 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. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::usePlugin, HomeView.HomeView::routePluginUse, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::usePlugin (cognitive 35) apps/web/src/components/HomeView.tsx:1446— HomeView.HomeView::usePlugin has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 7 (10 pts), boolean chains 9, 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. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::routePluginUse, HomeView.HomeView::pickChip, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::routePluginUse (cognitive 35) apps/web/src/components/HomeView.tsx:1749— HomeView.HomeView::routePluginUse has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 5, if/else 4 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::usePlugin, HomeView.HomeView::pickChip, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::pickChip (cognitive 20) apps/web/src/components/HomeView.tsx:2524— HomeView.HomeView::pickChip has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::usePlugin, HomeView.HomeView::routePluginUse, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
HomeView.HomeView::submitScenario (cognitive 16) apps/web/src/components/HomeView.tsx:2734— HomeView.HomeView::submitScenario has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView, HomeView.HomeView::usePlugin, HomeView.HomeView::routePluginUse, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::handleTestProvider (cognitive 40) apps/web/src/components/SettingsDialog.tsx:2604— SettingsDialog.SettingsDialog::handleTestProvider has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 6 (13 pts), boolean chains 6, 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. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleFetchProviderModels, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::handleFetchProviderModels (cognitive 40) apps/web/src/components/SettingsDialog.tsx:2757— SettingsDialog.SettingsDialog::handleFetchProviderModels has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 7 (10 pts), boolean chains 4, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleTestProvider, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::renderAgentModelConfig (cognitive 29) apps/web/src/components/SettingsDialog.tsx:3983— SettingsDialog.SettingsDialog::renderAgentModelConfig has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 13 (16 pts), boolean chains 11, if/else 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. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleTestProvider, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::renderTestMessage (cognitive 27) apps/web/src/components/SettingsDialog.tsx:2950— SettingsDialog.SettingsDialog::renderTestMessage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 4 (8 pts), boolean chains 6, match/switch 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. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleTestProvider, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SettingsDialog.SettingsDialog::handleTestAgent (cognitive 22) apps/web/src/components/SettingsDialog.tsx:2530— SettingsDialog.SettingsDialog::handleTestAgent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, ternaries 4 (6 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog, SettingsDialog.SettingsDialog::handleTestProvider, SettingsDialog.SettingsDialog::handleFetchProviderModels, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileViewer.HtmlViewer::publishCurrentFilePublic (cognitive 30) REDACTED:8213— FileViewer.HtmlViewer::publishCurrentFilePublic has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 2 (9 pts), boolean chains 7, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::updateCurrentFilePublic, FileViewer.HtmlViewer::applyManualEdit, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileViewer.HtmlViewer::applyManualEdit (cognitive 30) REDACTED:13884— FileViewer.HtmlViewer::applyManualEdit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (16 pts), ternaries 6 (12 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileViewer.HtmlViewer::deployToSelectedProvider (cognitive 24) REDACTED:14979— FileViewer.HtmlViewer::deployToSelectedProvider has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 4 (6 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileViewer.HtmlViewer::updateCurrentFilePublic (cognitive 19) REDACTED:8331— FileViewer.HtmlViewer::updateCurrentFilePublic has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, 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. This shape REPEATS in the file: 5 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::applyManualEdit, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileViewer.HtmlViewer::sendBoardBatch (cognitive 16) REDACTED:15524— FileViewer.HtmlViewer::sendBoardBatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 5 other methods here (FileViewer.HtmlViewer, FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Cross-context type Platform (daemon → platform) REDACTED:79— Platform (context daemon) is exposed in platform's public surface via proxy-env.mergeProxyAwareEnv — couples the contexts.
Cross-context type Platform (daemon → platform) REDACTED:253— Platform (context daemon) is exposed in platform's public surface via proxy-env.parseMacosScutilProxyOutput — couples the contexts.
Cross-context type Platform (daemon → platform) REDACTED:321— Platform (context daemon) is exposed in platform's public surface via proxy-env.parseWindowsInternetSettingsProxyOutput — couples the contexts.
Cross-context type Platform (daemon → platform) REDACTED:107— Platform (context daemon) is exposed in platform's public surface via process.processCommandExactlyRunsExecutable — couples the contexts.
Cross-context type Platform (daemon → platform) REDACTED:471— Platform (context daemon) is exposed in platform's public surface via process.selectStampedProcessesAtInvocation — couples the contexts.
IC1 · Incompleteness & stubs· Both branches are identical · ×5
Both branches are identical — the condition decides nothing apps/daemon/src/plugins/export.ts:76— The `if` and its `else` contain the same statements, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body.
Both branches are identical — the condition decides nothing apps/daemon/src/plugins/validate.ts:91— 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 REDACTED:2851— 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 REDACTED:18499— 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 REDACTED:90— 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.
runs.registerRunRoutes::handleRunCreate (cognitive 432) apps/daemon/src/routes/runs.ts:1393— runs.registerRunRoutes::handleRunCreate has cognitive complexity 432 (threshold 15). Drivers by points: if/else 105 (175 pts), boolean chains 125, ternaries 51 (99 pts), error handling 17 (33 pts) (nesting depth added 134). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (runs.registerRunRoutes::statusWithStrategyTask, runs.registerRunRoutes::prepareRunWorkspaceScope, runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
runs.registerRunRoutes::prepareRunWorkspaceScope (cognitive 26) apps/daemon/src/routes/runs.ts:1167— runs.registerRunRoutes::prepareRunWorkspaceScope has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 3 other methods here (runs.registerRunRoutes::statusWithStrategyTask, runs.registerRunRoutes::handleRunCreate, runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart (cognitive 24) apps/daemon/src/routes/runs.ts:2282— runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 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. This shape REPEATS in the file: 3 other methods here (runs.registerRunRoutes::statusWithStrategyTask, runs.registerRunRoutes::prepareRunWorkspaceScope, runs.registerRunRoutes::handleRunCreate) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
runs.registerRunRoutes::statusWithStrategyTask (cognitive 16) apps/daemon/src/routes/runs.ts:1021— runs.registerRunRoutes::statusWithStrategyTask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (6 pts), boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (runs.registerRunRoutes::prepareRunWorkspaceScope, runs.registerRunRoutes::handleRunCreate, runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
touchpoint-content-cache.createTouchpointContentCache::retryRefusals (cognitive 60) apps/daemon/src/routes/touchpoint-content-cache.ts:850— touchpoint-content-cache.createTouchpointContentCache::retryRefusals has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (46 pts), loops 5 (7 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (touchpoint-content-cache.createTouchpointContentCache, touchpoint-content-cache.createTouchpointContentCache::fenceActive, touchpoint-content-cache.createTouchpointContentCache::sweepExpired, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
touchpoint-content-cache.createTouchpointContentCache::refuseAuthority (cognitive 21) apps/daemon/src/routes/touchpoint-content-cache.ts:1233— touchpoint-content-cache.createTouchpointContentCache::refuseAuthority has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (touchpoint-content-cache.createTouchpointContentCache, touchpoint-content-cache.createTouchpointContentCache::fenceActive, touchpoint-content-cache.createTouchpointContentCache::sweepExpired, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
touchpoint-content-cache.createTouchpointContentCache::sweepExpired (cognitive 17) apps/daemon/src/routes/touchpoint-content-cache.ts:809— touchpoint-content-cache.createTouchpointContentCache::sweepExpired has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (touchpoint-content-cache.createTouchpointContentCache, touchpoint-content-cache.createTouchpointContentCache::fenceActive, touchpoint-content-cache.createTouchpointContentCache::retryRefusals, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
touchpoint-content-cache.createTouchpointContentCache::fenceActive (cognitive 16) apps/daemon/src/routes/touchpoint-content-cache.ts:666— touchpoint-content-cache.createTouchpointContentCache::fenceActive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (touchpoint-content-cache.createTouchpointContentCache, touchpoint-content-cache.createTouchpointContentCache::sweepExpired, touchpoint-content-cache.createTouchpointContentCache::retryRefusals, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatComposer.ChatComposer::handlePopoverKey (cognitive 32) apps/web/src/components/ChatComposer.tsx:2963— ChatComposer.ChatComposer::handlePopoverKey has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 10 (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. This shape REPEATS in the file: 4 other methods here (ChatComposer.ChatComposer, ChatComposer.ChatComposer::tryHandlePetSlash, ChatComposer.ChatComposer::addAssetsFromLibrary, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatComposer.ChatComposer::pickMentionByFlatIndex (cognitive 24) apps/web/src/components/ChatComposer.tsx:3030— ChatComposer.ChatComposer::pickMentionByFlatIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (ChatComposer.ChatComposer, ChatComposer.ChatComposer::tryHandlePetSlash, ChatComposer.ChatComposer::addAssetsFromLibrary, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatComposer.ChatComposer::tryHandlePetSlash (cognitive 23) apps/web/src/components/ChatComposer.tsx:1422— ChatComposer.ChatComposer::tryHandlePetSlash has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 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. This shape REPEATS in the file: 4 other methods here (ChatComposer.ChatComposer, ChatComposer.ChatComposer::addAssetsFromLibrary, ChatComposer.ChatComposer::handlePopoverKey, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatComposer.ChatComposer::addAssetsFromLibrary (cognitive 20) apps/web/src/components/ChatComposer.tsx:2497— ChatComposer.ChatComposer::addAssetsFromLibrary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (6 pts), error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (ChatComposer.ChatComposer, ChatComposer.ChatComposer::tryHandlePetSlash, ChatComposer.ChatComposer::handlePopoverKey, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
runs.registerRunRoutes::handleRunCreate (cyclomatic 363) apps/daemon/src/routes/runs.ts:1393— runs.registerRunRoutes::handleRunCreate has cyclomatic complexity 363 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (runs.registerRunRoutes::prepareRunWorkspaceScope, runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
runs.registerRunRoutes::prepareRunWorkspaceScope (cyclomatic 24) apps/daemon/src/routes/runs.ts:1167— runs.registerRunRoutes::prepareRunWorkspaceScope has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 2 other methods here (runs.registerRunRoutes::handleRunCreate, runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart (cyclomatic 22) apps/daemon/src/routes/runs.ts:2282— runs.registerRunRoutes::handleRunCreate::fallbackAutomaticBeforeStart has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (runs.registerRunRoutes::prepareRunWorkspaceScope, runs.registerRunRoutes::handleRunCreate) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.runDomToPptx::preserveLayeredGradientBackgrounds (cyclomatic 38) apps/desktop/src/main/deck-capture.ts:2597— deck-capture.runDomToPptx::preserveLayeredGradientBackgrounds has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (deck-capture.runDomToPptx::setCaptureBoxStyles, deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds (cyclomatic 29) apps/desktop/src/main/deck-capture.ts:2477— deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: 2 other methods here (deck-capture.runDomToPptx::setCaptureBoxStyles, deck-capture.runDomToPptx::preserveLayeredGradientBackgrounds) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.runDomToPptx::setCaptureBoxStyles (cyclomatic 25) apps/desktop/src/main/deck-capture.ts:2434— deck-capture.runDomToPptx::setCaptureBoxStyles has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: 2 other methods here (deck-capture.runDomToPptx::preserveLayeredPseudoGradientBackgrounds, deck-capture.runDomToPptx::preserveLayeredGradientBackgrounds) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryShell.EntryShell::pluginLoopCreateInput (cyclomatic 30) apps/web/src/components/EntryShell.tsx:1672— EntryShell.EntryShell::pluginLoopCreateInput 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. This shape REPEATS in the file: 3 other methods here (EntryShell.EntryShell, EntryShell.EntryShell::handleOpenAllProjects, EntryShell.EntryShell::handlePluginLoopSubmit) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryShell.EntryShell::handleOpenAllProjects (cyclomatic 23) apps/web/src/components/EntryShell.tsx:1096— EntryShell.EntryShell::handleOpenAllProjects has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 3 other methods here (EntryShell.EntryShell, EntryShell.EntryShell::handlePluginLoopSubmit, EntryShell.EntryShell::pluginLoopCreateInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryShell.EntryShell::handlePluginLoopSubmit (cyclomatic 23) apps/web/src/components/EntryShell.tsx:1487— EntryShell.EntryShell::handlePluginLoopSubmit has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (EntryShell.EntryShell, EntryShell.EntryShell::handleOpenAllProjects, EntryShell.EntryShell::pluginLoopCreateInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatComposer.ChatComposer::handlePopoverKey (cyclomatic 28) apps/web/src/components/ChatComposer.tsx:2963— ChatComposer.ChatComposer::handlePopoverKey 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. This shape REPEATS in the file: 3 other methods here (ChatComposer.ChatComposer, ChatComposer.ChatComposer::tryHandlePetSlash, ChatComposer.ChatComposer::pickMentionByFlatIndex) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatComposer.ChatComposer::pickMentionByFlatIndex (cyclomatic 19) apps/web/src/components/ChatComposer.tsx:3030— ChatComposer.ChatComposer::pickMentionByFlatIndex has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (ChatComposer.ChatComposer, ChatComposer.ChatComposer::tryHandlePetSlash, ChatComposer.ChatComposer::handlePopoverKey) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatComposer.ChatComposer::tryHandlePetSlash (cyclomatic 17) apps/web/src/components/ChatComposer.tsx:1422— ChatComposer.ChatComposer::tryHandlePetSlash has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (ChatComposer.ChatComposer, ChatComposer.ChatComposer::handlePopoverKey, ChatComposer.ChatComposer::pickMentionByFlatIndex) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: ChatComposer.designToolboxActionPrompt (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D10 · Test Quality· Fixed-sleep synchronisation · ×3
Fixed-sleep synchronisation: renews a long maintenance lease so a competing sweep cannot steal it packages/standalone/tests/blob.test.ts:85— 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((resolveDelay) => setTimeout(resolveDelay, 5))` — 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: coalesces a racing POST /collab/pull and handle pull into one adapter pull apps/daemon/tests/collab-sync-routes.test.ts:5395— This test starts work it did not wait for (`viaHandle`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 50))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: preserves model-cache invalidation when forced status refresh joins an in-flight probe apps/daemon/tests/integrations/vela.routes.test.ts:489— This test starts work it did not wait for (`warmStatus`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 25))` — 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.
EntryShell.OnboardingView::handleAmrSignInToContinue (cognitive 41) apps/web/src/components/EntryShell.tsx:3121— EntryShell.OnboardingView::handleAmrSignInToContinue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 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. This shape REPEATS in the file: 3 other methods here (EntryShell.OnboardingView, EntryShell.OnboardingView::handleCancelAmrLogin, EntryShell.OnboardingView::pollAmrLoginCompletion) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryShell.OnboardingView::pollAmrLoginCompletion (cognitive 33) apps/web/src/components/EntryShell.tsx:3300— EntryShell.OnboardingView::pollAmrLoginCompletion has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 3 other methods here (EntryShell.OnboardingView, EntryShell.OnboardingView::handleAmrSignInToContinue, EntryShell.OnboardingView::handleCancelAmrLogin) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryShell.OnboardingView::handleCancelAmrLogin (cognitive 16) apps/web/src/components/EntryShell.tsx:3245— EntryShell.OnboardingView::handleCancelAmrLogin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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. This shape REPEATS in the file: 3 other methods here (EntryShell.OnboardingView, EntryShell.OnboardingView::handleAmrSignInToContinue, EntryShell.OnboardingView::pollAmrLoginCompletion) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryShell.EntryShell::handlePluginLoopSubmit (cognitive 38) apps/web/src/components/EntryShell.tsx:1487— EntryShell.EntryShell::handlePluginLoopSubmit has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 3 (6 pts), loops 2 (5 pts), boolean chains 4, error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (EntryShell.EntryShell, EntryShell.EntryShell::handleOpenAllProjects, EntryShell.EntryShell::pluginLoopCreateInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryShell.EntryShell::pluginLoopCreateInput (cognitive 28) apps/web/src/components/EntryShell.tsx:1672— EntryShell.EntryShell::pluginLoopCreateInput has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 16, boolean chains 12. 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. This shape REPEATS in the file: 3 other methods here (EntryShell.EntryShell, EntryShell.EntryShell::handleOpenAllProjects, EntryShell.EntryShell::handlePluginLoopSubmit) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryShell.EntryShell::handleOpenAllProjects (cognitive 21) apps/web/src/components/EntryShell.tsx:1096— EntryShell.EntryShell::handleOpenAllProjects has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, ternaries 2, 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. This shape REPEATS in the file: 3 other methods here (EntryShell.EntryShell, EntryShell.EntryShell::handlePluginLoopSubmit, EntryShell.EntryShell::pluginLoopCreateInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DesignFilesPanel.DesignFilesPanel::renderFileRow (cognitive 17) apps/web/src/components/DesignFilesPanel.tsx:930— DesignFilesPanel.DesignFilesPanel::renderFileRow has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 13 (17 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. This shape REPEATS in the file: 3 other methods here (DesignFilesPanel.DesignFilesPanel, DesignFilesPanel.DesignFilesPanel::renderPageCard, DesignFilesPanel.DesignFilesPanel::renderEmptyState) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DesignFilesPanel.DesignFilesPanel::renderEmptyState (cognitive 17) apps/web/src/components/DesignFilesPanel.tsx:1508— DesignFilesPanel.DesignFilesPanel::renderEmptyState has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 3 other methods here (DesignFilesPanel.DesignFilesPanel, DesignFilesPanel.DesignFilesPanel::renderFileRow, DesignFilesPanel.DesignFilesPanel::renderPageCard) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DesignFilesPanel.DesignFilesPanel::renderPageCard (cognitive 16) apps/web/src/components/DesignFilesPanel.tsx:1073— DesignFilesPanel.DesignFilesPanel::renderPageCard has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 3 other methods here (DesignFilesPanel.DesignFilesPanel, DesignFilesPanel.DesignFilesPanel::renderFileRow, DesignFilesPanel.DesignFilesPanel::renderEmptyState) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Cross-context type Platform (daemon → packaged) apps/packaged/src/sidecars.ts:474— Platform (context daemon) is exposed in packaged's public surface via sidecars.resolveDaemonStatusTimeoutMs — couples the contexts.
Cross-context type Platform (daemon → packaged) apps/packaged/src/managed-headless.ts:32— Platform (context daemon) is exposed in packaged's public surface via managed-headless.isPackagedManagedLaunch — couples the contexts.
Cross-context type Platform (daemon → packaged) apps/packaged/src/managed-headless.ts:47— Platform (context daemon) is exposed in packaged's public surface via managed-headless.supportsDeferredHeadlessDesktop — couples the contexts.
TooManyMethods: ComposioConnectorProvider apps/daemon/src/connectors/composio.ts:441— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 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.
TooManyMethods: WorkspaceBillingRuntimeCoordinator apps/daemon/src/collab/workspace-billing-runtime.ts:182— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CollabClient apps/web/src/collab/collab-client.ts:101— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
IC1 · Incompleteness & stubs· Markup wires an event to an empty handler · ×3
Markup wires an event to an empty handler REDACTED:2410— `onRemoveMember` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
Markup wires an event to an empty handler apps/web/src/components/DesignSystemFlow.tsx:2877— `onDeleteConversation` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
Markup wires an event to an empty handler apps/web/src/components/EntryShell.tsx:2241— `onViewAll` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
Dead file (~1 LoC) tools/release/src/storage/publish-beta-metadata.ts— no import path from any entry point (859 application, 107 tooling, 3062 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) tools/release/src/storage/summary-beta.ts— no import path from any entry point (859 application, 107 tooling, 3062 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) tools/release/src/storage/verify-beta-metadata.ts— no import path from any entry point (859 application, 107 tooling, 3062 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
import-export-routes.registerProjectExportRoutes::handleScreenshotExport (cyclomatic 98) REDACTED:964— import-export-routes.registerProjectExportRoutes::handleScreenshotExport has cyclomatic complexity 98 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (import-export-routes.registerProjectExportRoutes::handleStandaloneHtmlExport) 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.
import-export-routes.registerProjectExportRoutes::handleStandaloneHtmlExport (cyclomatic 29) REDACTED:810— import-export-routes.registerProjectExportRoutes::handleStandaloneHtmlExport has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (import-export-routes.registerProjectExportRoutes::handleScreenshotExport) 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.
frontmatter.parseYamlSubset (cyclomatic 41) apps/daemon/src/design-systems/frontmatter.ts:26— frontmatter.parseYamlSubset has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
frontmatter.parseYamlSubset (cyclomatic 41) packages/plugin-runtime/src/parsers/frontmatter.ts:68— frontmatter.parseYamlSubset has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
touchpoint-content-cache.createTouchpointContentCache::retryRefusals (cyclomatic 30) apps/daemon/src/routes/touchpoint-content-cache.ts:850— touchpoint-content-cache.createTouchpointContentCache::retryRefusals has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (touchpoint-content-cache.createTouchpointContentCache, touchpoint-content-cache.createTouchpointContentCache::parseAssembly) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
touchpoint-content-cache.createTouchpointContentCache::parseAssembly (cyclomatic 24) apps/daemon/src/routes/touchpoint-content-cache.ts:355— touchpoint-content-cache.createTouchpointContentCache::parseAssembly 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. This shape REPEATS in the file: 2 other methods here (touchpoint-content-cache.createTouchpointContentCache, touchpoint-content-cache.createTouchpointContentCache::retryRefusals) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
build-turn-blocks.buildTurnBlocks::finishTurn (cyclomatic 27) apps/web/src/runtime/chat/build-turn-blocks.ts:1498— build-turn-blocks.buildTurnBlocks::finishTurn has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (build-turn-blocks.buildTurnBlocks, build-turn-blocks.buildTurnBlocks::applyTodoList) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
build-turn-blocks.buildTurnBlocks::applyTodoList (cyclomatic 22) apps/web/src/runtime/chat/build-turn-blocks.ts:1253— build-turn-blocks.buildTurnBlocks::applyTodoList has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (build-turn-blocks.buildTurnBlocks, build-turn-blocks.buildTurnBlocks::finishTurn) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
import-export-routes.registerProjectExportRoutes::handleScreenshotExport (cognitive 126) REDACTED:964— import-export-routes.registerProjectExportRoutes::handleScreenshotExport has cognitive complexity 126 (threshold 15). Drivers by points: if/else 36 (48 pts), boolean chains 37, ternaries 13 (34 pts), error handling 3 (5 pts), loops 1 (2 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (import-export-routes.registerProjectExportRoutes::handleStandaloneHtmlExport) 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.
import-export-routes.registerProjectExportRoutes::handleStandaloneHtmlExport (cognitive 44) REDACTED:810— import-export-routes.registerProjectExportRoutes::handleStandaloneHtmlExport has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 10 (23 pts), if/else 8 (11 pts), boolean chains 8, error handling 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (import-export-routes.registerProjectExportRoutes::handleScreenshotExport) 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.
frontmatter.parseYamlSubset (cognitive 91) apps/daemon/src/design-systems/frontmatter.ts:26— frontmatter.parseYamlSubset has cognitive complexity 91 (threshold 15). Drivers by points: if/else 27 (78 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
frontmatter.parseYamlSubset (cognitive 91) packages/plugin-runtime/src/parsers/frontmatter.ts:68— frontmatter.parseYamlSubset has cognitive complexity 91 (threshold 15). Drivers by points: if/else 27 (78 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
deck-capture.collectLayeredPptxBackgroundTargets::materializeLayeredPseudoBackground (cognitive 51) apps/desktop/src/main/deck-capture.ts:696— deck-capture.collectLayeredPptxBackgroundTargets::materializeLayeredPseudoBackground has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 35, if/else 8 (12 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: 2 other methods here (deck-capture.collectLayeredPptxBackgroundTargets, deck-capture.collectLayeredPptxBackgroundTargets::splitLayers) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
deck-capture.collectLayeredPptxBackgroundTargets::splitLayers (cognitive 24) apps/desktop/src/main/deck-capture.ts:584— deck-capture.collectLayeredPptxBackgroundTargets::splitLayers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 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. This shape REPEATS in the file: 2 other methods here (deck-capture.collectLayeredPptxBackgroundTargets, deck-capture.collectLayeredPptxBackgroundTargets::materializeLayeredPseudoBackground) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
build-turn-blocks.buildTurnBlocks::applyTodoList (cognitive 36) apps/web/src/runtime/chat/build-turn-blocks.ts:1253— build-turn-blocks.buildTurnBlocks::applyTodoList has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (build-turn-blocks.buildTurnBlocks, build-turn-blocks.buildTurnBlocks::finishTurn) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
build-turn-blocks.buildTurnBlocks::finishTurn (cognitive 33) apps/web/src/runtime/chat/build-turn-blocks.ts:1498— build-turn-blocks.buildTurnBlocks::finishTurn has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (7 pts), boolean chains 6, 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. This shape REPEATS in the file: 2 other methods here (build-turn-blocks.buildTurnBlocks, build-turn-blocks.buildTurnBlocks::applyTodoList) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PluginsView.ExtensionsMarketplace::shareResource (cognitive 30) REDACTED:1635— PluginsView.ExtensionsMarketplace::shareResource has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 12 (22 pts), if/else 4, boolean chains 3, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (PluginsView.ExtensionsMarketplace, PluginsView.ExtensionsMarketplace::unshareResource) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PluginsView.ExtensionsMarketplace::unshareResource (cognitive 17) REDACTED:1703— PluginsView.ExtensionsMarketplace::unshareResource has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4, boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (PluginsView.ExtensionsMarketplace, PluginsView.ExtensionsMarketplace::shareResource) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileWorkspace.FileWorkspace::runSketchSave (cognitive 28) apps/web/src/components/FileWorkspace.tsx:2986— FileWorkspace.FileWorkspace::runSketchSave has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (8 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (FileWorkspace.FileWorkspace, FileWorkspace.FileWorkspace::handleDeleteMany) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileWorkspace.FileWorkspace::handleDeleteMany (cognitive 18) apps/web/src/components/FileWorkspace.tsx:2695— FileWorkspace.FileWorkspace::handleDeleteMany has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (FileWorkspace.FileWorkspace, FileWorkspace.FileWorkspace::runSketchSave) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
json-line-stream.classifyJsonCandidate::parseValue (cognitive 21) apps/daemon/src/agent-protocol/core/json-line-stream.ts:207— json-line-stream.classifyJsonCandidate::parseValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 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. This shape REPEATS in the file: 2 other methods here (json-line-stream.classifyJsonCandidate, json-line-stream.classifyJsonCandidate::parseNumber) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
json-line-stream.classifyJsonCandidate::parseNumber (cognitive 20) apps/daemon/src/agent-protocol/core/json-line-stream.ts:183— json-line-stream.classifyJsonCandidate::parseNumber has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (json-line-stream.classifyJsonCandidate, json-line-stream.classifyJsonCandidate::parseValue) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Cross-context type PluginShareAction (daemon → contracts) packages/contracts/src/plugins/share-actions.ts:16— PluginShareAction (context daemon) is exposed in contracts's public surface via CreatePluginShareProjectRequest.action — couples the contexts.
Cross-context type PluginShareAction (daemon → contracts) packages/contracts/src/api/plugin-candidates.ts:67— PluginShareAction (context daemon) is exposed in contracts's public surface via SkillPluginCandidateShareTaskResponse.action — couples the contexts.
Cross-context type Platform (daemon → sidecar) packages/sidecar/src/stamp.ts:160— Platform (context daemon) is exposed in sidecar's public surface via stamp.resolvePrivateIpcPath — couples the contexts.
Cross-context type Platform (daemon → sidecar) packages/sidecar/src/supervisor-exit.ts:19— Platform (context daemon) is exposed in sidecar's public surface via supervisor-exit.supervisorExitDisposition — couples the contexts.
MethodTooLong: StandaloneBundler.bundleDocument REDACTED:151— MethodTooLong — bundleDocument 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: ToolPackCache.acquire tools/pack/src/cache/index.ts:171— MethodTooLong — acquire runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (6 lines × 2) .github/scripts/release.py:115— .github/scripts/release.py:115-120 | .github/scripts/release.py:257-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) skills/hatch-pet/scripts/generate_pet_images.py:201— skills/hatch-pet/scripts/generate_pet_images.py:201-206 | skills/hatch-pet/scripts/record_imagegen_result.py:151-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) .github/scripts/release.py:97— .github/scripts/release.py:97-101 | .github/scripts/release.py:240-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `.github/scripts/release.py:104` calls `set` and `.github/scripts/release.py:247` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) skills/hatch-pet/scripts/pet_job_status.py:26— skills/hatch-pet/scripts/pet_job_status.py:26-30 | skills/hatch-pet/scripts/record_imagegen_result.py:64-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Fake-async — async method never awaits apps/daemon/src/services/plugin-installation.ts:85— `folderLooksLikePlugin` 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 tools/release/src/catalog/export-catalog.ts:66— `exportCatalogFromEnv` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
R10 · Code Duplication· Duplicated block with local edits (82 matched lines × 2 locations) · ×2
Duplicated block with local edits (82 matched lines × 2 locations) apps/daemon/src/runtimes/mmd-routes.ts:13— apps/daemon/src/runtimes/mmd-routes.ts:13 · apps/daemon/src/runtimes/qwen-settings.ts:19 — the two spans are one implementation copied and then locally edited — 622 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) apps/web/src/components/McpClientSection.tsx:1189— apps/web/src/components/McpClientSection.tsx:1189 · apps/web/src/components/XaiOAuthControl.tsx:152 — the two spans are one implementation copied and then locally edited — 447 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (73 matched lines × 2 locations) · ×2
Duplicated block with local edits (73 matched lines × 2 locations) packages/contracts/src/prompts/canonical-xml.ts:57— packages/contracts/src/prompts/canonical-xml.ts:57 · packages/contracts/src/prompts/od-next-prompt-bundle.ts:43 — the two spans are one implementation copied and then locally edited — 494 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 (73 matched lines × 2 locations) tools/release/src/release-note/publication.ts:37— tools/release/src/release-note/publication.ts:37 · tools/release/src/release-note/source.ts:40 — the two spans are one implementation copied and then locally edited — 508 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) apps/daemon/src/tools-design-systems-cli.ts:25— apps/daemon/src/tools-design-systems-cli.ts:25 · apps/daemon/src/tools-live-artifacts-cli.ts:40 — the two spans are one implementation copied and then locally edited — 664 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) apps/web/src/components/ProjectView.tsx:10614— apps/web/src/components/ProjectView.tsx:10614 · apps/web/src/components/ProjectView.tsx:10863 — the two spans are one implementation copied and then locally edited — 364 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
AC4 · Keyboard semantics· Link used as a button (placeholder href) · ×1
Link used as a button (placeholder href) apps/web/src/components/FileWorkspace.tsx:4681— An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 2419 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
ProjectView.ProjectView (cyclomatic 1776) apps/web/src/components/ProjectView.tsx:2168— ProjectView.ProjectView has cyclomatic complexity 1776 (threshold 15). Of this number, 192 points are the body's own statements and 1584 belong to 361 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.
App.AppInner (cyclomatic 830) apps/web/src/App.tsx:982— App.AppInner has cyclomatic complexity 830 (threshold 15). Of this number, 206 points are the body's own statements and 624 belong to 180 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.
FileViewer.HtmlViewer (cyclomatic 615) REDACTED:7238— FileViewer.HtmlViewer has cyclomatic complexity 615 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 6 other methods here (FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, FileViewer.HtmlViewer::loadCloudflareZones, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
FileWorkspace.FileWorkspace (cyclomatic 612) apps/web/src/components/FileWorkspace.tsx:1334— FileWorkspace.FileWorkspace has cyclomatic complexity 612 (threshold 15). Of this number, 113 points are the body's own statements and 499 belong to 140 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.
chat.registerChatRoutes (cyclomatic 454) REDACTED:67— chat.registerChatRoutes has cyclomatic complexity 454 (threshold 15). Most of this is not in the body itself: 1 of the 454 points is its own statement and the rest belongs to 59 function items inside it that branch (a function literal at line 273, a function literal at line 1553, a function literal at line 1184, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ChatPane.ChatPane (cyclomatic 384) apps/web/src/components/ChatPane.tsx:1322— ChatPane.ChatPane has cyclomatic complexity 384 (threshold 15). Of this number, 94 points are the body's own statements and 290 belong to 100 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.
WorkspaceTabsBar.WorkspaceTabsBar (cyclomatic 296) apps/web/src/components/WorkspaceTabsBar.tsx:860— WorkspaceTabsBar.WorkspaceTabsBar has cyclomatic complexity 296 (threshold 15). Of this number, 28 points are the body's own statements and 268 belong to 77 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.
static-resource.registerStaticResourceRoutes (cyclomatic 286) REDACTED:116— static-resource.registerStaticResourceRoutes has cyclomatic complexity 286 (threshold 15). Most of this is not in the body itself: 1 of the 286 points is its own statement and the rest belongs to 43 function items inside it that branch (a function literal at line 1098, a function literal at line 1272, a function literal at line 621, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
RecentProjectsStrip.RecentProjectsStrip (cyclomatic 282) apps/web/src/components/RecentProjectsStrip.tsx:360— RecentProjectsStrip.RecentProjectsStrip has cyclomatic complexity 282 (threshold 15). Of this number, 74 points are the body's own statements and 208 belong to 62 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.
collab-sync.registerCollabSyncRoutes (cyclomatic 280) REDACTED:758— collab-sync.registerCollabSyncRoutes has cyclomatic complexity 280 (threshold 15). Most of this is not in the body itself: 1 of the 280 points is its own statement and the rest belongs to 22 function literals inside it that branch (lines 1335, 2737, 1801, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HomeHero.HomeHero (cyclomatic 277) apps/web/src/components/HomeHero.tsx:354— HomeHero.HomeHero has cyclomatic complexity 277 (threshold 15). Of this number, 121 points are the body's own statements and 156 belong to 79 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.
InlineModelSwitcher.InlineModelSwitcher (cyclomatic 237) apps/web/src/components/InlineModelSwitcher.tsx:177— InlineModelSwitcher.InlineModelSwitcher has cyclomatic complexity 237 (threshold 15). Of this number, 99 points are the body's own statements and 138 belong to 47 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.
MemorySection.MemorySection (cyclomatic 216) apps/web/src/components/MemorySection.tsx:728— MemorySection.MemorySection has cyclomatic complexity 216 (threshold 15). Of this number, 60 points are the body's own statements and 156 belong to 50 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.
DesignSystemFlow.DesignSystemDetailView (cyclomatic 205) apps/web/src/components/DesignSystemFlow.tsx:1633— DesignSystemFlow.DesignSystemDetailView has cyclomatic complexity 205 (threshold 15). Of this number, 35 points are the body's own statements and 170 belong to 51 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.
QuestionForm.QuestionFormView (cyclomatic 203) apps/web/src/components/QuestionForm.tsx:120— QuestionForm.QuestionFormView has cyclomatic complexity 203 (threshold 15). Of this number, 63 points are the body's own statements and 140 belong to 34 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.
AssistantMessage.AssistantMessageImpl (cyclomatic 203) REDACTED:403— AssistantMessage.AssistantMessageImpl has cyclomatic complexity 203 (threshold 15). Of this number, 134 points are the body's own statements and 69 belong to 28 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.
run-analytics-lifecycle.createRunAnalyticsLifecycle.install (cyclomatic 187) apps/daemon/src/services/run-analytics-lifecycle.ts:343— run-analytics-lifecycle.createRunAnalyticsLifecycle.install has cyclomatic complexity 187 (threshold 15). Most of this is not in the body itself: 2 of the 187 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 349, 739, 811, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignSystemsTab.DesignSystemsTab (cyclomatic 164) apps/web/src/components/DesignSystemsTab.tsx:166— DesignSystemsTab.DesignSystemsTab has cyclomatic complexity 164 (threshold 15). Most of this is not in the body itself: 15 of the 164 points are its own statements and the rest belongs to 45 function items inside it that branch (a function literal at line 442, handleShareToTeam, deleteSystem, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SettingsDialog.SettingsDialog (cyclomatic 164) apps/web/src/components/SettingsDialog.tsx:1502— SettingsDialog.SettingsDialog has cyclomatic complexity 164 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleTestProvider, SettingsDialog.SettingsDialog::handleFetchProviderModels, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
collab-context.registerCollabContextRoutes (cyclomatic 161) REDACTED:330— collab-context.registerCollabContextRoutes has cyclomatic complexity 161 (threshold 15). Most of this is not in the body itself: 4 of the 161 points are its own statements and the rest belongs to 24 function items inside it that branch (a function literal at line 902, a function literal at line 785, a function literal at line 598, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
DesignsTab.DesignsTab (cyclomatic 159) apps/web/src/components/DesignsTab.tsx:129— DesignsTab.DesignsTab has cyclomatic complexity 159 (threshold 15). Of this number, 40 points are the body's own statements and 119 belong to 44 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.
FileViewer.MarkdownViewer (cyclomatic 157) REDACTED:19911— FileViewer.MarkdownViewer has cyclomatic complexity 157 (threshold 15). Of this number, 34 points are the body's own statements and 123 belong to 36 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.
comments.registerProjectCommentRoutes (cyclomatic 146) REDACTED:244— comments.registerProjectCommentRoutes has cyclomatic complexity 146 (threshold 15). Most of this is not in the body itself: 1 of the 146 points is its own statement and the rest belongs to 26 function items inside it that branch (a function literal at line 577, callerMayMutate, isLocalTeamRelayCandidate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
vela.proxyTouchpointRuntimeRequest (cyclomatic 146) REDACTED:588— vela.proxyTouchpointRuntimeRequest has cyclomatic complexity 146 (threshold 15). Of this number, 43 points are the body's own statements and 103 belong to 20 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.
NewProjectPanel.NewProjectPanel (cyclomatic 145) apps/web/src/components/NewProjectPanel.tsx:276— NewProjectPanel.NewProjectPanel has cyclomatic complexity 145 (threshold 15). Of this number, 55 points are the body's own statements and 90 belong to 27 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.
cli.runAutomation (cyclomatic 144) apps/daemon/src/cli.ts:12098— cli.runAutomation has cyclomatic complexity 144 (threshold 15). Of this number, 136 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.
FileViewer.FileVersionManagerModal (cyclomatic 144) REDACTED:3470— FileViewer.FileVersionManagerModal has cyclomatic complexity 144 (threshold 15). Of this number, 45 points are the body's own statements and 99 belong to 42 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.
session.attachAcpSession.parser (cyclomatic 141) apps/daemon/src/agent-protocol/acp/session.ts:1041— session.attachAcpSession.parser has cyclomatic complexity 141 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProductionCampaignModal.ProductionCampaignModal (cyclomatic 141) apps/web/src/components/ProductionCampaignModal.tsx:263— ProductionCampaignModal.ProductionCampaignModal has cyclomatic complexity 141 (threshold 15). Of this number, 36 points are the body's own statements and 105 belong to 24 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.
index.registerPluginRoutes (cyclomatic 139) REDACTED:397— index.registerPluginRoutes has cyclomatic complexity 139 (threshold 15). Most of this is not in the body itself: 1 of the 139 points is its own statement and the rest belongs to 28 function items inside it that branch (a function literal at line 702, a function literal at line 574, a function literal at line 633, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
system.composeSystemPrompt (cyclomatic 137) REDACTED:899— system.composeSystemPrompt has cyclomatic complexity 137 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
daemon.consumeDaemonPhysicalRun (cyclomatic 136) apps/web/src/providers/daemon.ts:1764— daemon.consumeDaemonPhysicalRun has cyclomatic complexity 136 (threshold 15). Of this number, 120 points are the body's own statements and 16 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.generateMedia (cyclomatic 134) apps/daemon/src/media/index.ts:351— index.generateMedia has cyclomatic complexity 134 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli.runProject (cyclomatic 130) apps/daemon/src/cli.ts:7528— cli.runProject has cyclomatic complexity 130 (threshold 15). Of this number, 129 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.
ShareTab.ShareTab (cyclomatic 129) apps/web/src/components/share/ShareTab.tsx:115— ShareTab.ShareTab has cyclomatic complexity 129 (threshold 15). Of this number, 115 points are the body's own statements and 14 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.
LibrarySection.LibrarySection (cyclomatic 128) apps/web/src/components/LibrarySection.tsx:499— LibrarySection.LibrarySection has cyclomatic complexity 128 (threshold 15). Of this number, 30 points are the body's own statements and 98 belong to 43 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.
Icon.Icon (cyclomatic 126) apps/web/src/components/Icon.tsx:277— Icon.Icon has cyclomatic complexity 126 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
library.registerLibraryRoutes (cyclomatic 125) REDACTED:170— library.registerLibraryRoutes has cyclomatic complexity 125 (threshold 15). Most of this is not in the body itself: 1 of the 125 points is its own statement and the rest belongs to 18 function items inside it that branch (a function literal at line 330, applyAssetToProject, a function literal at line 714, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
NextStepActions.NextStepActions (cyclomatic 125) apps/web/src/components/NextStepActions.tsx:333— NextStepActions.NextStepActions has cyclomatic complexity 125 (threshold 15). Of this number, 67 points are the body's own statements and 58 belong to 20 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.
memory.registerMemoryRoutes (cyclomatic 124) REDACTED:109— memory.registerMemoryRoutes has cyclomatic complexity 124 (threshold 15). Most of this is not in the body itself: 1 of the 124 points is its own statement and the rest belongs to 22 function literals inside it that branch (lines 549, 187, 433, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignKitView.DesignKitViewInner (cyclomatic 123) apps/web/src/components/DesignKitView.tsx:313— DesignKitView.DesignKitViewInner has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (DesignKitView.DesignKitViewInner::handleKitKeyDown) 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.
brand-routes.registerBrandRoutes (cyclomatic 120) REDACTED:142— brand-routes.registerBrandRoutes has cyclomatic complexity 120 (threshold 15). Most of this is not in the body itself: 1 of the 120 points is its own statement and the rest belongs to 19 function items inside it that branch (a function literal at line 330, a function literal at line 669, a function literal at line 564, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
system.renderMetadataBlock (cyclomatic 120) REDACTED:1752— system.renderMetadataBlock has cyclomatic complexity 120 (threshold 15). Of this number, 119 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.
SkillsSection.SkillsSection (cyclomatic 116) apps/web/src/components/SkillsSection.tsx:106— SkillsSection.SkillsSection has cyclomatic complexity 116 (threshold 15). Of this number, 16 points are the body's own statements and 100 belong to 28 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.
PetSettings.PetSettings (cyclomatic 112) apps/web/src/components/pet/PetSettings.tsx:54— PetSettings.PetSettings has cyclomatic complexity 112 (threshold 15). Of this number, 59 points are the body's own statements and 53 belong to 19 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run-failure-classification.classifyRunFailureBase (cyclomatic 111) apps/daemon/src/run-failure-classification.ts:1028— run-failure-classification.classifyRunFailureBase has cyclomatic complexity 111 (threshold 15). Of this number, 110 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.
PreviewModal.PreviewModal (cyclomatic 110) apps/web/src/components/PreviewModal.tsx:243— PreviewModal.PreviewModal has cyclomatic complexity 110 (threshold 15). Of this number, 59 points are the body's own statements and 51 belong to 31 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.
AvatarMenu.AvatarMenu (cyclomatic 109) apps/web/src/components/AvatarMenu.tsx:94— AvatarMenu.AvatarMenu has cyclomatic complexity 109 (threshold 15). Of this number, 62 points are the body's own statements and 47 belong to 25 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.
tools-connectors-cli.auditDesignSystemPackage (cyclomatic 108) apps/daemon/src/tools-connectors-cli.ts:1722— tools-connectors-cli.auditDesignSystemPackage has cyclomatic complexity 108 (threshold 15). To reduce it, separate the cases: extract each independent 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-observation-otlp-exporter.legacyAndOtlpTaskMappingsMatch (cyclomatic 107) apps/daemon/src/observability/task-observation-otlp-exporter.ts:640— task-observation-otlp-exporter.legacyAndOtlpTaskMappingsMatch has cyclomatic complexity 107 (threshold 15). Of this number, 102 points are the body's own statements and 5 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.
touchpoint-lifecycle.useTouchpointLifecycle (cyclomatic 106) apps/web/src/components/touchpoint-lifecycle.ts:424— touchpoint-lifecycle.useTouchpointLifecycle has cyclomatic complexity 106 (threshold 15). Most of this is not in the body itself: 8 of the 106 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 660, 574, 823, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
touchpoint-content-cache.createTouchpointContentCache (cyclomatic 105) apps/daemon/src/routes/touchpoint-content-cache.ts:273— touchpoint-content-cache.createTouchpointContentCache has cyclomatic complexity 105 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (touchpoint-content-cache.createTouchpointContentCache::parseAssembly, touchpoint-content-cache.createTouchpointContentCache::retryRefusals) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
UpdateDialog.UpdateDialog (cyclomatic 105) apps/web/src/components/UpdateDialog.tsx:42— UpdateDialog.UpdateDialog has cyclomatic complexity 105 (threshold 15). Of this number, 26 points are the body's own statements and 79 belong to 18 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stock-telemetry.parseStockJournal (cyclomatic 104) apps/daemon/src/media/stock-telemetry.ts:213— stock-telemetry.parseStockJournal has cyclomatic complexity 104 (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.
SettingsDialog.OrbitSection (cyclomatic 104) apps/web/src/components/SettingsDialog.tsx:6904— SettingsDialog.OrbitSection has cyclomatic complexity 104 (threshold 15). Of this number, 77 points are the body's own statements and 27 belong to 15 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.
cli.runWorkspace (cyclomatic 102) apps/daemon/src/cli.ts:8072— cli.runWorkspace has cyclomatic complexity 102 (threshold 15). Of this number, 97 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.
EntryNavRail.EntryTopRightCluster (cyclomatic 99) apps/web/src/components/EntryNavRail.tsx:1076— EntryNavRail.EntryTopRightCluster has cyclomatic complexity 99 (threshold 15). Of this number, 70 points are the body's own statements and 29 belong to 23 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
runtime.createDesktopRuntime (cyclomatic 96) REDACTED:2022— runtime.createDesktopRuntime has cyclomatic complexity 96 (threshold 15). Most of this is not in the body itself: 4 of the 96 points are its own statements and the rest belongs to 26 function literals inside it that branch (lines 2389, 2121, 2196, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.runRun (cyclomatic 95) apps/daemon/src/cli.ts:8374— cli.runRun has cyclomatic complexity 95 (threshold 15). To reduce it, separate the cases: extract each independent 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-analytics-observability.scanRunEventsForUsageAnalytics (cyclomatic 91) apps/daemon/src/run-analytics-observability.ts:701— run-analytics-observability.scanRunEventsForUsageAnalytics has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chat-run-messages.unboundedAgentPayloadToPersistedAgentEvent (cyclomatic 91) apps/daemon/src/runtimes/chat-run-messages.ts:529— chat-run-messages.unboundedAgentPayloadToPersistedAgentEvent has cyclomatic complexity 91 (threshold 15). Of this number, 89 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
collab-sync.registerCollabSyncRoutes.pullSharedProjectOnce (cyclomatic 91) REDACTED:1950— collab-sync.registerCollabSyncRoutes.pullSharedProjectOnce has cyclomatic complexity 91 (threshold 15). Of this number, 77 points are the body's own statements and 14 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
langfuse-bridge.projectDeliverableSyntaxTelemetry (cyclomatic 91) apps/daemon/src/langfuse-bridge.ts:319— langfuse-bridge.projectDeliverableSyntaxTelemetry has cyclomatic complexity 91 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
design-systems.registerDesignSystemRoutes (cyclomatic 90) REDACTED:200— design-systems.registerDesignSystemRoutes has cyclomatic complexity 90 (threshold 15). Most of this is not in the body itself: 1 of the 90 points is its own statement and the rest belongs to 20 function literals inside it that branch (lines 995, 559, 628, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
runtime-evidence-graph-v1.evaluateRuntimeEvidenceGraphV1 (cyclomatic 89) packages/contracts/src/observability/runtime-evidence-graph-v1.ts:74— runtime-evidence-graph-v1.evaluateRuntimeEvidenceGraphV1 has cyclomatic complexity 89 (threshold 15). Of this number, 83 points are the body's own statements and 6 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.
run-analytics-observability.summarizeRunTimingAnalytics (cyclomatic 88) apps/daemon/src/run-analytics-observability.ts:1162— run-analytics-observability.summarizeRunTimingAnalytics has cyclomatic complexity 88 (threshold 15). Of this number, 86 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.
vela.registerVelaRoutes (cyclomatic 87) REDACTED:1070— vela.registerVelaRoutes has cyclomatic complexity 87 (threshold 15). Most of this is not in the body itself: 3 of the 87 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 1204, a function literal at line 1420, a function literal at line 1319, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cli.runFiles (cyclomatic 86) apps/daemon/src/cli.ts:8951— cli.runFiles has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useProjectCollab.useProjectCollab (cyclomatic 84) apps/web/src/collab/useProjectCollab.ts:328— useProjectCollab.useProjectCollab has cyclomatic complexity 84 (threshold 15). Of this number, 69 points are the body's own statements and 15 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.
EntryShell.OnboardingView (cyclomatic 84) apps/web/src/components/EntryShell.tsx:2291— EntryShell.OnboardingView has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EntryShell.OnboardingView::handleAmrSignInToContinue) 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.
build-turn-blocks.buildTurnBlocks (cyclomatic 84) apps/web/src/runtime/chat/build-turn-blocks.ts:461— build-turn-blocks.buildTurnBlocks has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (build-turn-blocks.buildTurnBlocks::applyTodoList, build-turn-blocks.buildTurnBlocks::finishTurn) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PluginMetaSections.PluginMetaSections (cyclomatic 82) apps/web/src/components/plugin-details/PluginMetaSections.tsx:89— PluginMetaSections.PluginMetaSections has cyclomatic complexity 82 (threshold 15). Of this number, 50 points are the body's own statements and 32 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
langfuse-bridge.buildSafeRunQualityProjectionFromDaemon (cyclomatic 81) apps/daemon/src/langfuse-bridge.ts:1322— langfuse-bridge.buildSafeRunQualityProjectionFromDaemon has cyclomatic complexity 81 (threshold 15). Of this number, 77 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.
ConnectorsBrowser.ConnectorsBrowser (cyclomatic 81) apps/web/src/components/ConnectorsBrowser.tsx:431— ConnectorsBrowser.ConnectorsBrowser has cyclomatic complexity 81 (threshold 15). Most of this is not in the body itself: 15 of the 81 points are its own statements and the rest belongs to 34 function items inside it that branch (runConnectorAction, a function literal at line 791, hydrateToolPreview, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-terminal-reconciliation.reconcileDurableRunTerminals (cyclomatic 80) apps/daemon/src/runtimes/run-terminal-reconciliation.ts:363— run-terminal-reconciliation.reconcileDurableRunTerminals has cyclomatic complexity 80 (threshold 15). Of this number, 73 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.
useWorkspaceContext.useWorkspaceBillingResponse (cyclomatic 80) apps/web/src/collab/useWorkspaceContext.ts:1246— useWorkspaceContext.useWorkspaceBillingResponse has cyclomatic complexity 80 (threshold 15). Most of this is not in the body itself: 14 of the 80 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 1319, 1335, 1445, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
orchestrator.runOrchestrator (cyclomatic 79) apps/daemon/src/critique/orchestrator.ts:123— orchestrator.runOrchestrator has cyclomatic complexity 79 (threshold 15). Of this number, 76 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
routes.registerConnectorRoutes (cyclomatic 78) REDACTED:554— routes.registerConnectorRoutes has cyclomatic complexity 78 (threshold 15). Most of this is not in the body itself: 1 of the 78 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 755, 655, 724, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
daemon.translateAgentEvent (cyclomatic 78) apps/web/src/providers/daemon.ts:2524— daemon.translateAgentEvent has cyclomatic complexity 78 (threshold 15). Of this number, 76 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatComposer.ChatComposer (cyclomatic 78) apps/web/src/components/ChatComposer.tsx:593— ChatComposer.ChatComposer has cyclomatic complexity 78 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 3 other methods here (ChatComposer.ChatComposer::tryHandlePetSlash, ChatComposer.ChatComposer::handlePopoverKey, ChatComposer.ChatComposer::pickMentionByFlatIndex) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
import-export-routes.registerImportRoutes (cyclomatic 77) REDACTED:64— import-export-routes.registerImportRoutes has cyclomatic complexity 77 (threshold 15). Most of this is not in the body itself: 1 of the 77 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 205, a function literal at line 367, a function literal at line 118, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FileViewer.CommentSidePanel (cyclomatic 77) REDACTED:4762— FileViewer.CommentSidePanel has cyclomatic complexity 77 (threshold 15). Of this number, 22 points are the body's own statements and 55 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useProjectWorkspaceScope.useProjectWorkspaceScope (cyclomatic 76) apps/web/src/collab/useProjectWorkspaceScope.ts:387— useProjectWorkspaceScope.useProjectWorkspaceScope has cyclomatic complexity 76 (threshold 15). Of this number, 21 points are the body's own statements and 55 belong to 12 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.
hub-events-subscriber.startHubEventsSubscriber.consumeStream (cyclomatic 75) apps/daemon/src/collab/hub-events-subscriber.ts:418— hub-events-subscriber.startHubEventsSubscriber.consumeStream has cyclomatic complexity 75 (threshold 15). Of this number, 50 points are the body's own statements and 25 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
byok-tools.executeAIHubMixGenerateVideo (cyclomatic 75) apps/daemon/src/byok-tools.ts:1423— byok-tools.executeAIHubMixGenerateVideo has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
memory-llm.pickProvider (cyclomatic 75) apps/daemon/src/memory-llm.ts:434— memory-llm.pickProvider has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EntryShell.EntryShell (cyclomatic 73) apps/web/src/components/EntryShell.tsx:633— EntryShell.EntryShell has cyclomatic complexity 73 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 3 other methods here (EntryShell.EntryShell::handleOpenAllProjects, EntryShell.EntryShell::handlePluginLoopSubmit, EntryShell.EntryShell::pluginLoopCreateInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BoardComposerPopover.BoardComposerPopover (cyclomatic 73) apps/web/src/components/BoardComposerPopover.tsx:417— BoardComposerPopover.BoardComposerPopover has cyclomatic complexity 73 (threshold 15). Of this number, 47 points are the body's own statements and 26 belong to 10 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.
FileWorkspace.DesignSystemProjectPanel (cyclomatic 73) apps/web/src/components/FileWorkspace.tsx:4817— FileWorkspace.DesignSystemProjectPanel has cyclomatic complexity 73 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FileWorkspace.DesignSystemProjectPanel::_renderReviewCard) 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.
brand-capture.renderHtml (cyclomatic 73) clipper/brand-capture.js:974— brand-capture.renderHtml has cyclomatic complexity 73 (threshold 15). Of this number, 58 points are the body's own statements and 15 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
db.mergeSyncedPreviewComment (cyclomatic 72) apps/daemon/src/db.ts:4539— db.mergeSyncedPreviewComment has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mcp-routes.registerMcpRoutes (cyclomatic 72) apps/daemon/src/mcp-routes.ts:18— mcp-routes.registerMcpRoutes has cyclomatic complexity 72 (threshold 15). Most of this is not in the body itself: 2 of the 72 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 290, a function literal at line 230, computeInstallPayload, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cli.runLibrary (cyclomatic 72) apps/daemon/src/cli.ts:10071— cli.runLibrary has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComposerPlusMenu.ComposerPlusMenu (cyclomatic 72) apps/web/src/components/ComposerPlusMenu.tsx:322— ComposerPlusMenu.ComposerPlusMenu has cyclomatic complexity 72 (threshold 15). Of this number, 36 points are the body's own statements and 36 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.
HoverTouchpointOverlay.HoverTouchpointOverlay (cyclomatic 72) apps/web/src/components/HoverTouchpointOverlay.tsx:142— HoverTouchpointOverlay.HoverTouchpointOverlay has cyclomatic complexity 72 (threshold 15). Most of this is not in the body itself: 8 of the 72 points are its own statements and the rest belongs to 25 function items inside it that branch (a function literal at line 272, a function literal at line 227, a function literal at line 202, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TasksView.TasksView (cyclomatic 72) apps/web/src/components/TasksView.tsx:398— TasksView.TasksView has cyclomatic complexity 72 (threshold 15). Most of this is not in the body itself: 15 of the 72 points are its own statements and the rest belongs to 18 function items inside it that branch (crystallizeRun, a function literal at line 761, a function literal at line 475, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
proactive-content-pull.createProactiveContentPull.runCatchUpSweep (cyclomatic 71) apps/daemon/src/collab/proactive-content-pull.ts:1529— proactive-content-pull.createProactiveContentPull.runCatchUpSweep has cyclomatic complexity 71 (threshold 15). Of this number, 65 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
REDACTED.bindChartInteractions (cyclomatic 71) design-templates/social-media-matrix-tracker-template/assets/template.html:863— REDACTED.bindChartInteractions has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 7 of the 71 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 1027, 996, 1058, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
REDACTED.bindChartInteractions (cyclomatic 71) design-templates/social-media-matrix-tracker-template/example.html:863— REDACTED.bindChartInteractions has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 7 of the 71 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 1027, 996, 1058, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignSystemsSection.DesignSystemsSection (cyclomatic 70) apps/web/src/components/DesignSystemsSection.tsx:45— DesignSystemsSection.DesignSystemsSection has cyclomatic complexity 70 (threshold 15). Of this number, 28 points are the body's own statements and 42 belong to 18 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.
langfuse-trace.buildTracePayload (cyclomatic 69) apps/daemon/src/langfuse-trace.ts:1897— langfuse-trace.buildTracePayload has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
db.migrate (cyclomatic 68) apps/daemon/src/db.ts:105— db.migrate has cyclomatic complexity 68 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
claude-stream.createClaudeStreamHandler.handleObject (cyclomatic 67) apps/daemon/src/runtimes/claude-stream.ts:717— claude-stream.createClaudeStreamHandler.handleObject has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileViewer.LiveArtifactViewer (cyclomatic 67) REDACTED:2093— FileViewer.LiveArtifactViewer has cyclomatic complexity 67 (threshold 15). Of this number, 27 points are the body's own statements and 40 belong to 23 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
team-mirror-materializer.materializePulledTeamMirror (cyclomatic 66) apps/daemon/src/collab/team-mirror-materializer.ts:165— team-mirror-materializer.materializePulledTeamMirror has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 9 of the 66 points are its own statements and the rest belongs to one function literal inside it that branches (line 186). 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.
server.startServer (cyclomatic 66) REDACTED:3194— server.startServer has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (server.startServer::syncSharedTeamPlugin, server.startServer::syncSharedTeamSkill, server.startServer::composeDaemonSystemPrompt, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
cli.runCollab (cyclomatic 66) apps/daemon/src/cli.ts:1483— cli.runCollab has cyclomatic complexity 66 (threshold 15). Of this number, 48 points are the body's own statements and 18 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useWorkspaceContext.useWorkspaceContext (cyclomatic 66) apps/web/src/collab/useWorkspaceContext.ts:651— useWorkspaceContext.useWorkspaceContext has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 1 of the 66 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 707, 775, 652, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
json-event-stream.handleCodexEvent (cyclomatic 65) apps/daemon/src/runtimes/json-event-stream.ts:1161— json-event-stream.handleCodexEvent has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AmrLoginPill.AmrLoginPill (cyclomatic 65) apps/web/src/components/AmrLoginPill.tsx:283— AmrLoginPill.AmrLoginPill has cyclomatic complexity 65 (threshold 15). Most of this is not in the body itself: 15 of the 65 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 530, 665, 391, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignBrowserPanel.DesignBrowserPanel (cyclomatic 64) REDACTED:912— DesignBrowserPanel.DesignBrowserPanel has cyclomatic complexity 64 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (DesignBrowserPanel.DesignBrowserPanel::savePageSnapshot) 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.
live-artifact.registerLiveArtifactRoutes (cyclomatic 63) REDACTED:13— live-artifact.registerLiveArtifactRoutes has cyclomatic complexity 63 (threshold 15). Most of this is not in the body itself: 1 of the 63 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 53, 227, 193, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
conversations.registerProjectConversationRoutes::mergeMessageWriteForDaemonBacked (cyclomatic 63) REDACTED:446— conversations.registerProjectConversationRoutes::mergeMessageWriteForDaemonBacked has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cli.runComment (cyclomatic 63) apps/daemon/src/cli.ts:500— cli.runComment has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
system.composeSystemPrompt (cyclomatic 63) REDACTED:286— system.composeSystemPrompt has cyclomatic complexity 63 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deck-capture.isolateLayeredPptxBackground (cyclomatic 62) apps/desktop/src/main/deck-capture.ts:975— deck-capture.isolateLayeredPptxBackground has cyclomatic complexity 62 (threshold 15). Of this number, 60 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cli.runMarketplace (cyclomatic 61) apps/daemon/src/cli.ts:3601— cli.runMarketplace has cyclomatic complexity 61 (threshold 15). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cli.runPluginEvents (cyclomatic 61) apps/daemon/src/cli.ts:4470— cli.runPluginEvents has cyclomatic complexity 61 (threshold 15). Of this number, 48 points are the body's own statements and 13 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NewProjectPanel.DesignSystemPicker (cyclomatic 61) apps/web/src/components/NewProjectPanel.tsx:2136— NewProjectPanel.DesignSystemPicker has cyclomatic complexity 61 (threshold 15). Of this number, 29 points are the body's own statements and 32 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.
HandoffButton.HandoffButton (cyclomatic 61) apps/web/src/components/HandoffButton.tsx:335— HandoffButton.HandoffButton has cyclomatic complexity 61 (threshold 15). Of this number, 28 points are the body's own statements and 33 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.
thread-cleanup.cleanupClosedCodexThread (cyclomatic 60) apps/daemon/src/agent-protocol/codex-app-server/thread-cleanup.ts:42— thread-cleanup.cleanupClosedCodexThread has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 2 of the 60 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 197, 125, 82, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-diagnostics.toolExecutionLifecycleAnalytics (cyclomatic 60) apps/daemon/src/run-diagnostics.ts:274— run-diagnostics.toolExecutionLifecycleAnalytics has cyclomatic complexity 60 (threshold 15). Of this number, 52 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.
ProductionCampaignBadge.ProductionCampaignBadge (cyclomatic 60) apps/web/src/components/ProductionCampaignBadge.tsx:56— ProductionCampaignBadge.ProductionCampaignBadge has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 10 of the 60 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 71, 146, 103, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SettingsDialog.ConnectorSection (cyclomatic 60) apps/web/src/components/SettingsDialog.tsx:6367— SettingsDialog.ConnectorSection has cyclomatic complexity 60 (threshold 15). Of this number, 39 points are the body's own statements and 21 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.
EntryNavRail.EntryNavRail (cyclomatic 59) apps/web/src/components/EntryNavRail.tsx:2095— EntryNavRail.EntryNavRail has cyclomatic complexity 59 (threshold 15). Of this number, 33 points are the body's own statements and 26 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UpdaterPopup.UpdaterPopup (cyclomatic 59) apps/web/src/components/UpdaterPopup.tsx:114— UpdaterPopup.UpdaterPopup has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 14 of the 59 points are its own statements and the rest belongs to 17 function items inside it that branch (installAndQuit, a function literal at line 155, a function literal at line 185, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FileViewer.ReactComponentViewer (cyclomatic 59) REDACTED:6739— FileViewer.ReactComponentViewer has cyclomatic complexity 59 (threshold 15). Of this number, 19 points are the body's own statements and 40 belong to 18 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
app-config.applyConfigValue (cyclomatic 58) apps/daemon/src/app-config.ts:540— app-config.applyConfigValue has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
collab-cloud.memberCommentProblem (cyclomatic 58) apps/daemon/src/integrations/collab-cloud.ts:217— collab-cloud.memberCommentProblem has cyclomatic complexity 58 (threshold 15). Of this number, 57 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
vela-child-evidence.parseWireFact (cyclomatic 58) apps/daemon/src/runtimes/vela-child-evidence.ts:389— vela-child-evidence.parseWireFact has cyclomatic complexity 58 (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.
langfuse-bridge.collectAgentEvents (cyclomatic 58) apps/daemon/src/langfuse-bridge.ts:716— langfuse-bridge.collectAgentEvents has cyclomatic complexity 58 (threshold 15). Of this number, 57 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
genui.registerGenuiRoutes (cyclomatic 58) REDACTED:30— genui.registerGenuiRoutes has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 1 of the 58 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 72, a function literal at line 153, a function literal at line 189, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AssistantMessage.FormBlock (cyclomatic 58) REDACTED:3150— AssistantMessage.FormBlock has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 15 of the 58 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 3322, 3257, 3279, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.runProjectShare (cyclomatic 57) apps/daemon/src/cli.ts:7428— cli.runProjectShare has cyclomatic complexity 57 (threshold 15). Of this number, 55 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
claude-diagnostics.diagnoseClaudeCliFailure (cyclomatic 56) apps/daemon/src/claude-diagnostics.ts:78— claude-diagnostics.diagnoseClaudeCliFailure has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PluginCard.PluginCard (cyclomatic 56) apps/web/src/components/plugins-home/PluginCard.tsx:61— PluginCard.PluginCard has cyclomatic complexity 56 (threshold 15). Of this number, 54 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.
DesignSystemPicker.DesignSystemPicker (cyclomatic 55) apps/web/src/components/DesignSystemPicker.tsx:75— DesignSystemPicker.DesignSystemPicker has cyclomatic complexity 55 (threshold 15). Of this number, 36 points are the body's own statements and 19 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProductionCampaignHover.ProductionCampaignHover (cyclomatic 55) apps/web/src/components/ProductionCampaignHover.tsx:108— ProductionCampaignHover.ProductionCampaignHover 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 18 function literals inside it that branch (lines 157, 192, 201, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.MediaProvidersSection (cyclomatic 55) apps/web/src/components/SettingsDialog.tsx:7723— SettingsDialog.MediaProvidersSection has cyclomatic complexity 55 (threshold 15). Of this number, 30 points are the body's own statements and 25 belong to 10 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.
TooltipLayer.TooltipLayer (cyclomatic 55) apps/web/src/components/TooltipLayer.tsx:141— TooltipLayer.TooltipLayer has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 9 of the 55 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 225, 201, 342, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
critique.isPanelEvent (cyclomatic 55) packages/contracts/src/critique.ts:190— critique.isPanelEvent has cyclomatic complexity 55 (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.
claude-child-evidence.createClaudeChildEvidenceCollector.observe (cyclomatic 54) apps/daemon/src/runtimes/claude-child-evidence.ts:676— claude-child-evidence.createClaudeChildEvidenceCollector.observe has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex-child-evidence.parseRolloutStructure (cyclomatic 54) apps/daemon/src/runtimes/codex-child-evidence.ts:258— codex-child-evidence.parseRolloutStructure has cyclomatic complexity 54 (threshold 15). Of this number, 53 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
xai.registerXaiRoutes (cyclomatic 54) apps/daemon/src/routes/xai.ts:54— xai.registerXaiRoutes has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 1 of the 54 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 253, a function literal at line 150, handleCallback, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
DesignSystemsTab.DesignSystemDetail (cyclomatic 54) apps/web/src/components/DesignSystemsTab.tsx:1476— DesignSystemsTab.DesignSystemDetail has cyclomatic complexity 54 (threshold 15). Of this number, 40 points are the body's own statements and 14 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.
MessageCenter.MessageCenter (cyclomatic 54) apps/web/src/components/MessageCenter.tsx:66— MessageCenter.MessageCenter has cyclomatic complexity 54 (threshold 15). Of this number, 20 points are the body's own statements and 34 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
bake-plugin-previews.bakeOne (cyclomatic 54) scripts/bake-plugin-previews.mjs:483— bake-plugin-previews.bakeOne has cyclomatic complexity 54 (threshold 15). Of this number, 36 points are the body's own statements and 18 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proactive-content-pull.createProactiveContentPull.attemptIntent (cyclomatic 53) apps/daemon/src/collab/proactive-content-pull.ts:1036— proactive-content-pull.createProactiveContentPull.attemptIntent has cyclomatic complexity 53 (threshold 15). Of this number, 52 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
v1.drain (cyclomatic 53) apps/daemon/src/critique/parsers/v1.ts:109— v1.drain has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
deploy.registerDeployRoutes (cyclomatic 53) REDACTED:11— deploy.registerDeployRoutes has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 1 of the 53 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 99, a function literal at line 228, a function literal at line 54, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
proactive-content-pull.createProactiveContentPull.processContentChanged (cyclomatic 52) apps/daemon/src/collab/proactive-content-pull.ts:1350— proactive-content-pull.createProactiveContentPull.processContentChanged has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lint-artifact.lintArtifact (cyclomatic 52) apps/daemon/src/lint-artifact.ts:120— lint-artifact.lintArtifact has cyclomatic complexity 52 (threshold 15). Of this number, 45 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
collab-cloud-service.createCollabCloudService.flushOutboxIdentityBatch (cyclomatic 52) apps/daemon/src/collab/collab-cloud-service.ts:909— collab-cloud-service.createCollabCloudService.flushOutboxIdentityBatch has cyclomatic complexity 52 (threshold 15). Of this number, 41 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
deck-capture.collectLayeredPptxBackgroundTargets::materializeLayeredPseudoBackground (cyclomatic 52) apps/desktop/src/main/deck-capture.ts:696— deck-capture.collectLayeredPptxBackgroundTargets::materializeLayeredPseudoBackground 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.
InviteDialog.InviteDialog (cyclomatic 52) apps/web/src/components/InviteDialog.tsx:91— InviteDialog.InviteDialog has cyclomatic complexity 52 (threshold 15). Of this number, 17 points are the body's own statements and 35 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.
EntryShell.OnboardingDropdown (cyclomatic 52) apps/web/src/components/EntryShell.tsx:4547— EntryShell.OnboardingDropdown has cyclomatic complexity 52 (threshold 15). Of this number, 28 points are the body's own statements and 24 belong to 11 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.
ToolRow.ToolRow (cyclomatic 52) apps/web/src/components/chat/primitives/ToolRow.tsx:79— ToolRow.ToolRow has cyclomatic complexity 52 (threshold 15). Of this number, 49 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatComposer.MentionPopover (cyclomatic 52) apps/web/src/components/ChatComposer.tsx:6520— ChatComposer.MentionPopover has cyclomatic complexity 52 (threshold 15). Of this number, 32 points are the body's own statements and 20 belong to 8 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.
FileWorkspace.PageCreatorDialog (cyclomatic 52) apps/web/src/components/FileWorkspace.tsx:8136— FileWorkspace.PageCreatorDialog has cyclomatic complexity 52 (threshold 15). Of this number, 18 points are the body's own statements and 34 belong to 15 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.
run-diagnostics.summarizeRunDiagnosticsForAnalytics (cyclomatic 51) apps/daemon/src/run-diagnostics.ts:605— run-diagnostics.summarizeRunDiagnosticsForAnalytics has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MemoryModelInline.MemoryModelInline (cyclomatic 51) apps/web/src/components/MemoryModelInline.tsx:189— MemoryModelInline.MemoryModelInline has cyclomatic complexity 51 (threshold 15). Of this number, 18 points are the body's own statements and 33 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.
brand-capture.collectImageAssets (cyclomatic 51) clipper/brand-capture.js:585— brand-capture.collectImageAssets has cyclomatic complexity 51 (threshold 15). Of this number, 49 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
mcp.handleMcpToolCall (cyclomatic 50) apps/daemon/src/mcp.ts:2162— mcp.handleMcpToolCall has cyclomatic complexity 50 (threshold 15). Of this number, 49 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.
telemetry.registerTelemetryRoutes (cyclomatic 50) REDACTED:150— telemetry.registerTelemetryRoutes has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 3 of the 50 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 293, 224, 160, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SketchEditor.SketchEditor (cyclomatic 50) apps/web/src/components/SketchEditor.tsx:90— SketchEditor.SketchEditor has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 13 of the 50 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 379, 342, 298, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ExamplesTab.ExamplesTab (cyclomatic 50) apps/web/src/components/ExamplesTab.tsx:123— ExamplesTab.ExamplesTab has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 5 of the 50 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 273, 326, 172, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RailRecentRow.RailRecentRow (cyclomatic 49) apps/web/src/components/entry-nav-rail/RailRecentRow.tsx:136— RailRecentRow.RailRecentRow has cyclomatic complexity 49 (threshold 15). Of this number, 32 points are the body's own statements and 17 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PluginsView.PluginsView (cyclomatic 49) REDACTED:241— PluginsView.PluginsView has cyclomatic complexity 49 (threshold 15). Of this number, 24 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.
build-turn-blocks.readImageCall (cyclomatic 49) apps/web/src/runtime/chat/build-turn-blocks.ts:1957— build-turn-blocks.readImageCall has cyclomatic complexity 49 (threshold 15). Of this number, 43 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AssistantMessage.AssistantFooter (cyclomatic 49) REDACTED:2180— AssistantMessage.AssistantFooter has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run-failure-classification.classification (cyclomatic 48) apps/daemon/src/run-failure-classification.ts:897— run-failure-classification.classification has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
runs.createChatRunService.create (cyclomatic 48) apps/daemon/src/runtimes/runs.ts:948— runs.createChatRunService.create has cyclomatic complexity 48 (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.
collab-presence.registerCollabPresenceRoutes (cyclomatic 48) apps/daemon/src/routes/collab-presence.ts:703— collab-presence.registerCollabPresenceRoutes has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 830, 931, 775, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PluginsView.ExtensionsMarketplace (cyclomatic 48) REDACTED:1034— PluginsView.ExtensionsMarketplace has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (PluginsView.ExtensionsMarketplace::shareResource) 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.
preview-runtime-state.isPreviewRuntimeState (cyclomatic 48) packages/contracts/src/runtime/preview-runtime-state.ts:78— preview-runtime-state.isPreviewRuntimeState has cyclomatic complexity 48 (threshold 15). Of this number, 22 points are the body's own statements and 26 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.
claude-stream.createClaudeStreamHandler.handleStreamEvent (cyclomatic 47) apps/daemon/src/runtimes/claude-stream.ts:977— claude-stream.createClaudeStreamHandler.handleStreamEvent 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.
ConnectorsBrowser.ConnectorDetailDrawer (cyclomatic 47) apps/web/src/components/ConnectorsBrowser.tsx:1290— ConnectorsBrowser.ConnectorDetailDrawer has cyclomatic complexity 47 (threshold 15). Of this number, 42 points are the body's own statements and 5 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
javascript-image-references.javascriptImageReferences (cyclomatic 46) apps/daemon/src/artifacts/javascript-image-references.ts:18— javascript-image-references.javascriptImageReferences 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.
StandaloneBundler.bundleDocument (cyclomatic 46) REDACTED:151— StandaloneBundler.bundleDocument 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.
assets.registerPluginAssetRoutes::servePluginSandboxedHtml (cyclomatic 46) REDACTED:128— assets.registerPluginAssetRoutes::servePluginSandboxedHtml 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.
DesignFilesPanel.DesignFilesPanel (cyclomatic 46) apps/web/src/components/DesignFilesPanel.tsx:485— DesignFilesPanel.DesignFilesPanel 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. This shape REPEATS in the file: one other method here (DesignFilesPanel.DesignFilesPanel::handlePluginFolderAgentAction) 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.
validate.validateRecord (cyclomatic 46) tools/release/src/catalog/validate.ts:23— validate.validateRecord 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.
prefetch.harvestFromHtml (cyclomatic 45) REDACTED:823— prefetch.harvestFromHtml has cyclomatic complexity 45 (threshold 15). Of this number, 43 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
trace-object-manifest.collectSources (cyclomatic 45) apps/daemon/src/trace-object-manifest.ts:429— trace-object-manifest.collectSources has cyclomatic complexity 45 (threshold 15). Of this number, 44 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
comment-file-deletion.createCommentFileDeletion (cyclomatic 45) apps/daemon/src/collab/comment-file-deletion.ts:28— comment-file-deletion.createCommentFileDeletion has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 36, 73, 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.
langfuse-bridge.buildTraceSafeManifests (cyclomatic 45) apps/daemon/src/langfuse-bridge.ts:1102— langfuse-bridge.buildTraceSafeManifests 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.
index.renderAIHubMixVideo (cyclomatic 45) apps/daemon/src/media/index.ts:3378— index.renderAIHubMixVideo 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.
SettingsDialog.IntegrationsSection (cyclomatic 45) apps/web/src/components/SettingsDialog.tsx:8449— SettingsDialog.IntegrationsSection has cyclomatic complexity 45 (threshold 15). Of this number, 25 points are the body's own statements and 20 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.
html-injection-points.skipForeignContent (cyclomatic 45) REDACTED:556— html-injection-points.skipForeignContent 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.
validateInstallation (cyclomatic 45) shells/terminal/runtime/fossil.mjs:41— validateInstallation has cyclomatic complexity 45 (threshold 15). Of this number, 44 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
events.mapPiRpcEvent (cyclomatic 44) apps/daemon/src/agent-protocol/pi-rpc/events.ts:25— events.mapPiRpcEvent has cyclomatic complexity 44 (threshold 15). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
langfuse-trace.buildSafeRunQualityProjectionV1 (cyclomatic 44) apps/daemon/src/langfuse-trace.ts:1749— langfuse-trace.buildSafeRunQualityProjectionV1 has cyclomatic complexity 44 (threshold 15). Of this number, 32 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.
task-observation-rollout.taskAggregate (cyclomatic 44) apps/daemon/src/observability/task-observation-rollout.ts:489— task-observation-rollout.taskAggregate has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 12 of the 44 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 502, 651, 655, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
codex-child-evidence.resolveRolloutPath (cyclomatic 44) apps/daemon/src/runtimes/codex-child-evidence.ts:442— codex-child-evidence.resolveRolloutPath has cyclomatic complexity 44 (threshold 15). Of this number, 35 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.
cli.runPluginVerify (cyclomatic 44) apps/daemon/src/cli.ts:4679— cli.runPluginVerify has cyclomatic complexity 44 (threshold 15). Of this number, 42 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
updater.createDesktopUpdater.checkForCandidate (cyclomatic 44) apps/desktop/src/main/updater.ts:787— updater.createDesktopUpdater.checkForCandidate has cyclomatic complexity 44 (threshold 15). Of this number, 38 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypePillRow.TypePillRow (cyclomatic 44) apps/web/src/components/home-hero/TypePillRow.tsx:24— TypePillRow.TypePillRow has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 5 of the 44 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 43, focusItem, a function literal at line 171, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PluginLoopHome.PluginLoopHome (cyclomatic 44) apps/web/src/components/PluginLoopHome.tsx:107— PluginLoopHome.PluginLoopHome has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 11 of the 44 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 310, usePlugin, onKeyDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
XaiOAuthControl.XaiOAuthControl (cyclomatic 44) apps/web/src/components/XaiOAuthControl.tsx:130— XaiOAuthControl.XaiOAuthControl has cyclomatic complexity 44 (threshold 15). Of this number, 29 points are the body's own statements and 15 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
reconnect-state.nextChatReconnectView (cyclomatic 44) apps/web/src/runtime/chat/reconnect-state.ts:207— reconnect-state.nextChatReconnectView 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.
runs.summarizeModelStepEvents (cyclomatic 43) apps/daemon/src/runtimes/runs.ts:154— runs.summarizeModelStepEvents has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
task-observation-rollout.createTaskObservationRolloutService.finalizeTask (cyclomatic 43) apps/daemon/src/observability/task-observation-rollout.ts:1138— task-observation-rollout.createTaskObservationRolloutService.finalizeTask has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.renderOpenRouterVideo (cyclomatic 43) apps/daemon/src/media/index.ts:2005— index.renderOpenRouterVideo has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
payload-desktop-handoff.prepareLegacyPayloadDesktopHandoff (cyclomatic 43) apps/daemon/src/sidecar/payload-desktop-handoff.ts:242— payload-desktop-handoff.prepareLegacyPayloadDesktopHandoff has cyclomatic complexity 43 (threshold 15). Of this number, 42 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
question-form.normalizeType (cyclomatic 43) apps/web/src/artifacts/question-form.ts:986— question-form.normalizeType has cyclomatic complexity 43 (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.
AmrArtifactUpgradeGate.AmrArtifactUpgradeGate (cyclomatic 43) apps/web/src/components/AmrArtifactUpgradeGate.tsx:82— AmrArtifactUpgradeGate.AmrArtifactUpgradeGate has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 2 of the 43 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 143, 117, 178, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
shared-lifecycle.reduceSharedLifecycleState (cyclomatic 43) packages/standalone/src/shared-lifecycle.ts:146— shared-lifecycle.reduceSharedLifecycleState has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ToolPackCache.acquire (cyclomatic 43) tools/pack/src/cache/index.ts:171— ToolPackCache.acquire has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 264, seedFromAlias, materializeTarget, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
runs.buildExecutionDiagnostics (cyclomatic 42) apps/daemon/src/runtimes/runs.ts:373— runs.buildExecutionDiagnostics has cyclomatic complexity 42 (threshold 15). Of this number, 30 points are the body's own statements and 12 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.
runs.createChatRunService.stream (cyclomatic 42) apps/daemon/src/runtimes/runs.ts:1932— runs.createChatRunService.stream has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 11 of the 42 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 2010, completeReplay, deliver, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
codex-child-evidence.collectCodexChildEvidence.collectChildren (cyclomatic 42) apps/daemon/src/runtimes/codex-child-evidence.ts:908— codex-child-evidence.collectCodexChildEvidence.collectChildren has cyclomatic complexity 42 (threshold 15). Of this number, 38 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.main (cyclomatic 42) apps/packaged/src/index.ts:118— index.main has cyclomatic complexity 42 (threshold 15). Of this number, 34 points are the body's own statements and 8 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.
McpClientSection.McpOAuthControl (cyclomatic 42) apps/web/src/components/McpClientSection.tsx:1136— McpClientSection.McpOAuthControl has cyclomatic complexity 42 (threshold 15). Of this number, 23 points are the body's own statements and 19 belong to 10 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.
task-store.rowToTask (cyclomatic 41) apps/daemon/src/strategies/task-store.ts:868— task-store.rowToTask has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
runs.durableRunState (cyclomatic 41) apps/daemon/src/runtimes/runs.ts:566— runs.durableRunState has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
runs.createChatRunService.terminateProcessTree (cyclomatic 41) apps/daemon/src/runtimes/runs.ts:2228— runs.createChatRunService.terminateProcessTree has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 4 of the 41 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 2248, a function literal at line 2312, a function literal at line 2353, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cli.runExport (cyclomatic 41) apps/daemon/src/cli.ts:814— cli.runExport has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chat-interaction.installChatInteractionObserver (cyclomatic 41) apps/web/src/observability/chat-interaction.ts:37— chat-interaction.installChatInteractionObserver has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 3 of the 41 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 61, start, 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.
MediaSurface.MediaSurface (cyclomatic 41) apps/web/src/components/plugins-home/cards/MediaSurface.tsx:55— MediaSurface.MediaSurface has cyclomatic complexity 41 (threshold 15). Of this number, 22 points are the body's own statements and 19 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
builder.runElectronBuilder (cyclomatic 41) tools/pack/src/win/builder.ts:500— builder.runElectronBuilder has cyclomatic complexity 41 (threshold 15). Of this number, 27 points are the body's own statements and 14 belong to 10 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.
json-event-stream.handleGeminiEvent (cyclomatic 40) apps/daemon/src/runtimes/json-event-stream.ts:307— json-event-stream.handleGeminiEvent has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
service.assertJsonSchemaMatches (cyclomatic 40) apps/daemon/src/connectors/service.ts:304— service.assertJsonSchemaMatches has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
runs.summarizeAssistantMessageEvents (cyclomatic 40) apps/daemon/src/runtimes/runs.ts:254— runs.summarizeAssistantMessageEvents has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
import-export-routes.registerFinalizeRoutes (cyclomatic 40) REDACTED:2014— import-export-routes.registerFinalizeRoutes has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 1 of the 40 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 2028, 2106). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.resolvePluginGithubTarget (cyclomatic 40) apps/daemon/src/cli.ts:5843— cli.resolvePluginGithubTarget has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cli.runMemory (cyclomatic 40) apps/daemon/src/cli.ts:11360— cli.runMemory has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
updater.createDesktopUpdater.downloadUpdate (cyclomatic 40) apps/desktop/src/main/updater.ts:932— updater.createDesktopUpdater.downloadUpdate has cyclomatic complexity 40 (threshold 15). Of this number, 39 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.
router.parseRoute (cyclomatic 40) apps/web/src/router.ts:76— router.parseRoute has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConnectorsBrowser.ConnectorCard (cyclomatic 40) apps/web/src/components/ConnectorsBrowser.tsx:1059— ConnectorsBrowser.ConnectorCard has cyclomatic complexity 40 (threshold 15). Of this number, 35 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useConversationChat.useConversationChat.runSend (cyclomatic 40) apps/web/src/components/workspace/useConversationChat.ts:183— useConversationChat.useConversationChat.runSend 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 18 function items inside it that branch (clearRefs, ownsScope, a function literal at line 310, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
daemon-health.createDaemonHealth.previousSessionReport (cyclomatic 39) apps/daemon/src/services/daemon-health.ts:501— daemon-health.createDaemonHealth.previousSessionReport 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.
probe.parseDshProfileModelsOutput (cyclomatic 39) apps/daemon/src/agent-protocol/dsh-profile/probe.ts:26— probe.parseDshProfileModelsOutput 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.
manifest.validateArtifactManifestInput (cyclomatic 39) apps/daemon/src/artifacts/manifest.ts:86— manifest.validateArtifactManifestInput 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.
mcp.mcpDeliveryFacts (cyclomatic 39) apps/daemon/src/mcp.ts:1709— mcp.mcpDeliveryFacts 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.
StandaloneBundler.rewriteJavaScript::visit (cyclomatic 39) REDACTED:578— StandaloneBundler.rewriteJavaScript::visit 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.
run-deliverable-validation.resolveDeliverable (cyclomatic 39) apps/daemon/src/run-deliverable-validation.ts:254— run-deliverable-validation.resolveDeliverable has cyclomatic complexity 39 (threshold 15). Of this number, 34 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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-input-snapshot.loadOdNextTaskInputSnapshot (cyclomatic 39) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:853— task-input-snapshot.loadOdNextTaskInputSnapshot has cyclomatic complexity 39 (threshold 15). Of this number, 34 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
runtime.createCollabRuntime (cyclomatic 39) apps/daemon/src/collab/runtime.ts:220— runtime.createCollabRuntime has cyclomatic complexity 39 (threshold 15). Of this number, 16 points are the body's own statements and 23 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.
memory-connectors.guessFieldValue (cyclomatic 39) apps/daemon/src/memory-connectors.ts:292— memory-connectors.guessFieldValue 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.
vela-billing.parseBillingPreflight (cyclomatic 39) apps/daemon/src/integrations/vela-billing.ts:74— vela-billing.parseBillingPreflight has cyclomatic complexity 39 (threshold 15). Of this number, 27 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
cli.runAmr (cyclomatic 39) apps/daemon/src/cli.ts:1291— cli.runAmr 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.
NewAutomationModal.NewAutomationModal (cyclomatic 39) apps/web/src/components/NewAutomationModal.tsx:240— NewAutomationModal.NewAutomationModal 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. This shape REPEATS in the file: one other method here (NewAutomationModal.NewAutomationModal::submit) 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.
QueuedSendStack.QueuedSendStack (cyclomatic 39) apps/web/src/components/chat/QueuedSendStack.tsx:27— QueuedSendStack.QueuedSendStack has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 8 of the 39 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 139, 87, 177, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ChatPane.ChatMessageRail (cyclomatic 39) apps/web/src/components/ChatPane.tsx:4861— ChatPane.ChatMessageRail has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 8 of the 39 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 5050, a function literal at line 4939, a function literal at line 5104, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProjectView.mergeServerMessageWithLocal (cyclomatic 39) apps/web/src/components/ProjectView.tsx:699— ProjectView.mergeServerMessageWithLocal 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.
mcp.getArtifact (cyclomatic 38) apps/daemon/src/mcp.ts:3262— mcp.getArtifact has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
deliverable-syntax-quotes.proposeLocalStringQuotePatch (cyclomatic 38) apps/daemon/src/artifacts/deliverable-syntax-quotes.ts:121— deliverable-syntax-quotes.proposeLocalStringQuotePatch has cyclomatic complexity 38 (threshold 15). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
deliverable-syntax-safe-fix.scanJavaScript (cyclomatic 38) apps/daemon/src/artifacts/deliverable-syntax-safe-fix.ts:122— deliverable-syntax-safe-fix.scanJavaScript has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
eval-context.buildEvalContext (cyclomatic 38) apps/daemon/src/observability/eval-context.ts:69— eval-context.buildEvalContext 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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-failure-evidence.admissionPhase (cyclomatic 38) apps/daemon/src/services/run-failure-evidence.ts:23— run-failure-evidence.admissionPhase has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.renderGrokVideo (cyclomatic 38) apps/daemon/src/media/index.ts:2367— index.renderGrokVideo has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
handoff.registerHandoffRoutes (cyclomatic 38) apps/daemon/src/routes/handoff.ts:30— handoff.registerHandoffRoutes has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 45, 112). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.runPluginPublishRepo (cyclomatic 38) apps/daemon/src/cli.ts:5522— cli.runPluginPublishRepo has cyclomatic complexity 38 (threshold 15). Of this number, 33 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli.runTemplates (cyclomatic 38) apps/daemon/src/cli.ts:9389— cli.runTemplates has cyclomatic complexity 38 (threshold 15). Of this number, 31 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HomeView.HomeView (cyclomatic 38) apps/web/src/components/HomeView.tsx:498— HomeView.HomeView has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView::usePlugin, HomeView.HomeView::routePluginUse, HomeView.HomeView::pickChip, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
useAnchoredPopover.useAnchoredPopover (cyclomatic 38) apps/web/src/hooks/useAnchoredPopover.ts:214— useAnchoredPopover.useAnchoredPopover has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 238, 327, 347). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
capture.buildFigmaIr::elementNode (cyclomatic 38) clipper/capture.js:354— capture.buildFigmaIr::elementNode has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
shared-lifecycle.validateSharedLifecycleState (cyclomatic 38) packages/standalone/src/shared-lifecycle.ts:88— shared-lifecycle.validateSharedLifecycleState 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.
runtime-child-observations.adaptMainRunToolObservationsV1 (cyclomatic 37) apps/daemon/src/observability/runtime-child-observations.ts:56— runtime-child-observations.adaptMainRunToolObservationsV1 has cyclomatic complexity 37 (threshold 15). Of this number, 27 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
collab-cloud-service.createCollabCloudService.pollProjectRound (cyclomatic 37) apps/daemon/src/collab/collab-cloud-service.ts:1425— collab-cloud-service.createCollabCloudService.pollProjectRound has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
amr-guidance.resolveRunFailureUiIgnoringSelfPromotion (cyclomatic 37) apps/web/src/runtime/amr-guidance.ts:1640— amr-guidance.resolveRunFailureUiIgnoringSelfPromotion has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AssistantMessage.buildBlocks (cyclomatic 37) REDACTED:4030— AssistantMessage.buildBlocks has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ManualEditPanel.ManualEditPanel (cyclomatic 37) apps/web/src/components/ManualEditPanel.tsx:26— ManualEditPanel.ManualEditPanel has cyclomatic complexity 37 (threshold 15). Of this number, 21 points are the body's own statements and 16 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.
CustomSelect.CustomSelect (cyclomatic 37) apps/web/src/components/CustomSelect.tsx:58— CustomSelect.CustomSelect 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 11 function items inside it that branch (onButtonKeyDown, a function literal at line 100, a function literal at line 129, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
vela.parseAmrEntryAnalyticsPayload (cyclomatic 36) apps/daemon/src/integrations/vela.ts:1577— vela.parseAmrEntryAnalyticsPayload has cyclomatic complexity 36 (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.
db.upsertMessage (cyclomatic 36) apps/daemon/src/db.ts:3210— db.upsertMessage 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.
index.startBrandExtraction (cyclomatic 36) apps/daemon/src/brands/index.ts:283— index.startBrandExtraction 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.
schema.validateSource (cyclomatic 36) apps/daemon/src/live-artifacts/schema.ts:560— schema.validateSource has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
question-form.mapRawQuestion (cyclomatic 36) apps/web/src/artifacts/question-form.ts:670— question-form.mapRawQuestion has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CommentSyncBanner.CommentSyncBanner (cyclomatic 36) apps/web/src/components/share/CommentSyncBanner.tsx:37— CommentSyncBanner.CommentSyncBanner has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
skills.listSkills (cyclomatic 35) apps/daemon/src/skills.ts:232— skills.listSkills has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session.attachDshProfileSession.handleRunFrame (cyclomatic 35) apps/daemon/src/agent-protocol/dsh-profile/session.ts:131— session.attachDshProfileSession.handleRunFrame has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
detection.probe (cyclomatic 35) apps/daemon/src/runtimes/detection.ts:564— detection.probe has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mcp-tokens.sanitizeToken (cyclomatic 35) apps/daemon/src/mcp-tokens.ts:86— mcp-tokens.sanitizeToken has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BrandReferencePicker.BrandReferencePicker (cyclomatic 35) apps/web/src/components/BrandReferencePicker.tsx:143— BrandReferencePicker.BrandReferencePicker has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 178, 255, 324, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AmrLoginPill.AmrAccountControl (cyclomatic 35) apps/web/src/components/AmrLoginPill.tsx:127— AmrLoginPill.AmrAccountControl has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SettingsDialog.deriveAboutUpdateControl (cyclomatic 35) apps/web/src/components/SettingsDialog.tsx:311— SettingsDialog.deriveAboutUpdateControl has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session.attachAcpSession.emitAcpExecutionObservability (cyclomatic 34) apps/daemon/src/agent-protocol/acp/session.ts:716— session.attachAcpSession.emitAcpExecutionObservability has cyclomatic complexity 34 (threshold 15). Of this number, 30 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
opencode-child-evidence.createOpenCodeRootTaskEvidenceCollector.observe (cyclomatic 34) apps/daemon/src/runtimes/opencode-child-evidence.ts:146— opencode-child-evidence.createOpenCodeRootTaskEvidenceCollector.observe has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
json-event-stream.handleAntigravityEvent (cyclomatic 34) apps/daemon/src/runtimes/json-event-stream.ts:435— json-event-stream.handleAntigravityEvent 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.
validate.validateBrand (cyclomatic 34) apps/daemon/src/brands/validate.ts:51— validate.validateBrand has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
discovery-observation.createObserver.push (cyclomatic 34) apps/daemon/src/strategies/od-next/discovery-observation.ts:17— discovery-observation.createObserver.push 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.
run-lifecycle-analytics.foldEventIntoRunAdmissionEvidence (cyclomatic 34) apps/daemon/src/runtimes/run-lifecycle-analytics.ts:198— run-lifecycle-analytics.foldEventIntoRunAdmissionEvidence has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
plugin-asset-cache.isPrivateAddress (cyclomatic 34) apps/daemon/src/plugins/plugin-asset-cache.ts:119— plugin-asset-cache.isPrivateAddress 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.renderVolcengineVideo (cyclomatic 34) apps/daemon/src/media/index.ts:1463— index.renderVolcengineVideo has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tools-connectors-cli.parseOptions (cyclomatic 34) apps/daemon/src/tools-connectors-cli.ts:181— tools-connectors-cli.parseOptions 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.
cli.runPluginSnapshots (cyclomatic 34) apps/daemon/src/cli.ts:3833— cli.runPluginSnapshots has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
projects.bootstrapProjectRoute (cyclomatic 34) apps/web/src/state/projects.ts:402— projects.bootstrapProjectRoute has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 417). 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.
LibraryUploadModal.LibraryUploadModal (cyclomatic 34) apps/web/src/components/LibraryUploadModal.tsx:48— LibraryUploadModal.LibraryUploadModal has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 7 of the 34 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 104, a function literal at line 227, a function literal at line 58, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProjectReferenceModal.ProjectReferenceModal (cyclomatic 34) apps/web/src/components/ProjectReferenceModal.tsx:39— ProjectReferenceModal.ProjectReferenceModal has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 11 function items inside it that branch (confirm, a function literal at line 79, a function literal at line 95, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CommunityView.CommunityView (cyclomatic 34) apps/web/src/components/CommunityView.tsx:110— CommunityView.CommunityView 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 15 function items inside it that branch (handleDetailsUse, a function literal at line 414, typeTab, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
McpClientSection.McpRow (cyclomatic 34) apps/web/src/components/McpClientSection.tsx:773— McpClientSection.McpRow has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NewProjectPanel.MediaModelCards (cyclomatic 34) apps/web/src/components/NewProjectPanel.tsx:2784— NewProjectPanel.MediaModelCards has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 2806, 2851, 2866, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PluginsView.TeamPanel (cyclomatic 34) REDACTED:4244— PluginsView.TeamPanel has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 7 of the 34 points are its own statements and the rest belongs to 6 function items inside it that branch (share, a function literal at line 4280, a function literal at line 4284, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TabLauncherMenu.TabLauncherMenu (cyclomatic 34) apps/web/src/components/workspace/TabLauncherMenu.tsx:56— TabLauncherMenu.TabLauncherMenu has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 16 function items inside it that branch (onInputKeyDown, a function literal at line 125, a function literal at line 99, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AppWashKineticGrid.AppWashKineticGrid (cyclomatic 34) apps/web/src/components/AppWashKineticGrid.tsx:41— AppWashKineticGrid.AppWashKineticGrid has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 167, 44, 83, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
normalized-agent-observation-v1.NormalizedUsageEvidenceV1Schema (cyclomatic 34) packages/contracts/src/observability/normalized-agent-observation-v1.ts:290— normalized-agent-observation-v1.NormalizedUsageEvidenceV1Schema 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.
normalize-plugin-scenarios.classify (cyclomatic 34) scripts/normalize-plugin-scenarios.ts:220— normalize-plugin-scenarios.classify has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mcp.startRun (cyclomatic 33) apps/daemon/src/mcp.ts:2613— mcp.startRun has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
od-next-exact-input.assertOdNextExactInputMapV1 (cyclomatic 33) apps/daemon/src/runtimes/od-next-exact-input.ts:684— od-next-exact-input.assertOdNextExactInputMapV1 has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chat-prompt-inputs.normalizeCommentAttachments (cyclomatic 33) apps/daemon/src/runtimes/chat-prompt-inputs.ts:500— chat-prompt-inputs.normalizeCommentAttachments has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to one function literal inside it that branches (line 503). 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.
langfuse-bridge.reportRunCompletedFromDaemon (cyclomatic 33) apps/daemon/src/langfuse-bridge.ts:1564— langfuse-bridge.reportRunCompletedFromDaemon has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (langfuse-bridge.reportRunCompletedFromDaemon::buildContext) 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.
cli.runLint (cyclomatic 33) apps/daemon/src/cli.ts:947— cli.runLint has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.pollUntilDoneOrBudget (cyclomatic 33) apps/daemon/src/cli.ts:2343— cli.pollUntilDoneOrBudget has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginPublish (cyclomatic 33) apps/daemon/src/cli.ts:5396— cli.runPluginPublish has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
iframe-error.trackVisiblePreview (cyclomatic 33) REDACTED:489— iframe-error.trackVisiblePreview has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 4 of the 33 points are its own statements and the rest belongs to 11 function items inside it that branch (onMessage, update, probe, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
HomeHero.modelOptionIcon (cyclomatic 33) apps/web/src/components/HomeHero.tsx:3552— HomeHero.modelOptionIcon has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
touchpoint-component.verifyWebTouchpoint (cyclomatic 33) apps/web/src/components/touchpoint-component.ts:157— touchpoint-component.verifyWebTouchpoint 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
markdown.parseBlocks (cyclomatic 33) REDACTED:140— markdown.parseBlocks has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PluginDetailView.PluginDetailView (cyclomatic 33) apps/web/src/components/PluginDetailView.tsx:179— PluginDetailView.PluginDetailView has cyclomatic complexity 33 (threshold 15). Of this number, 17 points are the body's own statements and 16 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.
PreviewDrawOverlay.PreviewDrawOverlay (cyclomatic 33) REDACTED:128— PreviewDrawOverlay.PreviewDrawOverlay has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (PreviewDrawOverlay.PreviewDrawOverlay::send) 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.
detection.isOpenDesignHostBridge (cyclomatic 33) packages/host/src/detection.ts:32— detection.isOpenDesignHostBridge has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
bake-plugin-previews.verticalDeckState (cyclomatic 33) scripts/bake-plugin-previews.mjs:289— bake-plugin-previews.verticalDeckState has cyclomatic complexity 33 (threshold 15). Of this number, 27 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
common.contentType (cyclomatic 33) tools/release/src/storage/common.ts:53— common.contentType has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
convergence.self_check (cyclomatic 33) .github/scripts/convergence.py:1825— convergence.self_check has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
json-line-stream.classifyJsonCandidate (cyclomatic 32) apps/daemon/src/agent-protocol/core/json-line-stream.ts:139— json-line-stream.classifyJsonCandidate has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (json-line-stream.classifyJsonCandidate::parseValue) 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.
vela.parseAmrOnboardingProfileAnalyticsPayload (cyclomatic 32) apps/daemon/src/integrations/vela.ts:1653— vela.parseAmrOnboardingProfileAnalyticsPayload 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.
session.attachPiRpcSession.parser (cyclomatic 32) apps/daemon/src/agent-protocol/pi-rpc/session.ts:330— session.attachPiRpcSession.parser has cyclomatic complexity 32 (threshold 15). Of this number, 26 points are the body's own statements and 6 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.
claude-child-evidence.createClaudeChildEvidenceCollector.terminal (cyclomatic 32) apps/daemon/src/runtimes/claude-child-evidence.ts:578— claude-child-evidence.createClaudeChildEvidenceCollector.terminal has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
byok-tools.executeGenerateVideo (cyclomatic 32) apps/daemon/src/byok-tools.ts:787— byok-tools.executeGenerateVideo has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
comment-file-authority.commitCommentFileFacts (cyclomatic 32) apps/daemon/src/collab/comment-file-authority.ts:11— comment-file-authority.commitCommentFileFacts has cyclomatic complexity 32 (threshold 15). Of this number, 19 points are the body's own statements and 13 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.
figma-import.detectImageExt (cyclomatic 32) apps/daemon/src/figma/figma-import.ts:260— figma-import.detectImageExt 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.
skill-installation.installSkillSourceCandidate (cyclomatic 32) apps/daemon/src/services/skill-installation.ts:388— skill-installation.installSkillSourceCandidate has cyclomatic complexity 32 (threshold 15). Of this number, 27 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cloudflare-pages-helpers.checkCloudflarePagesDeploymentLinks (cyclomatic 32) apps/daemon/src/deploy/cloudflare-pages-helpers.ts:79— cloudflare-pages-helpers.checkCloudflarePagesDeploymentLinks 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.
update-lifecycle-observations.recordIncomingUpdateStageResults (cyclomatic 32) apps/desktop/src/main/update-lifecycle-observations.ts:114— update-lifecycle-observations.recordIncomingUpdateStageResults has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
long-task.installLongTaskObserver (cyclomatic 32) apps/web/src/observability/long-task.ts:37— long-task.installLongTaskObserver has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 102, a function literal at line 67, start, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
project-cover.HtmlProjectCoverFrame (cyclomatic 32) apps/web/src/components/project-cover.tsx:164— project-cover.HtmlProjectCoverFrame has cyclomatic complexity 32 (threshold 15). Of this number, 25 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.
HomeHero.FooterSelectOption (cyclomatic 32) apps/web/src/components/HomeHero.tsx:3221— HomeHero.FooterSelectOption has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 3343, 3246, 3254, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HomeHero.pluginMatchesExampleChip (cyclomatic 32) apps/web/src/components/HomeHero.tsx:4273— HomeHero.pluginMatchesExampleChip has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PluginsView.AvailablePluginDetailsModal (cyclomatic 32) REDACTED:3192— PluginsView.AvailablePluginDetailsModal has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
parser.findOpenTag (cyclomatic 32) REDACTED:58— parser.findOpenTag has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Foldable.Foldable (cyclomatic 32) apps/web/src/components/chat/primitives/Foldable.tsx:33— Foldable.Foldable has cyclomatic complexity 32 (threshold 15). Of this number, 19 points are the body's own statements and 13 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.
AssistantMessage.AssistantFeedback (cyclomatic 32) REDACTED:2398— AssistantMessage.AssistantFeedback has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (submitReasons, toggleFeedback, a function literal at line 2444, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FileViewer.FileViewer (cyclomatic 32) REDACTED:1876— FileViewer.FileViewer has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExperienceSurvey.ExperienceSurvey (cyclomatic 32) apps/web/src/components/ExperienceSurvey.tsx:107— ExperienceSurvey.ExperienceSurvey has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 196, 142, 175, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
animation-map.describeTween (cyclomatic 32) design-templates/hyperframes/scripts/animation-map.mjs:222— animation-map.describeTween has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
check-whats-new-document.checkWhatsNewDocument (cyclomatic 32) scripts/check-whats-new-document.ts:53— check-whats-new-document.checkWhatsNewDocument has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session.attachCodexAppServerSession.handleFrame (cyclomatic 31) apps/daemon/src/agent-protocol/codex-app-server/session.ts:346— session.attachCodexAppServerSession.handleFrame 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.
memory.brandToMemoryEntries (cyclomatic 31) apps/daemon/src/brands/memory.ts:71— memory.brandToMemoryEntries 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.
evidence-delivery.drainEvidence (cyclomatic 31) apps/daemon/src/services/evidence-delivery.ts:186— evidence-delivery.drainEvidence has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 195, 222, 216, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tools-connectors-cli.scoreDesignFile (cyclomatic 31) apps/daemon/src/tools-connectors-cli.ts:593— tools-connectors-cli.scoreDesignFile 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.
updater.createDesktopUpdater.restoreStoreState (cyclomatic 31) apps/desktop/src/main/updater.ts:635— updater.createDesktopUpdater.restoreStoreState 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.
GoPlanSunsetDialog.GoPlanSunsetDialog (cyclomatic 31) apps/web/src/components/GoPlanSunsetDialog.tsx:28— GoPlanSunsetDialog.GoPlanSunsetDialog has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 82, a function literal at line 65, a function literal at line 44, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
MemoryToast.MemoryToast (cyclomatic 31) apps/web/src/components/MemoryToast.tsx:56— MemoryToast.MemoryToast has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 137, 70, 112, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignSystemSwitchPicker.DesignSystemSwitchPicker (cyclomatic 31) apps/web/src/components/DesignSystemSwitchPicker.tsx:27— DesignSystemSwitchPicker.DesignSystemSwitchPicker has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 10 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (handlePick, a function literal at line 177, a function literal at line 60, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ComposerModePicker.ComposerModePicker (cyclomatic 31) REDACTED:140— ComposerModePicker.ComposerModePicker 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 literals inside it that branch (lines 168, 200, 264, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
GenUISurfaceRenderer.readObjectSchemaFields (cyclomatic 31) apps/web/src/components/GenUISurfaceRenderer.tsx:574— GenUISurfaceRenderer.readObjectSchemaFields 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.
state-machine.reduceGenerationState (cyclomatic 31) packages/standalone/src/state-machine.ts:138— state-machine.reduceGenerationState 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.
lib.parseYamlSubset (cyclomatic 31) scripts/migrate-to-plugins/lib.ts:48— lib.parseYamlSubset has cyclomatic complexity 31 (threshold 15). Of this number, 17 points are the body's own statements and 14 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.
pack.prepare (cyclomatic 31) .github/scripts/pack.py:149— pack.prepare 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.
db.upsertPreviewComment (cyclomatic 30) apps/daemon/src/db.ts:3868— db.upsertPreviewComment 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.
intent-resolution-store.readIntentResolution (cyclomatic 30) apps/daemon/src/strategies/od-next/intent-resolution-store.ts:49— intent-resolution-store.readIntentResolution has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tool-execution-lifecycle.sanitizeToolExecutionLifecycleUpdate (cyclomatic 30) apps/daemon/src/agent-protocol/acp/tool-execution-lifecycle.ts:178— tool-execution-lifecycle.sanitizeToolExecutionLifecycleUpdate 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.
owned-content-sync.createOwnedContentSync.perform (cyclomatic 30) apps/daemon/src/collab/owned-content-sync.ts:54— owned-content-sync.createOwnedContentSync.perform 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.
pull-profile.emitVelaResourcePullProfile (cyclomatic 30) apps/daemon/src/collab/pull-profile.ts:109— pull-profile.emitVelaResourcePullProfile 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.
deploy.walkReferencedFiles (cyclomatic 30) REDACTED:361— deploy.walkReferencedFiles has cyclomatic complexity 30 (threshold 15). Of this number, 26 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ratchet.evaluateRollout (cyclomatic 30) apps/daemon/src/critique/ratchet.ts:137— ratchet.evaluateRollout 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.
chat-artifacts.registerProjectChatArtifactRoutes (cyclomatic 30) REDACTED:43— chat-artifacts.registerProjectChatArtifactRoutes 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 9 function items inside it that branch (sendSnapshotBlob, a function literal at line 152, authorizeRead, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cli.runMemoryRule (cyclomatic 30) apps/daemon/src/cli.ts:11561— cli.runMemoryRule has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
deck-capture.measureSlide (cyclomatic 30) apps/desktop/src/main/deck-capture.ts:2981— deck-capture.measureSlide 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 4 function items inside it that branch (positiveCssNumber, measureAuthored, deckStageAuthoredSize, …). 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.
router.buildPath (cyclomatic 30) apps/web/src/router.ts:178— router.buildPath 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.
design-kit.parsedToKit (cyclomatic 30) apps/web/src/runtime/design-kit.ts:511— design-kit.parsedToKit 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.
NewProjectPanel.PromptTemplatePicker (cyclomatic 30) apps/web/src/components/NewProjectPanel.tsx:1803— NewProjectPanel.PromptTemplatePicker has cyclomatic complexity 30 (threshold 15). Of this number, 16 points are the body's own statements and 14 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileOpsSummary.FileOpsSummary (cyclomatic 30) apps/web/src/components/FileOpsSummary.tsx:125— FileOpsSummary.FileOpsSummary has cyclomatic complexity 30 (threshold 15). Of this number, 25 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.
InlinePluginsRail.InlinePluginsRail (cyclomatic 30) apps/web/src/components/InlinePluginsRail.tsx:59— InlinePluginsRail.InlinePluginsRail has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 5 function items inside it that branch (onClick, a function literal at line 199, a function literal at line 93, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
DesignSystemFlow.DesignSystemPackageCard (cyclomatic 30) apps/web/src/components/DesignSystemFlow.tsx:3215— DesignSystemFlow.DesignSystemPackageCard has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GenUISurfaceRenderer.GenUISurfaceRenderer (cyclomatic 30) apps/web/src/components/GenUISurfaceRenderer.tsx:73— GenUISurfaceRenderer.GenUISurfaceRenderer has cyclomatic complexity 30 (threshold 15). Of this number, 25 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.
protocol.validateStandaloneMetadata (cyclomatic 30) REDACTED:230— protocol.validateStandaloneMetadata 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.
updates.acpToolName (cyclomatic 29) apps/daemon/src/agent-protocol/acp/updates.ts:623— updates.acpToolName has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
deliverable-syntax-safe-fix.proposePatch (cyclomatic 29) apps/daemon/src/artifacts/deliverable-syntax-safe-fix.ts:256— deliverable-syntax-safe-fix.proposePatch has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
deliverable-syntax-finalization.finalizeCandidate (cyclomatic 29) apps/daemon/src/artifacts/deliverable-syntax-finalization.ts:55— deliverable-syntax-finalization.finalizeCandidate has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
workspace-context.parseWorkspaceCollabContext (cyclomatic 29) apps/daemon/src/collab/workspace-context.ts:251— workspace-context.parseWorkspaceCollabContext 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.
langfuse-trace.postVelaBatch (cyclomatic 29) apps/daemon/src/langfuse-trace.ts:2711— langfuse-trace.postVelaBatch has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
task-input-snapshot.createOdNextTaskInputSnapshot (cyclomatic 29) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:571— task-input-snapshot.createOdNextTaskInputSnapshot has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 658). 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.
vela-share-publish.publishVelaShareVersion (cyclomatic 29) apps/daemon/src/collab/vela-share-publish.ts:49— vela-share-publish.publishVelaShareVersion has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
rollout.evaluateOdNextRollout (cyclomatic 29) apps/daemon/src/strategies/od-next/rollout.ts:119— rollout.evaluateOdNextRollout 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.
memory-connectors.readConnectorMemoryContext (cyclomatic 29) apps/daemon/src/memory-connectors.ts:1096— memory-connectors.readConnectorMemoryContext has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cli.runPluginSimulate (cyclomatic 29) apps/daemon/src/cli.ts:4850— cli.runPluginSimulate has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
updater.createDesktopUpdater.installUpdate (cyclomatic 29) apps/desktop/src/main/updater.ts:1213— updater.createDesktopUpdater.installUpdate has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tool-kind.targetFromSimple (cyclomatic 29) apps/web/src/runtime/chat/tool-kind.ts:377— tool-kind.targetFromSimple has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
deck-thumbnail-parser.extractStylesheetImports (cyclomatic 29) REDACTED:404— deck-thumbnail-parser.extractStylesheetImports has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodingPlanUsage.CodingPlanUsage (cyclomatic 29) apps/web/src/components/CodingPlanUsage.tsx:39— CodingPlanUsage.CodingPlanUsage has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DesignSystemPreviewModal.DesignSystemPreviewModal (cyclomatic 29) apps/web/src/components/DesignSystemPreviewModal.tsx:46— DesignSystemPreviewModal.DesignSystemPreviewModal has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 100, 89, 134, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
preview.inferPluginPreview (cyclomatic 29) apps/web/src/components/plugins-home/preview.ts:189— preview.inferPluginPreview has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
modelProviderIcon.modelProviderIconSrc (cyclomatic 29) apps/web/src/components/modelProviderIcon.ts:8— modelProviderIcon.modelProviderIconSrc 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.
FileOpsSummary.ArtifactCard (cyclomatic 29) apps/web/src/components/FileOpsSummary.tsx:558— FileOpsSummary.ArtifactCard has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TerminalViewer.TerminalViewer (cyclomatic 29) apps/web/src/components/workspace/TerminalViewer.tsx:174— TerminalViewer.TerminalViewer has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 207, 235, 305, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
content.pickImages (cyclomatic 29) clipper/content.js:1053— content.pickImages has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1241, 1272, 1261, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
chat-protocol-context.chatProtocolSkipRanges (cyclomatic 29) packages/contracts/src/artifacts/chat-protocol-context.ts:79— chat-protocol-context.chatProtocolSkipRanges has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
html-injection-points.scanTag (cyclomatic 29) REDACTED:108— html-injection-points.scanTag has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
resolve.resolveContext (cyclomatic 29) packages/plugin-runtime/src/resolve.ts:61— resolve.resolveContext has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
operations.convergeSidecarLaunch (cyclomatic 29) packages/sidecar/src/operations.ts:219— operations.convergeSidecarLaunch has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowContract.__init__ (cyclomatic 29) .github/scripts/convergence.py:134— WorkflowContract.__init__ has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vela-command.runVelaCommand (cyclomatic 28) apps/daemon/src/integrations/vela-command.ts:257— vela-command.runVelaCommand 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 6 function literals inside it that branch (lines 305, 287, 390, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-store.compareAndTransitionStrategyTaskExecution (cyclomatic 28) apps/daemon/src/strategies/task-store.ts:621— task-store.compareAndTransitionStrategyTaskExecution 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 626). 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.
vela-child-evidence.createVelaChildEvidenceConsumer.observe (cyclomatic 28) apps/daemon/src/runtimes/vela-child-evidence.ts:600— vela-child-evidence.createVelaChildEvidenceConsumer.observe has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deliverable-syntax.checkDeliverableSyntax (cyclomatic 28) apps/daemon/src/artifacts/deliverable-syntax.ts:371— deliverable-syntax.checkDeliverableSyntax 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.
imagery-fallback.findImageRefs (cyclomatic 28) REDACTED:140— imagery-fallback.findImageRefs has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
imagery-fallback.imageSize (cyclomatic 28) REDACTED:232— imagery-fallback.imageSize 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.
claude-child-evidence.adaptClaudeChildRuntimeFactV1 (cyclomatic 28) apps/daemon/src/runtimes/claude-child-evidence.ts:879— claude-child-evidence.adaptClaudeChildRuntimeFactV1 has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
byok-tools.executeAIHubMixGenerateSpeech (cyclomatic 28) apps/daemon/src/byok-tools.ts:1144— byok-tools.executeAIHubMixGenerateSpeech has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
project-public-file-stop.createProjectPublicFileStop (cyclomatic 28) apps/daemon/src/collab/project-public-file-stop.ts:30— project-public-file-stop.createProjectPublicFileStop 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 5 function literals inside it that branch (lines 31, 73, 76, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
public-file-failure.classifyVelaCommandFailure (cyclomatic 28) apps/daemon/src/collab/public-file-failure.ts:38— public-file-failure.classifyVelaCommandFailure has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deploy.setupCloudflarePagesCustomDomain (cyclomatic 28) REDACTED:874— deploy.setupCloudflarePagesCustomDomain 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.
search.searchInstalledPlugins (cyclomatic 28) apps/daemon/src/plugins/search.ts:52— search.searchInstalledPlugins has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
resolve-snapshot.resolvePluginSnapshot (cyclomatic 28) apps/daemon/src/plugins/resolve-snapshot.ts:190— resolve-snapshot.resolvePluginSnapshot 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.
initial-prompt-bundle-service.createOdNextInitialPromptBundleService (cyclomatic 28) apps/daemon/src/strategies/od-next/initial-prompt-bundle-service.ts:183— initial-prompt-bundle-service.createOdNextInitialPromptBundleService 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 186). 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.
message-event-payload-heal.runMessageEventPayloadHealPass (cyclomatic 28) REDACTED:98— message-event-payload-heal.runMessageEventPayloadHealPass has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
finalize-design.extractDesignMd (cyclomatic 28) apps/daemon/src/design/finalize-design.ts:712— finalize-design.extractDesignMd 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.
task-handoff.resolveStrategyHandoff (cyclomatic 28) apps/daemon/src/strategies/od-next/task-handoff.ts:59— task-handoff.resolveStrategyHandoff has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
comment-batch-receipt.parseCommentBatchReceipt (cyclomatic 28) apps/daemon/src/collab/comment-batch-receipt.ts:4— comment-batch-receipt.parseCommentBatchReceipt 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.
published-file-comment-backfill.enqueuePublishedFileComments (cyclomatic 28) apps/daemon/src/collab/published-file-comment-backfill.ts:25— published-file-comment-backfill.enqueuePublishedFileComments 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
vela-public-file-stop.createVelaPublicFileStop (cyclomatic 28) apps/daemon/src/collab/vela-public-file-stop.ts:23— vela-public-file-stop.createVelaPublicFileStop has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 24, 38). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.runFigma (cyclomatic 28) apps/daemon/src/cli.ts:6707— cli.runFigma 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. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
launcher-after-quit.inspectExistingDesktopForLauncher (cyclomatic 28) apps/packaged/src/launcher-after-quit.ts:217— launcher-after-quit.inspectExistingDesktopForLauncher 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.
amr-balance-gate.fetchWorkspaceWalletSnapshot (cyclomatic 28) apps/web/src/runtime/amr-balance-gate.ts:152— amr-balance-gate.fetchWorkspaceWalletSnapshot 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.
SkillsSection.SkillRow (cyclomatic 28) apps/web/src/components/SkillsSection.tsx:830— SkillsSection.SkillRow has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PluginsView.availablePluginVersions (cyclomatic 28) REDACTED:4038— PluginsView.availablePluginVersions 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.
manifest.parseArtifactManifest (cyclomatic 28) apps/web/src/artifacts/manifest.ts:100— manifest.parseArtifactManifest has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChatPane.QueuedSendStrip (cyclomatic 28) apps/web/src/components/ChatPane.tsx:6001— ChatPane.QueuedSendStrip has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 5 function items inside it that branch (handleDragOver, handleDrop, a function literal at line 6114, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FileViewer.stripInspectOverridesAndIndex (cyclomatic 28) REDACTED:5955— FileViewer.stripInspectOverridesAndIndex has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileViewer.CommentPreviewOverlays (cyclomatic 28) REDACTED:6094— FileViewer.CommentPreviewOverlays 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 4 function literals inside it that branch (lines 6152, 6195, 6221, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
content.collectImagesInPage (cyclomatic 28) clipper/content.js:879— content.collectImagesInPage has cyclomatic complexity 28 (threshold 15). Of this number, 20 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
REDACTED.drawLineChart (cyclomatic 28) design-templates/social-media-matrix-tracker-template/assets/template.html:665— REDACTED.drawLineChart has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
REDACTED.drawLineChart (cyclomatic 28) design-templates/social-media-matrix-tracker-template/example.html:665— REDACTED.drawLineChart has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
html-injection-points.skipTemplateContent (cyclomatic 28) REDACTED:290— html-injection-points.skipTemplateContent 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.
index.normalizeDesktopRenderSlidesInput (cyclomatic 28) packages/sidecar-proto/src/index.ts:952— index.normalizeDesktopRenderSlidesInput has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
collab-cloud.parseMemberPage (cyclomatic 27) apps/daemon/src/integrations/collab-cloud.ts:369— collab-cloud.parseMemberPage 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.
mcp-observability.normalizeExternalPluginRunAnalyticsHints (cyclomatic 27) apps/daemon/src/mcp-observability.ts:198— mcp-observability.normalizeExternalPluginRunAnalyticsHints has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
mcp.observeMcpToolCall (cyclomatic 27) apps/daemon/src/mcp.ts:1566— mcp.observeMcpToolCall 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.
byok-tools.executeGenerateImage (cyclomatic 27) apps/daemon/src/byok-tools.ts:593— byok-tools.executeGenerateImage has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run-lifecycle-analytics.foldEventIntoRunSideEffectLedger (cyclomatic 27) apps/daemon/src/runtimes/run-lifecycle-analytics.ts:260— run-lifecycle-analytics.foldEventIntoRunSideEffectLedger 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.
runs.createChatRunService.statusBody (cyclomatic 27) apps/daemon/src/runtimes/runs.ts:1525— runs.createChatRunService.statusBody has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
langfuse-bridge.reportRunCompletedFromDaemon::buildContext (cyclomatic 27) apps/daemon/src/langfuse-bridge.ts:1702— langfuse-bridge.reportRunCompletedFromDaemon::buildContext has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (langfuse-bridge.reportRunCompletedFromDaemon) 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.
store.recoverStaleLiveArtifactRefreshes (cyclomatic 27) apps/daemon/src/live-artifacts/store.ts:1123— store.recoverStaleLiveArtifactRefreshes 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.
daemon.registerDaemonRoutes (cyclomatic 27) REDACTED:34— daemon.registerDaemonRoutes 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 11 function items inside it that branch (parseRate, a function literal at line 101, parsePositiveInt, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cli.runMcpInstall (cyclomatic 27) apps/daemon/src/cli.ts:2837— cli.runMcpInstall has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runConversation (cyclomatic 27) apps/daemon/src/cli.ts:9544— cli.runConversation has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
startup-telemetry.reportStartupFailure (cyclomatic 27) apps/packaged/src/startup-telemetry.ts:500— startup-telemetry.reportStartupFailure 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.
WorkspaceBillingInterestRegistry.flush (cyclomatic 27) apps/web/src/collab/workspace-billing-interests.ts:120— WorkspaceBillingInterestRegistry.flush has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 162, 128, 220, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
daemon.streamViaDaemon (cyclomatic 27) apps/web/src/providers/daemon.ts:977— daemon.streamViaDaemon 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.
design-md-parse.parseTypography (cyclomatic 27) REDACTED:227— design-md-parse.parseTypography has cyclomatic complexity 27 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EntryNavRail.RailRecentSection (cyclomatic 27) apps/web/src/components/EntryNavRail.tsx:405— EntryNavRail.RailRecentSection has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 512, a function literal at line 517, a function literal at line 526, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
updater.deriveUpdaterModel (cyclomatic 27) apps/web/src/lib/updater.ts:119— updater.deriveUpdaterModel has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
amr-funding-feedback.checkAmrFundingFeedback (cyclomatic 27) apps/web/src/runtime/amr-funding-feedback.ts:43— amr-funding-feedback.checkAmrFundingFeedback has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 61, 58). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FigmaImportModal.FigmaImportModal (cyclomatic 27) apps/web/src/components/FigmaImportModal.tsx:43— FigmaImportModal.FigmaImportModal has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 80, 61, 68, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
modelOptions.SearchableModelSelect (cyclomatic 27) apps/web/src/components/modelOptions.tsx:201— modelOptions.SearchableModelSelect has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (modelOptions.SearchableModelSelect::renderModelOption) 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.
artifact-refs.indexArtifactRefs (cyclomatic 27) apps/web/src/runtime/chat/artifact-refs.ts:103— artifact-refs.indexArtifactRefs 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.
AnchoredMenuShell.AnchoredMenuShell (cyclomatic 27) apps/web/src/components/chat/AnchoredMenuShell.tsx:110— AnchoredMenuShell.AnchoredMenuShell has cyclomatic complexity 27 (threshold 15). Of this number, 18 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.
QuestionForm.summarizeQuestionFormAnswers (cyclomatic 27) apps/web/src/components/QuestionForm.tsx:3131— QuestionForm.summarizeQuestionFormAnswers has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShareMoreMenu.ShareMoreMenu (cyclomatic 27) apps/web/src/components/share/ShareMoreMenu.tsx:21— ShareMoreMenu.ShareMoreMenu has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 78, a function literal at line 38, a function literal at line 64, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ExamplesTab.ExampleCard (cyclomatic 27) apps/web/src/components/ExamplesTab.tsx:507— ExamplesTab.ExampleCard has cyclomatic complexity 27 (threshold 15). Of this number, 15 points are the body's own statements and 12 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.
html-injection-points.findRealTagOffset (cyclomatic 27) REDACTED:680— html-injection-points.findRealTagOffset 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.
normalized-agent-observation-v1.PromptBoundaryEvidenceV1Schema (cyclomatic 27) packages/contracts/src/observability/normalized-agent-observation-v1.ts:148— normalized-agent-observation-v1.PromptBoundaryEvidenceV1Schema has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
import-prompt-templates.inferCategory (cyclomatic 27) scripts/import-prompt-templates.mjs:260— import-prompt-templates.inferCategory 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.
ScopeContract._validate (cyclomatic 27) .github/scripts/scopes.py:98— ScopeContract._validate 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.
vela.spawnVelaLoginAttempt (cyclomatic 26) apps/daemon/src/integrations/vela.ts:1269— vela.spawnVelaLoginAttempt has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 4 function items inside it that branch (handleTerminal, a function literal at line 1425, a function literal at line 1372, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tool-execution-lifecycle.projectToolExecutionLifecycleDiagnostic (cyclomatic 26) apps/daemon/src/agent-protocol/acp/tool-execution-lifecycle.ts:285— tool-execution-lifecycle.projectToolExecutionLifecycleDiagnostic 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.
JsonPathScanner.step (cyclomatic 26) apps/daemon/src/runtimes/tool-input-path-scanner.ts:255— JsonPathScanner.step 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.
config.writeConfig (cyclomatic 26) apps/daemon/src/media/config.ts:437— config.writeConfig has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent 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-input-snapshot.mediaTypeFromBytes (cyclomatic 26) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:398— task-input-snapshot.mediaTypeFromBytes has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
device-frames.materializeOdNextDeviceFrames (cyclomatic 26) apps/daemon/src/strategies/od-next/device-frames.ts:195— device-frames.materializeOdNextDeviceFrames has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
collab-sync.registerCollabSyncRoutes.pullAccessForRequest (cyclomatic 26) REDACTED:881— collab-sync.registerCollabSyncRoutes.pullAccessForRequest 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.
update-apply-observations.observeUpdateLifecycleStages (cyclomatic 26) apps/daemon/src/migration/update-apply-observations.ts:316— update-apply-observations.observeUpdateLifecycleStages 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.
finalize-design.finalizeDesignPackage (cyclomatic 26) apps/daemon/src/design/finalize-design.ts:263— finalize-design.finalizeDesignPackage 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.
marketplaces.registerPluginMarketplaceRoutes (cyclomatic 26) REDACTED:40— marketplaces.registerPluginMarketplaceRoutes has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 54, a function literal at line 102, a function literal at line 88, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stock-telemetry.createStockRecorder (cyclomatic 26) apps/daemon/src/media/stock-telemetry.ts:74— stock-telemetry.createStockRecorder 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.
tools-connectors-cli.runConnectorsToolCli (cyclomatic 26) apps/daemon/src/tools-connectors-cli.ts:2772— tools-connectors-cli.runConnectorsToolCli 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.
index.registerProjectRoutes::reconcileLocalRowWithRemoteTeamAccess (cyclomatic 26) REDACTED:2604— index.registerProjectRoutes::reconcileLocalRowWithRemoteTeamAccess has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
vela.proxyAmrApiRequest (cyclomatic 26) REDACTED:298— vela.proxyAmrApiRequest has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
memory-llm.callLocalCli (cyclomatic 26) apps/daemon/src/memory-llm.ts:952— memory-llm.callLocalCli has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 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.
handoff-cli.parseOptions (cyclomatic 26) apps/daemon/src/handoff-cli.ts:78— handoff-cli.parseOptions 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.
cli.runPluginCandidates (cyclomatic 26) apps/daemon/src/cli.ts:5295— cli.runPluginCandidates has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runConfig (cyclomatic 26) apps/daemon/src/cli.ts:10989— cli.runConfig has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.collectDistillAnnotations (cyclomatic 26) apps/daemon/src/cli.ts:11689— cli.collectDistillAnnotations has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
deck-capture.isolateLayeredPptxBackground.paintsBehindTarget (cyclomatic 26) apps/desktop/src/main/deck-capture.ts:1061— deck-capture.isolateLayeredPptxBackground.paintsBehindTarget has cyclomatic complexity 26 (threshold 15). 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 (paintClipState, paintClipChain, a function literal at line 1086, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useWorkspaceContext.useTeamProjects (cyclomatic 26) apps/web/src/collab/useWorkspaceContext.ts:2018— useWorkspaceContext.useTeamProjects has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 8 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.
CollabClient.pollStatus (cyclomatic 26) apps/web/src/collab/collab-client.ts:502— CollabClient.pollStatus has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CollabClient.stabilizePresenceRoster (cyclomatic 26) apps/web/src/collab/collab-client.ts:700— CollabClient.stabilizePresenceRoster 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.
tool-kind.searchPattern (cyclomatic 26) apps/web/src/runtime/chat/tool-kind.ts:450— tool-kind.searchPattern 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.
McpClientSection.McpClientSection (cyclomatic 26) apps/web/src/components/McpClientSection.tsx:317— McpClientSection.McpClientSection has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 8 function items inside it that branch (save, a function literal at line 521, a function literal at line 363, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useMemoryWrittenCard.useMemoryWrittenCard.scheduleWindow (cyclomatic 26) apps/web/src/runtime/useMemoryWrittenCard.ts:174— useMemoryWrittenCard.useMemoryWrittenCard.scheduleWindow 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 2 function literals inside it that branch (lines 175, 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.
DesignFilesPanel.HtmlCardThumbnail (cyclomatic 26) apps/web/src/components/DesignFilesPanel.tsx:2057— DesignFilesPanel.HtmlCardThumbnail 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 9 function literals inside it that branch (lines 2138, 2114, 2168, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
validate-save-target.validateCommentSaveTarget (cyclomatic 26) REDACTED:6— validate-save-target.validateCommentSaveTarget has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements 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.
brand-capture.deriveBrandColors (cyclomatic 26) clipper/brand-capture.js:425— brand-capture.deriveBrandColors has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 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.
code.buildNode (cyclomatic 26) figma-plugin/code.js:175— code.buildNode has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
od-next-strategy.composeOdNextStrategyStableRequestContextV2 (cyclomatic 26) packages/contracts/src/prompts/od-next-strategy.ts:489— od-next-strategy.composeOdNextStrategyStableRequestContextV2 has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
check-cross-app-imports.collectCreateRequireBindings::collectCreateRequireImports (cyclomatic 26) scripts/check-cross-app-imports.ts:135— check-cross-app-imports.collectCreateRequireBindings::collectCreateRequireImports 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.
notebooklm-export-github.main (cyclomatic 26) scripts/notebooklm-export-github.ts:242— notebooklm-export-github.main 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.
pack.finalize (cyclomatic 26) .github/scripts/pack.py:260— pack.finalize 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.
task-store.validateTransition (cyclomatic 25) apps/daemon/src/strategies/task-store.ts:1543— task-store.validateTransition 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.
vela-child-evidence.adaptVelaChildRuntimeFactV1 (cyclomatic 25) apps/daemon/src/runtimes/vela-child-evidence.ts:726— vela-child-evidence.adaptVelaChildRuntimeFactV1 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.
session.attachPiRpcSession (cyclomatic 25) apps/daemon/src/agent-protocol/pi-rpc/session.ts:183— session.attachPiRpcSession 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.
normalize.createCodexAppServerNormalizer.handleItem (cyclomatic 25) apps/daemon/src/agent-protocol/codex-app-server/normalize.ts:459— normalize.createCodexAppServerNormalizer.handleItem 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.
mcp.extractRelativeRefs (cyclomatic 25) apps/daemon/src/mcp.ts:3473— mcp.extractRelativeRefs 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.
automation-ingestions.ingestAutomationSource (cyclomatic 25) apps/daemon/src/automation-ingestions.ts:365— automation-ingestions.ingestAutomationSource 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
project-request-authority.enforceLocalProjectDataPlaneRequest (cyclomatic 25) apps/daemon/src/collab/project-request-authority.ts:42— project-request-authority.enforceLocalProjectDataPlaneRequest 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.
prefetch.buildMaterialMd (cyclomatic 25) REDACTED:688— prefetch.buildMaterialMd 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.
task-input-snapshot.removeManagedSnapshotDir (cyclomatic 25) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:175— task-input-snapshot.removeManagedSnapshotDir 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.
chat-prompt-inputs.renderCommentAttachmentHint (cyclomatic 25) apps/daemon/src/runtimes/chat-prompt-inputs.ts:579— chat-prompt-inputs.renderCommentAttachmentHint has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chat-run-messages.persistRunFailureClassification (cyclomatic 25) apps/daemon/src/runtimes/chat-run-messages.ts:373— chat-run-messages.persistRunFailureClassification 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.
vela-cli-team-projects.toTeamProject (cyclomatic 25) apps/daemon/src/collab/vela-cli-team-projects.ts:426— vela-cli-team-projects.toTeamProject 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.
marketplaces.safeParseManifest (cyclomatic 25) apps/daemon/src/plugins/marketplaces.ts:405— marketplaces.safeParseManifest has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main-run-observation.buildStructuredMainRunObservationV1 (cyclomatic 25) apps/daemon/src/observability/main-run-observation.ts:246— main-run-observation.buildStructuredMainRunObservationV1 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.
task-observation-aggregation.validateParentGraph (cyclomatic 25) apps/daemon/src/observability/task-observation-aggregation.ts:321— task-observation-aggregation.validateParentGraph 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.
index.registerProjectPluginRoutes (cyclomatic 25) REDACTED:957— index.registerProjectPluginRoutes 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 11 function literals inside it that branch (lines 1023, 974, 989, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
memory-llm.collectProposedEntries (cyclomatic 25) apps/daemon/src/memory-llm.ts:1213— memory-llm.collectProposedEntries 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
team-resource-share.registerTeamResourceShareRoutes (cyclomatic 25) apps/daemon/src/routes/team-resource-share.ts:80— team-resource-share.registerTeamResourceShareRoutes 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 5 function items inside it that branch (a function literal at line 138, a function literal at line 167, resolveScope, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
library.detectMime (cyclomatic 25) apps/daemon/src/library.ts:147— library.detectMime 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.
cli.runPluginUpgrade (cyclomatic 25) apps/daemon/src/cli.ts:5089— cli.runPluginUpgrade has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginApply (cyclomatic 25) apps/daemon/src/cli.ts:5172— cli.runPluginApply has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
registry.fetchAgentsStream (cyclomatic 25) apps/web/src/providers/registry.ts:236— registry.fetchAgentsStream has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openai-compatible.isOpenAICompatible (cyclomatic 25) apps/web/src/providers/openai-compatible.ts:26— openai-compatible.isOpenAICompatible 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.
api-proxy.streamProxyEndpoint (cyclomatic 25) apps/web/src/providers/api-proxy.ts:38— api-proxy.streamProxyEndpoint 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.
BrandPreviewCard.BrandPreviewCard (cyclomatic 25) apps/web/src/components/BrandPreviewCard.tsx:46— BrandPreviewCard.BrandPreviewCard 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 3 function literals inside it that branch (lines 129, 106, 75). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BrandsTab.BrandsTab (cyclomatic 25) apps/web/src/components/BrandsTab.tsx:36— BrandsTab.BrandsTab has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 126, 88, 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.
LibraryPreviewModal.LibraryPreviewModal (cyclomatic 25) apps/web/src/components/LibraryPreviewModal.tsx:259— LibraryPreviewModal.LibraryPreviewModal has cyclomatic complexity 25 (threshold 15). Of this number, 19 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.
media-surfaces.normalizeHomeMediaInputs (cyclomatic 25) apps/web/src/components/home-hero/media-surfaces.ts:82— media-surfaces.normalizeHomeMediaInputs 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.
plugin-source.derivePluginSourceLinks (cyclomatic 25) apps/web/src/runtime/plugin-source.ts:116— plugin-source.derivePluginSourceLinks 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.
modelOptions.SearchableModelSelect::renderModelOption (cyclomatic 25) apps/web/src/components/modelOptions.tsx:478— modelOptions.SearchableModelSelect::renderModelOption 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. This shape REPEATS in the file: one other method here (modelOptions.SearchableModelSelect) 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.
visualScore.pluginVisualScore (cyclomatic 25) apps/web/src/components/plugins-home/visualScore.ts:98— visualScore.pluginVisualScore 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.
project-events.createProjectEventsConnection.connect (cyclomatic 25) apps/web/src/providers/project-events.ts:136— project-events.createProjectEventsConnection.connect has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 146, handleLiveArtifactEvent, a function literal at line 178, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
comments.renderCommentAttachmentContext (cyclomatic 25) apps/web/src/comments.ts:475— comments.renderCommentAttachmentContext 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 2 function literals inside it that branch (lines 482, 519). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
QuestionForm.VisualDirectionStack (cyclomatic 25) apps/web/src/components/QuestionForm.tsx:1734— QuestionForm.VisualDirectionStack has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 9 function items inside it that branch (handleStackPointerDown, handleStackPointerDown::onUp, a function literal at line 1787, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ToolCard.TodoCard (cyclomatic 25) apps/web/src/components/ToolCard.tsx:256— ToolCard.TodoCard has cyclomatic complexity 25 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useCommentSyncState.useCommentSyncState (cyclomatic 25) apps/web/src/components/share/useCommentSyncState.ts:31— useCommentSyncState.useCommentSyncState has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 59, 47, 82, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
export-error-code.exportErrorCode (cyclomatic 25) apps/web/src/analytics/export-error-code.ts:24— export-error-code.exportErrorCode 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.
FileWorkspace.designSystemInitialGenerationSteps (cyclomatic 25) apps/web/src/components/FileWorkspace.tsx:6492— FileWorkspace.designSystemInitialGenerationSteps has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileWorkspace.Tab (cyclomatic 25) apps/web/src/components/FileWorkspace.tsx:8581— FileWorkspace.Tab has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DesignSystemFlow.DropZone (cyclomatic 25) apps/web/src/components/DesignSystemFlow.tsx:3809— DesignSystemFlow.DropZone has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 9 function items inside it that branch (beginFileDialogReturnLoading, processSelectedFiles, a function literal at line 3832, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useProjectRouteWorkspaceContext.useProjectRouteWorkspaceContext (cyclomatic 25) apps/web/src/collab/useProjectRouteWorkspaceContext.ts:44— useProjectRouteWorkspaceContext.useProjectRouteWorkspaceContext 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 7 function literals inside it that branch (lines 164, 125, 204, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
guard.checkE2eLayout (cyclomatic 25) scripts/guard.ts:770— guard.checkE2eLayout 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.
fossil.validateRequest (cyclomatic 25) shells/terminal/runtime/fossil.mjs:24— fossil.validateRequest 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.
validate.validateCatalogProvenance (cyclomatic 25) tools/release/src/catalog/validate.ts:210— validate.validateCatalogProvenance 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.
Workload.__init__ (cyclomatic 25) .github/scripts/convergence.py:80— Workload.__init__ 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.
ConvergenceContract.__init__ (cyclomatic 25) .github/scripts/convergence.py:211— ConvergenceContract.__init__ 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.
comment-file-facts.commentFilesAtReceipt (cyclomatic 24) apps/daemon/src/collab/comment-file-facts.ts:48— comment-file-facts.commentFilesAtReceipt 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
deliverable-syntax-quotes.staticHtmlFragment (cyclomatic 24) apps/daemon/src/artifacts/deliverable-syntax-quotes.ts:56— deliverable-syntax-quotes.staticHtmlFragment 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.
projects.createBatchArchiveStream (cyclomatic 24) REDACTED:423— projects.createBatchArchiveStream 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.
RoutineService.start_ (cyclomatic 24) apps/daemon/src/routines.ts:553— RoutineService.start_ 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 2 function literals inside it that branch (lines 567, 694). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
hub-events-subscriber.parseHubWorkspaceEvent (cyclomatic 24) apps/daemon/src/collab/hub-events-subscriber.ts:136— hub-events-subscriber.parseHubWorkspaceEvent has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.readDesignSystemSourceEvidence (cyclomatic 24) REDACTED:1192— index.readDesignSystemSourceEvidence 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.
index.backfillDesignSystemWorkspaceResources (cyclomatic 24) REDACTED:1659— index.backfillDesignSystemWorkspaceResources 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.
team-mirror-promotion.promoteAuthorizedTeamProjectStage (cyclomatic 24) apps/daemon/src/collab/team-mirror-promotion.ts:282— team-mirror-promotion.promoteAuthorizedTeamProjectStage has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deploy.analyzeDeployPlan (cyclomatic 24) REDACTED:1651— deploy.analyzeDeployPlan 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.
doctor.doctorPlugin (cyclomatic 24) apps/daemon/src/plugins/doctor.ts:43— doctor.doctorPlugin 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.
verify.verifyPlugin (cyclomatic 24) apps/daemon/src/plugins/verify.ts:84— verify.verifyPlugin has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
code-import.runCodeImport (cyclomatic 24) apps/daemon/src/plugins/atoms/code-import.ts:105— code-import.runCodeImport 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.
composio.normalizePersistedConnectorDefinition (cyclomatic 24) apps/daemon/src/connectors/composio.ts:1269— composio.normalizePersistedConnectorDefinition 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.
qoder-stream.createQoderStreamHandler.handleObject (cyclomatic 24) apps/daemon/src/runtimes/qoder-stream.ts:86— qoder-stream.createQoderStreamHandler.handleObject 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.
preview.renderMarkdownLite (cyclomatic 24) apps/daemon/src/design-systems/preview.ts:420— preview.renderMarkdownLite has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run-artifact-fs.diffRunArtifacts (cyclomatic 24) apps/daemon/src/run-artifact-fs.ts:386— run-artifact-fs.diffRunArtifacts 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.
tools-connectors-cli.renderGithubDesignEvidenceMarkdown (cyclomatic 24) apps/daemon/src/tools-connectors-cli.ts:1382— tools-connectors-cli.renderGithubDesignEvidenceMarkdown 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.
comment-sync-state.createCommentSyncStateService.read (cyclomatic 24) apps/daemon/src/collab/comment-sync-state.ts:34— comment-sync-state.createCommentSyncStateService.read has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
terminal.registerTerminalRoutes (cyclomatic 24) REDACTED:22— terminal.registerTerminalRoutes has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 52, a function literal at line 111, resolveSession, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
collab-presence.readHeartbeat (cyclomatic 24) apps/daemon/src/routes/collab-presence.ts:337— collab-presence.readHeartbeat has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli.runMessageCenterList (cyclomatic 24) apps/daemon/src/cli.ts:1768— cli.runMessageCenterList has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runMediaGenerate (cyclomatic 24) apps/daemon/src/cli.ts:2138— cli.runMediaGenerate has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginValidate (cyclomatic 24) apps/daemon/src/cli.ts:3225— cli.runPluginValidate has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
conformance.runAdapterConformance (cyclomatic 24) apps/daemon/src/critique/conformance.ts:139— conformance.runAdapterConformance 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.
runtime.fetchResolvedProjectDir (cyclomatic 24) REDACTED:196— runtime.fetchResolvedProjectDir 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.
chat-scroll-jank.installChatScrollJankObserver (cyclomatic 24) apps/web/src/observability/chat-scroll-jank.ts:10— chat-scroll-jank.installChatScrollJankObserver 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 4 function items inside it that branch (a function literal at line 53, frame, activity, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
chat-scroll-freeze.onStructureMutations (cyclomatic 24) apps/web/src/observability/chat-scroll-freeze.ts:1037— chat-scroll-freeze.onStructureMutations 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.
config.loadConfig (cyclomatic 24) apps/web/src/state/config.ts:681— config.loadConfig 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.
srcdoc.buildSrcdoc (cyclomatic 24) REDACTED:357— srcdoc.buildSrcdoc has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DesignKitView.DesignKitViewInner::handleKitKeyDown (cyclomatic 24) apps/web/src/components/DesignKitView.tsx:772— DesignKitView.DesignKitViewInner::handleKitKeyDown 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. This shape REPEATS in the file: one other method here (DesignKitView.DesignKitViewInner) 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.
CloudSignInTip.CloudSignInTip (cyclomatic 24) apps/web/src/components/CloudSignInTip.tsx:101— CloudSignInTip.CloudSignInTip has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 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.
project-cover-pipeline.designSystemCoverFromBrandJson (cyclomatic 24) apps/web/src/lib/project-cover-pipeline.ts:343— project-cover-pipeline.designSystemCoverFromBrandJson has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AmrBalanceDialog.AmrBalanceDialog (cyclomatic 24) apps/web/src/components/AmrBalanceDialog.tsx:114— AmrBalanceDialog.AmrBalanceDialog has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 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.
SkillDetailsModal.SkillDetailsModal (cyclomatic 24) apps/web/src/components/SkillDetailsModal.tsx:27— SkillDetailsModal.SkillDetailsModal 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.
touchpoint-lifecycle.mountTouchpoint (cyclomatic 24) apps/web/src/components/touchpoint-lifecycle.ts:1001— touchpoint-lifecycle.mountTouchpoint has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 1033, dispose, current, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useDeletedShareNotices.useDeletedShareNotices (cyclomatic 24) apps/web/src/components/project-actions/useDeletedShareNotices.ts:28— useDeletedShareNotices.useDeletedShareNotices 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 6 function literals inside it that branch (lines 66, 86, 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.
question-form.parseLegacyForm (cyclomatic 24) apps/web/src/artifacts/question-form.ts:563— question-form.parseLegacyForm 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.
question-form.completeTopLevelString (cyclomatic 24) apps/web/src/artifacts/question-form.ts:844— question-form.completeTopLevelString 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.
PresenceBar.PresenceBar (cyclomatic 24) apps/web/src/collab/PresenceBar.tsx:73— PresenceBar.PresenceBar has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 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.
PreviewDrawOverlay.PreviewDrawOverlay::send (cyclomatic 24) REDACTED:971— PreviewDrawOverlay.PreviewDrawOverlay::send 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. This shape REPEATS in the file: one other method here (PreviewDrawOverlay.PreviewDrawOverlay) 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.
ChatComposer.StagedAttachmentTray (cyclomatic 24) apps/web/src/components/ChatComposer.tsx:4577— ChatComposer.StagedAttachmentTray has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 4620, removeCard, a function literal at line 4602, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
source-patches.applyManualEditPatch (cyclomatic 24) apps/web/src/edit-mode/source-patches.ts:109— source-patches.applyManualEditPatch 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.
FileViewer.resolveDesktopPreviewContentMeasurement (cyclomatic 24) REDACTED:1283— FileViewer.resolveDesktopPreviewContentMeasurement 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.
FileViewer.styleTagIsInspectOverrideBlock (cyclomatic 24) REDACTED:5875— FileViewer.styleTagIsInspectOverrideBlock 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.
DesignSystemFlow.prepareCreatedDesignSystemProject (cyclomatic 24) apps/web/src/components/DesignSystemFlow.tsx:4403— DesignSystemFlow.prepareCreatedDesignSystemProject has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent 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-skill.adaptAgentSkill (cyclomatic 24) packages/plugin-runtime/src/adapters/agent-skill.ts:36— agent-skill.adaptAgentSkill 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.
protocol.compareVersions (cyclomatic 24) REDACTED:162— protocol.compareVersions 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.
check-plugin-preview-manifest.validatePreviewManifest (cyclomatic 24) scripts/check-plugin-preview-manifest.ts:87— check-plugin-preview-manifest.validatePreviewManifest 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.
check-whats-new-publish-workflow.findWhatsNewWorkflowViolations (cyclomatic 24) scripts/check-whats-new-publish-workflow.ts:271— check-whats-new-publish-workflow.findWhatsNewWorkflowViolations 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.
render-previews.createPlaywrightPreviewRenderer (cyclomatic 24) tools/release/src/catalog/render-previews.ts:325— render-previews.createPlaywrightPreviewRenderer 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 4 function items inside it that branch (renderer, getBrowser, a function literal at line 332, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous) (cyclomatic 24) clipper/background.js:566— (anonymous) 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 2 function literals inside it that branch (lines 567, 572). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
lifecycleRequest (cyclomatic 24) shells/terminal/runtime/sidecar-host.mjs:95— lifecycleRequest has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs 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.
app-config.normalizeAgentCliEnvPrefs (cyclomatic 23) apps/daemon/src/app-config.ts:412— app-config.normalizeAgentCliEnvPrefs 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.
updates.acpToolNameFromKind (cyclomatic 23) apps/daemon/src/agent-protocol/acp/updates.ts:495— updates.acpToolNameFromKind has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
comment-file-facts.parseCommentFileState (cyclomatic 23) apps/daemon/src/collab/comment-file-facts.ts:10— comment-file-facts.parseCommentFileState has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
json-event-stream.handleOpenCodeEvent (cyclomatic 23) apps/daemon/src/runtimes/json-event-stream.ts:221— json-event-stream.handleOpenCodeEvent 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.
mcp.validateRuntimeJsonSchema (cyclomatic 23) apps/daemon/src/mcp.ts:877— mcp.validateRuntimeJsonSchema 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.
mcp.mcpFailureFacts (cyclomatic 23) apps/daemon/src/mcp.ts:1507— mcp.mcpFailureFacts 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.
mcp.getRun (cyclomatic 23) apps/daemon/src/mcp.ts:2734— mcp.getRun 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.
artifacts-cli.runArtifactsCli (cyclomatic 23) apps/daemon/src/artifacts-cli.ts:106— artifacts-cli.runArtifactsCli has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
motion-delivery.readMotionExportSpec (cyclomatic 23) apps/daemon/src/artifacts/motion-delivery.ts:16— motion-delivery.readMotionExportSpec 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.
claude-stream.createClaudeStreamHandler.emitCanonicalTaskSnapshot (cyclomatic 23) apps/daemon/src/runtimes/claude-stream.ts:349— claude-stream.createClaudeStreamHandler.emitCanonicalTaskSnapshot 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.
byok-tools.executeAIHubMixGenerateImage (cyclomatic 23) apps/daemon/src/byok-tools.ts:993— byok-tools.executeAIHubMixGenerateImage 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.
skill-shell-read.literalArgs (cyclomatic 23) apps/daemon/src/strategies/od-next/skill-shell-read.ts:2— skill-shell-read.literalArgs 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.
vela-project-share-state.parseProjectShareState.publications (cyclomatic 23) apps/daemon/src/collab/vela-project-share-state.ts:70— vela-project-share-state.parseProjectShareState.publications 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.
composio.normalizePersistedConnectorToolDefinition (cyclomatic 23) apps/daemon/src/connectors/composio.ts:1300— composio.normalizePersistedConnectorToolDefinition has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
artifact-handler.handleCritiqueArtifact (cyclomatic 23) apps/daemon/src/critique/artifact-handler.ts:41— artifact-handler.handleCritiqueArtifact has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 60, 197). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
runs.createChatRunService.replayRecordedEvents (cyclomatic 23) apps/daemon/src/runtimes/runs.ts:1856— runs.createChatRunService.replayRecordedEvents has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProductionMarkerStream.line (cyclomatic 23) apps/daemon/src/strategies/od-next/production-marker.ts:45— ProductionMarkerStream.line 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-retry-policy.transientSuppressedReason (cyclomatic 23) apps/daemon/src/run-retry-policy.ts:176— run-retry-policy.transientSuppressedReason 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.
diagnostic-faults.diagnosticFaultFromRun (cyclomatic 23) apps/daemon/src/services/diagnostic-faults.ts:29— diagnostic-faults.diagnosticFaultFromRun has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
plugin-share-tasks.createPluginShareTaskStore.run (cyclomatic 23) apps/daemon/src/services/plugin-share-tasks.ts:163— plugin-share-tasks.createPluginShareTaskStore.run 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.
stock-telemetry.collectStockTelemetry (cyclomatic 23) apps/daemon/src/media/stock-telemetry.ts:298— stock-telemetry.collectStockTelemetry 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.
memory-connectors.buildToolInput (cyclomatic 23) apps/daemon/src/memory-connectors.ts:356— memory-connectors.buildToolInput has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
memory-connectors.collectLikelyTitleTexts (cyclomatic 23) apps/daemon/src/memory-connectors.ts:732— memory-connectors.collectLikelyTitleTexts 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.
persistent-sync-cache.createPersistentSyncCache (cyclomatic 23) apps/daemon/src/collab/persistent-sync-cache.ts:72— persistent-sync-cache.createPersistentSyncCache has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (read, readStoredSnapshot). 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.
prompt-templates.validateTemplate (cyclomatic 23) apps/daemon/src/media/prompt-templates.ts:93— prompt-templates.validateTemplate has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli.runDaemonDb (cyclomatic 23) apps/daemon/src/cli.ts:9779— cli.runDaemonDb has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
deck-capture.renderDeckSlides (cyclomatic 23) apps/desktop/src/main/deck-capture.ts:238— deck-capture.renderDeckSlides has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
scheduler.createDesktopUpdaterScheduler.tick (cyclomatic 23) apps/desktop/src/main/updater/scheduler.ts:95— scheduler.createDesktopUpdaterScheduler.tick has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
runtime.pickAndImportFolder (cyclomatic 23) REDACTED:545— runtime.pickAndImportFolder has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
projects.deleteProject (cyclomatic 23) apps/web/src/state/projects.ts:1144— projects.deleteProject has cyclomatic complexity 23 (threshold 15). Of this number, 19 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.
project-cover-pipeline.resolveProjectCover (cyclomatic 23) apps/web/src/lib/project-cover-pipeline.ts:60— project-cover-pipeline.resolveProjectCover has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LexicalComposerInput.MentionAtomicNavigationPlugin (cyclomatic 23) apps/web/src/components/composer/LexicalComposerInput.tsx:488— LexicalComposerInput.MentionAtomicNavigationPlugin has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 543, 501, 522, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RoutinesSection.RoutinesSection::submit (cyclomatic 23) apps/web/src/components/RoutinesSection.tsx:583— RoutinesSection.RoutinesSection::submit has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsDialog.NotificationsSection (cyclomatic 23) apps/web/src/components/SettingsDialog.tsx:9050— SettingsDialog.NotificationsSection has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 10 function items inside it that branch (toggleSound, toggleDesktop, a function literal at line 9146, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PluginsView.PluginImportModal (cyclomatic 23) REDACTED:3699— PluginsView.PluginImportModal has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EntryShell.OnboardingView::handleAmrSignInToContinue (cyclomatic 23) apps/web/src/components/EntryShell.tsx:3121— EntryShell.OnboardingView::handleAmrSignInToContinue has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EntryShell.OnboardingView) 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.
file-ops.deriveFileOps (cyclomatic 23) apps/web/src/runtime/file-ops.ts:142— file-ops.deriveFileOps has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
file-ops.shellWords (cyclomatic 23) apps/web/src/runtime/file-ops.ts:295— file-ops.shellWords has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
auto-open-file.collectTurnCandidates (cyclomatic 23) apps/web/src/components/auto-open-file.ts:282— auto-open-file.collectTurnCandidates 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.
FileWorkspace.designSystemReviewSubtitle (cyclomatic 23) apps/web/src/components/FileWorkspace.tsx:6141— FileWorkspace.designSystemReviewSubtitle has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: FileWorkspace.isDesignSystemTokenFile (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
AmrArtifactUpgradeDialog.AmrArtifactUpgradeDialog (cyclomatic 23) apps/web/src/components/AmrArtifactUpgradeDialog.tsx:66— AmrArtifactUpgradeDialog.AmrArtifactUpgradeDialog has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 108, 91, 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.
useGlideIndicator.useGlideIndicator (cyclomatic 23) apps/web/src/hooks/useGlideIndicator.ts:53— useGlideIndicator.useGlideIndicator has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 70, 95, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignSystemFlow.DesignSystemCreationFlow::generate (cyclomatic 23) apps/web/src/components/DesignSystemFlow.tsx:859— DesignSystemFlow.DesignSystemCreationFlow::generate has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (DesignSystemFlow.DesignSystemCreationFlow) 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.
DesignSystemFlow.DesignSystemCreationFlow (cyclomatic 23) apps/web/src/components/DesignSystemFlow.tsx:343— DesignSystemFlow.DesignSystemCreationFlow has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (DesignSystemFlow.DesignSystemCreationFlow::generate) 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.
SessionModeToggle.SessionModeToggle (cyclomatic 23) apps/web/src/components/SessionModeToggle.tsx:204— SessionModeToggle.SessionModeToggle has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 310, 288, 346, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
background.chrome.runtime.onMessage.addListener() (cyclomatic 23) clipper/background.js:566— background.chrome.runtime.onMessage.addListener() has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to one function literal inside it that branches (line 567). 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.
check-html-plugin-preview-contracts.validateHtmlPluginPreviewContract (cyclomatic 23) scripts/check-html-plugin-preview-contracts.ts:49— check-html-plugin-preview-contracts.validateHtmlPluginPreviewContract has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
postinstall.readExternalPlan (cyclomatic 23) scripts/postinstall.mjs:65— postinstall.readExternalPlan has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
system-tokens.groupOf (cyclomatic 23) tools/release/src/catalog/system-tokens.ts:39— system-tokens.groupOf has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
system-tokens.loadCatalogSystemTokens (cyclomatic 23) tools/release/src/catalog/system-tokens.ts:57— system-tokens.loadCatalogSystemTokens 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.
rerun_infra_cancel.resolve_live_pr_head (cyclomatic 23) .github/scripts/rerun_infra_cancel.py:419— rerun_infra_cancel.resolve_live_pr_head 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.
execute (cyclomatic 23) shells/terminal/runtime/fossil.mjs:277— execute has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 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.
comment-inbound-store.applyMemberPage (cyclomatic 22) apps/daemon/src/collab/comment-inbound-store.ts:223— comment-inbound-store.applyMemberPage has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 229). 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-store.rowToTask.runs (cyclomatic 22) apps/daemon/src/strategies/task-store.ts:982— task-store.rowToTask.runs has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
task-store.validateRunChain (cyclomatic 22) apps/daemon/src/strategies/task-store.ts:1463— task-store.validateRunChain has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
prompt-telemetry.summarizeMetadataValue (cyclomatic 22) apps/daemon/src/prompt-telemetry.ts:292— prompt-telemetry.summarizeMetadataValue 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.
codex.parseCodexDebugModels (cyclomatic 22) apps/daemon/src/runtimes/defs/codex.ts:59— codex.parseCodexDebugModels 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.
projects.writeProjectFile (cyclomatic 22) REDACTED:864— projects.writeProjectFile 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.
memory.composeMemoryBody (cyclomatic 22) REDACTED:621— memory.composeMemoryBody has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.isProjectManifest (cyclomatic 22) REDACTED:4116— index.isProjectManifest 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.
index.reconcileProgrammaticExtractionTranscript (cyclomatic 22) apps/daemon/src/brands/index.ts:920— index.reconcileProgrammaticExtractionTranscript has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
vela-cli-team-projects.toVelaTeamProjectRecord (cyclomatic 22) apps/daemon/src/collab/vela-cli-team-projects.ts:478— vela-cli-team-projects.toVelaTeamProjectRecord 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.
proactive-content-pull.createProactiveContentPull.runIntent (cyclomatic 22) apps/daemon/src/collab/proactive-content-pull.ts:1241— proactive-content-pull.createProactiveContentPull.runIntent 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.
update-apply-observations.replayUpdateStageMetrics (cyclomatic 22) apps/daemon/src/migration/update-apply-observations.ts:381— update-apply-observations.replayUpdateStageMetrics 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.
token-contract-rebuild.decideRebuild (cyclomatic 22) apps/daemon/src/design-systems/token-contract-rebuild.ts:133— token-contract-rebuild.decideRebuild has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
handoff.runHandoffAtom (cyclomatic 22) apps/daemon/src/plugins/atoms/handoff.ts:159— handoff.runHandoffAtom 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.
schema.validateLiveArtifactRefreshLogEntry (cyclomatic 22) apps/daemon/src/live-artifacts/schema.ts:818— schema.validateLiveArtifactRefreshLogEntry has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
runs.summarizeToolEvents (cyclomatic 22) apps/daemon/src/runtimes/runs.ts:108— runs.summarizeToolEvents 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.
runs.createChatRunService.commitFinish (cyclomatic 22) apps/daemon/src/runtimes/runs.ts:1616— runs.createChatRunService.commitFinish has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
langfuse-bridge.messageUsageFromAnalytics (cyclomatic 22) apps/daemon/src/langfuse-bridge.ts:528— langfuse-bridge.messageUsageFromAnalytics has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
transcript-export.exportProjectTranscript (cyclomatic 22) apps/daemon/src/transcript-export.ts:161— transcript-export.exportProjectTranscript has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AutomaticDiagnostics.drain (cyclomatic 22) apps/daemon/src/services/automatic-diagnostics.ts:151— AutomaticDiagnostics.drain has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
automation.registerAutomationRoutes (cyclomatic 22) REDACTED:31— automation.registerAutomationRoutes 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 8 function literals inside it that branch (lines 110, 34, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
attribution.createAttributionService (cyclomatic 22) apps/daemon/src/routes/attribution.ts:62— attribution.createAttributionService has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
media.registerMediaRoutes::handleGenerate (cyclomatic 22) REDACTED:305— media.registerMediaRoutes::handleGenerate has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tools-connectors-cli.collectGithubEvidenceWithConnector (cyclomatic 22) apps/daemon/src/tools-connectors-cli.ts:784— tools-connectors-cli.collectGithubEvidenceWithConnector 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.
inline-assets.inlineRelativeAssets (cyclomatic 22) REDACTED:96— inline-assets.inlineRelativeAssets has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
import-export-routes.buildProjectExportManifestResponse (cyclomatic 22) REDACTED:1839— import-export-routes.buildProjectExportManifestResponse has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
owned-content-files.applyOwnedProjectContent (cyclomatic 22) apps/daemon/src/collab/owned-content-files.ts:113— owned-content-files.applyOwnedProjectContent has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cli.runMedia (cyclomatic 22) apps/daemon/src/cli.ts:1979— cli.runMedia has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runShare (cyclomatic 22) apps/daemon/src/cli.ts:6607— cli.runShare has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runChat (cyclomatic 22) apps/daemon/src/cli.ts:9654— cli.runChat has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runDesignSystemDownload (cyclomatic 22) apps/daemon/src/cli.ts:10455— cli.runDesignSystemDownload has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runDeploy (cyclomatic 22) apps/daemon/src/cli.ts:12690— cli.runDeploy has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
payload.runLauncherCleanupLifecycle (cyclomatic 22) apps/desktop/src/main/updater/payload.ts:681— payload.runLauncherCleanupLifecycle 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.
runtime.pickAndReplaceWorkingDir (cyclomatic 22) REDACTED:659— runtime.pickAndReplaceWorkingDir has cyclomatic complexity 22 (threshold 15). Of this number, 20 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.
index.runDesktopMainWithTiming (cyclomatic 22) apps/desktop/src/main/index.ts:707— index.runDesktopMainWithTiming has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 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.
launcher-runtime.resolvePackagedLauncherRuntime (cyclomatic 22) apps/packaged/src/launcher-runtime.ts:451— launcher-runtime.resolvePackagedLauncherRuntime 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.
sidecars.buildPackagedDaemonSpawnEnv (cyclomatic 22) apps/packaged/src/sidecars.ts:668— sidecars.buildPackagedDaemonSpawnEnv has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useWorkspaceContext.useTeamProjects.loadFull (cyclomatic 22) apps/web/src/collab/useWorkspaceContext.ts:2087— useWorkspaceContext.useTeamProjects.loadFull has cyclomatic complexity 22 (threshold 15). Of this number, 14 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.
useWorkspaceContext.useTeamProjects.loadProjectMetadata (cyclomatic 22) apps/web/src/collab/useWorkspaceContext.ts:2171— useWorkspaceContext.useTeamProjects.loadProjectMetadata has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Toast.Toast (cyclomatic 22) apps/web/src/components/Toast.tsx:74— Toast.Toast has cyclomatic complexity 22 (threshold 15). Of this number, 18 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.
WhatsNewPopup.WhatsNewPopup (cyclomatic 22) apps/web/src/components/WhatsNewPopup.tsx:74— WhatsNewPopup.WhatsNewPopup 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 5 function literals inside it that branch (lines 91, 118, 88, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pluginPopularity.comparePluginGalleryOrder (cyclomatic 22) apps/web/src/components/plugins-home/pluginPopularity.ts:61— pluginPopularity.comparePluginGalleryOrder 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.
LexicalComposerInput.LexicalComposerInput (cyclomatic 22) apps/web/src/components/composer/LexicalComposerInput.tsx:720— LexicalComposerInput.LexicalComposerInput has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 759, 798, 825, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectLocationsSection.ProjectLocationsSection (cyclomatic 22) apps/web/src/components/ProjectLocationsSection.tsx:41— ProjectLocationsSection.ProjectLocationsSection has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 10 function items inside it that branch (handleAddFolder, a function literal at line 210, a function literal at line 59, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
reducer.reduce (cyclomatic 22) apps/web/src/components/Theater/state/reducer.ts:180— reducer.reduce has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
useCritiqueReplay.useCritiqueReplay (cyclomatic 22) apps/web/src/components/Theater/hooks/useCritiqueReplay.ts:81— useCritiqueReplay.useCritiqueReplay 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 5 function literals inside it that branch (lines 125, 166, 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.
NewProjectPanel.buildMetadata (cyclomatic 22) apps/web/src/components/NewProjectPanel.tsx:3086— NewProjectPanel.buildMetadata 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.
NewProjectModal.NewProjectModalBody (cyclomatic 22) apps/web/src/components/NewProjectModal.tsx:70— NewProjectModal.NewProjectModalBody has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EntryShell.defaultPluginInputsForCreate (cyclomatic 22) apps/web/src/components/EntryShell.tsx:388— EntryShell.defaultPluginInputsForCreate 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.
EntryShell.OnboardingByokSetupPanel (cyclomatic 22) apps/web/src/components/EntryShell.tsx:4146— EntryShell.OnboardingByokSetupPanel has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useDeletedShareNotices.useDeletedShareNotices.retry (cyclomatic 22) apps/web/src/components/project-actions/useDeletedShareNotices.ts:142— useDeletedShareNotices.useDeletedShareNotices.retry has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 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.
PetOverlay.PetOverlay (cyclomatic 22) apps/web/src/components/pet/PetOverlay.tsx:140— PetOverlay.PetOverlay has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (PetOverlay.PetOverlay::onPointerMove) 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.
useCharReveal.useCharReveal (cyclomatic 22) apps/web/src/components/chat/useCharReveal.ts:246— useCharReveal.useCharReveal has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 248). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
anchor.resolveCommentAnchor (cyclomatic 22) apps/web/src/comments/anchor.ts:54— anchor.resolveCommentAnchor 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.
QuoteBar.QuoteBar (cyclomatic 22) apps/web/src/components/chat/QuoteBar.tsx:257— QuoteBar.QuoteBar has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 339, 366, 292, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ImageRow.ImageRow (cyclomatic 22) apps/web/src/components/chat/primitives/ImageRow.tsx:102— ImageRow.ImageRow has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 191, preview, a function literal at line 133). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
IframeKeepAlivePool.IframeKeepAliveProvider (cyclomatic 22) apps/web/src/components/IframeKeepAlivePool.tsx:79— IframeKeepAlivePool.IframeKeepAliveProvider 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 items inside it that branch (a function literal at line 123, removeEntry, enforceLimit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
DesignFilesBuildingState.DesignFilesBuildingState (cyclomatic 22) REDACTED:79— DesignFilesBuildingState.DesignFilesBuildingState has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 159, 88, 140, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FileWorkspace.DesignSystemProjectPanel::_renderReviewCard (cyclomatic 22) apps/web/src/components/FileWorkspace.tsx:5377— FileWorkspace.DesignSystemProjectPanel::_renderReviewCard has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (FileWorkspace.DesignSystemProjectPanel) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: FileWorkspace.isDesignSystemTokenFile (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
ProjectView.findTouchedProjectFile (cyclomatic 22) apps/web/src/components/ProjectView.tsx:15533— ProjectView.findTouchedProjectFile has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mappers.deriveConfigureGlobals (cyclomatic 22) packages/contracts/src/analytics/events/mappers.ts:431— mappers.deriveConfigureGlobals has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: mappers.agentIdToTracking (cyclomatic 29) 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.
automatic.buildAutomaticDiagnostics (cyclomatic 22) packages/diagnostics/src/automatic.ts:89— automatic.buildAutomaticDiagnostics has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 3 function items inside it that branch (records, flush, a function literal at line 152). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
validate.validateSafe (cyclomatic 22) packages/plugin-runtime/src/validate.ts:43— validate.validateSafe 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.
shell-update.validateShellUpdaterSnapshot (cyclomatic 22) packages/standalone/src/shell-update.ts:109— shell-update.validateShellUpdaterSnapshot 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.
build.packWin (cyclomatic 22) tools/pack/src/win/build.ts:61— build.packWin has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 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.
validate.validateCatalog (cyclomatic 22) tools/release/src/catalog/validate.ts:125— validate.validateCatalog 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.
prerelease-progress-card.buildState (cyclomatic 22) tools/release/src/notifications/prerelease-progress-card.ts:451— prerelease-progress-card.buildState 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.
updates.acpToolResultContent (cyclomatic 21) apps/daemon/src/agent-protocol/acp/updates.ts:737— updates.acpToolResultContent 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.
json-event-stream.handleKimiEvent (cyclomatic 21) apps/daemon/src/runtimes/json-event-stream.ts:528— json-event-stream.handleKimiEvent 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.
session.attachCodexAppServerSession.openThread (cyclomatic 21) apps/daemon/src/agent-protocol/codex-app-server/session.ts:272— session.attachCodexAppServerSession.openThread has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (onThread, a function literal at line 310). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
projects.reconcileHtmlArtifactManifest (cyclomatic 21) REDACTED:969— projects.reconcileHtmlArtifactManifest 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.
index.listDesignSystems (cyclomatic 21) REDACTED:320— index.listDesignSystems 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.
index.summarizeTokenContractReport (cyclomatic 21) REDACTED:1234— index.summarizeTokenContractReport 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.
byok-tools.executeGenerateSpeech (cyclomatic 21) apps/daemon/src/byok-tools.ts:481— byok-tools.executeGenerateSpeech 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.
motion-cover.freezeMotionArtifactCovers (cyclomatic 21) apps/daemon/src/chat-artifacts/motion-cover.ts:69— motion-cover.freezeMotionArtifactCovers has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
task-object-summary.taskObjectMetadata (cyclomatic 21) apps/daemon/src/observability/task-object-summary.ts:2— task-object-summary.taskObjectMetadata has cyclomatic complexity 21 (threshold 15). Of this number, 15 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.
run-lifecycle-analytics.scanRunEventsForRetrySideEffects (cyclomatic 21) apps/daemon/src/runtimes/run-lifecycle-analytics.ts:87— run-lifecycle-analytics.scanRunEventsForRetrySideEffects 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.
vela-share-binding.resumeExistingVelaShare (cyclomatic 21) apps/daemon/src/collab/vela-share-binding.ts:37— vela-share-binding.resumeExistingVelaShare 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
share-alias-recovery.reserveFileShareAlias (cyclomatic 21) apps/daemon/src/collab/share-alias-recovery.ts:10— share-alias-recovery.reserveFileShareAlias has cyclomatic complexity 21 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
fig-decode.buildDocument.build (cyclomatic 21) apps/daemon/src/figma/fig-decode.ts:293— fig-decode.buildDocument.build has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mcp-config.sanitizeMcpServer (cyclomatic 21) apps/daemon/src/mcp-config.ts:175— mcp-config.sanitizeMcpServer 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.
mcp-config.buildOpenCodeMcpConfigContent (cyclomatic 21) apps/daemon/src/mcp-config.ts:456— mcp-config.buildOpenCodeMcpConfigContent 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.
agent-process.reapLeftoverAgentProcesses (cyclomatic 21) apps/daemon/src/runtimes/agent-process.ts:470— agent-process.reapLeftoverAgentProcesses has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
project-file-versions.normalizeArtifactOrigin (cyclomatic 21) apps/daemon/src/project-file-versions.ts:212— project-file-versions.normalizeArtifactOrigin 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.
project-file-versions.createProjectFileVersionUnlocked (cyclomatic 21) apps/daemon/src/project-file-versions.ts:491— project-file-versions.createProjectFileVersionUnlocked 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.
main-run-observation.usageValues (cyclomatic 21) apps/daemon/src/observability/main-run-observation.ts:82— main-run-observation.usageValues 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.
index.renderLeonardoImage (cyclomatic 21) apps/daemon/src/media/index.ts:2238— index.renderLeonardoImage 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.
index.renderMinimaxTTS (cyclomatic 21) apps/daemon/src/media/index.ts:2777— index.renderMinimaxTTS 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.
mcp-bootstrap.ensureMcpDaemonUrl (cyclomatic 21) apps/daemon/src/mcp-bootstrap.ts:125— mcp-bootstrap.ensureMcpDaemonUrl 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.
stock-search.stockSearch (cyclomatic 21) apps/daemon/src/media/stock-search.ts:101— stock-search.stockSearch has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 119, 122, 132). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tools-connectors-cli.renderLocalDesignEvidenceMarkdown (cyclomatic 21) apps/daemon/src/tools-connectors-cli.ts:1463— tools-connectors-cli.renderLocalDesignEvidenceMarkdown has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
skill-installation.findSkillRoot (cyclomatic 21) apps/daemon/src/services/skill-installation.ts:258— skill-installation.findSkillRoot has cyclomatic complexity 21 (threshold 15). Of this number, 13 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.
cli.runMediaStockSearch (cyclomatic 21) apps/daemon/src/cli.ts:2013— cli.runMediaStockSearch has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginInstall (cyclomatic 21) apps/daemon/src/cli.ts:4398— cli.runPluginInstall has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runUiRespond (cyclomatic 21) apps/daemon/src/cli.ts:6357— cli.runUiRespond has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 6359). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runUiPrefill (cyclomatic 21) apps/daemon/src/cli.ts:6446— cli.runUiPrefill has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 6448). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runAtoms (cyclomatic 21) apps/daemon/src/cli.ts:9960— cli.runAtoms has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
task-analytics-operations.matchesFilter (cyclomatic 21) apps/daemon/src/observability/task-analytics-operations.ts:221— task-analytics-operations.matchesFilter 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
release-lifecycle.isReleaseCleanupEntry (cyclomatic 21) apps/desktop/src/main/updater/release-lifecycle.ts:131— release-lifecycle.isReleaseCleanupEntry 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.
deck-thumbnail-parser.parseDeckThumbnails (cyclomatic 21) REDACTED:106— deck-thumbnail-parser.parseDeckThumbnails 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.
design-kit.brandToKit (cyclomatic 21) apps/web/src/runtime/design-kit.ts:362— design-kit.brandToKit 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
amr-balance-gate.amrBalanceGateFromMemory (cyclomatic 21) apps/web/src/runtime/amr-balance-gate.ts:24— amr-balance-gate.amrBalanceGateFromMemory 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DeepSeekV4FlashCampaign.DeepSeekV4FlashCampaign (cyclomatic 21) apps/web/src/components/DeepSeekV4FlashCampaign.tsx:138— DeepSeekV4FlashCampaign.DeepSeekV4FlashCampaign has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 172, a function literal at line 155, takeAction, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProductionCampaignModal.dispatchProductionCampaignAction (cyclomatic 21) apps/web/src/components/ProductionCampaignModal.tsx:107— ProductionCampaignModal.dispatchProductionCampaignAction 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.
validation.validateApiKeyShape (cyclomatic 21) apps/web/src/components/byok/validation.ts:262— validation.validateApiKeyShape 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.
useCritiqueTheaterEnabled.setCritiqueTheaterEnabled (cyclomatic 21) apps/web/src/components/Theater/hooks/useCritiqueTheaterEnabled.ts:133— useCritiqueTheaterEnabled.setCritiqueTheaterEnabled has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 195). 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.
UseEverywhereModal.UseEverywhereGuidePanel (cyclomatic 21) apps/web/src/components/UseEverywhereModal.tsx:143— UseEverywhereModal.UseEverywhereGuidePanel has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 8 function items inside it that branch (onCopySnippet, onCopyGuide, a function literal at line 183, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PluginsHomeSection.PluginsHomeSection (cyclomatic 21) apps/web/src/components/PluginsHomeSection.tsx:67— PluginsHomeSection.PluginsHomeSection has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PluginsHomeSection.pluginFacetLabel (cyclomatic 29) 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.
useBrandReadyPrompt.useBrandReadyPrompt (cyclomatic 21) apps/web/src/runtime/useBrandReadyPrompt.ts:114— useBrandReadyPrompt.useBrandReadyPrompt has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 139, 124, 197). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PluginsSection.PluginsSection (cyclomatic 21) apps/web/src/components/PluginsSection.tsx:103— PluginsSection.PluginsSection has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 203, 110, 165, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignBrowserPanel.DesignBrowserPanel::savePageSnapshot (cyclomatic 21) REDACTED:1863— DesignBrowserPanel.DesignBrowserPanel::savePageSnapshot has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (DesignBrowserPanel.DesignBrowserPanel) 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.
file-viewer-render-mode.shouldUrlLoadHtmlPreview (cyclomatic 21) apps/web/src/components/file-viewer-render-mode.ts:104— file-viewer-render-mode.shouldUrlLoadHtmlPreview 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.
FileViewer.LiveArtifactRefreshHistoryPanel (cyclomatic 21) REDACTED:3014— FileViewer.LiveArtifactRefreshHistoryPanel has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 3127, 3176). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FileWorkspace.designSystemSectionPhaseLabel (cyclomatic 21) apps/web/src/components/FileWorkspace.tsx:7545— FileWorkspace.designSystemSectionPhaseLabel has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: FileWorkspace.isDesignSystemTokenFile (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
DesignSystemFlow.GitHubRepositoryAccessPanel (cyclomatic 21) apps/web/src/components/DesignSystemFlow.tsx:4102— DesignSystemFlow.GitHubRepositoryAccessPanel has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
content.shadow.querySelectorAll("button[data-act]").forEach() (cyclomatic 21) clipper/content.js:326— content.shadow.querySelectorAll("button[data-act]").forEach() 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 one function literal inside it that branches (line 327). 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.
REDACTED.normalizeImageFills (cyclomatic 21) REDACTED:151— REDACTED.normalizeImageFills has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 4 function items inside it that branch (walk, prune, a function literal at line 177, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
observability.parseClientExperienceDiagnostic (cyclomatic 21) packages/contracts/src/analytics/observability.ts:54— observability.parseClientExperienceDiagnostic has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
protocol.parseHostCommand (cyclomatic 21) packages/dsh-runtime/src/protocol.ts:56— protocol.parseHostCommand 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.
toolchain.wellKnownUserToolchainBins (cyclomatic 21) packages/platform/src/toolchain.ts:62— toolchain.wellKnownUserToolchainBins 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.
agent-skill.mapInputs (cyclomatic 21) packages/plugin-runtime/src/adapters/agent-skill.ts:153— agent-skill.mapInputs 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.
style-policy.collectCssHardcodedColorMatchesFromDeclarationValue (cyclomatic 21) scripts/style-policy.ts:225— style-policy.collectCssHardcodedColorMatchesFromDeclarationValue 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.
architecture.importsFrom::visit (cyclomatic 21) scripts/lib/guard/architecture.ts:40— architecture.importsFrom::visit 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.
example.runExampleGenerator (cyclomatic 21) scripts/migrate-to-plugins/example.ts:55— example.runExampleGenerator has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sync-hyperframes-skill.main (cyclomatic 21) scripts/sync-hyperframes-skill.mjs:52— sync-hyperframes-skill.main has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
convergence.successful_workload_jobs (cyclomatic 21) .github/scripts/convergence.py:612— convergence.successful_workload_jobs 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.
validate_atlas.main (cyclomatic 21) skills/hatch-pet/scripts/validate_atlas.py:37— validate_atlas.main has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 21) clipper/content.js:326— (anonymous) 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 one function literal inside it that branches (line 327). 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.
env.spawnEnvForAgent (cyclomatic 20) apps/daemon/src/runtimes/env.ts:103— env.spawnEnvForAgent 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.
frozen-skill-package.verifySelection (cyclomatic 20) apps/daemon/src/strategies/od-next/frozen-skill-package.ts:878— frozen-skill-package.verifySelection has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
local-profiles.createLocalAgentDef (cyclomatic 20) apps/daemon/src/runtimes/local-profiles.ts:125— local-profiles.createLocalAgentDef 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.
artifacts-cli.parseOptions (cyclomatic 20) apps/daemon/src/artifacts-cli.ts:47— artifacts-cli.parseOptions 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.
automation-proposals.createAutomationProposal (cyclomatic 20) apps/daemon/src/automation-proposals.ts:69— automation-proposals.createAutomationProposal has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
workspace-resource-mutation.enforceVerifiedWorkspaceResourceRead (cyclomatic 20) apps/daemon/src/collab/workspace-resource-mutation.ts:802— workspace-resource-mutation.enforceVerifiedWorkspaceResourceRead 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.
vela-workspace-context.mapVelaWorkspaceContext (cyclomatic 20) apps/daemon/src/collab/vela-workspace-context.ts:117— vela-workspace-context.mapVelaWorkspaceContext 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.
index.finalizeBrandCore (cyclomatic 20) apps/daemon/src/brands/index.ts:1393— index.finalizeBrandCore 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.
gc.sweepChatArtifactStorage (cyclomatic 20) apps/daemon/src/chat-artifacts/gc.ts:45— gc.sweepChatArtifactStorage has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run-failure-classification.classifyRunFailure (cyclomatic 20) apps/daemon/src/run-failure-classification.ts:1771— run-failure-classification.classifyRunFailure 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.
FileConnectorCredentialStore.readRecords (cyclomatic 20) apps/daemon/src/connectors/service.ts:228— FileConnectorCredentialStore.readRecords has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ConnectorService.execute (cyclomatic 20) apps/daemon/src/connectors/service.ts:756— ConnectorService.execute 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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-lifecycle-tracer.runLifecycleMarkersForStreamEvent (cyclomatic 20) apps/daemon/src/run-lifecycle-tracer.ts:85— run-lifecycle-tracer.runLifecycleMarkersForStreamEvent has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
run-artifact-fs.snapshotProjectArtifacts::walk (cyclomatic 20) apps/daemon/src/run-artifact-fs.ts:211— run-artifact-fs.snapshotProjectArtifacts::walk 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.
run-retry-policy.decidePostToolResumeRecovery (cyclomatic 20) apps/daemon/src/run-retry-policy.ts:113— run-retry-policy.decidePostToolResumeRecovery has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
provider-models.listProviderModels (cyclomatic 20) apps/daemon/src/integrations/provider-models.ts:294— provider-models.listProviderModels 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.
handoff-design.synthesizeHandoffPrompt (cyclomatic 20) apps/daemon/src/design/handoff-design.ts:157— handoff-design.synthesizeHandoffPrompt 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.
vela.renderVelaImage (cyclomatic 20) REDACTED:354— vela.renderVelaImage 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.
DiagnosticConsentFence.apply (cyclomatic 20) apps/daemon/src/services/diagnostic-consent.ts:93— DiagnosticConsentFence.apply has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vela-stock-search.searchVelaStockPhotos.slots.attempts (cyclomatic 20) apps/daemon/src/media/vela-stock-search.ts:44— vela-stock-search.searchVelaStockPhotos.slots.attempts has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
index.applyUrlPreviewBridgesToHtml (cyclomatic 20) REDACTED:1853— index.applyUrlPreviewBridgesToHtml 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.
index.registerProjectFileRoutes::sendProjectFile (cyclomatic 20) REDACTED:6311— index.registerProjectFileRoutes::sendProjectFile 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.
WorkspaceBillingRuntimeCoordinator.invalidate (cyclomatic 20) apps/daemon/src/collab/workspace-billing-runtime.ts:437— WorkspaceBillingRuntimeCoordinator.invalidate 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.
vela-cli-resource-pull-batcher.createVelaResourcePullBatcher.flush (cyclomatic 20) apps/daemon/src/collab/vela-cli-resource-pull-batcher.ts:58— vela-cli-resource-pull-batcher.createVelaResourcePullBatcher.flush 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.
server.filesystemWriteFileNamesFromRunEvents (cyclomatic 20) REDACTED:2062— server.filesystemWriteFileNamesFromRunEvents 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.
daemon-startup.parseDaemonCliStartupArgs (cyclomatic 20) apps/daemon/src/daemon-startup.ts:45— daemon-startup.parseDaemonCliStartupArgs 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.
cli.runDoctor (cyclomatic 20) apps/daemon/src/cli.ts:10875— cli.runDoctor has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
task-analytics-operations.buildTaskAnalyticsReportV1 (cyclomatic 20) apps/daemon/src/observability/task-analytics-operations.ts:254— task-analytics-operations.buildTaskAnalyticsReportV1 has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
release-lifecycle.scanReleaseCleanupEntries (cyclomatic 20) apps/desktop/src/main/updater/release-lifecycle.ts:289— release-lifecycle.scanReleaseCleanupEntries 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.
obsolete-installed-outer.resolveInstalledOuterExecutable (cyclomatic 20) apps/packaged/src/obsolete-installed-outer.ts:67— obsolete-installed-outer.resolveInstalledOuterExecutable 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.
experience-diagnostics.reportExperienceEvent (cyclomatic 20) apps/web/src/observability/experience-diagnostics.ts:49— experience-diagnostics.reportExperienceEvent has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
provider.AnalyticsProvider (cyclomatic 20) apps/web/src/analytics/provider.tsx:170— provider.AnalyticsProvider 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 9 function literals inside it that branch (lines 245, 265, 292, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
registry.publishProjectFilePublic (cyclomatic 20) apps/web/src/providers/registry.ts:1962— registry.publishProjectFilePublic 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.
config.mergeDaemonConfig (cyclomatic 20) apps/web/src/state/config.ts:1089— config.mergeDaemonConfig 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.
deck-thumbnail-parser.findCssImportEnd (cyclomatic 20) REDACTED:363— deck-thumbnail-parser.findCssImportEnd 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.
use-cloud-sign-in.useCloudSignIn.begin (cyclomatic 20) apps/web/src/components/use-cloud-sign-in.ts:45— use-cloud-sign-in.useCloudSignIn.begin 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.
EntrySettingsMenu.EntrySettingsMenu (cyclomatic 20) apps/web/src/components/EntrySettingsMenu.tsx:74— EntrySettingsMenu.EntrySettingsMenu has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 122, 131, 237, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LibraryPicker.LibraryPicker (cyclomatic 20) apps/web/src/components/LibraryPicker.tsx:61— LibraryPicker.LibraryPicker has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 88, a function literal at line 102, confirm, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
LexicalComposerInput.readCaretRect (cyclomatic 20) apps/web/src/components/composer/LexicalComposerInput.tsx:77— LexicalComposerInput.readCaretRect 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.
HomeHero.FooterInputOption (cyclomatic 20) apps/web/src/components/HomeHero.tsx:3134— HomeHero.FooterInputOption has cyclomatic complexity 20 (threshold 15). Of this number, 16 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. This is NOT this file's highest cyclomatic complexity: HomeHero.pluginPresetArtifactLabel (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
PluginsView.ExtensionsMarketplace::shareResource (cyclomatic 20) REDACTED:1635— PluginsView.ExtensionsMarketplace::shareResource has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (PluginsView.ExtensionsMarketplace) 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.
NewAutomationModal.NewAutomationModal::submit (cyclomatic 20) apps/web/src/components/NewAutomationModal.tsx:444— NewAutomationModal.NewAutomationModal::submit has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (NewAutomationModal.NewAutomationModal) 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.
chat-events.appendErrorStatusEvent (cyclomatic 20) apps/web/src/runtime/chat-events.ts:59— chat-events.appendErrorStatusEvent 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.
question-form.parseOption (cyclomatic 20) apps/web/src/artifacts/question-form.ts:1047— question-form.parseOption 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.
ManualEditPanel.readableManualEditTargetName (cyclomatic 20) apps/web/src/components/ManualEditPanel.tsx:456— ManualEditPanel.readableManualEditTargetName 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.
WorkspaceTabsBar.reviveTab (cyclomatic 20) apps/web/src/components/WorkspaceTabsBar.tsx:320— WorkspaceTabsBar.reviveTab 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.
GenUISurfaceRenderer.JsonSchemaFormSurface::submit (cyclomatic 20) apps/web/src/components/GenUISurfaceRenderer.tsx:680— GenUISurfaceRenderer.JsonSchemaFormSurface::submit 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.
GenUISurfaceRenderer.renderFieldControl (cyclomatic 20) apps/web/src/components/GenUISurfaceRenderer.tsx:785— GenUISurfaceRenderer.renderFieldControl has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mappers.projectKindToTracking (cyclomatic 20) packages/contracts/src/analytics/events/mappers.ts:50— mappers.projectKindToTracking has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: mappers.agentIdToTracking (cyclomatic 29) 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.
normalized-agent-observation-v1.TimingEvidenceV1Schema (cyclomatic 20) packages/contracts/src/observability/normalized-agent-observation-v1.ts:421— normalized-agent-observation-v1.TimingEvidenceV1Schema has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
touchpoint-component-v2.TouchpointComponentV2ManifestSchema (cyclomatic 20) packages/contracts/src/touchpoint-component-v2.ts:151— touchpoint-component-v2.TouchpointComponentV2ManifestSchema 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.
check-design-system-manifests.checkDesignSystemManifests (cyclomatic 20) scripts/check-design-system-manifests.ts:78— check-design-system-manifests.checkDesignSystemManifests 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.
check-design-system-manifests.validateDesignTokensJson (cyclomatic 20) scripts/check-design-system-manifests.ts:157— check-design-system-manifests.validateDesignTokensJson 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.
architecture.scriptsArchitectureErrors (cyclomatic 20) scripts/lib/guard/architecture.ts:119— architecture.scriptsArchitectureErrors 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.
payload.buildWinLauncherPayloadArchive (cyclomatic 20) tools/pack/src/win/payload.ts:67— payload.buildWinLauncherPayloadArchive has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (createArchiveFromInstallerBase, a function literal at line 239, runSegment, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
publication.verifyReleaseNotePublication (cyclomatic 20) tools/release/src/release-note/publication.ts:85— publication.verifyReleaseNotePublication 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.
convergence.validate_products (cyclomatic 20) .github/scripts/convergence.py:681— convergence.validate_products 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.
convergence.publish_command (cyclomatic 20) .github/scripts/convergence.py:2027— convergence.publish_command 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.
stable-docker.metadata_identity (cyclomatic 20) .github/scripts/release/stable-docker.py:63— stable-docker.metadata_identity 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.
app-config.validateOrbit (cyclomatic 19) apps/daemon/src/app-config.ts:326— app-config.validateOrbit 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.
env.openDesignAmrTraceEnv (cyclomatic 19) apps/daemon/src/runtimes/env.ts:241— env.openDesignAmrTraceEnv has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OpenCodeToolEvents.handle (cyclomatic 19) apps/daemon/src/runtimes/opencode-tool-events.ts:18— OpenCodeToolEvents.handle 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.
deliverable-syntax-metrics.recordDeliverableSyntaxCheck (cyclomatic 19) apps/daemon/src/artifacts/deliverable-syntax-metrics.ts:15— deliverable-syntax-metrics.recordDeliverableSyntaxCheck 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.
deliverable-syntax-safe-fix.delimiterAtError (cyclomatic 19) apps/daemon/src/artifacts/deliverable-syntax-safe-fix.ts:225— deliverable-syntax-safe-fix.delimiterAtError 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.
linked-page-delivery.findTouchedLinkedPage (cyclomatic 19) apps/daemon/src/artifacts/linked-page-delivery.ts:46— linked-page-delivery.findTouchedLinkedPage 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.
hyperframes-audio.prepareHyperFramesAudio (cyclomatic 19) apps/daemon/src/media/hyperframes-audio.ts:14— hyperframes-audio.prepareHyperFramesAudio 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.
memory.writeMemoryConfig (cyclomatic 19) REDACTED:242— memory.writeMemoryConfig 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.
workspace-resource-mutation.workspaceResourceAccess (cyclomatic 19) apps/daemon/src/collab/workspace-resource-mutation.ts:456— workspace-resource-mutation.workspaceResourceAccess 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.
vela-workspace-context.createVelaWorkspaceContextProvider.current (cyclomatic 19) apps/daemon/src/collab/vela-workspace-context.ts:274— vela-workspace-context.createVelaWorkspaceContextProvider.current has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run-failure-evidence.verifiedModelSelectionMismatch (cyclomatic 19) apps/daemon/src/services/run-failure-evidence.ts:93— run-failure-evidence.verifiedModelSelectionMismatch 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.
strategy-provenance.validateBundledStrategyActivationV2 (cyclomatic 19) apps/daemon/src/plugins/strategy-provenance.ts:71— strategy-provenance.validateBundledStrategyActivationV2 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.
proactive-content-pull.createProactiveContentPull.shouldPull (cyclomatic 19) apps/daemon/src/collab/proactive-content-pull.ts:678— proactive-content-pull.createProactiveContentPull.shouldPull has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deploy.deployToCloudflarePages (cyclomatic 19) REDACTED:726— deploy.deployToCloudflarePages 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.
server-services.createDesignSystemServerServices.resolveDesignSystemWorkspaceProject (cyclomatic 19) apps/daemon/src/design-systems/server-services.ts:664— server-services.createDesignSystemServerServices.resolveDesignSystemWorkspaceProject 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.
team-resource-share.parseSharedResourceRecords (cyclomatic 19) apps/daemon/src/collab/team-resource-share.ts:331— team-resource-share.parseSharedResourceRecords 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.
versioning.resolveRequestedVersion (cyclomatic 19) apps/daemon/src/registry/versioning.ts:76— versioning.resolveRequestedVersion has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 92). 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.
marketplaces.marketplaceRegistryIdFromUrl (cyclomatic 19) apps/daemon/src/plugins/marketplaces.ts:116— marketplaces.marketplaceRegistryIdFromUrl 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.
tool-loop-guard.createToolLoopGuard.observeToolResult (cyclomatic 19) apps/daemon/src/tool-loop-guard.ts:378— tool-loop-guard.createToolLoopGuard.observeToolResult 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.
transcript-export.coalesceBlocks (cyclomatic 19) apps/daemon/src/transcript-export.ts:451— transcript-export.coalesceBlocks has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
vela.parsePublishedProfiles (cyclomatic 19) REDACTED:189— vela.parsePublishedProfiles 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.
index.renderOpenAISpeech (cyclomatic 19) apps/daemon/src/media/index.ts:1382— index.renderOpenAISpeech 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.
index.renderSenseAudioImage (cyclomatic 19) apps/daemon/src/media/index.ts:3133— index.renderSenseAudioImage 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.
tavily.tavilySearch (cyclomatic 19) apps/daemon/src/research/tavily.ts:46— tavily.tavilySearch 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.
routine.registerRoutineRoutes::validateRoutineInput (cyclomatic 19) REDACTED:309— routine.registerRoutineRoutes::validateRoutineInput 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.
design-systems.registerDesignSystemRoutes.authorizeDesignSystemRead (cyclomatic 19) REDACTED:282— design-systems.registerDesignSystemRoutes.authorizeDesignSystemRead has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
memory-llm.envKeyFor (cyclomatic 19) apps/daemon/src/memory-llm.ts:235— memory-llm.envKeyFor 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.
memory-connectors.buildNotionPageReadInput (cyclomatic 19) apps/daemon/src/memory-connectors.ts:915— memory-connectors.buildNotionPageReadInput has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
memory-connectors.maybeEnrichNotionSearchResponse (cyclomatic 19) apps/daemon/src/memory-connectors.ts:958— memory-connectors.maybeEnrichNotionSearchResponse 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.
vela-cli-collab-client.collabCloudErrorFromVelaFailure (cyclomatic 19) REDACTED:374— vela-cli-collab-client.collabCloudErrorFromVelaFailure 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.
vela-billing.parseBillingCatalog (cyclomatic 19) apps/daemon/src/integrations/vela-billing.ts:503— vela-billing.parseBillingCatalog has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 516). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: vela-billing.parseWorkspaceBillingSnapshot (cyclomatic 20) 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.
public-file-stop-retry.registerPublicFileStopRetryRoutes (cyclomatic 19) apps/daemon/src/routes/public-file-stop-retry.ts:27— public-file-stop-retry.registerPublicFileStopRetryRoutes 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 4 function literals inside it that branch (lines 54, 28, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
powered-preview-origin.projectPoweredPreviewOriginDecision (cyclomatic 19) REDACTED:44— powered-preview-origin.projectPoweredPreviewOriginDecision 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.
byok-cli.byokProviderFromCliOptions (cyclomatic 19) apps/daemon/src/runtimes/byok-cli.ts:11— byok-cli.byokProviderFromCliOptions has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
cli.runPluginScaffold (cyclomatic 19) apps/daemon/src/cli.ts:3164— cli.runPluginScaffold has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginRun (cyclomatic 19) apps/daemon/src/cli.ts:3962— cli.runPluginRun has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginCanon (cyclomatic 19) apps/daemon/src/cli.ts:4953— cli.runPluginCanon has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runLibraryList (cyclomatic 19) apps/daemon/src/cli.ts:10290— cli.runLibraryList has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
update-lifecycle-observations.findIncomingUpdateObservation (cyclomatic 19) apps/desktop/src/main/update-lifecycle-observations.ts:46— update-lifecycle-observations.findIncomingUpdateObservation 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
feed.selectUpdateCandidate (cyclomatic 19) apps/desktop/src/main/updater/feed.ts:173— feed.selectUpdateCandidate 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.
updater.createDesktopUpdater.snapshot (cyclomatic 19) apps/desktop/src/main/updater.ts:543— updater.createDesktopUpdater.snapshot 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.
launcher-runtime.confirmPackagedLauncherRuntime (cyclomatic 19) apps/packaged/src/launcher-runtime.ts:629— launcher-runtime.confirmPackagedLauncherRuntime 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.
resource-error.installResourceErrorObserver (cyclomatic 19) apps/web/src/observability/resource-error.ts:105— resource-error.installResourceErrorObserver has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (listener, loadListener, startWindow, …). 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.
chat-scroll-freeze-detector.classifyActivityRole (cyclomatic 19) apps/web/src/observability/chat-scroll-freeze-detector.ts:894— chat-scroll-freeze-detector.classifyActivityRole 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.
chat-scroll-forensics.collectRuntimeSection (cyclomatic 19) apps/web/src/observability/chat-scroll-forensics.ts:487— chat-scroll-forensics.collectRuntimeSection 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.
public-file-publish.publicFilePublishFailureKey (cyclomatic 19) apps/web/src/collab/public-file-publish.ts:108— public-file-publish.publicFilePublishFailureKey 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.
useBatchProjectShareCount.useBatchProjectShareCount (cyclomatic 19) apps/web/src/components/project-actions/useBatchProjectShareCount.ts:20— useBatchProjectShareCount.useBatchProjectShareCount 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 literals inside it that branch (lines 38, 31, 40). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
exports.exportProjectAsPptx (cyclomatic 19) REDACTED:983— exports.exportProjectAsPptx 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.
HtmlSurface.HtmlSurface (cyclomatic 19) apps/web/src/components/plugins-home/cards/HtmlSurface.tsx:73— HtmlSurface.HtmlSurface has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 126, 88, 107, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WorkingDirPicker.WorkingDirPicker (cyclomatic 19) apps/web/src/components/WorkingDirPicker.tsx:61— WorkingDirPicker.WorkingDirPicker has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HomeHero.buildHomeMentionEntities (cyclomatic 19) apps/web/src/components/HomeHero.tsx:2998— HomeHero.buildHomeMentionEntities has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: HomeHero.pluginPresetArtifactLabel (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
PluginShareMenu.PluginShareMenu (cyclomatic 19) apps/web/src/components/plugin-details/PluginShareMenu.tsx:111— PluginShareMenu.PluginShareMenu has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 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 125, a function literal at line 123, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PluginMediaDetail.PluginMediaDetail (cyclomatic 19) apps/web/src/components/plugin-details/PluginMediaDetail.tsx:88— PluginMediaDetail.PluginMediaDetail has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
visualScore.sortByVisualAppeal (cyclomatic 19) apps/web/src/components/plugins-home/visualScore.ts:147— visualScore.sortByVisualAppeal has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 157). 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.
question-form.parseForm (cyclomatic 19) apps/web/src/artifacts/question-form.ts:509— question-form.parseForm has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExecutionShell.ExecutionShell (cyclomatic 19) apps/web/src/components/chat/ExecutionShell.tsx:113— ExecutionShell.ExecutionShell 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AssistantMessage.toolFamily (cyclomatic 19) REDACTED:3936— AssistantMessage.toolFamily 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.
ChatComposer.buildComposerMentionEntities (cyclomatic 19) apps/web/src/components/ChatComposer.tsx:4043— ChatComposer.buildComposerMentionEntities 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.
FileViewer.serializeInspectOverrides (cyclomatic 19) REDACTED:5721— FileViewer.serializeInspectOverrides 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.
ProjectView.resolveRetryTarget (cyclomatic 19) apps/web/src/components/ProjectView.tsx:15210— ProjectView.resolveRetryTarget 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.
DesignSystemFlow.buildSourceContextManifest (cyclomatic 19) apps/web/src/components/DesignSystemFlow.tsx:5575— DesignSystemFlow.buildSourceContextManifest 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.
PluginInputsForm.renderField (cyclomatic 19) apps/web/src/components/PluginInputsForm.tsx:110— PluginInputsForm.renderField has cyclomatic complexity 19 (threshold 15). Of this number, 16 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.
code.applyBoxProps (cyclomatic 19) figma-plugin/code.js:119— code.applyBoxProps 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.
encode.encodeOdEventForAgui (cyclomatic 19) packages/agui-adapter/src/encode.ts:87— encode.encodeOdEventForAgui 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.
collab.parseOwnedProjectContentUpdate (cyclomatic 19) packages/contracts/src/api/collab.ts:249— collab.parseOwnedProjectContentUpdate has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
client.assertEnvelope (cyclomatic 19) packages/sidecar/src/client.ts:192— client.assertEnvelope 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.
state-machine.validateGenerationState (cyclomatic 19) packages/standalone/src/state-machine.ts:98— state-machine.validateGenerationState 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.
shell-update.reduceShellUpdaterSnapshot (cyclomatic 19) packages/standalone/src/shell-update.ts:137— shell-update.reduceShellUpdaterSnapshot 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.
bake-plugin-previews.loadPreviewOptions (cyclomatic 19) scripts/bake-plugin-previews.mjs:229— bake-plugin-previews.loadPreviewOptions 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.
bake-plugin-previews.cropDeckViewportToSlide (cyclomatic 19) scripts/bake-plugin-previews.mjs:436— bake-plugin-previews.cropDeckViewportToSlide has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 439, 437, 465). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
check-html-plugin-preview-contracts.checkHtmlPluginPreviewContracts (cyclomatic 19) scripts/check-html-plugin-preview-contracts.ts:121— check-html-plugin-preview-contracts.checkHtmlPluginPreviewContracts 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.
registry.queryWinRegistryEntries (cyclomatic 19) tools/pack/src/win/registry.ts:73— registry.queryWinRegistryEntries has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
prerelease-card.renderPrereleaseCard (cyclomatic 19) tools/release/src/notifications/prerelease-card.ts:392— prerelease-card.renderPrereleaseCard 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.
convergence.calculate (cyclomatic 19) .github/scripts/convergence.py:471— convergence.calculate 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.
convergence.resolve_references (cyclomatic 19) .github/scripts/convergence.py:1045— convergence.resolve_references 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.
convergence.finalize_candidate (cyclomatic 19) .github/scripts/convergence.py:1299— convergence.finalize_candidate 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.
handoff.main (cyclomatic 19) .github/scripts/handoff.py:491— handoff.main 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.
release.legacy_release_v1 (cyclomatic 19) .github/scripts/release.py:238— release.legacy_release_v1 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.
finalize_pet_run.validate_mirror_hash (cyclomatic 19) skills/hatch-pet/scripts/finalize_pet_run.py:81— finalize_pet_run.validate_mirror_hash 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.
app-config.validateAgentCliEnv (cyclomatic 18) apps/daemon/src/app-config.ts:279— app-config.validateAgentCliEnv 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.
app-config.validateProjectLocations (cyclomatic 18) apps/daemon/src/app-config.ts:374— app-config.validateProjectLocations 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.
app-config.doWrite (cyclomatic 18) apps/daemon/src/app-config.ts:931— app-config.doWrite 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.
db.repairSyncedCommentCreationTime (cyclomatic 18) apps/daemon/src/db.ts:4467— db.repairSyncedCommentCreationTime 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.
db.normalizeMessage (cyclomatic 18) apps/daemon/src/db.ts:5333— db.normalizeMessage 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.
prompt-telemetry.bindOdNextExactSendPromptEvidence (cyclomatic 18) apps/daemon/src/prompt-telemetry.ts:470— prompt-telemetry.bindOdNextExactSendPromptEvidence 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.
frames.parseDshProfileRuntimeFrame (cyclomatic 18) apps/daemon/src/agent-protocol/dsh-profile/frames.ts:85— frames.parseDshProfileRuntimeFrame 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.
json-event-stream.extractErrorMessage (cyclomatic 18) apps/daemon/src/runtimes/json-event-stream.ts:121— json-event-stream.extractErrorMessage 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: json-event-stream.normalizeTodoStatus (cyclomatic 20) 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.
run-analytics-observability.foldEventIntoPerRequestUsageLedger (cyclomatic 18) apps/daemon/src/run-analytics-observability.ts:233— run-analytics-observability.foldEventIntoPerRequestUsageLedger 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.
analytics.createAnalyticsService.capture (cyclomatic 18) apps/daemon/src/analytics.ts:430— analytics.createAnalyticsService.capture 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.
automation-templates.normalizeAutomationTemplate (cyclomatic 18) apps/daemon/src/automation-templates.ts:231— automation-templates.normalizeAutomationTemplate 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 240). 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.
chat-run-lifecycle.classifyChatRunCloseStatus (cyclomatic 18) apps/daemon/src/runtimes/chat-run-lifecycle.ts:67— chat-run-lifecycle.classifyChatRunCloseStatus 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.
config.readMaskedConfig (cyclomatic 18) apps/daemon/src/media/config.ts:393— config.readMaskedConfig 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-capture.captureRunChatArtifactSnapshots (cyclomatic 18) apps/daemon/src/chat-artifacts/run-capture.ts:81— run-capture.captureRunChatArtifactSnapshots 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.
reconcile.recoverPathIntent (cyclomatic 18) apps/daemon/src/chat-artifacts/reconcile.ts:135— reconcile.recoverPathIntent 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.
chat-run-messages.pinAssistantMessageOnRunCreate (cyclomatic 18) apps/daemon/src/runtimes/chat-run-messages.ts:762— chat-run-messages.pinAssistantMessageOnRunCreate 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 one function literal inside it that branches (line 787). 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.
share-viewer-origin.normalizedShareViewerOrigin (cyclomatic 18) apps/daemon/src/integrations/share-viewer-origin.ts:22— share-viewer-origin.normalizedShareViewerOrigin 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.
project-locations.readProjectManifest (cyclomatic 18) apps/daemon/src/project-locations.ts:88— project-locations.readProjectManifest 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.
policy.parseMediaExecutionPolicyInput (cyclomatic 18) apps/daemon/src/media/policy.ts:25— policy.parseMediaExecutionPolicyInput 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.
server-services.createDesignSystemServerServices.listAllDesignSystems (cyclomatic 18) apps/daemon/src/design-systems/server-services.ts:360— server-services.createDesignSystemServerServices.listAllDesignSystems has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 432, 426). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
installer.installFromGithub (cyclomatic 18) apps/daemon/src/plugins/installer.ts:220— installer.installFromGithub 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.
installer.installFromLocalFolder (cyclomatic 18) apps/daemon/src/plugins/installer.ts:722— installer.installFromLocalFolder 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.
patch-edit.applyOneFileHunks (cyclomatic 18) apps/daemon/src/plugins/atoms/patch-edit.ts:336— patch-edit.applyOneFileHunks 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.
figma-extract.walkNode (cyclomatic 18) apps/daemon/src/plugins/atoms/figma-extract.ts:298— figma-extract.walkNode 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-process.classifyLeftoverAgentRecord (cyclomatic 18) apps/daemon/src/runtimes/agent-process.ts:348— agent-process.classifyLeftoverAgentRecord 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.
share-helpers.upsertSkillPluginCandidateAssistantMessage (cyclomatic 18) apps/daemon/src/plugins/share-helpers.ts:383— share-helpers.upsertSkillPluginCandidateAssistantMessage 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.
runtime-child-observations.adaptRuntimeChildObservationsV1 (cyclomatic 18) apps/daemon/src/observability/runtime-child-observations.ts:270— runtime-child-observations.adaptRuntimeChildObservationsV1 has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 272, 307). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.renderOpenAIImage (cyclomatic 18) apps/daemon/src/media/index.ts:963— index.renderOpenAIImage has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: index.sniffImageExt (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.
index.renderMinimaxImage (cyclomatic 18) apps/daemon/src/media/index.ts:2885— index.renderMinimaxImage has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: index.sniffImageExt (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.
index.renderSenseAudioTTS (cyclomatic 18) apps/daemon/src/media/index.ts:3023— index.renderSenseAudioTTS has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: index.sniffImageExt (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.
index.falQueueRun (cyclomatic 18) apps/daemon/src/media/index.ts:3662— index.falQueueRun 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: index.sniffImageExt (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.
diagnostics-export.createDiagnosticsExportHandler (cyclomatic 18) apps/daemon/src/diagnostics-export.ts:339— diagnostics-export.createDiagnosticsExportHandler 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 3 function literals inside it that branch (lines 341, 441, 415). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.registerPluginEventRoutes (cyclomatic 18) REDACTED:303— index.registerPluginEventRoutes 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 8 function items inside it that branch (a function literal at line 359, a function literal at line 335, a function literal at line 368, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
import-export-routes.chooseExportManifestEntryFile (cyclomatic 18) REDACTED:1946— import-export-routes.chooseExportManifestEntryFile 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.
memory-llm.describeFetchError (cyclomatic 18) apps/daemon/src/memory-llm.ts:746— memory-llm.describeFetchError 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: memory-llm.chatProtocolFromAgentId (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.
community-pets-sync.syncCommunityPets (cyclomatic 18) apps/daemon/src/community-pets-sync.ts:243— community-pets-sync.syncCommunityPets has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
shadcn-import.classifyIpv4 (cyclomatic 18) apps/daemon/src/design-systems/shadcn-import.ts:297— shadcn-import.classifyIpv4 has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
library.sniffImageDimensions (cyclomatic 18) apps/daemon/src/library.ts:186— library.sniffImageDimensions 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.
mcp-live-artifacts-server.callTool (cyclomatic 18) apps/daemon/src/mcp-live-artifacts-server.ts:163— mcp-live-artifacts-server.callTool 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.
handoff-cli.runProjectHandoff (cyclomatic 18) apps/daemon/src/handoff-cli.ts:134— handoff-cli.runProjectHandoff 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.
tools-live-artifacts-cli.runLiveArtifactsToolCli (cyclomatic 18) apps/daemon/src/tools-live-artifacts-cli.ts:250— tools-live-artifacts-cli.runLiveArtifactsToolCli 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.
cli.runPluginWhoami (cyclomatic 18) apps/daemon/src/cli.ts:3414— cli.runPluginWhoami has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.applyPluginFilters (cyclomatic 18) apps/daemon/src/cli.ts:4188— cli.applyPluginFilters has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.streamRunEvents (cyclomatic 18) apps/daemon/src/cli.ts:8759— cli.streamRunEvents 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: cli.runPlugin (cyclomatic 38) 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.
cli.attachTerminal (cyclomatic 18) apps/daemon/src/cli.ts:8873— cli.attachTerminal has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.parseScheduleFlag (cyclomatic 18) apps/daemon/src/cli.ts:11882— cli.parseScheduleFlag 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: cli.runPlugin (cyclomatic 38) 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.
payload.prepareLauncherPayloadRelease (cyclomatic 18) apps/desktop/src/main/updater/payload.ts:203— payload.prepareLauncherPayloadRelease 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.
launcher-runtime.resolvePayloadConfig (cyclomatic 18) apps/packaged/src/launcher-runtime.ts:285— launcher-runtime.resolvePayloadConfig 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.
router.handlePopstate (cyclomatic 18) apps/web/src/router.ts:364— router.handlePopstate has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useCollab.useCollab (cyclomatic 18) apps/web/src/collab/useCollab.ts:100— useCollab.useCollab 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 3 function literals inside it that branch (lines 141, 215, 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.
config.buildMediaProvidersForDaemonSave (cyclomatic 18) apps/web/src/state/config.ts:913— config.buildMediaProvidersForDaemonSave 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.
tool-kind.splitTopLevel (cyclomatic 18) apps/web/src/runtime/chat/tool-kind.ts:75— tool-kind.splitTopLevel has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tool-kind.outputRedirectionTargets (cyclomatic 18) apps/web/src/runtime/chat/tool-kind.ts:187— tool-kind.outputRedirectionTargets 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.
kit-upload.useKitModuleUpload.uploadModule (cyclomatic 18) apps/web/src/runtime/kit-upload.ts:37— kit-upload.useKitModuleUpload.uploadModule 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.
NewBrandModal.NewBrandModal (cyclomatic 18) apps/web/src/components/NewBrandModal.tsx:19— NewBrandModal.NewBrandModal 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 8 function literals inside it that branch (lines 41, 54, 30, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TemplatePicker.TemplatePicker (cyclomatic 18) apps/web/src/components/home-hero/TemplatePicker.tsx:20— TemplatePicker.TemplatePicker has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
markdown.renderInline (cyclomatic 18) REDACTED:602— markdown.renderInline 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.
validation.validateByokDraft (cyclomatic 18) apps/web/src/components/byok/validation.ts:122— validation.validateByokDraft 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.
InterruptButton.InterruptButton (cyclomatic 18) apps/web/src/components/Theater/InterruptButton.tsx:21— InterruptButton.InterruptButton has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 26, 24). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EntryShell.OnboardingCliSetupPanel (cyclomatic 18) apps/web/src/components/EntryShell.tsx:4011— EntryShell.OnboardingCliSetupPanel 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.
partial-json.repairJsonPrefix (cyclomatic 18) apps/web/src/runtime/partial-json.ts:16— partial-json.repairJsonPrefix 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.
useMemoryWrittenCard.useMemoryWrittenCard (cyclomatic 18) apps/web/src/runtime/useMemoryWrittenCard.ts:139— useMemoryWrittenCard.useMemoryWrittenCard has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 233, 166). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
anchor.fuzzyFindSnapshot (cyclomatic 18) apps/web/src/comments/anchor.ts:88— anchor.fuzzyFindSnapshot 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.
split-shell-cards.splitShellCards (cyclomatic 18) apps/web/src/runtime/chat/split-shell-cards.ts:43— split-shell-cards.splitShellCards has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QuestionForm.VisualStylePicker (cyclomatic 18) apps/web/src/components/QuestionForm.tsx:1466— QuestionForm.VisualStylePicker has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1548, selectStyle, pickRandomStyle, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AssistantMessage.recoverLinkedProjectFilesFromContent (cyclomatic 18) REDACTED:1824— AssistantMessage.recoverLinkedProjectFilesFromContent 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.
AssistantMessage.ProseBlock (cyclomatic 18) REDACTED:2934— AssistantMessage.ProseBlock has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 3062, 3092, 3008, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ToolCard.parseLegacyAskUserQuestion (cyclomatic 18) apps/web/src/components/ToolCard.tsx:139— ToolCard.parseLegacyAskUserQuestion 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.
ChatComposer.workspaceContextDescription (cyclomatic 18) apps/web/src/components/ChatComposer.tsx:4321— ChatComposer.workspaceContextDescription 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.
ChatComposer.DesignToolboxPanel (cyclomatic 18) apps/web/src/components/ChatComposer.tsx:5282— ChatComposer.DesignToolboxPanel 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 7 function items inside it that branch (a function literal at line 5429, a function literal at line 5465, a function literal at line 5359, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SketchPreview.excalidrawElementToSketchItem (cyclomatic 18) REDACTED:220— SketchPreview.excalidrawElementToSketchItem 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.
ChatPane.UserMessageImpl (cyclomatic 18) apps/web/src/components/ChatPane.tsx:6657— ChatPane.UserMessageImpl has cyclomatic complexity 18 (threshold 15). Of this number, 12 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.
BoardComposerPopover.popoverAnchorStyle (cyclomatic 18) apps/web/src/components/BoardComposerPopover.tsx:160— BoardComposerPopover.popoverAnchorStyle has cyclomatic complexity 18 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DeckSlideThumbnail.DeckSlideThumbnail (cyclomatic 18) apps/web/src/components/DeckSlideThumbnail.tsx:101— DeckSlideThumbnail.DeckSlideThumbnail 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 109, 175, 201, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ManualEditPanel.StyleInspector (cyclomatic 18) apps/web/src/components/ManualEditPanel.tsx:783— ManualEditPanel.StyleInspector has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
source-patches.setBrandKitTextValue (cyclomatic 18) apps/web/src/edit-mode/source-patches.ts:331— source-patches.setBrandKitTextValue 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.
QuickSwitcher.QuickSwitcher (cyclomatic 18) apps/web/src/components/QuickSwitcher.tsx:29— QuickSwitcher.QuickSwitcher 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 (onKeyDown, a function literal at line 47, a function literal at line 97, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WorkspaceTabsBar.readPersistedTabsStore (cyclomatic 18) apps/web/src/components/WorkspaceTabsBar.tsx:526— WorkspaceTabsBar.readPersistedTabsStore 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.
brand-capture.pickCard (cyclomatic 18) clipper/brand-capture.js:767— brand-capture.pickCard has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
manifest.schema.validateSource (cyclomatic 18) design-systems/_schema/manifest.schema.ts:231— manifest.schema.validateSource 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.
client-metrics.processExitMetricFields (cyclomatic 18) packages/contracts/src/analytics/client-metrics.ts:136— client-metrics.processExitMetricFields 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.
artifact-markdown-context.computeSkipRanges (cyclomatic 18) packages/contracts/src/artifacts/artifact-markdown-context.ts:44— artifact-markdown-context.computeSkipRanges has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
system.promptTemplateReferenceLines (cyclomatic 18) REDACTED:998— system.promptTemplateReferenceLines 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.
BubbleScene.Bubble (cyclomatic 18) skills/chat-motion-overlay/assets/remotion-template/src/components/BubbleScene.tsx:87— BubbleScene.Bubble 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.
index.resolveToolPackBuildOutput (cyclomatic 18) tools/pack/src/config/index.ts:175— index.resolveToolPackBuildOutput 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.
rerun_infra_cancel.resolve_merge_group_open_pr (cyclomatic 18) .github/scripts/rerun_infra_cancel.py:544— rerun_infra_cancel.resolve_merge_group_open_pr 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.
rerun_infra_cancel.self_check (cyclomatic 18) .github/scripts/rerun_infra_cancel.py:698— rerun_infra_cancel.self_check 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.
inspect_frames.inspect_state (cyclomatic 18) skills/hatch-pet/scripts/inspect_frames.py:109— inspect_frames.inspect_state 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.
json-line-stream.classifyJsonCandidate::parseValue (cyclomatic 17) apps/daemon/src/agent-protocol/core/json-line-stream.ts:207— json-line-stream.classifyJsonCandidate::parseValue has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (json-line-stream.classifyJsonCandidate) 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.
models.detectAcpModels (cyclomatic 17) apps/daemon/src/agent-protocol/acp/models.ts:215— models.detectAcpModels 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 6 function literals inside it that branch (lines 270, 241, 303, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
vela.cancelVelaLogin (cyclomatic 17) apps/daemon/src/integrations/vela.ts:1028— vela.cancelVelaLogin 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 branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
diagnostics-evidence.createDiagnosticsEvidence.record (cyclomatic 17) apps/daemon/src/services/diagnostics-evidence.ts:183— diagnostics-evidence.createDiagnosticsEvidence.record 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.
vela-command.redactVelaCommandError (cyclomatic 17) apps/daemon/src/integrations/vela-command.ts:40— vela-command.redactVelaCommandError has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
workspace-project-home.collapseWorkspaceProjectHomes (cyclomatic 17) apps/daemon/src/collab/workspace-project-home.ts:149— workspace-project-home.collapseWorkspaceProjectHomes has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 163). 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.
daemon-health.createDaemonHealth (cyclomatic 17) apps/daemon/src/services/daemon-health.ts:199— daemon-health.createDaemonHealth 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
daemon-health.createDaemonHealth.evaluate (cyclomatic 17) apps/daemon/src/services/daemon-health.ts:416— daemon-health.createDaemonHealth.evaluate 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.
db.compactAdjacentMessageAgentEvents (cyclomatic 17) apps/daemon/src/db.ts:3443— db.compactAdjacentMessageAgentEvents 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.
db.normalizePreviewComment (cyclomatic 17) apps/daemon/src/db.ts:4868— db.normalizePreviewComment 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.
frozen-skill-package.captureSelection (cyclomatic 17) apps/daemon/src/strategies/od-next/frozen-skill-package.ts:464— frozen-skill-package.captureSelection 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.
models.mergeMissingFallbackModelMetadata (cyclomatic 17) apps/daemon/src/runtimes/models.ts:89— models.mergeMissingFallbackModelMetadata 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.
auth.probeAgentAuthStatus (cyclomatic 17) apps/daemon/src/runtimes/auth.ts:597— auth.probeAgentAuthStatus 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.
opencode-child-evidence.childUsageFromSanitizedExport (cyclomatic 17) apps/daemon/src/runtimes/opencode-child-evidence.ts:274— opencode-child-evidence.childUsageFromSanitizedExport 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.
json-event-stream.handleCursorEvent (cyclomatic 17) apps/daemon/src/runtimes/json-event-stream.ts:777— json-event-stream.handleCursorEvent has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: json-event-stream.normalizeTodoStatus (cyclomatic 20) 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.
projects.parseByteRange (cyclomatic 17) REDACTED:1654— projects.parseByteRange 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.
memory.extractFromMessage (cyclomatic 17) REDACTED:1083— memory.extractFromMessage 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.
fonts.harvestFonts (cyclomatic 17) apps/daemon/src/brands/fonts.ts:236— fonts.harvestFonts has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
seed-fallback.deriveSeedPalette (cyclomatic 17) REDACTED:154— seed-fallback.deriveSeedPalette has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.launchProgrammaticBackgroundExtraction (cyclomatic 17) apps/daemon/src/brands/index.ts:558— index.launchProgrammaticBackgroundExtraction has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 619, 590, 609, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
brand-routes.reconcileBrandMetaStatus (cyclomatic 17) REDACTED:821— brand-routes.reconcileBrandMetaStatus 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.
copilot-stream.createCopilotStreamHandler.handleObject (cyclomatic 17) apps/daemon/src/copilot-stream.ts:67— copilot-stream.createCopilotStreamHandler.handleObject 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.
xai-tokens.sanitizeToken (cyclomatic 17) apps/daemon/src/integrations/xai-tokens.ts:62— xai-tokens.sanitizeToken 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.
video.buildVideoRequest (cyclomatic 17) apps/daemon/src/media-adapters/video.ts:177— video.buildVideoRequest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: video.normalizeVideoResponse (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
run-failure-evidence.runFailureEvidence (cyclomatic 17) apps/daemon/src/services/run-failure-evidence.ts:133— run-failure-evidence.runFailureEvidence 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.
run-artifacts.collectWrittenPathsMatching (cyclomatic 17) apps/daemon/src/runtimes/run-artifacts.ts:151— run-artifacts.collectWrittenPathsMatching 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.
run-failure-classification.processExitDetail (cyclomatic 17) apps/daemon/src/run-failure-classification.ts:634— run-failure-classification.processExitDetail 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.
trace-object-manifest.buildTraceObjectManifests (cyclomatic 17) apps/daemon/src/trace-object-manifest.ts:685— trace-object-manifest.buildTraceObjectManifests 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 2 function literals inside it that branch (lines 714, 704). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
codex-model-preflight.preflightCodexDefaultModel (cyclomatic 17) REDACTED:401— codex-model-preflight.preflightCodexDefaultModel 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.
team-project-share.createDesignSystemBackingProjectPreparer (cyclomatic 17) apps/daemon/src/design-systems/team-project-share.ts:87— team-project-share.createDesignSystemBackingProjectPreparer 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 90, 110). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ensure-core-stages.ensureCoreQualityStages (cyclomatic 17) apps/daemon/src/plugins/ensure-core-stages.ts:87— ensure-core-stages.ensureCoreQualityStages has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
apply.applyPlugin (cyclomatic 17) apps/daemon/src/plugins/apply.ts:108— apply.applyPlugin 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.
patch-edit.applyPatchForStep (cyclomatic 17) apps/daemon/src/plugins/atoms/patch-edit.ts:122— patch-edit.applyPatchForStep 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.
schema.validateBoundedJsonInternal (cyclomatic 17) apps/daemon/src/live-artifacts/schema.ts:375— schema.validateBoundedJsonInternal has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: schema.validatePersistedLiveArtifact (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.
schema.validateDocument (cyclomatic 17) apps/daemon/src/live-artifacts/schema.ts:742— schema.validateDocument 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. This is NOT this file's highest cyclomatic complexity: schema.validatePersistedLiveArtifact (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.
transcript.writeTranscript (cyclomatic 17) apps/daemon/src/critique/transcript.ts:31— transcript.writeTranscript has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fig-decode.decodeFigFile (cyclomatic 17) apps/daemon/src/figma/fig-decode.ts:57— fig-decode.decodeFigFile 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.
runs.createChatRunService.hydrateDurableRun (cyclomatic 17) apps/daemon/src/runtimes/runs.ts:839— runs.createChatRunService.hydrateDurableRun 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.
runs.createChatRunService.noteMediaTaskFailure (cyclomatic 17) apps/daemon/src/runtimes/runs.ts:1186— runs.createChatRunService.noteMediaTaskFailure 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.
run-artifact-fs.snapshotProjectArtifactsAsync::walk (cyclomatic 17) apps/daemon/src/run-artifact-fs.ts:266— run-artifact-fs.snapshotProjectArtifactsAsync::walk has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
marker-settlement.settleMarkerTurn (cyclomatic 17) apps/daemon/src/strategies/od-next/marker-settlement.ts:15— marker-settlement.settleMarkerTurn 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.
langfuse-bridge.collectToolCalls (cyclomatic 17) apps/daemon/src/langfuse-bridge.ts:623— langfuse-bridge.collectToolCalls 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.
task-observation-aggregation.buildLegacyTaskObservationPayload (cyclomatic 17) apps/daemon/src/observability/task-observation-aggregation.ts:1092— task-observation-aggregation.buildLegacyTaskObservationPayload 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.
task-observation-rollout.readTaskObservationRolloutConfig (cyclomatic 17) apps/daemon/src/observability/task-observation-rollout.ts:249— task-observation-rollout.readTaskObservationRolloutConfig 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.
codex-child-evidence.collectCodexChildEvidence (cyclomatic 17) apps/daemon/src/runtimes/codex-child-evidence.ts:785— codex-child-evidence.collectCodexChildEvidence 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.
vela.renderVelaVideo (cyclomatic 17) REDACTED:574— vela.renderVelaVideo 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.
store.normalizeRefreshLockMetadata (cyclomatic 17) apps/daemon/src/live-artifacts/store.ts:508— store.normalizeRefreshLockMetadata 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.
conformance-history.readConformanceHistory (cyclomatic 17) apps/daemon/src/critique/conformance-history.ts:78— conformance-history.readConformanceHistory has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
xai-oauth-server.startCallbackListener.handle (cyclomatic 17) REDACTED:96— xai-oauth-server.startCallbackListener.handle 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.
deploy.registerDeploymentCheckRoutes (cyclomatic 17) REDACTED:276— deploy.registerDeploymentCheckRoutes 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 one function literal inside it that branches (line 284). 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.
index.rewriteOutsideExecutableHtmlRanges (cyclomatic 17) REDACTED:178— index.rewriteOutsideExecutableHtmlRanges has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 185, 212, 199, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
collab-cloud-service.previewCommentToCloud (cyclomatic 17) apps/daemon/src/collab/collab-cloud-service.ts:276— collab-cloud-service.previewCommentToCloud 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.
collab-cloud-service.createCollabCloudService.pushOutboxRecord (cyclomatic 17) apps/daemon/src/collab/collab-cloud-service.ts:757— collab-cloud-service.createCollabCloudService.pushOutboxRecord 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.
telemetry.validateMcpAnalyticsEventProperties (cyclomatic 17) REDACTED:597— telemetry.validateMcpAnalyticsEventProperties 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.
shadcn-import.writeShadcnFiles (cyclomatic 17) apps/daemon/src/design-systems/shadcn-import.ts:699— shadcn-import.writeShadcnFiles 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.
server.createFinalizedMessageTelemetryReporter::reportFinalized (cyclomatic 17) REDACTED:2407— server.createFinalizedMessageTelemetryReporter::reportFinalized 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.
cli.runPluginExport (cyclomatic 17) apps/daemon/src/cli.ts:3540— cli.runPluginExport 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. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginOpenDesignPr (cyclomatic 17) apps/daemon/src/cli.ts:5684— cli.runPluginOpenDesignPr has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginDoctor (cyclomatic 17) apps/daemon/src/cli.ts:6112— cli.runPluginDoctor 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. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runBrandExtractFromHtml (cyclomatic 17) apps/daemon/src/cli.ts:7069— cli.runBrandExtractFromHtml 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. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.projectShareHttpFailure (cyclomatic 17) apps/daemon/src/cli.ts:7398— cli.projectShareHttpFailure has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
release-lifecycle.withUpdaterLifecycleLock (cyclomatic 17) apps/desktop/src/main/updater/release-lifecycle.ts:208— release-lifecycle.withUpdaterLifecycleLock has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
client.getAnalyticsClient (cyclomatic 17) apps/web/src/analytics/client.ts:248— client.getAnalyticsClient has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 260, 364, 447). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
source-attribution.landingAttributionPersonProperties (cyclomatic 17) apps/web/src/analytics/source-attribution.ts:105— source-attribution.landingAttributionPersonProperties 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.
projects.normalizeTabsState (cyclomatic 17) apps/web/src/state/projects.ts:1689— projects.normalizeTabsState has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
registry.connectConnector (cyclomatic 17) apps/web/src/providers/registry.ts:1503— registry.connectConnector 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.
daemon.buildPriorRunContextWarning (cyclomatic 17) apps/web/src/providers/daemon.ts:167— daemon.buildPriorRunContextWarning 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.
daemon.startVelaLogin (cyclomatic 17) apps/web/src/providers/daemon.ts:1445— daemon.startVelaLogin 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.
ProjectDeleteConfirmDialog.ProjectDeleteConfirmDialog (cyclomatic 17) apps/web/src/components/project-actions/ProjectDeleteConfirmDialog.tsx:18— ProjectDeleteConfirmDialog.ProjectDeleteConfirmDialog 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.
exports.exportProjectImageDataUrl (cyclomatic 17) REDACTED:1161— exports.exportProjectImageDataUrl 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.
ProjectSearchModal.ProjectSearchModal (cyclomatic 17) apps/web/src/components/ProjectSearchModal.tsx:47— ProjectSearchModal.ProjectSearchModal has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 151, onInputKeyDown, a function literal at line 68, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
LibrarySection.LibraryCard (cyclomatic 17) apps/web/src/components/LibrarySection.tsx:360— LibrarySection.LibraryCard has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HomeHero.comparePluginPresetOrder (cyclomatic 17) apps/web/src/components/HomeHero.tsx:4225— HomeHero.comparePluginPresetOrder has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: HomeHero.pluginPresetArtifactLabel (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
OpenDesignTouchpointElement.mount (cyclomatic 17) apps/web/src/components/touchpoint-component.ts:334— OpenDesignTouchpointElement.mount has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
markdown.MarkdownCodeBlock (cyclomatic 17) REDACTED:420— markdown.MarkdownCodeBlock has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 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.
MemorySection.describeRecord (cyclomatic 17) apps/web/src/components/MemorySection.tsx:557— MemorySection.describeRecord has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 586, 572). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
NewProjectPanel.PlatformPicker (cyclomatic 17) apps/web/src/components/NewProjectPanel.tsx:1210— NewProjectPanel.PlatformPicker has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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.
OwnedContentUpdate.OwnedContentUpdate (cyclomatic 17) apps/web/src/components/OwnedContentUpdate.tsx:7— OwnedContentUpdate.OwnedContentUpdate has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatComposer.buildDesignToolboxResources (cyclomatic 17) apps/web/src/components/ChatComposer.tsx:5687— ChatComposer.buildDesignToolboxResources has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: ChatComposer.designToolboxActionPrompt (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
ChatPane.ChatRows::renderItem (cyclomatic 17) apps/web/src/components/ChatPane.tsx:5424— ChatPane.ChatRows::renderItem 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. This is NOT this file's highest cyclomatic complexity: ChatPane.hasVisibleBrandAssistantEvent (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
ChatPane.useMeasuredVirtualWindow (cyclomatic 17) apps/web/src/components/ChatPane.tsx:5749— ChatPane.useMeasuredVirtualWindow 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 6 function literals inside it that branch (lines 5842, 5787, 5794, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: ChatPane.hasVisibleBrandAssistantEvent (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
useFinalizeProject.useFinalizeProject.trigger (cyclomatic 17) apps/web/src/hooks/useFinalizeProject.ts:79— useFinalizeProject.useFinalizeProject.trigger 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.
ProjectView.createBufferedTextUpdates.flushPending (cyclomatic 17) apps/web/src/components/ProjectView.tsx:16115— ProjectView.createBufferedTextUpdates.flushPending 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ProjectView.isStoredWorkspaceContextItem (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
WorkspaceTabsBar.normalizeTabsState (cyclomatic 17) apps/web/src/components/WorkspaceTabsBar.tsx:371— WorkspaceTabsBar.normalizeTabsState has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DesignSystemAssetDropzone.DesignSystemAssetDropzone::renderLightbox (cyclomatic 17) apps/web/src/components/DesignSystemAssetDropzone.tsx:380— DesignSystemAssetDropzone.DesignSystemAssetDropzone::renderLightbox 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.
brand-capture.collectPalette (cyclomatic 17) clipper/brand-capture.js:313— brand-capture.collectPalette has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
animation-map.computeFlags (cyclomatic 17) design-templates/hyperframes/scripts/animation-map.mjs:287— animation-map.computeFlags has cyclomatic complexity 17 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
html-injection-points.observeSelectMode (cyclomatic 17) REDACTED:381— html-injection-points.observeSelectMode 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.
index.execute (cyclomatic 17) packages/dsh-runtime/src/index.ts:254— index.execute has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
client.normalizeSidecarLaunchResources (cyclomatic 17) packages/sidecar/src/client.ts:154— client.normalizeSidecarLaunchResources 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 is NOT this file's highest cyclomatic complexity: SidecarClient.#start (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
blob.materializeStandaloneBlob (cyclomatic 17) packages/standalone/src/blob.ts:163— blob.materializeStandaloneBlob has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
bootloader-handoff.createStandaloneGenerationBootloader (cyclomatic 17) packages/standalone/src/bootloader-handoff.ts:265— bootloader-handoff.createStandaloneGenerationBootloader 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 269, 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.
fossil.convergeTerminalSidecar (cyclomatic 17) shells/terminal/runtime/fossil.mjs:94— fossil.convergeTerminalSidecar 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.
render-previews.renderCatalogPreviews (cyclomatic 17) tools/release/src/catalog/render-previews.ts:474— render-previews.renderCatalogPreviews has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rollback-latest.planLatestRollback (cyclomatic 17) tools/release/src/storage/rollback-latest.ts:203— rollback-latest.planLatestRollback 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.
convergence.plan_command (cyclomatic 17) .github/scripts/convergence.py:1189— convergence.plan_command 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.
convergence.prepare_publication (cyclomatic 17) .github/scripts/convergence.py:1468— convergence.prepare_publication 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.
postinstall.consume_command (cyclomatic 17) .github/scripts/postinstall.py:118— postinstall.consume_command 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.
release.publish (cyclomatic 17) .github/scripts/release.py:93— release.publish 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.
extract_strip_frames.connected_components (cyclomatic 17) skills/hatch-pet/scripts/extract_strip_frames.py:102— extract_strip_frames.connected_components 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.
session-params.buildAcpSessionNewParams.mcpServers (cyclomatic 16) apps/daemon/src/agent-protocol/acp/session-params.ts:54— session-params.buildAcpSessionNewParams.mcpServers 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.
diagnostics-environment.diagnosticFailureCode (cyclomatic 16) REDACTED:61— diagnostics-environment.diagnosticFailureCode 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.
db.dropTrailingMessageAgentDeltas (cyclomatic 16) apps/daemon/src/db.ts:3706— db.dropTrailingMessageAgentDeltas 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.
db.normalizeBrowserWorkspaceTab (cyclomatic 16) apps/daemon/src/db.ts:5797— db.normalizeBrowserWorkspaceTab 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.
task-store.validateMappedFinalText (cyclomatic 16) apps/daemon/src/strategies/task-store.ts:1345— task-store.validateMappedFinalText 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.
byok-opencode.buildProviderEntry (cyclomatic 16) apps/daemon/src/runtimes/byok-opencode.ts:177— byok-opencode.buildProviderEntry 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.
json-event-stream.openCodeToolResult (cyclomatic 16) apps/daemon/src/runtimes/json-event-stream.ts:193— json-event-stream.openCodeToolResult 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: json-event-stream.normalizeTodoStatus (cyclomatic 20) 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.
normalize.toExecItem (cyclomatic 16) apps/daemon/src/agent-protocol/codex-app-server/normalize.ts:114— normalize.toExecItem has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: normalize.createCodexAppServerNormalizer.handleNotification (cyclomatic 20) 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.
McpObservabilitySession.resolveAttribution (cyclomatic 16) apps/daemon/src/mcp.ts:1238— McpObservabilitySession.resolveAttribution 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.
deliverable-syntax-safe-fix.proposeDeliverableSyntaxSafeFix (cyclomatic 16) apps/daemon/src/artifacts/deliverable-syntax-safe-fix.ts:341— deliverable-syntax-safe-fix.proposeDeliverableSyntaxSafeFix 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.
routines.validateSchedule (cyclomatic 16) apps/daemon/src/routines.ts:395— routines.validateSchedule 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.
workspace-resource-mutation.workspaceResourceMutationAllowed (cyclomatic 16) apps/daemon/src/collab/workspace-resource-mutation.ts:518— workspace-resource-mutation.workspaceResourceMutationAllowed 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.
index.isAllowedDesignSystemStaticFile (cyclomatic 16) REDACTED:1037— index.isAllowedDesignSystemStaticFile has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.createUserDesignSystem (cyclomatic 16) REDACTED:1282— index.createUserDesignSystem 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.
index.migrateLegacyDesignSystemPackage (cyclomatic 16) REDACTED:2046— index.migrateLegacyDesignSystemPackage has cyclomatic complexity 16 (threshold 15). Of this number, 8 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.
index.readUserMetadata (cyclomatic 16) REDACTED:2958— index.readUserMetadata 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.
video-cover.freezeVideoFirstFrame (cyclomatic 16) apps/daemon/src/chat-artifacts/video-cover.ts:150— video-cover.freezeVideoFirstFrame 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.
chat-prompt-inputs.formatDesignFilesWorkspaceHint (cyclomatic 16) apps/daemon/src/runtimes/chat-prompt-inputs.ts:878— chat-prompt-inputs.formatDesignFilesWorkspaceHint has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chat-run-messages.persistRunEventToAssistantMessage (cyclomatic 16) apps/daemon/src/runtimes/chat-run-messages.ts:240— chat-run-messages.persistRunEventToAssistantMessage 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.
chat-run-messages.unboundedPersistedAgentEvent (cyclomatic 16) apps/daemon/src/runtimes/chat-run-messages.ts:454— chat-run-messages.unboundedPersistedAgentEvent 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.
local-comment-files.createLocalCommentFiles.admit (cyclomatic 16) apps/daemon/src/collab/local-comment-files.ts:59— local-comment-files.createLocalCommentFiles.admit has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 65, 81). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
proactive-content-pull.createProactiveContentPull.requestCatchUp (cyclomatic 16) apps/daemon/src/collab/proactive-content-pull.ts:2238— proactive-content-pull.createProactiveContentPull.requestCatchUp 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.
plugin-asset-cache.expandIpv6 (cyclomatic 16) apps/daemon/src/plugins/plugin-asset-cache.ts:86— plugin-asset-cache.expandIpv6 has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 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.
installer.installFromArchiveUrl (cyclomatic 16) apps/daemon/src/plugins/installer.ts:522— installer.installFromArchiveUrl 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.
figma-extract.downloadAssets (cyclomatic 16) apps/daemon/src/plugins/atoms/figma-extract.ts:199— figma-extract.downloadAssets 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.
token-map.runTokenMap (cyclomatic 16) apps/daemon/src/plugins/atoms/token-map.ts:117— token-map.runTokenMap has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
versioning.comparePrerelease (cyclomatic 16) apps/daemon/src/registry/versioning.ts:159— versioning.comparePrerelease 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.
opencode-log.extractOpenCodeServiceFailure (cyclomatic 16) apps/daemon/src/runtimes/opencode-log.ts:131— opencode-log.extractOpenCodeServiceFailure 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.
opencode-event-plugin.applyOpenCodeEventPlugin (cyclomatic 16) apps/daemon/src/runtimes/opencode-event-plugin.ts:45— opencode-event-plugin.applyOpenCodeEventPlugin 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.
showcase.extractColors (cyclomatic 16) apps/daemon/src/design-systems/showcase.ts:660— showcase.extractColors has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (push, a function literal at line 679). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
runs.createChatRunService.emit (cyclomatic 16) apps/daemon/src/runtimes/runs.ts:1486— runs.createChatRunService.emit 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.
runs.createChatRunService.drop (cyclomatic 16) apps/daemon/src/runtimes/runs.ts:2572— runs.createChatRunService.drop 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.
codex-archived-rollout-index.findIndexedCodexArchivedRolloutPath (cyclomatic 16) apps/daemon/src/codex-archived-rollout-index.ts:18— codex-archived-rollout-index.findIndexedCodexArchivedRolloutPath 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.
project-amr-trace-env.openDesignAmrTraceEnvForRun (cyclomatic 16) apps/daemon/src/runtimes/project-amr-trace-env.ts:113— project-amr-trace-env.openDesignAmrTraceEnvForRun 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.
project-file-versions.renameProjectFileVersionStore (cyclomatic 16) apps/daemon/src/project-file-versions.ts:582— project-file-versions.renameProjectFileVersionStore has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 595). 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.
index.renderAIHubMixImage (cyclomatic 16) apps/daemon/src/media/index.ts:3230— index.renderAIHubMixImage has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: index.sniffImageExt (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.
orbit.normalizeSummaryStore (cyclomatic 16) apps/daemon/src/orbit.ts:222— orbit.normalizeSummaryStore 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.
comment-preparation.prepareCommentIdentity (cyclomatic 16) apps/daemon/src/services/comment-preparation.ts:133— comment-preparation.prepareCommentIdentity has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 146). 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.
tools-connectors-cli.decodeBinaryContentPayload (cyclomatic 16) apps/daemon/src/tools-connectors-cli.ts:459— tools-connectors-cli.decodeBinaryContentPayload 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.
tools-connectors-cli.runGithubDesignContext (cyclomatic 16) apps/daemon/src/tools-connectors-cli.ts:1620— tools-connectors-cli.runGithubDesignContext 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.
tools-connectors-cli.skillHasReusableSections (cyclomatic 16) apps/daemon/src/tools-connectors-cli.ts:2249— tools-connectors-cli.skillHasReusableSections 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.
vela.proxyVelaMessageCenterRequest (cyclomatic 16) REDACTED:391— vela.proxyVelaMessageCenterRequest has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
memory-connectors.collectOutputDigest (cyclomatic 16) apps/daemon/src/memory-connectors.ts:631— memory-connectors.collectOutputDigest 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.
memory-connectors.collectNotionPageCandidates (cyclomatic 16) apps/daemon/src/memory-connectors.ts:859— memory-connectors.collectNotionPageCandidates 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.
WorkspaceBillingRuntimeCoordinator.setClientInterests (cyclomatic 16) apps/daemon/src/collab/workspace-billing-runtime.ts:253— WorkspaceBillingRuntimeCoordinator.setClientInterests 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.
workspace-projects-reconciler.reconcileWorkspaceProjectsWithRemote (cyclomatic 16) apps/daemon/src/collab/workspace-projects-reconciler.ts:420— workspace-projects-reconciler.reconcileWorkspaceProjectsWithRemote has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
skill-installation.resolveGithubSkillTreeUrl (cyclomatic 16) apps/daemon/src/services/skill-installation.ts:80— skill-installation.resolveGithubSkillTreeUrl 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.
library.registerLibraryAsset (cyclomatic 16) apps/daemon/src/library.ts:324— library.registerLibraryAsset 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.
cli.surfaceFetchError (cyclomatic 16) apps/daemon/src/cli.ts:2455— cli.surfaceFetchError has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginYank (cyclomatic 16) apps/daemon/src/cli.ts:6039— cli.runPluginYank has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
cli.runPluginTrust (cyclomatic 16) apps/daemon/src/cli.ts:6208— cli.runPluginTrust 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. This is NOT this file's highest cyclomatic complexity: cli.runPlugin (cyclomatic 38) 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.
memory-sampler.startMemorySampler.sample (cyclomatic 16) apps/desktop/src/main/memory-sampler.ts:72— memory-sampler.startMemorySampler.sample 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.
store.isInstallResult (cyclomatic 16) apps/desktop/src/main/updater/store.ts:215— store.isInstallResult 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.
store.ensureOwnedUpdateRoot (cyclomatic 16) apps/desktop/src/main/updater/store.ts:228— store.ensureOwnedUpdateRoot 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.
updater.createDesktopUpdater.metric (cyclomatic 16) apps/desktop/src/main/updater.ts:462— updater.createDesktopUpdater.metric 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.
obsolete-installed-outer.retireObsoleteInstalledOuter (cyclomatic 16) apps/packaged/src/obsolete-installed-outer.ts:101— obsolete-installed-outer.retireObsoleteInstalledOuter 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.
iframe-error.isPreviewFrameVisible (cyclomatic 16) REDACTED:464— iframe-error.isPreviewFrameVisible 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.
exports.buildDesignManifestContent (cyclomatic 16) REDACTED:189— exports.buildDesignManifestContent has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LibraryPreviewModal.ElementPanel (cyclomatic 16) apps/web/src/components/LibraryPreviewModal.tsx:184— LibraryPreviewModal.ElementPanel has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlaceholderCarousel.PlaceholderCarousel (cyclomatic 16) apps/web/src/components/home-hero/PlaceholderCarousel.tsx:52— PlaceholderCarousel.PlaceholderCarousel has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 80, 92, 62). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PluginScenarioDetail.PluginScenarioDetail (cyclomatic 16) apps/web/src/components/plugin-details/PluginScenarioDetail.tsx:38— PluginScenarioDetail.PluginScenarioDetail has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConnectorsBrowser.loadConnectorAuthorizationPending (cyclomatic 16) apps/web/src/components/ConnectorsBrowser.tsx:72— ConnectorsBrowser.loadConnectorAuthorizationPending 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.
PluginsView.AvailablePluginsPanel (cyclomatic 16) REDACTED:3028— PluginsView.AvailablePluginsPanel has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MarketplaceView.MarketplaceView (cyclomatic 16) apps/web/src/components/MarketplaceView.tsx:28— MarketplaceView.MarketplaceView has cyclomatic complexity 16 (threshold 15). Of this number, 9 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.
PetOverlay.PetOverlay::onPointerMove (cyclomatic 16) apps/web/src/components/pet/PetOverlay.tsx:361— PetOverlay.PetOverlay::onPointerMove has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (PetOverlay.PetOverlay) 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.
question-form.parseDirectionCards (cyclomatic 16) apps/web/src/artifacts/question-form.ts:1119— question-form.parseDirectionCards 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.
in-project-link.resolveAgainstResolvedDir (cyclomatic 16) apps/web/src/runtime/in-project-link.ts:129— in-project-link.resolveAgainstResolvedDir 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.
PixelLiquid.PixelLiquid (cyclomatic 16) apps/web/src/components/PixelLiquid.tsx:29— PixelLiquid.PixelLiquid has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 32, 45, 67). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Orb.Orb (cyclomatic 16) apps/web/src/components/chat/primitives/Orb.tsx:61— Orb.Orb has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 64, 124, 90, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
build-turn-blocks.markerSearchViews (cyclomatic 16) apps/web/src/runtime/chat/build-turn-blocks.ts:161— build-turn-blocks.markerSearchViews has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (flush, a function literal at line 169, a function literal at line 186). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AssistantMessage.stripSystemReminders (cyclomatic 16) REDACTED:4158— AssistantMessage.stripSystemReminders has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChatPane.foldStrategyTaskTurns (cyclomatic 16) apps/web/src/components/ChatPane.tsx:1062— ChatPane.foldStrategyTaskTurns has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ChatPane.hasVisibleBrandAssistantEvent (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
DesignFilesPanel.DesignFilesPanel::handlePluginFolderAgentAction (cyclomatic 16) apps/web/src/components/DesignFilesPanel.tsx:1360— DesignFilesPanel.DesignFilesPanel::handlePluginFolderAgentAction has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (DesignFilesPanel.DesignFilesPanel) 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.
markdown-scroll-sync.measureEditorBlockOffsets (cyclomatic 16) apps/web/src/components/markdown-scroll-sync.ts:106— markdown-scroll-sync.measureEditorBlockOffsets has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
execution-policy.mediaExecutionPolicyForProjectMetadata (cyclomatic 16) apps/web/src/media/execution-policy.ts:8— execution-policy.mediaExecutionPolicyForProjectMetadata 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.
DesignSystemFlow.buildCreationAgentPrompt (cyclomatic 16) apps/web/src/components/DesignSystemFlow.tsx:5465— DesignSystemFlow.buildCreationAgentPrompt 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.
CollabDemoView.CollabDemoView (cyclomatic 16) apps/web/src/collab/CollabDemoView.tsx:51— CollabDemoView.CollabDemoView has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
REDACTED.wireForm (cyclomatic 16) design-templates/open-design-landing/example.html:3059— REDACTED.wireForm has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 3065, 3077, 3085, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
diff-cells.pair (cyclomatic 16) docs/design/chat-mirror/diff-cells.mjs:394— diff-cells.pair has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
media-stock.parseStockSearchRequest (cyclomatic 16) packages/contracts/src/api/media-stock.ts:74— media-stock.parseStockSearchRequest 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.
comment-target-title.resolveCommentTargetTitle (cyclomatic 16) packages/contracts/src/comment-target-title.ts:45— comment-target-title.resolveCommentTargetTitle 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.
comment-identity-selector.commentSelectorClaimsIdentity (cyclomatic 16) packages/contracts/src/runtime/comment-identity-selector.ts:4— comment-identity-selector.commentSelectorClaimsIdentity 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.
index.validateLauncherDesktopHandoffDescriptor (cyclomatic 16) packages/launcher-proto/src/index.ts:554— index.validateLauncherDesktopHandoffDescriptor 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.
index.selectLauncherRuntimeTarget (cyclomatic 16) packages/launcher-proto/src/index.ts:643— index.selectLauncherRuntimeTarget 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.
maintenance.withStandaloneMaintenanceLock (cyclomatic 16) packages/standalone/src/maintenance.ts:14— maintenance.withStandaloneMaintenanceLock 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.
garbage.liveStoreReferences (cyclomatic 16) packages/standalone/src/garbage.ts:17— garbage.liveStoreReferences has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StandaloneUpdater.prepareLatest (cyclomatic 16) REDACTED:96— StandaloneUpdater.prepareLatest 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.
sync-community-pets.parseArgs (cyclomatic 16) scripts/sync-community-pets.ts:62— sync-community-pets.parseArgs has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ToolPackCache.readHit (cyclomatic 16) tools/pack/src/cache/index.ts:356— ToolPackCache.readHit has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (materializeTarget, a function literal at line 411). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cache-lifecycle-snapshot.summarizeDescriptor (cyclomatic 16) tools/pack/src/updates/cache-lifecycle-snapshot.ts:45— cache-lifecycle-snapshot.summarizeDescriptor 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.
entry-assets.stageCatalogEntryAssets (cyclomatic 16) tools/release/src/catalog/entry-assets.ts:86— entry-assets.stageCatalogEntryAssets 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.
publish-metadata.uploadLatestMetadataWithCas (cyclomatic 16) tools/release/src/storage/publish-metadata.ts:199— publish-metadata.uploadLatestMetadataWithCas 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.
convergence.handoff_command (cyclomatic 16) .github/scripts/convergence.py:1425— convergence.handoff_command 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.
convergence.main (cyclomatic 16) .github/scripts/convergence.py:2212— convergence.main has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
stable-docker.image_identity (cyclomatic 16) .github/scripts/release/stable-docker.py:158— stable-docker.image_identity 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.
finalize_pet_run.main (cyclomatic 16) skills/hatch-pet/scripts/finalize_pet_run.py:220— finalize_pet_run.main has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
runWebStandaloneAfterPack (cyclomatic 16) tools/pack/resources/web-standalone-after-pack.cjs:959— runWebStandaloneAfterPack 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.
FixmeComment e2e/ui/workspace-multi-client-collab.test.ts:766— // FIXME: Restore this P0 case after workspace-context refreshes use semantic — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment apps/daemon/tests/routes/conversation-fork-title-numbering.test.ts:127— // 线上已经有一批叫「XXX 分叉」的会话,产品明确不迁移 —— 老名字整个当基名。 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
ProjectView.ProjectView (cognitive 2274) apps/web/src/components/ProjectView.tsx:2168— ProjectView.ProjectView has cognitive complexity 2274 (threshold 15). Drivers by points: if/else 778 (1164 pts), ternaries 341 (627 pts), boolean chains 392, loops 42 (60 pts), error handling 26 (31 pts) (nesting depth added 695). Of this number, 163 points are the body's own statements and 2111 belong to 361 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.
App.AppInner (cognitive 775) apps/web/src/App.tsx:982— App.AppInner has cognitive complexity 775 (threshold 15). Drivers by points: if/else 302 (357 pts), boolean chains 207, ternaries 131 (185 pts), error handling 15 (19 pts), loops 5 (7 pts) (nesting depth added 115). Of this number, 145 points are the body's own statements and 630 belong to 180 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.
FileViewer.HtmlViewer (cognitive 767) REDACTED:7238— FileViewer.HtmlViewer has cognitive complexity 767 (threshold 15). Drivers by points: if/else 869 (1091 pts), ternaries 496 (919 pts), boolean chains 628, error handling 33 (40 pts), loops 13 (17 pts) (nesting depth added 656). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (FileViewer.HtmlViewer::publishCurrentFilePublic, FileViewer.HtmlViewer::updateCurrentFilePublic, FileViewer.HtmlViewer::applyManualEdit, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ChatPane.ChatPane (cognitive 435) apps/web/src/components/ChatPane.tsx:1322— ChatPane.ChatPane has cognitive complexity 435 (threshold 15). Drivers by points: if/else 163 (203 pts), ternaries 75 (133 pts), boolean chains 88, loops 9, error handling 1, match/switch 1 (nesting depth added 98). Of this number, 137 points are the body's own statements and 298 belong to 100 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.
InlineModelSwitcher.InlineModelSwitcher (cognitive 390) apps/web/src/components/InlineModelSwitcher.tsx:177— InlineModelSwitcher.InlineModelSwitcher has cognitive complexity 390 (threshold 15). Drivers by points: ternaries 78 (222 pts), if/else 76 (114 pts), boolean chains 53, loops 1 (nesting depth added 182). Of this number, 182 points are the body's own statements and 208 belong to 47 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RecentProjectsStrip.RecentProjectsStrip (cognitive 363) apps/web/src/components/RecentProjectsStrip.tsx:360— RecentProjectsStrip.RecentProjectsStrip has cognitive complexity 363 (threshold 15). Drivers by points: ternaries 113 (200 pts), if/else 77 (95 pts), boolean chains 54, loops 8, error handling 5 (6 pts) (nesting depth added 106). Of this number, 90 points are the body's own statements and 273 belong to 62 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.
run-analytics-lifecycle.createRunAnalyticsLifecycle.install (cognitive 362) apps/daemon/src/services/run-analytics-lifecycle.ts:343— run-analytics-lifecycle.createRunAnalyticsLifecycle.install has cognitive complexity 362 (threshold 15). Drivers by points: ternaries 134 (295 pts), if/else 16 (29 pts), boolean chains 21, error handling 5 (13 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 184). Most of this is not in the body itself: 1 of the 362 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 349, 739, 811, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MemorySection.MemorySection (cognitive 361) apps/web/src/components/MemorySection.tsx:728— MemorySection.MemorySection has cognitive complexity 361 (threshold 15). Drivers by points: ternaries 95 (244 pts), if/else 61 (72 pts), boolean chains 36, error handling 5, loops 4 (nesting depth added 160). Of this number, 118 points are the body's own statements and 243 belong to 50 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
static-resource.registerStaticResourceRoutes (cognitive 329) REDACTED:116— static-resource.registerStaticResourceRoutes has cognitive complexity 329 (threshold 15). Drivers by points: if/else 117 (140 pts), ternaries 59 (88 pts), boolean chains 57, error handling 34 (39 pts), loops 4 (5 pts) (nesting depth added 58). None of this is in the body itself: all 329 points belong to 43 function items inside it that branch (a function literal at line 1098, a function literal at line 922, a function literal at line 1272, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
HomeHero.HomeHero (cognitive 311) apps/web/src/components/HomeHero.tsx:354— HomeHero.HomeHero has cognitive complexity 311 (threshold 15). Drivers by points: ternaries 92 (138 pts), if/else 81 (89 pts), boolean chains 77, loops 4 (7 pts) (nesting depth added 57). Of this number, 122 points are the body's own statements and 189 belong to 79 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.
collab-sync.registerCollabSyncRoutes (cognitive 309) REDACTED:758— collab-sync.registerCollabSyncRoutes has cognitive complexity 309 (threshold 15). Drivers by points: if/else 111 (151 pts), boolean chains 71, error handling 26 (46 pts), ternaries 26 (41 pts) (nesting depth added 75). None of this is in the body itself: all 309 points belong to 22 function literals inside it that branch (lines 1335, 1801, 2737, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
daemon.consumeDaemonPhysicalRun (cognitive 300) apps/web/src/providers/daemon.ts:1764— daemon.consumeDaemonPhysicalRun has cognitive complexity 300 (threshold 15). Drivers by points: if/else 77 (229 pts), ternaries 9 (29 pts), boolean chains 23, error handling 4 (13 pts), loops 3 (6 pts) (nesting depth added 184). Of this number, 280 points are the body's own statements and 20 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignsTab.DesignsTab (cognitive 288) apps/web/src/components/DesignsTab.tsx:129— DesignsTab.DesignsTab has cognitive complexity 288 (threshold 15). Drivers by points: ternaries 65 (172 pts), if/else 51 (74 pts), boolean chains 34, error handling 6 (7 pts), loops 1 (nesting depth added 131). Of this number, 50 points are the body's own statements and 238 belong to 44 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cli.runAutomation (cognitive 280) apps/daemon/src/cli.ts:12098— cli.runAutomation has cognitive complexity 280 (threshold 15). Drivers by points: if/else 76 (174 pts), error handling 21 (51 pts), ternaries 10 (26 pts), loops 8 (21 pts), boolean chains 7, match/switch 1 (nesting depth added 157). Of this number, 266 points are the body's own statements and 14 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.
session.attachAcpSession.parser (cognitive 267) apps/daemon/src/agent-protocol/acp/session.ts:1041— session.attachAcpSession.parser has cognitive complexity 267 (threshold 15). Drivers by points: if/else 70 (181 pts), boolean chains 43, ternaries 11 (43 pts) (nesting depth added 143). 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.
QuestionForm.QuestionFormView (cognitive 257) apps/web/src/components/QuestionForm.tsx:120— QuestionForm.QuestionFormView has cognitive complexity 257 (threshold 15). Drivers by points: ternaries 76 (152 pts), boolean chains 52, if/else 45 (52 pts), loops 1 (nesting depth added 83). Of this number, 98 points are the body's own statements and 159 belong to 34 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.
SettingsDialog.SettingsDialog (cognitive 253) apps/web/src/components/SettingsDialog.tsx:1502— SettingsDialog.SettingsDialog has cognitive complexity 253 (threshold 15). Drivers by points: ternaries 228 (636 pts), if/else 206 (304 pts), boolean chains 170, error handling 8 (10 pts), match/switch 3, loops 1 (nesting depth added 508). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 5 other methods here (SettingsDialog.SettingsDialog::handleTestAgent, SettingsDialog.SettingsDialog::handleTestProvider, SettingsDialog.SettingsDialog::handleFetchProviderModels, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DesignSystemFlow.DesignSystemDetailView (cognitive 250) apps/web/src/components/DesignSystemFlow.tsx:1633— DesignSystemFlow.DesignSystemDetailView has cognitive complexity 250 (threshold 15). Drivers by points: if/else 97 (114 pts), ternaries 55 (92 pts), boolean chains 38, error handling 5 (6 pts) (nesting depth added 55). Of this number, 48 points are the body's own statements and 202 belong to 51 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.
PreviewModal.PreviewModal (cognitive 233) apps/web/src/components/PreviewModal.tsx:243— PreviewModal.PreviewModal has cognitive complexity 233 (threshold 15). Drivers by points: ternaries 54 (144 pts), if/else 30 (56 pts), boolean chains 22, error handling 2 (8 pts), match/switch 1 (3 pts) (nesting depth added 124). Of this number, 121 points are the body's own statements and 112 belong to 31 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cli.runProject (cognitive 231) apps/daemon/src/cli.ts:7528— cli.runProject has cognitive complexity 231 (threshold 15). Drivers by points: if/else 77 (167 pts), ternaries 13 (33 pts), boolean chains 18, loops 3 (7 pts), error handling 2 (5 pts), match/switch 1 (nesting depth added 117). Of this number, 228 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AssistantMessage.AssistantMessageImpl (cognitive 226) REDACTED:403— AssistantMessage.AssistantMessageImpl has cognitive complexity 226 (threshold 15). Drivers by points: ternaries 68 (112 pts), boolean chains 79, if/else 20 (30 pts), loops 5 (nesting depth added 54). Of this number, 148 points are the body's own statements and 78 belong to 28 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.
ShareTab.ShareTab (cognitive 226) apps/web/src/components/share/ShareTab.tsx:115— ShareTab.ShareTab has cognitive complexity 226 (threshold 15). Drivers by points: ternaries 56 (162 pts), boolean chains 46, if/else 8 (18 pts) (nesting depth added 116). Of this number, 194 points are the body's own statements and 32 belong to 6 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DesignKitView.DesignKitViewInner (cognitive 209) apps/web/src/components/DesignKitView.tsx:313— DesignKitView.DesignKitViewInner has cognitive complexity 209 (threshold 15). Drivers by points: ternaries 131 (270 pts), boolean chains 79, if/else 67 (76 pts), error handling 5, loops 1 (nesting depth added 148). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DesignKitView.DesignKitViewInner::handleKitKeyDown) 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.
FileViewer.MarkdownViewer (cognitive 197) REDACTED:19911— FileViewer.MarkdownViewer has cognitive complexity 197 (threshold 15). Drivers by points: if/else 79 (94 pts), ternaries 43 (78 pts), boolean chains 24, error handling 1 (nesting depth added 50). Of this number, 55 points are the body's own statements and 142 belong to 36 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.
build-turn-blocks.buildTurnBlocks (cognitive 195) apps/web/src/runtime/chat/build-turn-blocks.ts:461— build-turn-blocks.buildTurnBlocks has cognitive complexity 195 (threshold 15). Drivers by points: if/else 122 (241 pts), boolean chains 45, ternaries 17 (29 pts), loops 17 (28 pts) (nesting depth added 142). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (build-turn-blocks.buildTurnBlocks::applyTodoList, build-turn-blocks.buildTurnBlocks::finishTurn) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AvatarMenu.AvatarMenu (cognitive 189) apps/web/src/components/AvatarMenu.tsx:94— AvatarMenu.AvatarMenu has cognitive complexity 189 (threshold 15). Drivers by points: ternaries 47 (132 pts), boolean chains 29, if/else 24 (28 pts) (nesting depth added 89). Of this number, 98 points are the body's own statements and 91 belong to 25 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
system.renderMetadataBlock (cognitive 179) REDACTED:1752— system.renderMetadataBlock has cognitive complexity 179 (threshold 15). Drivers by points: if/else 51 (79 pts), ternaries 23 (59 pts), boolean chains 33, loops 4 (8 pts) (nesting depth added 68). Of this number, 178 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.
collab-sync.registerCollabSyncRoutes.pullSharedProjectOnce (cognitive 177) REDACTED:1950— collab-sync.registerCollabSyncRoutes.pullSharedProjectOnce has cognitive complexity 177 (threshold 15). Drivers by points: if/else 37 (99 pts), error handling 11 (30 pts), ternaries 14 (26 pts), boolean chains 20, loops 1 (2 pts) (nesting depth added 94). Of this number, 160 points are the body's own statements and 17 belong to 4 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
collab-context.registerCollabContextRoutes (cognitive 175) REDACTED:330— collab-context.registerCollabContextRoutes has cognitive complexity 175 (threshold 15). Drivers by points: if/else 58 (80 pts), ternaries 35 (47 pts), boolean chains 38, error handling 8 (9 pts), loops 1 (nesting depth added 35). Most of this is not in the body itself: 2 of the 175 points are its own statements and the rest belongs to 24 function items inside it that branch (a function literal at line 902, a function literal at line 785, a function literal at line 598, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FileViewer.FileVersionManagerModal (cognitive 171) REDACTED:3470— FileViewer.FileVersionManagerModal has cognitive complexity 171 (threshold 15). Drivers by points: ternaries 43 (77 pts), if/else 63 (69 pts), boolean chains 23, error handling 1, loops 1 (nesting depth added 40). Of this number, 47 points are the body's own statements and 124 belong to 42 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.
run-failure-classification.classification (cognitive 169) apps/daemon/src/run-failure-classification.ts:897— run-failure-classification.classification has cognitive complexity 169 (threshold 15). Drivers by points: ternaries 33 (158 pts), boolean chains 11 (nesting depth added 125). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
hub-events-subscriber.startHubEventsSubscriber.consumeStream (cognitive 168) apps/daemon/src/collab/hub-events-subscriber.ts:418— hub-events-subscriber.startHubEventsSubscriber.consumeStream has cognitive complexity 168 (threshold 15). Drivers by points: if/else 34 (89 pts), ternaries 18 (57 pts), boolean chains 9, loops 4 (7 pts), error handling 3 (6 pts) (nesting depth added 100). Of this number, 145 points are the body's own statements and 23 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PetSettings.PetSettings (cognitive 163) apps/web/src/components/pet/PetSettings.tsx:54— PetSettings.PetSettings has cognitive complexity 163 (threshold 15). Drivers by points: ternaries 66 (115 pts), if/else 18 (24 pts), boolean chains 17, error handling 7 (nesting depth added 55). Of this number, 95 points are the body's own statements and 68 belong to 19 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runRun (cognitive 159) apps/daemon/src/cli.ts:8374— cli.runRun has cognitive complexity 159 (threshold 15). Drivers by points: if/else 55 (114 pts), ternaries 12 (23 pts), boolean chains 12, error handling 2 (5 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NewProjectPanel.NewProjectPanel (cognitive 158) apps/web/src/components/NewProjectPanel.tsx:276— NewProjectPanel.NewProjectPanel has cognitive complexity 158 (threshold 15). Drivers by points: ternaries 54 (67 pts), if/else 48 (56 pts), boolean chains 33, error handling 2 (nesting depth added 21). Of this number, 52 points are the body's own statements and 106 belong to 27 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.
FileWorkspace.FileWorkspace (cognitive 157) apps/web/src/components/FileWorkspace.tsx:1334— FileWorkspace.FileWorkspace has cognitive complexity 157 (threshold 15). Drivers by points: if/else 246 (305 pts), ternaries 167 (298 pts), boolean chains 140, loops 19 (23 pts), error handling 6 (7 pts) (nesting depth added 195). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (FileWorkspace.FileWorkspace::handleDeleteMany, FileWorkspace.FileWorkspace::runSketchSave) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
system.composeSystemPrompt (cognitive 155) REDACTED:899— system.composeSystemPrompt has cognitive complexity 155 (threshold 15). Drivers by points: if/else 49 (62 pts), ternaries 23 (48 pts), boolean chains 43, loops 1 (2 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryNavRail.EntryTopRightCluster (cognitive 151) apps/web/src/components/EntryNavRail.tsx:1076— EntryNavRail.EntryTopRightCluster has cognitive complexity 151 (threshold 15). Drivers by points: ternaries 42 (90 pts), if/else 23 (35 pts), boolean chains 26 (nesting depth added 60). Of this number, 110 points are the body's own statements and 41 belong to 23 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LibrarySection.LibrarySection (cognitive 150) apps/web/src/components/LibrarySection.tsx:499— LibrarySection.LibrarySection has cognitive complexity 150 (threshold 15). Drivers by points: if/else 64 (74 pts), ternaries 30 (48 pts), boolean chains 22, loops 4 (5 pts), error handling 1 (nesting depth added 29). Of this number, 43 points are the body's own statements and 107 belong to 43 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.
run-terminal-reconciliation.reconcileDurableRunTerminals (cognitive 148) apps/daemon/src/runtimes/run-terminal-reconciliation.ts:363— run-terminal-reconciliation.reconcileDurableRunTerminals has cognitive complexity 148 (threshold 15). Drivers by points: ternaries 19 (58 pts), if/else 20 (50 pts), error handling 8 (21 pts), boolean chains 13, loops 6 (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vela.proxyTouchpointRuntimeRequest (cognitive 148) REDACTED:588— vela.proxyTouchpointRuntimeRequest has cognitive complexity 148 (threshold 15). Drivers by points: if/else 72 (83 pts), boolean chains 42, ternaries 13 (15 pts), error handling 4 (7 pts), loops 1 (nesting depth added 16). Of this number, 43 points are the body's own statements and 105 belong to 20 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.
cli.runWorkspace (cognitive 147) apps/daemon/src/cli.ts:8072— cli.runWorkspace has cognitive complexity 147 (threshold 15). Drivers by points: if/else 39 (71 pts), ternaries 24 (41 pts), boolean chains 23, loops 5 (11 pts), match/switch 1 (nesting depth added 55). Of this number, 143 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.registerPluginRoutes (cognitive 146) REDACTED:397— index.registerPluginRoutes has cognitive complexity 146 (threshold 15). Drivers by points: if/else 67 (76 pts), boolean chains 29, ternaries 20 (22 pts), error handling 16 (19 pts) (nesting depth added 14). None of this is in the body itself: all 146 points belong to 28 function items inside it that branch (a function literal at line 702, a function literal at line 930, a function literal at line 574, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tools-connectors-cli.auditDesignSystemPackage (cognitive 142) apps/daemon/src/tools-connectors-cli.ts:1722— tools-connectors-cli.auditDesignSystemPackage has cognitive complexity 142 (threshold 15). Drivers by points: if/else 58 (90 pts), boolean chains 31, ternaries 9 (16 pts), loops 4 (5 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NextStepActions.NextStepActions (cognitive 140) apps/web/src/components/NextStepActions.tsx:333— NextStepActions.NextStepActions has cognitive complexity 140 (threshold 15). Drivers by points: ternaries 36 (65 pts), boolean chains 44, if/else 27 (31 pts) (nesting depth added 33). Of this number, 78 points are the body's own statements and 62 belong to 20 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.
chat-run-messages.unboundedAgentPayloadToPersistedAgentEvent (cognitive 136) apps/daemon/src/runtimes/chat-run-messages.ts:529— chat-run-messages.unboundedAgentPayloadToPersistedAgentEvent has cognitive complexity 136 (threshold 15). Drivers by points: ternaries 42 (87 pts), if/else 24 (27 pts), boolean chains 22 (nesting depth added 48). Of this number, 134 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.
index.generateMedia (cognitive 136) apps/daemon/src/media/index.ts:351— index.generateMedia has cognitive complexity 136 (threshold 15). Drivers by points: if/else 52 (59 pts), boolean chains 51, ternaries 14 (20 pts), error handling 3 (5 pts), loops 1 (nesting depth added 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
library.registerLibraryRoutes (cognitive 136) REDACTED:170— library.registerLibraryRoutes has cognitive complexity 136 (threshold 15). Drivers by points: if/else 61 (68 pts), ternaries 28 (36 pts), boolean chains 17, error handling 11 (14 pts), loops 1 (nesting depth added 18). None of this is in the body itself: all 136 points belong to 18 function items inside it that branch (a function literal at line 330, applyAssetToProject, a function literal at line 714, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
UpdateDialog.UpdateDialog (cognitive 136) apps/web/src/components/UpdateDialog.tsx:42— UpdateDialog.UpdateDialog has cognitive complexity 136 (threshold 15). Drivers by points: ternaries 35 (60 pts), if/else 50 (58 pts), boolean chains 18 (nesting depth added 33). Of this number, 25 points are the body's own statements and 111 belong to 18 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.
memory.registerMemoryRoutes (cognitive 135) REDACTED:109— memory.registerMemoryRoutes has cognitive complexity 135 (threshold 15). Drivers by points: ternaries 45 (54 pts), if/else 22 (34 pts), boolean chains 27, error handling 20 (nesting depth added 21). None of this is in the body itself: all 135 points belong to 22 function literals inside it that branch (lines 187, 433, 481, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
runtime-evidence-graph-v1.evaluateRuntimeEvidenceGraphV1 (cognitive 135) packages/contracts/src/observability/runtime-evidence-graph-v1.ts:74— runtime-evidence-graph-v1.evaluateRuntimeEvidenceGraphV1 has cognitive complexity 135 (threshold 15). Drivers by points: if/else 39 (79 pts), boolean chains 24, loops 13 (16 pts), ternaries 5 (16 pts) (nesting depth added 54). Of this number, 130 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
orchestrator.runOrchestrator (cognitive 131) apps/daemon/src/critique/orchestrator.ts:123— orchestrator.runOrchestrator has cognitive complexity 131 (threshold 15). Drivers by points: if/else 42 (79 pts), ternaries 10 (30 pts), boolean chains 12, error handling 3 (6 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 61). Of this number, 126 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.
brand-routes.registerBrandRoutes (cognitive 130) REDACTED:142— brand-routes.registerBrandRoutes has cognitive complexity 130 (threshold 15). Drivers by points: if/else 44 (53 pts), ternaries 40 (52 pts), boolean chains 15, error handling 10 (nesting depth added 21). None of this is in the body itself: all 130 points belong to 19 function items inside it that branch (a function literal at line 330, a function literal at line 669, a function literal at line 564, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SkillsSection.SkillsSection (cognitive 130) apps/web/src/components/SkillsSection.tsx:106— SkillsSection.SkillsSection has cognitive complexity 130 (threshold 15). Drivers by points: if/else 54 (64 pts), boolean chains 35, ternaries 18 (27 pts), loops 4 (nesting depth added 19). Of this number, 19 points are the body's own statements and 111 belong to 28 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.
run-failure-classification.classifyRunFailureBase (cognitive 129) apps/daemon/src/run-failure-classification.ts:1028— run-failure-classification.classifyRunFailureBase has cognitive complexity 129 (threshold 15). Drivers by points: ternaries 29 (61 pts), if/else 44 (46 pts), boolean chains 22 (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.
SettingsDialog.OrbitSection (cognitive 125) apps/web/src/components/SettingsDialog.tsx:6904— SettingsDialog.OrbitSection has cognitive complexity 125 (threshold 15). Drivers by points: ternaries 57 (85 pts), boolean chains 21, if/else 15 (16 pts), error handling 3 (nesting depth added 29). Of this number, 96 points are the body's own statements and 29 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.
run-analytics-observability.scanRunEventsForUsageAnalytics (cognitive 124) apps/daemon/src/run-analytics-observability.ts:701— run-analytics-observability.scanRunEventsForUsageAnalytics has cognitive complexity 124 (threshold 15). Drivers by points: if/else 16 (50 pts), ternaries 27 (42 pts), boolean chains 30, loops 2 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runLibrary (cognitive 123) apps/daemon/src/cli.ts:10071— cli.runLibrary has cognitive complexity 123 (threshold 15). Drivers by points: if/else 41 (90 pts), ternaries 7 (18 pts), boolean chains 5, error handling 3 (5 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runFiles (cognitive 121) apps/daemon/src/cli.ts:8951— cli.runFiles has cognitive complexity 121 (threshold 15). Drivers by points: if/else 39 (77 pts), ternaries 9 (21 pts), boolean chains 16, loops 2 (4 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent 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-analytics-observability.summarizeRunTimingAnalytics (cognitive 116) apps/daemon/src/run-analytics-observability.ts:1162— run-analytics-observability.summarizeRunTimingAnalytics has cognitive complexity 116 (threshold 15). Drivers by points: if/else 54 (91 pts), boolean chains 20, ternaries 1 (3 pts), loops 2 (nesting depth added 39). Of this number, 114 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
v1.drain (cognitive 116) apps/daemon/src/critique/parsers/v1.ts:109— v1.drain has cognitive complexity 116 (threshold 15). Drivers by points: if/else 37 (101 pts), boolean chains 8, ternaries 2 (6 pts), loops 1 (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-llm.pickProvider (cognitive 115) apps/daemon/src/memory-llm.ts:434— memory-llm.pickProvider has cognitive complexity 115 (threshold 15). Drivers by points: if/else 23 (46 pts), boolean chains 32, ternaries 10 (27 pts), error handling 4 (10 pts) (nesting depth added 46). 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.
ProductionCampaignModal.ProductionCampaignModal (cognitive 113) apps/web/src/components/ProductionCampaignModal.tsx:263— ProductionCampaignModal.ProductionCampaignModal has cognitive complexity 113 (threshold 15). Drivers by points: if/else 48 (56 pts), boolean chains 39, ternaries 12 (17 pts), error handling 1 (nesting depth added 13). Of this number, 22 points are the body's own statements and 91 belong to 24 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.
HandoffButton.HandoffButton (cognitive 112) apps/web/src/components/HandoffButton.tsx:335— HandoffButton.HandoffButton has cognitive complexity 112 (threshold 15). Drivers by points: ternaries 35 (82 pts), if/else 20 (22 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 51). Of this number, 52 points are the body's own statements and 60 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.
codex-child-evidence.parseRolloutStructure (cognitive 111) apps/daemon/src/runtimes/codex-child-evidence.ts:258— codex-child-evidence.parseRolloutStructure has cognitive complexity 111 (threshold 15). Drivers by points: if/else 27 (62 pts), ternaries 13 (34 pts), boolean chains 11, error handling 1 (2 pts), loops 2 (nesting depth added 57). Of this number, 110 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.
touchpoint-content-cache.createTouchpointContentCache (cognitive 111) apps/daemon/src/routes/touchpoint-content-cache.ts:273— touchpoint-content-cache.createTouchpointContentCache has cognitive complexity 111 (threshold 15). Drivers by points: if/else 145 (225 pts), boolean chains 50, loops 30 (36 pts), error handling 18 (24 pts), ternaries 14 (nesting depth added 92). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 4 other methods here (touchpoint-content-cache.createTouchpointContentCache::fenceActive, touchpoint-content-cache.createTouchpointContentCache::sweepExpired, touchpoint-content-cache.createTouchpointContentCache::retryRefusals, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
langfuse-bridge.buildSafeRunQualityProjectionFromDaemon (cognitive 109) apps/daemon/src/langfuse-bridge.ts:1322— langfuse-bridge.buildSafeRunQualityProjectionFromDaemon has cognitive complexity 109 (threshold 15). Drivers by points: ternaries 54 (87 pts), if/else 9 (12 pts), boolean chains 8, error handling 1 (2 pts) (nesting depth added 37). Of this number, 108 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-diagnostics.toolExecutionLifecycleAnalytics (cognitive 106) apps/daemon/src/run-diagnostics.ts:274— run-diagnostics.toolExecutionLifecycleAnalytics has cognitive complexity 106 (threshold 15). Drivers by points: if/else 26 (71 pts), ternaries 8 (19 pts), boolean chains 12, loops 2 (4 pts) (nesting depth added 58). Of this number, 96 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.
codex-child-evidence.collectCodexChildEvidence.collectChildren (cognitive 106) apps/daemon/src/runtimes/codex-child-evidence.ts:908— codex-child-evidence.collectCodexChildEvidence.collectChildren has cognitive complexity 106 (threshold 15). Drivers by points: ternaries 15 (54 pts), if/else 17 (38 pts), loops 6 (11 pts), boolean chains 3 (nesting depth added 65). Of this number, 101 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runMarketplace (cognitive 105) apps/daemon/src/cli.ts:3601— cli.runMarketplace has cognitive complexity 105 (threshold 15). Drivers by points: if/else 26 (51 pts), ternaries 11 (29 pts), loops 8 (20 pts), boolean chains 4, match/switch 1 (nesting depth added 55). Of this number, 104 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.
PluginMetaSections.PluginMetaSections (cognitive 105) apps/web/src/components/plugin-details/PluginMetaSections.tsx:89— PluginMetaSections.PluginMetaSections has cognitive complexity 105 (threshold 15). Drivers by points: ternaries 49 (80 pts), boolean chains 22, if/else 2, error handling 1 (nesting depth added 31). Of this number, 67 points are the body's own statements and 38 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.
touchpoint-lifecycle.useTouchpointLifecycle (cognitive 104) apps/web/src/components/touchpoint-lifecycle.ts:424— touchpoint-lifecycle.useTouchpointLifecycle has cognitive complexity 104 (threshold 15). Drivers by points: if/else 44 (60 pts), boolean chains 34, ternaries 8 (9 pts), error handling 1 (nesting depth added 17). Most of this is not in the body itself: 6 of the 104 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 660, 574, 823, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EntryShell.OnboardingView (cognitive 104) apps/web/src/components/EntryShell.tsx:2291— EntryShell.OnboardingView has cognitive complexity 104 (threshold 15). Drivers by points: if/else 118 (175 pts), ternaries 61 (113 pts), boolean chains 91, error handling 6, loops 1 (nesting depth added 109). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (EntryShell.OnboardingView::handleAmrSignInToContinue, EntryShell.OnboardingView::handleCancelAmrLogin, EntryShell.OnboardingView::pollAmrLoginCompletion) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ComposerPlusMenu.ComposerPlusMenu (cognitive 103) apps/web/src/components/ComposerPlusMenu.tsx:322— ComposerPlusMenu.ComposerPlusMenu has cognitive complexity 103 (threshold 15). Drivers by points: ternaries 35 (70 pts), if/else 18 (19 pts), boolean chains 14 (nesting depth added 36). Of this number, 66 points are the body's own statements and 37 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.
runtime.createDesktopRuntime (cognitive 102) REDACTED:2022— runtime.createDesktopRuntime has cognitive complexity 102 (threshold 15). Drivers by points: if/else 56 (58 pts), ternaries 19 (26 pts), boolean chains 13, error handling 4, loops 1 (nesting depth added 9). Most of this is not in the body itself: 4 of the 102 points are its own statements and the rest belongs to 26 function literals inside it that branch (lines 2389, 2517, 2121, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BoardComposerPopover.BoardComposerPopover (cognitive 101) apps/web/src/components/BoardComposerPopover.tsx:417— BoardComposerPopover.BoardComposerPopover has cognitive complexity 101 (threshold 15). Drivers by points: ternaries 28 (53 pts), if/else 16 (25 pts), boolean chains 23 (nesting depth added 34). Of this number, 67 points are the body's own statements and 34 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileViewer.CommentSidePanel (cognitive 101) REDACTED:4762— FileViewer.CommentSidePanel has cognitive complexity 101 (threshold 15). Drivers by points: ternaries 29 (57 pts), boolean chains 22, if/else 19 (22 pts) (nesting depth added 31). Of this number, 32 points are the body's own statements and 69 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
json-event-stream.handleCodexEvent (cognitive 97) apps/daemon/src/runtimes/json-event-stream.ts:1161— json-event-stream.handleCodexEvent has cognitive complexity 97 (threshold 15). Drivers by points: if/else 35 (64 pts), boolean chains 15, ternaries 5 (15 pts), loops 1 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude-child-evidence.createClaudeChildEvidenceCollector.observe (cognitive 97) apps/daemon/src/runtimes/claude-child-evidence.ts:676— claude-child-evidence.createClaudeChildEvidenceCollector.observe has cognitive complexity 97 (threshold 15). Drivers by points: if/else 18 (34 pts), ternaries 9 (31 pts), boolean chains 17, loops 6 (15 pts) (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
proactive-content-pull.createProactiveContentPull.runCatchUpSweep (cognitive 96) apps/daemon/src/collab/proactive-content-pull.ts:1529— proactive-content-pull.createProactiveContentPull.runCatchUpSweep has cognitive complexity 96 (threshold 15). Drivers by points: if/else 33 (63 pts), boolean chains 16, ternaries 7 (8 pts), error handling 3 (6 pts), loops 3 (nesting depth added 34). Of this number, 93 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
langfuse-bridge.buildTraceSafeManifests (cognitive 96) apps/daemon/src/langfuse-bridge.ts:1102— langfuse-bridge.buildTraceSafeManifests has cognitive complexity 96 (threshold 15). Drivers by points: ternaries 22 (65 pts), if/else 9 (19 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
design-systems.registerDesignSystemRoutes (cognitive 96) REDACTED:200— design-systems.registerDesignSystemRoutes has cognitive complexity 96 (threshold 15). Drivers by points: if/else 46 (51 pts), error handling 22 (23 pts), ternaries 10 (11 pts), boolean chains 10, loops 1 (nesting depth added 7). None of this is in the body itself: all 96 points belong to 20 function literals inside it that branch (lines 995, 916, 559, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
assets.registerPluginAssetRoutes::servePluginSandboxedHtml (cognitive 96) REDACTED:128— assets.registerPluginAssetRoutes::servePluginSandboxedHtml has cognitive complexity 96 (threshold 15). Drivers by points: ternaries 10 (45 pts), if/else 15 (28 pts), boolean chains 12, error handling 4 (10 pts), loops 1 (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FileViewer.ReactComponentViewer (cognitive 96) REDACTED:6739— FileViewer.ReactComponentViewer has cognitive complexity 96 (threshold 15). Drivers by points: ternaries 23 (51 pts), if/else 18 (29 pts), boolean chains 15, error handling 1 (nesting depth added 39). Of this number, 34 points are the body's own statements and 62 belong to 18 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.
cli.runPluginEvents (cognitive 95) apps/daemon/src/cli.ts:4470— cli.runPluginEvents has cognitive complexity 95 (threshold 15). Drivers by points: if/else 26 (43 pts), ternaries 13 (22 pts), boolean chains 10, error handling 3 (10 pts), loops 5 (10 pts) (nesting depth added 38). Of this number, 80 points are the body's own statements and 15 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build-turn-blocks.readImageCall (cognitive 95) apps/web/src/runtime/chat/build-turn-blocks.ts:1957— build-turn-blocks.readImageCall has cognitive complexity 95 (threshold 15). Drivers by points: if/else 27 (63 pts), boolean chains 14, loops 4 (10 pts), ternaries 3 (5 pts), error handling 1 (3 pts) (nesting depth added 46). Of this number, 87 points are the body's own statements and 8 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.
db.mergeSyncedPreviewComment (cognitive 94) apps/daemon/src/db.ts:4539— db.mergeSyncedPreviewComment has cognitive complexity 94 (threshold 15). Drivers by points: ternaries 44 (66 pts), boolean chains 14, if/else 8 (14 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmrLoginPill.AmrLoginPill (cognitive 93) apps/web/src/components/AmrLoginPill.tsx:283— AmrLoginPill.AmrLoginPill has cognitive complexity 93 (threshold 15). Drivers by points: if/else 39 (55 pts), ternaries 14 (26 pts), boolean chains 12 (nesting depth added 28). Of this number, 18 points are the body's own statements and 75 belong to 13 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.
html-injection-points.skipForeignContent (cognitive 93) REDACTED:556— html-injection-points.skipForeignContent has cognitive complexity 93 (threshold 15). Drivers by points: if/else 20 (50 pts), ternaries 5 (22 pts), boolean chains 14, loops 3 (7 pts) (nesting depth added 51). 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.
app-config.applyConfigValue (cognitive 92) apps/daemon/src/app-config.ts:540— app-config.applyConfigValue has cognitive complexity 92 (threshold 15). Drivers by points: if/else 51 (78 pts), boolean chains 11, loops 1 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileViewer.LiveArtifactViewer (cognitive 92) REDACTED:2093— FileViewer.LiveArtifactViewer has cognitive complexity 92 (threshold 15). Drivers by points: if/else 32 (44 pts), ternaries 28 (41 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 25). Of this number, 35 points are the body's own statements and 57 belong to 23 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
json-line-stream.classifyJsonCandidate (cognitive 90) apps/daemon/src/agent-protocol/core/json-line-stream.ts:139— json-line-stream.classifyJsonCandidate has cognitive complexity 90 (threshold 15). Drivers by points: if/else 55 (126 pts), loops 6 (9 pts), boolean chains 8, ternaries 1 (nesting depth added 74). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (json-line-stream.classifyJsonCandidate::parseNumber, json-line-stream.classifyJsonCandidate::parseValue) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
langfuse-trace.buildTracePayload (cognitive 90) apps/daemon/src/langfuse-trace.ts:1897— langfuse-trace.buildTracePayload has cognitive complexity 90 (threshold 15). Drivers by points: ternaries 48 (67 pts), boolean chains 11, if/else 7, loops 3 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude-stream.createClaudeStreamHandler.handleObject (cognitive 89) apps/daemon/src/runtimes/claude-stream.ts:717— claude-stream.createClaudeStreamHandler.handleObject has cognitive complexity 89 (threshold 15). Drivers by points: if/else 25 (49 pts), boolean chains 19, ternaries 7 (17 pts), loops 2 (4 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TasksView.TasksView (cognitive 88) apps/web/src/components/TasksView.tsx:398— TasksView.TasksView has cognitive complexity 88 (threshold 15). Drivers by points: ternaries 32 (49 pts), if/else 20 (21 pts), boolean chains 11, error handling 6, loops 1 (nesting depth added 18). Most of this is not in the body itself: 14 of the 88 points are its own statements and the rest belongs to 18 function items inside it that branch (crystallizeRun, a function literal at line 475, a function literal at line 761, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
vela.registerVelaRoutes (cognitive 87) REDACTED:1070— vela.registerVelaRoutes has cognitive complexity 87 (threshold 15). Drivers by points: if/else 36 (46 pts), boolean chains 19, error handling 11 (12 pts), ternaries 6 (10 pts) (nesting depth added 15). Most of this is not in the body itself: 2 of the 87 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 1204, a function literal at line 1420, a function literal at line 1504, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
routes.registerConnectorRoutes (cognitive 86) REDACTED:554— routes.registerConnectorRoutes has cognitive complexity 86 (threshold 15). Drivers by points: ternaries 26 (35 pts), if/else 25, error handling 14, boolean chains 12 (nesting depth added 9). None of this is in the body itself: all 86 points belong to 14 function literals inside it that branch (lines 755, 619, 683, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
StandaloneBundler.bundleDocument (cognitive 85) REDACTED:151— StandaloneBundler.bundleDocument has cognitive complexity 85 (threshold 15). Drivers by points: if/else 29 (62 pts), loops 10 (13 pts), boolean chains 5, ternaries 2 (5 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-capture.isolateLayeredPptxBackground (cognitive 85) apps/desktop/src/main/deck-capture.ts:975— deck-capture.isolateLayeredPptxBackground has cognitive complexity 85 (threshold 15). Drivers by points: if/else 23 (44 pts), boolean chains 18, loops 12 (16 pts), ternaries 6 (7 pts) (nesting depth added 26). Of this number, 83 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.
daemon.translateAgentEvent (cognitive 84) apps/web/src/providers/daemon.ts:2524— daemon.translateAgentEvent has cognitive complexity 84 (threshold 15). Drivers by points: ternaries 17 (37 pts), if/else 22 (24 pts), boolean chains 23 (nesting depth added 22). Of this number, 82 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.
DesignSystemsSection.DesignSystemsSection (cognitive 84) apps/web/src/components/DesignSystemsSection.tsx:45— DesignSystemsSection.DesignSystemsSection has cognitive complexity 84 (threshold 15). Drivers by points: ternaries 34 (48 pts), if/else 22 (24 pts), boolean chains 11, loops 1 (nesting depth added 16). Of this number, 34 points are the body's own statements and 50 belong to 18 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.
byok-tools.executeAIHubMixGenerateVideo (cognitive 83) apps/daemon/src/byok-tools.ts:1423— byok-tools.executeAIHubMixGenerateVideo has cognitive complexity 83 (threshold 15). Drivers by points: if/else 20 (30 pts), ternaries 14 (24 pts), boolean chains 18, error handling 6 (10 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
import-export-routes.registerImportRoutes (cognitive 83) REDACTED:64— import-export-routes.registerImportRoutes has cognitive complexity 83 (threshold 15). Drivers by points: if/else 37 (43 pts), boolean chains 18, ternaries 12 (14 pts), error handling 8 (nesting depth added 8). None of this is in the body itself: all 83 points belong to 8 function items inside it that branch (a function literal at line 205, a function literal at line 367, a function literal at line 118, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
REDACTED.bindChartInteractions (cognitive 83) design-templates/social-media-matrix-tracker-template/assets/template.html:863— REDACTED.bindChartInteractions has cognitive complexity 83 (threshold 15). Drivers by points: if/else 43 (55 pts), boolean chains 15, ternaries 10 (13 pts) (nesting depth added 15). Most of this is not in the body itself: 6 of the 83 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 996, 1027, 1058, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
REDACTED.bindChartInteractions (cognitive 83) design-templates/social-media-matrix-tracker-template/example.html:863— REDACTED.bindChartInteractions has cognitive complexity 83 (threshold 15). Drivers by points: if/else 43 (55 pts), boolean chains 15, ternaries 10 (13 pts) (nesting depth added 15). Most of this is not in the body itself: 6 of the 83 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 996, 1027, 1058, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
mcp-routes.registerMcpRoutes (cognitive 82) apps/daemon/src/mcp-routes.ts:18— mcp-routes.registerMcpRoutes has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 20 (31 pts), if/else 26 (27 pts), boolean chains 15, error handling 9 (nesting depth added 12). Most of this is not in the body itself: 1 of the 82 points is its own statement and the rest belongs to 13 function items inside it that branch (a function literal at line 290, a function literal at line 230, a function literal at line 360, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
trace-object-manifest.collectSources (cognitive 81) apps/daemon/src/trace-object-manifest.ts:429— trace-object-manifest.collectSources has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 12 (39 pts), boolean chains 18, if/else 9 (16 pts), error handling 3 (6 pts), loops 2 (nesting depth added 37). Of this number, 80 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, 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.
langfuse-bridge.collectAgentEvents (cognitive 81) apps/daemon/src/langfuse-bridge.ts:716— langfuse-bridge.collectAgentEvents has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 14 (36 pts), if/else 15 (31 pts), boolean chains 11, loops 2 (3 pts) (nesting depth added 39). Of this number, 80 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignSystemPicker.DesignSystemPicker (cognitive 80) apps/web/src/components/DesignSystemPicker.tsx:75— DesignSystemPicker.DesignSystemPicker has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 27 (48 pts), if/else 24 (26 pts), boolean chains 5, loops 1 (nesting depth added 23). Of this number, 57 points are the body's own statements and 23 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginLoopHome.PluginLoopHome (cognitive 80) apps/web/src/components/PluginLoopHome.tsx:107— PluginLoopHome.PluginLoopHome has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 24 (63 pts), if/else 8 (9 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 40). Most of this is not in the body itself: 12 of the 80 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 310, usePlugin, a function literal at line 134, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cli.runComment (cognitive 79) apps/daemon/src/cli.ts:500— cli.runComment has cognitive complexity 79 (threshold 15). Drivers by points: if/else 26 (39 pts), boolean chains 13, error handling 7 (12 pts), ternaries 6 (11 pts), loops 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
skills.listSkills (cognitive 78) apps/daemon/src/skills.ts:232— skills.listSkills has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 16 (44 pts), if/else 7 (19 pts), loops 3 (6 pts), error handling 2 (5 pts), boolean chains 4 (nesting depth added 46). Of this number, 76 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.
events.mapPiRpcEvent (cognitive 78) apps/daemon/src/agent-protocol/pi-rpc/events.ts:25— events.mapPiRpcEvent has cognitive complexity 78 (threshold 15). Drivers by points: if/else 26 (47 pts), ternaries 8 (22 pts), boolean chains 9 (nesting depth added 35). Of this number, 75 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
proactive-content-pull.createProactiveContentPull.attemptIntent (cognitive 78) apps/daemon/src/collab/proactive-content-pull.ts:1036— proactive-content-pull.createProactiveContentPull.attemptIntent has cognitive complexity 78 (threshold 15). Drivers by points: if/else 27 (49 pts), boolean chains 13, error handling 4 (8 pts), ternaries 4 (8 pts) (nesting depth added 30). Of this number, 77 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.
memory-connectors.readConnectorMemoryContext (cognitive 78) apps/daemon/src/memory-connectors.ts:1096— memory-connectors.readConnectorMemoryContext has cognitive complexity 78 (threshold 15). Drivers by points: if/else 14 (43 pts), ternaries 5 (18 pts), loops 4 (8 pts), boolean chains 5, error handling 1 (4 pts) (nesting depth added 49). Of this number, 77 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.
useWorkspaceContext.useWorkspaceBillingResponse (cognitive 78) apps/web/src/collab/useWorkspaceContext.ts:1246— useWorkspaceContext.useWorkspaceBillingResponse has cognitive complexity 78 (threshold 15). Drivers by points: if/else 32 (39 pts), boolean chains 19, ternaries 16 (17 pts), error handling 2 (3 pts) (nesting depth added 9). Most of this is not in the body itself: 13 of the 78 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 1319, 1335, 1445, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
check-whats-new-document.checkWhatsNewDocument (cognitive 78) scripts/check-whats-new-document.ts:53— check-whats-new-document.checkWhatsNewDocument has cognitive complexity 78 (threshold 15). Drivers by points: if/else 18 (50 pts), loops 6 (19 pts), boolean chains 4, ternaries 2 (3 pts), error handling 2 (nesting depth added 46). 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.
lint-artifact.lintArtifact (cognitive 77) apps/daemon/src/lint-artifact.ts:120— lint-artifact.lintArtifact has cognitive complexity 77 (threshold 15). Drivers by points: if/else 31 (55 pts), loops 9 (13 pts), boolean chains 9 (nesting depth added 28). Of this number, 66 points are the body's own statements and 11 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageCenter.MessageCenter (cognitive 77) apps/web/src/components/MessageCenter.tsx:66— MessageCenter.MessageCenter has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 20 (42 pts), if/else 24 (27 pts), boolean chains 8 (nesting depth added 25). Of this number, 39 points are the body's own statements and 38 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginCard.PluginCard (cognitive 77) apps/web/src/components/plugins-home/PluginCard.tsx:61— PluginCard.PluginCard has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 42 (68 pts), boolean chains 7, if/else 2 (nesting depth added 26). Of this number, 75 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.
DesignFilesPanel.DesignFilesPanel (cognitive 77) apps/web/src/components/DesignFilesPanel.tsx:485— DesignFilesPanel.DesignFilesPanel has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 102 (182 pts), if/else 72 (90 pts), boolean chains 35, loops 9 (10 pts), error handling 5 (6 pts) (nesting depth added 100). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (DesignFilesPanel.DesignFilesPanel::renderFileRow, DesignFilesPanel.DesignFilesPanel::renderPageCard, DesignFilesPanel.DesignFilesPanel::renderEmptyState) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
cli.runCollab (cognitive 76) apps/daemon/src/cli.ts:1483— cli.runCollab has cognitive complexity 76 (threshold 15). Drivers by points: if/else 19 (33 pts), ternaries 12 (25 pts), boolean chains 8, loops 2 (5 pts), error handling 3 (4 pts), match/switch 1 (nesting depth added 31). Of this number, 48 points are the body's own statements and 28 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryNavRail.EntryNavRail (cognitive 76) apps/web/src/components/EntryNavRail.tsx:2095— EntryNavRail.EntryNavRail has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 23 (41 pts), if/else 18 (23 pts), boolean chains 10, error handling 2 (nesting depth added 23). Of this number, 38 points are the body's own statements and 38 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsDialog.MediaProvidersSection (cognitive 76) apps/web/src/components/SettingsDialog.tsx:7723— SettingsDialog.MediaProvidersSection has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 26 (46 pts), if/else 16 (18 pts), boolean chains 11, loops 1 (nesting depth added 22). Of this number, 45 points are the body's own statements and 31 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryShell.EntryShell (cognitive 76) apps/web/src/components/EntryShell.tsx:633— EntryShell.EntryShell has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 70 (90 pts), if/else 60 (81 pts), boolean chains 62, loops 3 (6 pts), error handling 3 (4 pts) (nesting depth added 45). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: 3 other methods here (EntryShell.EntryShell::handleOpenAllProjects, EntryShell.EntryShell::handlePluginLoopSubmit, EntryShell.EntryShell::pluginLoopCreateInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileWorkspace.DesignSystemProjectPanel (cognitive 76) apps/web/src/components/FileWorkspace.tsx:4817— FileWorkspace.DesignSystemProjectPanel has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 65 (94 pts), if/else 38 (41 pts), boolean chains 32, error handling 9, loops 1 (nesting depth added 32). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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. This shape REPEATS in the file: one other method here (FileWorkspace.DesignSystemProjectPanel::_renderReviewCard) 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.
brand-capture.renderHtml (cognitive 76) clipper/brand-capture.js:974— brand-capture.renderHtml has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 32 (41 pts), boolean chains 35 (nesting depth added 9). Of this number, 59 points are the body's own statements and 17 belong to 9 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.
claude-stream.createClaudeStreamHandler.handleStreamEvent (cognitive 75) apps/daemon/src/runtimes/claude-stream.ts:977— claude-stream.createClaudeStreamHandler.handleStreamEvent has cognitive complexity 75 (threshold 15). Drivers by points: if/else 22 (51 pts), boolean chains 13, ternaries 4 (8 pts), error handling 1 (3 pts) (nesting depth added 35). 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.
proactive-content-pull.createProactiveContentPull.processContentChanged (cognitive 74) apps/daemon/src/collab/proactive-content-pull.ts:1350— proactive-content-pull.createProactiveContentPull.processContentChanged has cognitive complexity 74 (threshold 15). Drivers by points: if/else 30 (53 pts), boolean chains 9, ternaries 7 (9 pts), error handling 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schema.validateSource (cognitive 74) apps/daemon/src/live-artifacts/schema.ts:560— schema.validateSource has cognitive complexity 74 (threshold 15). Drivers by points: if/else 28 (64 pts), boolean chains 7, ternaries 1 (3 pts) (nesting depth added 38). Of this number, 53 points are the body's own statements and 21 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.
AssistantMessage.FormBlock (cognitive 74) REDACTED:3150— AssistantMessage.FormBlock has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 22 (38 pts), if/else 20 (23 pts), boolean chains 12, error handling 1 (nesting depth added 19). Of this number, 20 points are the body's own statements and 54 belong to 14 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.
stock-telemetry.parseStockJournal (cognitive 73) apps/daemon/src/media/stock-telemetry.ts:213— stock-telemetry.parseStockJournal has cognitive complexity 73 (threshold 15). Drivers by points: boolean chains 31, if/else 16 (29 pts), loops 4 (6 pts), ternaries 2 (4 pts), error handling 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.
NewProjectPanel.DesignSystemPicker (cognitive 73) apps/web/src/components/NewProjectPanel.tsx:2136— NewProjectPanel.DesignSystemPicker has cognitive complexity 73 (threshold 15). Drivers by points: ternaries 21 (33 pts), if/else 23 (25 pts), boolean chains 14, loops 1 (nesting depth added 14). Of this number, 33 points are the body's own statements and 40 belong to 15 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.
markdown.parseBlocks (cognitive 72) REDACTED:140— markdown.parseBlocks has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (49 pts), loops 7 (18 pts), boolean chains 5 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bake-plugin-previews.bakeOne (cognitive 72) scripts/bake-plugin-previews.mjs:483— bake-plugin-previews.bakeOne has cognitive complexity 72 (threshold 15). Drivers by points: if/else 26 (37 pts), boolean chains 11, error handling 7 (9 pts), ternaries 7 (9 pts), loops 4 (6 pts) (nesting depth added 17). Of this number, 47 points are the body's own statements and 25 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime-child-observations.adaptMainRunToolObservationsV1 (cognitive 71) apps/daemon/src/observability/runtime-child-observations.ts:56— runtime-child-observations.adaptMainRunToolObservationsV1 has cognitive complexity 71 (threshold 15). Drivers by points: if/else 13 (36 pts), ternaries 12 (23 pts), boolean chains 11, loops 1 (nesting depth added 34). Of this number, 58 points are the body's own statements and 13 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.startServer (cognitive 71) REDACTED:3194— server.startServer has cognitive complexity 71 (threshold 15). Drivers by points: if/else 837 (1203 pts), ternaries 438 (684 pts), boolean chains 557, error handling 100 (166 pts), loops 33 (63 pts), match/switch 1 (nesting depth added 708). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 8 other methods here (server.startServer::collectBundledScenarios, server.startServer::composeDaemonSystemPrompt, server.startServer::startChatRun, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
SettingsDialog.ConnectorSection (cognitive 71) apps/web/src/components/SettingsDialog.tsx:6367— SettingsDialog.ConnectorSection has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 26 (42 pts), if/else 15 (17 pts), boolean chains 10, error handling 2 (nesting depth added 18). Of this number, 50 points are the body's own statements and 21 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.
conversations.registerProjectConversationRoutes::mergeMessageWriteForDaemonBacked (cognitive 70) REDACTED:446— conversations.registerProjectConversationRoutes::mergeMessageWriteForDaemonBacked has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 17 (31 pts), boolean chains 27, if/else 9 (12 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thread-cleanup.cleanupClosedCodexThread (cognitive 69) apps/daemon/src/agent-protocol/codex-app-server/thread-cleanup.ts:42— thread-cleanup.cleanupClosedCodexThread has cognitive complexity 69 (threshold 15). Drivers by points: if/else 35 (47 pts), boolean chains 11, error handling 6 (8 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 15). Most of this is not in the body itself: 1 of the 69 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 197, 125, 82, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-observation-rollout.createTaskObservationRolloutService.finalizeTask (cognitive 69) apps/daemon/src/observability/task-observation-rollout.ts:1138— task-observation-rollout.createTaskObservationRolloutService.finalizeTask has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 10 (29 pts), if/else 21 (26 pts), error handling 3 (7 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useProjectWorkspaceScope.useProjectWorkspaceScope (cognitive 68) apps/web/src/collab/useProjectWorkspaceScope.ts:387— useProjectWorkspaceScope.useProjectWorkspaceScope has cognitive complexity 68 (threshold 15). Drivers by points: if/else 21 (25 pts), ternaries 15 (23 pts), boolean chains 19, error handling 1 (nesting depth added 12). Of this number, 17 points are the body's own statements and 51 belong to 12 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.
ChatComposer.ChatComposer (cognitive 68) apps/web/src/components/ChatComposer.tsx:593— ChatComposer.ChatComposer has cognitive complexity 68 (threshold 15). Drivers by points: if/else 210 (262 pts), ternaries 123 (157 pts), boolean chains 95, error handling 10 (14 pts), loops 9 (10 pts) (nesting depth added 91). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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. This shape REPEATS in the file: 4 other methods here (ChatComposer.ChatComposer::tryHandlePetSlash, ChatComposer.ChatComposer::addAssetsFromLibrary, ChatComposer.ChatComposer::handlePopoverKey, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileWorkspace.PageCreatorDialog (cognitive 68) apps/web/src/components/FileWorkspace.tsx:8136— FileWorkspace.PageCreatorDialog has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 20 (29 pts), if/else 19 (26 pts), boolean chains 9, loops 3 (4 pts) (nesting depth added 17). Of this number, 21 points are the body's own statements and 47 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.
db.migrate (cognitive 67) apps/daemon/src/db.ts:105— db.migrate has cognitive complexity 67 (threshold 15). Drivers by points: if/else 58, boolean chains 9. 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.
deliverable-syntax-safe-fix.scanJavaScript (cognitive 67) apps/daemon/src/artifacts/deliverable-syntax-safe-fix.ts:122— deliverable-syntax-safe-fix.scanJavaScript has cognitive complexity 67 (threshold 15). Drivers by points: if/else 22 (54 pts), boolean chains 12, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prefetch.harvestFromHtml (cognitive 67) REDACTED:823— prefetch.harvestFromHtml has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 7 (12 pts), boolean chains 8, error handling 4 (8 pts), ternaries 8 (nesting depth added 23). Of this number, 65 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.
resolve.resolveContext (cognitive 67) packages/plugin-runtime/src/resolve.ts:61— resolve.resolveContext has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (44 pts), loops 8 (15 pts), ternaries 3 (7 pts), boolean chains 1 (nesting depth added 39). Of this number, 66 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
builder.runElectronBuilder (cognitive 67) tools/pack/src/win/builder.ts:500— builder.runElectronBuilder has cognitive complexity 67 (threshold 15). Drivers by points: if/else 20 (42 pts), ternaries 11 (16 pts), boolean chains 7, error handling 2 (nesting depth added 27). Of this number, 46 points are the body's own statements and 21 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignBrowserPanel.DesignBrowserPanel (cognitive 66) REDACTED:912— DesignBrowserPanel.DesignBrowserPanel has cognitive complexity 66 (threshold 15). Drivers by points: if/else 128 (146 pts), ternaries 90 (122 pts), boolean chains 93, error handling 20 (22 pts), loops 2 (nesting depth added 52). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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. This shape REPEATS in the file: one other method here (DesignBrowserPanel.DesignBrowserPanel::savePageSnapshot) 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.
json-event-stream.handleAntigravityEvent (cognitive 65) apps/daemon/src/runtimes/json-event-stream.ts:435— json-event-stream.handleAntigravityEvent has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (34 pts), ternaries 10 (27 pts), boolean chains 4 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
mcp.getArtifact (cognitive 65) apps/daemon/src/mcp.ts:3262— mcp.getArtifact has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 11, error handling 4 (9 pts), loops 4 (8 pts), ternaries 5 (6 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
live-artifact.registerLiveArtifactRoutes (cognitive 65) REDACTED:13— live-artifact.registerLiveArtifactRoutes has cognitive complexity 65 (threshold 15). Drivers by points: if/else 31, ternaries 12 (15 pts), error handling 13, boolean chains 6 (nesting depth added 3). None of this is in the body itself: all 65 points belong to 11 function literals inside it that branch (lines 53, 227, 193, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
validate.validateRecord (cognitive 65) tools/release/src/catalog/validate.ts:23— validate.validateRecord has cognitive complexity 65 (threshold 15). Drivers by points: if/else 33 (53 pts), boolean chains 11, ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowContract.__init__ (cognitive 65) .github/scripts/convergence.py:134— WorkflowContract.__init__ has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (49 pts), loops 6 (11 pts), boolean chains 5 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginVerify (cognitive 64) apps/daemon/src/cli.ts:4679— cli.runPluginVerify has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 17 (32 pts), if/else 14 (21 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 25). Of this number, 63 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useProjectCollab.useProjectCollab (cognitive 64) apps/web/src/collab/useProjectCollab.ts:328— useProjectCollab.useProjectCollab has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 37, if/else 14, ternaries 10 (12 pts), error handling 1 (nesting depth added 2). Of this number, 51 points are the body's own statements and 13 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.
ExamplesTab.ExamplesTab (cognitive 64) apps/web/src/components/ExamplesTab.tsx:123— ExamplesTab.ExamplesTab has cognitive complexity 64 (threshold 15). Drivers by points: if/else 27 (39 pts), ternaries 10 (12 pts), boolean chains 7, loops 6 (nesting depth added 14). Most of this is not in the body itself: 5 of the 64 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 273, 172, 326, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
db.upsertMessage (cognitive 63) apps/daemon/src/db.ts:3210— db.upsertMessage has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 29 (57 pts), boolean chains 4, if/else 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runTemplates (cognitive 63) apps/daemon/src/cli.ts:9389— cli.runTemplates has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (38 pts), ternaries 5 (11 pts), error handling 4 (7 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 30). Of this number, 49 points are the body's own statements and 14 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.
useWorkspaceContext.useWorkspaceContext (cognitive 63) apps/web/src/collab/useWorkspaceContext.ts:651— useWorkspaceContext.useWorkspaceContext has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (25 pts), ternaries 17 (22 pts), boolean chains 15, error handling 1 (nesting depth added 8). None of this is in the body itself: all 63 points belong to 14 function literals inside it that branch (lines 707, 775, 947, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RailRecentRow.RailRecentRow (cognitive 63) apps/web/src/components/entry-nav-rail/RailRecentRow.tsx:136— RailRecentRow.RailRecentRow has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 16 (33 pts), if/else 15 (17 pts), boolean chains 13 (nesting depth added 19). Of this number, 43 points are the body's own statements and 20 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HoverTouchpointOverlay.HoverTouchpointOverlay (cognitive 63) apps/web/src/components/HoverTouchpointOverlay.tsx:142— HoverTouchpointOverlay.HoverTouchpointOverlay has cognitive complexity 63 (threshold 15). Drivers by points: if/else 35 (36 pts), boolean chains 17, ternaries 6 (8 pts), error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 63 points are its own statements and the rest belongs to 25 function items inside it that branch (a function literal at line 272, a function literal at line 202, a function literal at line 233, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-diagnostics.summarizeRunDiagnosticsForAnalytics (cognitive 62) apps/daemon/src/run-diagnostics.ts:605— run-diagnostics.summarizeRunDiagnosticsForAnalytics has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 8, ternaries 2 (5 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
genui.registerGenuiRoutes (cognitive 62) REDACTED:30— genui.registerGenuiRoutes has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (24 pts), ternaries 14 (18 pts), boolean chains 10, error handling 9 (10 pts) (nesting depth added 7). None of this is in the body itself: all 62 points belong to 9 function items inside it that branch (a function literal at line 72, a function literal at line 153, a function literal at line 189, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ConnectorsBrowser.ConnectorDetailDrawer (cognitive 62) apps/web/src/components/ConnectorsBrowser.tsx:1290— ConnectorsBrowser.ConnectorDetailDrawer has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 24 (46 pts), boolean chains 13, if/else 3 (nesting depth added 22). Of this number, 54 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryShell.OnboardingDropdown (cognitive 62) apps/web/src/components/EntryShell.tsx:4547— EntryShell.OnboardingDropdown has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 24 (35 pts), boolean chains 14, if/else 10 (13 pts) (nesting depth added 14). Of this number, 28 points are the body's own statements and 34 belong to 11 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.
service.assertJsonSchemaMatches (cognitive 61) apps/daemon/src/connectors/service.ts:304— service.assertJsonSchemaMatches has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 10, ternaries 4 (9 pts), loops 3 (7 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-cloud-service.createCollabCloudService.flushOutboxIdentityBatch (cognitive 61) apps/daemon/src/collab/collab-cloud-service.ts:909— collab-cloud-service.createCollabCloudService.flushOutboxIdentityBatch has cognitive complexity 61 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 12, loops 7 (12 pts), ternaries 2 (3 pts), error handling 2 (nesting depth added 18). Of this number, 58 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-cloud-service.createCollabCloudService.pollProjectRound (cognitive 61) apps/daemon/src/collab/collab-cloud-service.ts:1425— collab-cloud-service.createCollabCloudService.pollProjectRound has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (47 pts), boolean chains 6, ternaries 3 (5 pts), error handling 1 (2 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-protocol-context.chatProtocolSkipRanges (cognitive 61) packages/contracts/src/artifacts/chat-protocol-context.ts:79— chat-protocol-context.chatProtocolSkipRanges has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 7 (17 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandaloneBundler.rewriteJavaScript::visit (cognitive 60) REDACTED:578— StandaloneBundler.rewriteJavaScript::visit has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
langfuse-trace.buildSafeRunQualityProjectionV1 (cognitive 60) apps/daemon/src/langfuse-trace.ts:1749— langfuse-trace.buildSafeRunQualityProjectionV1 has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 32 (52 pts), boolean chains 8 (nesting depth added 20). Of this number, 37 points are the body's own statements and 23 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.
runs.summarizeModelStepEvents (cognitive 60) apps/daemon/src/runtimes/runs.ts:154— runs.summarizeModelStepEvents has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (36 pts), ternaries 7 (12 pts), boolean chains 10, loops 2 (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.
xai.registerXaiRoutes (cognitive 60) apps/daemon/src/routes/xai.ts:54— xai.registerXaiRoutes has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25, ternaries 10 (17 pts), boolean chains 9, error handling 9 (nesting depth added 7). None of this is in the body itself: all 60 points belong to 8 function items inside it that branch (a function literal at line 253, a function literal at line 150, handleCallback, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cli.collectDistillAnnotations (cognitive 60) apps/daemon/src/cli.ts:11689— cli.collectDistillAnnotations has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 9 (30 pts), if/else 8 (16 pts), loops 2 (6 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemoryModelInline.MemoryModelInline (cognitive 60) apps/web/src/components/MemoryModelInline.tsx:189— MemoryModelInline.MemoryModelInline has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (25 pts), ternaries 14 (22 pts), boolean chains 13 (nesting depth added 12). Of this number, 22 points are the body's own statements and 38 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.
reconnect-state.nextChatReconnectView (cognitive 60) apps/web/src/runtime/chat/reconnect-state.ts:207— reconnect-state.nextChatReconnectView has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 11, ternaries 4 (11 pts), match/switch 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runs.summarizeAssistantMessageEvents (cognitive 59) apps/daemon/src/runtimes/runs.ts:254— runs.summarizeAssistantMessageEvents has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (43 pts), boolean chains 10, ternaries 3 (4 pts), loops 2 (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.
langfuse-bridge.projectDeliverableSyntaxTelemetry (cognitive 59) apps/daemon/src/langfuse-bridge.ts:319— langfuse-bridge.projectDeliverableSyntaxTelemetry has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 29 (36 pts), boolean chains 22, if/else 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PluginsView.ExtensionsMarketplace (cognitive 59) REDACTED:1034— PluginsView.ExtensionsMarketplace has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 117 (279 pts), if/else 77 (99 pts), boolean chains 71, error handling 5, loops 2 (3 pts) (nesting depth added 185). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (PluginsView.ExtensionsMarketplace::shareResource, PluginsView.ExtensionsMarketplace::unshareResource) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
codex-child-evidence.resolveRolloutPath (cognitive 58) apps/daemon/src/runtimes/codex-child-evidence.ts:442— codex-child-evidence.resolveRolloutPath has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 4 (10 pts), boolean chains 9, ternaries 5 (6 pts) (nesting depth added 23). Of this number, 54 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deploy.registerDeployRoutes (cognitive 58) REDACTED:11— deploy.registerDeployRoutes has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 13 (20 pts), boolean chains 17, if/else 14 (15 pts), error handling 6 (nesting depth added 8). None of this is in the body itself: all 58 points belong to 7 function items inside it that branch (a function literal at line 99, a function literal at line 228, 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.
DesignSystemsTab.DesignSystemDetail (cognitive 58) apps/web/src/components/DesignSystemsTab.tsx:1476— DesignSystemsTab.DesignSystemDetail has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 24 (33 pts), boolean chains 18, if/else 6, error handling 1 (nesting depth added 9). Of this number, 44 points are the body's own statements and 14 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PluginsView.PluginsView (cognitive 58) REDACTED:241— PluginsView.PluginsView has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 19 (24 pts), if/else 16 (21 pts), boolean chains 11, error handling 2 (nesting depth added 10). Of this number, 26 points are the body's own statements and 32 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, 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.
ToolRow.ToolRow (cognitive 58) apps/web/src/components/chat/primitives/ToolRow.tsx:79— ToolRow.ToolRow has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 24 (39 pts), boolean chains 12, if/else 7 (nesting depth added 15). Of this number, 53 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.
AssistantMessage.AssistantFooter (cognitive 58) REDACTED:2180— AssistantMessage.AssistantFooter has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 21 (46 pts), boolean chains 10, if/else 2 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SketchEditor.SketchEditor (cognitive 58) apps/web/src/components/SketchEditor.tsx:90— SketchEditor.SketchEditor has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 20 (30 pts), if/else 18 (20 pts), boolean chains 7, error handling 1 (nesting depth added 12). Most of this is not in the body itself: 12 of the 58 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 379, 342, 298, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.runPluginSnapshots (cognitive 57) apps/daemon/src/cli.ts:3833— cli.runPluginSnapshots has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (35 pts), ternaries 8 (18 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenUISurfaceRenderer.readObjectSchemaFields (cognitive 57) apps/web/src/components/GenUISurfaceRenderer.tsx:574— GenUISurfaceRenderer.readObjectSchemaFields has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 13 (33 pts), if/else 9 (16 pts), boolean chains 7, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
html-injection-points.scanTag (cognitive 57) REDACTED:108— html-injection-points.scanTag has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 5 (12 pts), boolean chains 7 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
system.composeSystemPrompt (cognitive 57) REDACTED:286— system.composeSystemPrompt has cognitive complexity 57 (threshold 15). Drivers by points: if/else 25 (29 pts), boolean chains 21, ternaries 3 (5 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
shared-lifecycle.reduceSharedLifecycleState (cognitive 57) packages/standalone/src/shared-lifecycle.ts:146— shared-lifecycle.reduceSharedLifecycleState has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 11, ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
manifest.validateArtifactManifestInput (cognitive 56) apps/daemon/src/artifacts/manifest.ts:86— manifest.validateArtifactManifestInput has cognitive complexity 56 (threshold 15). Drivers by points: if/else 32 (49 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
comment-file-deletion.createCommentFileDeletion (cognitive 56) apps/daemon/src/collab/comment-file-deletion.ts:28— comment-file-deletion.createCommentFileDeletion has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 17, loops 6 (7 pts), ternaries 2, error handling 1 (nesting depth added 11). None of this is in the body itself: all 56 points belong to 7 function literals inside it that branch (lines 36, 73, 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.
tools-connectors-cli.parseOptions (cognitive 56) apps/daemon/src/tools-connectors-cli.ts:181— tools-connectors-cli.parseOptions has cognitive complexity 56 (threshold 15). Drivers by points: if/else 25 (46 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runAmr (cognitive 56) apps/daemon/src/cli.ts:1291— cli.runAmr has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (40 pts), ternaries 4 (8 pts), boolean chains 7, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runProjectShare (cognitive 56) apps/daemon/src/cli.ts:7428— cli.runProjectShare has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 13 (18 pts), boolean chains 11, loops 2 (4 pts), error handling 2 (nesting depth added 13). Of this number, 54 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.
cli.runMemoryRule (cognitive 56) apps/daemon/src/cli.ts:11561— cli.runMemoryRule has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (38 pts), error handling 3 (6 pts), boolean chains 4, loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-scroll-freeze.onStructureMutations (cognitive 56) apps/web/src/observability/chat-scroll-freeze.ts:1037— chat-scroll-freeze.onStructureMutations has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (29 pts), ternaries 5 (17 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
question-form.completeTopLevelString (cognitive 56) apps/web/src/artifacts/question-form.ts:844— question-form.completeTopLevelString has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 4 (13 pts), error handling 1 (6 pts), boolean chains 5 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-cloud.memberCommentProblem (cognitive 55) apps/daemon/src/integrations/collab-cloud.ts:217— collab-cloud.memberCommentProblem has cognitive complexity 55 (threshold 15). Drivers by points: if/else 25 (29 pts), boolean chains 25, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
prompt-telemetry.summarizeMetadataValue (cognitive 55) apps/daemon/src/prompt-telemetry.ts:292— prompt-telemetry.summarizeMetadataValue has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 8 (28 pts), if/else 9 (22 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 34). 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.
runtime.createCollabRuntime (cognitive 55) apps/daemon/src/collab/runtime.ts:220— runtime.createCollabRuntime has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (32 pts), ternaries 8 (12 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 19). Of this number, 24 points are the body's own statements and 31 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.
handoff.registerHandoffRoutes (cognitive 55) apps/daemon/src/routes/handoff.ts:30— handoff.registerHandoffRoutes has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 11, ternaries 4 (11 pts), error handling 1 (nesting depth added 19). None of this is in the body itself: all 55 points belong to 2 function literals inside it that branch (lines 45, 112). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.runMemory (cognitive 55) apps/daemon/src/cli.ts:11360— cli.runMemory has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (45 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatComposer.MentionPopover (cognitive 55) apps/web/src/components/ChatComposer.tsx:6520— ChatComposer.MentionPopover has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 18 (28 pts), boolean chains 26, if/else 1 (nesting depth added 10). Of this number, 28 points are the body's own statements and 27 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileViewer.stripInspectOverridesAndIndex (cognitive 55) REDACTED:5955— FileViewer.stripInspectOverridesAndIndex has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 4 (12 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 28). Of this number, 54 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp.mcpFailureFacts (cognitive 54) apps/daemon/src/mcp.ts:1507— mcp.mcpFailureFacts has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 18 (50 pts), boolean chains 3, if/else 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
runs.createChatRunService.stream (cognitive 54) apps/daemon/src/runtimes/runs.ts:1932— runs.createChatRunService.stream has cognitive complexity 54 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 10, loops 3, ternaries 2 (3 pts), error handling 1 (nesting depth added 11). Most of this is not in the body itself: 10 of the 54 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 2010, completeReplay, deliver, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
runs.createChatRunService.terminateProcessTree (cognitive 54) apps/daemon/src/runtimes/runs.ts:2228— runs.createChatRunService.terminateProcessTree has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 13, ternaries 5 (7 pts) (nesting depth added 14). Most of this is not in the body itself: 3 of the 54 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 2248, a function literal at line 2353, a function literal at line 2312, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
index.renderGrokVideo (cognitive 54) apps/daemon/src/media/index.ts:2367— index.renderGrokVideo has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 17, ternaries 3 (9 pts), error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
telemetry.registerTelemetryRoutes (cognitive 54) REDACTED:150— telemetry.registerTelemetryRoutes has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 16 (22 pts), boolean chains 14, if/else 14, error handling 4 (nesting depth added 6). Most of this is not in the body itself: 2 of the 54 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 293, 224, 160, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.runExport (cognitive 54) apps/daemon/src/cli.ts:814— cli.runExport has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 9 (23 pts), if/else 11 (13 pts), boolean chains 12, error handling 4 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.pollUntilDoneOrBudget (cognitive 54) apps/daemon/src/cli.ts:2343— cli.pollUntilDoneOrBudget has cognitive complexity 54 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 11, ternaries 7 (11 pts), loops 3 (7 pts), error handling 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
json-event-stream.handleGeminiEvent (cognitive 53) apps/daemon/src/runtimes/json-event-stream.ts:307— json-event-stream.handleGeminiEvent has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (31 pts), ternaries 7 (14 pts), boolean chains 8 (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.
deliverable-syntax-finalization.finalizeCandidate (cognitive 53) apps/daemon/src/artifacts/deliverable-syntax-finalization.ts:55— deliverable-syntax-finalization.finalizeCandidate has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (32 pts), ternaries 8 (17 pts), boolean chains 3, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-presence.registerCollabPresenceRoutes (cognitive 53) apps/daemon/src/routes/collab-presence.ts:703— collab-presence.registerCollabPresenceRoutes has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 11, error handling 5 (9 pts), ternaries 5 (nesting depth added 10). None of this is in the body itself: all 53 points belong to 4 function literals inside it that branch (lines 830, 931, 775, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LibraryUploadModal.LibraryUploadModal (cognitive 53) apps/web/src/components/LibraryUploadModal.tsx:48— LibraryUploadModal.LibraryUploadModal has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 13 (28 pts), if/else 13 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 21). Most of this is not in the body itself: 9 of the 53 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 104, a function literal at line 227, a function literal at line 58, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
session.attachPiRpcSession (cognitive 52) apps/daemon/src/agent-protocol/pi-rpc/session.ts:183— session.attachPiRpcSession has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 5 (14 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 27). Of this number, 49 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cli.resolvePluginGithubTarget (cognitive 52) apps/daemon/src/cli.ts:5843— cli.resolvePluginGithubTarget has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 16, ternaries 8 (15 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.
TooltipLayer.TooltipLayer (cognitive 52) apps/web/src/components/TooltipLayer.tsx:141— TooltipLayer.TooltipLayer has cognitive complexity 52 (threshold 15). Drivers by points: if/else 33 (35 pts), boolean chains 10, ternaries 6, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 52 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 225, 201, 148, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
javascript-image-references.javascriptImageReferences (cognitive 51) apps/daemon/src/artifacts/javascript-image-references.ts:18— javascript-image-references.javascriptImageReferences has cognitive complexity 51 (threshold 15). Drivers by points: if/else 7 (23 pts), boolean chains 11, ternaries 3 (9 pts), loops 3 (7 pts), error handling 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
finalize-design.extractDesignMd (cognitive 51) apps/daemon/src/design/finalize-design.ts:712— finalize-design.extractDesignMd has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 4 (9 pts), boolean chains 6 (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.
updater.createDesktopUpdater.checkForCandidate (cognitive 51) apps/desktop/src/main/updater.ts:787— updater.createDesktopUpdater.checkForCandidate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 9 (13 pts), boolean chains 10, loops 1 (2 pts), error handling 1 (nesting depth added 12). Of this number, 45 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updater.createDesktopUpdater.downloadUpdate (cognitive 51) apps/desktop/src/main/updater.ts:932— updater.createDesktopUpdater.downloadUpdate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (21 pts), ternaries 8 (17 pts), boolean chains 10, error handling 3 (nesting depth added 12). Of this number, 50 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeHero.FooterSelectOption (cognitive 51) apps/web/src/components/HomeHero.tsx:3221— HomeHero.FooterSelectOption has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 18 (39 pts), if/else 7 (8 pts), boolean chains 3, loops 1 (nesting depth added 22). Most of this is not in the body itself: 12 of the 51 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 3343, 3254, 3269, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProductionCampaignBadge.ProductionCampaignBadge (cognitive 51) apps/web/src/components/ProductionCampaignBadge.tsx:56— ProductionCampaignBadge.ProductionCampaignBadge has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (28 pts), boolean chains 13, ternaries 6 (9 pts), error handling 1 (nesting depth added 8). Most of this is not in the body itself: 6 of the 51 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 146, 71, 103, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
run-failure-evidence.admissionPhase (cognitive 50) apps/daemon/src/services/run-failure-evidence.ts:23— run-failure-evidence.admissionPhase has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 12, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-observation-rollout.taskAggregate (cognitive 50) apps/daemon/src/observability/task-observation-rollout.ts:489— task-observation-rollout.taskAggregate has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 23 (28 pts), if/else 10 (14 pts), boolean chains 8 (nesting depth added 9). Most of this is not in the body itself: 14 of the 50 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 502, 651, 675, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.renderOpenRouterVideo (cognitive 50) apps/daemon/src/media/index.ts:2005— index.renderOpenRouterVideo has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 16, ternaries 6 (9 pts), error handling 2 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
import-export-routes.registerFinalizeRoutes (cognitive 50) REDACTED:2014— import-export-routes.registerFinalizeRoutes has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 12, ternaries 4 (9 pts), error handling 1 (nesting depth added 13). None of this is in the body itself: all 50 points belong to 2 function literals inside it that branch (lines 2028, 2106). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
router.parseRoute (cognitive 50) apps/web/src/router.ts:76— router.parseRoute has cognitive complexity 50 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 12, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
router.buildPath (cognitive 50) apps/web/src/router.ts:178— router.buildPath has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (38 pts), ternaries 6 (12 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XaiOAuthControl.XaiOAuthControl (cognitive 50) apps/web/src/components/XaiOAuthControl.tsx:130— XaiOAuthControl.XaiOAuthControl has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 12, if/else 10 (11 pts), error handling 1 (nesting depth added 10). Of this number, 35 points are the body's own statements and 15 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpClientSection.McpOAuthControl (cognitive 50) apps/web/src/components/McpClientSection.tsx:1136— McpClientSection.McpOAuthControl has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 14 (24 pts), if/else 14, boolean chains 11, error handling 1 (nesting depth added 10). Of this number, 32 points are the body's own statements and 18 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser.findOpenTag (cognitive 50) REDACTED:58— parser.findOpenTag has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 19). Of this number, 47 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuestionForm.summarizeQuestionFormAnswers (cognitive 50) apps/web/src/components/QuestionForm.tsx:3131— QuestionForm.summarizeQuestionFormAnswers has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 8 (22 pts), if/else 7 (13 pts), boolean chains 8, loops 3 (7 pts) (nesting depth added 24). Of this number, 43 points are the body's own statements and 7 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.
html-injection-points.skipTemplateContent (cognitive 50) REDACTED:290— html-injection-points.skipTemplateContent has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (43 pts), boolean chains 6, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildFigmaIr::elementNode (cognitive 50) clipper/capture.js:354— buildFigmaIr::elementNode has cognitive complexity 50 (threshold 15). Drivers by points: if/else 26 (39 pts), boolean chains 9, loops 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.
InviteDialog.InviteDialog (cognitive 49) apps/web/src/components/InviteDialog.tsx:91— InviteDialog.InviteDialog has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 20 (25 pts), if/else 16 (17 pts), boolean chains 6, error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 33 belong to 15 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.
preview.inferPluginPreview (cognitive 49) apps/web/src/components/plugins-home/preview.ts:189— preview.inferPluginPreview has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 10 (24 pts), if/else 11 (19 pts), boolean chains 6 (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.
TypePillRow.TypePillRow (cognitive 49) apps/web/src/components/home-hero/TypePillRow.tsx:24— TypePillRow.TypePillRow has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (23 pts), ternaries 14 (18 pts), boolean chains 7, loops 1 (nesting depth added 7). Most of this is not in the body itself: 4 of the 49 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 43, focusItem, a function literal at line 151, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ManualEditPanel.ManualEditPanel (cognitive 49) apps/web/src/components/ManualEditPanel.tsx:26— ManualEditPanel.ManualEditPanel has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 19 (28 pts), if/else 11 (15 pts), boolean chains 6 (nesting depth added 13). Of this number, 24 points are the body's own statements and 25 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.
pack.prepare (cognitive 49) .github/scripts/pack.py:149— pack.prepare has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 11, loops 3 (4 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.
deliverable-syntax.checkDeliverableSyntax (cognitive 48) apps/daemon/src/artifacts/deliverable-syntax.ts:371— deliverable-syntax.checkDeliverableSyntax has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 3 (7 pts), error handling 3 (6 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deliverable-syntax-quotes.proposeLocalStringQuotePatch (cognitive 48) apps/daemon/src/artifacts/deliverable-syntax-quotes.ts:121— deliverable-syntax-quotes.proposeLocalStringQuotePatch has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 12, ternaries 4 (5 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.
memory.composeMemoryBody (cognitive 48) REDACTED:621— memory.composeMemoryBody has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 6 (14 pts), boolean chains 3 (nesting depth added 27). Of this number, 46 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.
index.startBrandExtraction (cognitive 48) apps/daemon/src/brands/index.ts:283— index.startBrandExtraction has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (25 pts), ternaries 8 (11 pts), boolean chains 7, error handling 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
od-next-exact-input.assertOdNextExactInputMapV1 (cognitive 48) apps/daemon/src/runtimes/od-next-exact-input.ts:684— od-next-exact-input.assertOdNextExactInputMapV1 has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 16, loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deploy.walkReferencedFiles (cognitive 48) REDACTED:361— deploy.walkReferencedFiles has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 7, ternaries 3 (7 pts), error handling 2 (4 pts), loops 1 (nesting depth added 23). Of this number, 44 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomaticDiagnostics.drain (cognitive 48) apps/daemon/src/services/automatic-diagnostics.ts:151— AutomaticDiagnostics.drain has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 2 (8 pts), error handling 3 (7 pts), boolean chains 4, loops 1 (nesting depth added 25). Of this number, 44 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.
tools-connectors-cli.renderGithubDesignEvidenceMarkdown (cognitive 48) apps/daemon/src/tools-connectors-cli.ts:1382— tools-connectors-cli.renderGithubDesignEvidenceMarkdown has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 8 (22 pts), loops 6 (15 pts), if/else 7 (9 pts), boolean chains 2 (nesting depth added 25). Of this number, 47 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
amr-guidance.resolveRunFailureUiIgnoringSelfPromotion (cognitive 48) apps/web/src/runtime/amr-guidance.ts:1640— amr-guidance.resolveRunFailureUiIgnoringSelfPromotion has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (28 pts), ternaries 9 (15 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaSurface.MediaSurface (cognitive 48) apps/web/src/components/plugins-home/cards/MediaSurface.tsx:55— MediaSurface.MediaSurface has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 9 (16 pts), boolean chains 14, loops 1 (nesting depth added 11). Of this number, 26 points are the body's own statements and 22 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommentSyncBanner.CommentSyncBanner (cognitive 48) apps/web/src/components/share/CommentSyncBanner.tsx:37— CommentSyncBanner.CommentSyncBanner has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 11 (24 pts), if/else 12 (13 pts), boolean chains 9, error handling 2 (nesting depth added 14). Of this number, 41 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.
GenUISurfaceRenderer.GenUISurfaceRenderer (cognitive 48) apps/web/src/components/GenUISurfaceRenderer.tsx:73— GenUISurfaceRenderer.GenUISurfaceRenderer has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 14 (29 pts), if/else 10 (14 pts), boolean chains 4, error handling 1 (nesting depth added 19). Of this number, 41 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.
plugin-asset-cache.isPrivateAddress (cognitive 47) apps/daemon/src/plugins/plugin-asset-cache.ts:119— plugin-asset-cache.isPrivateAddress has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 10 (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.
installer.installFromGithub (cognitive 47) apps/daemon/src/plugins/installer.ts:220— installer.installFromGithub has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 5 (15 pts), boolean chains 1, ternaries 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginPublishRepo (cognitive 47) apps/daemon/src/cli.ts:5522— cli.runPluginPublishRepo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (25 pts), ternaries 7 (9 pts), boolean chains 7, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 11). Of this number, 43 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
index.main (cognitive 47) apps/packaged/src/index.ts:118— index.main has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 15 (21 pts), if/else 17 (19 pts), boolean chains 5, error handling 2 (nesting depth added 8). Of this number, 38 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ProjectReferenceModal.ProjectReferenceModal (cognitive 47) apps/web/src/components/ProjectReferenceModal.tsx:39— ProjectReferenceModal.ProjectReferenceModal has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 13 (27 pts), if/else 11 (12 pts), boolean chains 7, loops 1 (nesting depth added 15). Most of this is not in the body itself: 14 of the 47 points are its own statements and the rest belongs to 11 function items inside it that branch (confirm, a function literal at line 95, a function literal at line 79, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SettingsDialog.IntegrationsSection (cognitive 47) apps/web/src/components/SettingsDialog.tsx:8449— SettingsDialog.IntegrationsSection has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 22 (26 pts), if/else 11, boolean chains 9, error handling 1 (nesting depth added 4). Of this number, 25 points are the body's own statements and 22 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.
DesignSystemSwitchPicker.DesignSystemSwitchPicker (cognitive 47) apps/web/src/components/DesignSystemSwitchPicker.tsx:27— DesignSystemSwitchPicker.DesignSystemSwitchPicker has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 12 (29 pts), boolean chains 9, if/else 8, loops 1 (nesting depth added 17). Most of this is not in the body itself: 14 of the 47 points are its own statements and the rest belongs to 6 function items inside it that branch (handlePick, a function literal at line 177, a function literal at line 42, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
brand-capture.collectImageAssets (cognitive 47) clipper/brand-capture.js:585— brand-capture.collectImageAssets has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 24, if/else 7 (14 pts), ternaries 3 (6 pts), loops 3 (nesting depth added 10). Of this number, 45 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
html-injection-points.findRealTagOffset (cognitive 47) REDACTED:680— html-injection-points.findRealTagOffset has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (40 pts), boolean chains 6, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lib.parseYamlSubset (cognitive 47) scripts/migrate-to-plugins/lib.ts:48— lib.parseYamlSubset has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 9, loops 2 (3 pts), ternaries 1 (nesting depth added 16). Of this number, 32 points are the body's own statements and 15 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
daemon-health.createDaemonHealth.previousSessionReport (cognitive 46) apps/daemon/src/services/daemon-health.ts:501— daemon-health.createDaemonHealth.previousSessionReport has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 19 (29 pts), boolean chains 9, if/else 7 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.attachDshProfileSession.handleRunFrame (cognitive 46) apps/daemon/src/agent-protocol/dsh-profile/session.ts:131— session.attachDshProfileSession.handleRunFrame has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 7, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp.handleMcpToolCall (cognitive 46) apps/daemon/src/mcp.ts:2162— mcp.handleMcpToolCall has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 12 (24 pts), if/else 7 (14 pts), boolean chains 6, error handling 1, match/switch 1 (nesting depth added 19). Of this number, 43 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude-diagnostics.diagnoseClaudeCliFailure (cognitive 46) apps/daemon/src/claude-diagnostics.ts:78— claude-diagnostics.diagnoseClaudeCliFailure has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 8 (15 pts), boolean chains 13 (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.
byok-tools.executeGenerateVideo (cognitive 46) apps/daemon/src/byok-tools.ts:787— byok-tools.executeGenerateVideo has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 7 (14 pts), boolean chains 5, error handling 4 (5 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.
agent-process.reapLeftoverAgentProcesses (cognitive 46) apps/daemon/src/runtimes/agent-process.ts:470— agent-process.reapLeftoverAgentProcesses has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (22 pts), error handling 6 (17 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 26). Of this number, 42 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handoff-cli.parseOptions (cognitive 46) apps/daemon/src/handoff-cli.ts:78— handoff-cli.parseOptions has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (43 pts), boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginUpgrade (cognitive 46) apps/daemon/src/cli.ts:5089— cli.runPluginUpgrade has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 3 (8 pts), ternaries 3 (7 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 25). Of this number, 45 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmrLoginPill.AmrAccountControl (cognitive 46) apps/web/src/components/AmrLoginPill.tsx:127— AmrLoginPill.AmrAccountControl has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 21 (34 pts), boolean chains 12 (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.
NewAutomationModal.NewAutomationModal (cognitive 46) apps/web/src/components/NewAutomationModal.tsx:240— NewAutomationModal.NewAutomationModal has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 48 (61 pts), boolean chains 29, if/else 26, error handling 1 (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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. This shape REPEATS in the file: one other method here (NewAutomationModal.NewAutomationModal::submit) 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.
rerun_infra_cancel.resolve_live_pr_head (cognitive 46) .github/scripts/rerun_infra_cancel.py:419— rerun_infra_cancel.resolve_live_pr_head has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 3 (6 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
probe.parseDshProfileModelsOutput (cognitive 45) apps/daemon/src/agent-protocol/dsh-profile/probe.ts:26— probe.parseDshProfileModelsOutput has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 7, ternaries 3 (7 pts), loops 2 (4 pts), error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp.extractRelativeRefs (cognitive 45) apps/daemon/src/mcp.ts:3473— mcp.extractRelativeRefs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 6 (11 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deliverable-syntax-quotes.staticHtmlFragment (cognitive 45) apps/daemon/src/artifacts/deliverable-syntax-quotes.ts:56— deliverable-syntax-quotes.staticHtmlFragment has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (35 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
code-import.runCodeImport (cognitive 45) apps/daemon/src/plugins/atoms/code-import.ts:105— code-import.runCodeImport has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (29 pts), error handling 2 (6 pts), loops 3 (6 pts), boolean chains 4 (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.
preview.renderMarkdownLite (cognitive 45) apps/daemon/src/design-systems/preview.ts:420— preview.renderMarkdownLite has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 22). Of this number, 43 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.
index.renderAIHubMixVideo (cognitive 45) apps/daemon/src/media/index.ts:3378— index.renderAIHubMixVideo has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 13, error handling 3 (5 pts), ternaries 3 (5 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.
stock-telemetry.collectStockTelemetry (cognitive 45) apps/daemon/src/media/stock-telemetry.ts:298— stock-telemetry.collectStockTelemetry has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (27 pts), error handling 4 (10 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runLint (cognitive 45) apps/daemon/src/cli.ts:947— cli.runLint has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 7 (14 pts), loops 3 (5 pts), boolean chains 4, error handling 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-thumbnail-parser.extractStylesheetImports (cognitive 45) REDACTED:404— deck-thumbnail-parser.extractStylesheetImports has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 7, ternaries 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionCampaignHover.ProductionCampaignHover (cognitive 45) apps/web/src/components/ProductionCampaignHover.tsx:108— ProductionCampaignHover.ProductionCampaignHover has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 14, ternaries 7 (8 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 45 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 157, 192, 201, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
McpClientSection.McpRow (cognitive 45) apps/web/src/components/McpClientSection.tsx:773— McpClientSection.McpRow has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 21 (37 pts), boolean chains 8 (nesting depth added 16). Of this number, 42 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
animation-map.describeTween (cognitive 45) design-templates/hyperframes/scripts/animation-map.mjs:222— animation-map.describeTween has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 3 (10 pts), boolean chains 9 (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.
validate.validateSafe (cognitive 45) packages/plugin-runtime/src/validate.ts:43— validate.validateSafe has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 6 (12 pts), boolean chains 3 (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.
projects.createBatchArchiveStream (cognitive 44) REDACTED:423— projects.createBatchArchiveStream has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (27 pts), error handling 3 (7 pts), loops 4 (6 pts), boolean chains 4 (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.
team-mirror-materializer.materializePulledTeamMirror (cognitive 44) apps/daemon/src/collab/team-mirror-materializer.ts:165— team-mirror-materializer.materializePulledTeamMirror has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 22, if/else 16 (17 pts), ternaries 4 (5 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 44 points are its own statements and the rest belongs to one function literal inside it that branches (line 186). 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.
search.searchInstalledPlugins (cognitive 44) apps/daemon/src/plugins/search.ts:52— search.searchInstalledPlugins has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (38 pts), boolean chains 5, loops 1 (nesting depth added 16). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools-connectors-cli.renderLocalDesignEvidenceMarkdown (cognitive 44) apps/daemon/src/tools-connectors-cli.ts:1463— tools-connectors-cli.renderLocalDesignEvidenceMarkdown has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 5 (18 pts), loops 6 (15 pts), if/else 7 (9 pts), boolean chains 2 (nesting depth added 24). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.streamRunEvents (cognitive 44) apps/daemon/src/cli.ts:8759— cli.streamRunEvents has cognitive complexity 44 (threshold 15). Drivers by points: if/else 7 (22 pts), ternaries 2 (9 pts), loops 3 (6 pts), error handling 1 (4 pts), boolean chains 3 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-kind.targetFromSimple (cognitive 44) apps/web/src/runtime/chat/tool-kind.ts:377— tool-kind.targetFromSimple has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 6 (14 pts), boolean chains 6 (nesting depth added 17). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConnectorsBrowser.ConnectorCard (cognitive 44) apps/web/src/components/ConnectorsBrowser.tsx:1059— ConnectorsBrowser.ConnectorCard has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 18 (27 pts), boolean chains 13, if/else 4 (nesting depth added 9). Of this number, 39 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsDialog.deriveAboutUpdateControl (cognitive 44) apps/web/src/components/SettingsDialog.tsx:311— SettingsDialog.deriveAboutUpdateControl has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 15 (33 pts), boolean chains 6, if/else 3 (4 pts), match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginsView.AvailablePluginDetailsModal (cognitive 44) REDACTED:3192— PluginsView.AvailablePluginDetailsModal has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 23 (37 pts), if/else 4, boolean chains 3 (nesting depth added 14). Of this number, 34 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AssistantMessage.buildBlocks (cognitive 44) REDACTED:4030— AssistantMessage.buildBlocks has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 7, ternaries 1 (3 pts), loops 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
notebooklm-export-github.main (cognitive 44) scripts/notebooklm-export-github.ts:242— notebooklm-export-github.main has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 14 (17 pts), ternaries 4 (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.
convergence.self_check (cognitive 44) .github/scripts/convergence.py:1825— convergence.self_check has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (20 pts), error handling 9 (13 pts), boolean chains 4, loops 4, ternaries 1 (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.
langfuse-bridge.reportRunCompletedFromDaemon (cognitive 43) apps/daemon/src/langfuse-bridge.ts:1564— langfuse-bridge.reportRunCompletedFromDaemon has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 41 (51 pts), if/else 10 (16 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 17). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (langfuse-bridge.reportRunCompletedFromDaemon::buildContext) 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.
cli.runPluginInstall (cognitive 43) apps/daemon/src/cli.ts:4398— cli.runPluginInstall has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 3 (8 pts), ternaries 3 (7 pts), boolean chains 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.
PluginsView.availablePluginVersions (cognitive 43) REDACTED:4038— PluginsView.availablePluginVersions has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 20 (40 pts), if/else 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileOpsSummary.ArtifactCard (cognitive 43) apps/web/src/components/FileOpsSummary.tsx:558— FileOpsSummary.ArtifactCard has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 17 (35 pts), boolean chains 8 (nesting depth added 18). Of this number, 38 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.
CustomSelect.CustomSelect (cognitive 43) apps/web/src/components/CustomSelect.tsx:58— CustomSelect.CustomSelect has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 9 (13 pts), boolean chains 11 (nesting depth added 6). Most of this is not in the body itself: 11 of the 43 points are its own statements and the rest belongs to 11 function items inside it that branch (onButtonKeyDown, a function literal at line 100, a function literal at line 129, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
protocol.compareVersions (cognitive 43) REDACTED:162— protocol.compareVersions has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 9 (23 pts), if/else 7 (13 pts), boolean chains 5, loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
protocol.validateStandaloneMetadata (cognitive 43) REDACTED:230— protocol.validateStandaloneMetadata has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (34 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-plugin-preview-manifest.validatePreviewManifest (cognitive 43) scripts/check-plugin-preview-manifest.ts:87— check-plugin-preview-manifest.validatePreviewManifest has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 5 (10 pts), boolean chains 6 (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.
normalize.createCodexAppServerNormalizer.handleItem (cognitive 42) apps/daemon/src/agent-protocol/codex-app-server/normalize.ts:459— normalize.createCodexAppServerNormalizer.handleItem has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 4, loops 1 (3 pts), ternaries 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-deliverable-validation.resolveDeliverable (cognitive 42) apps/daemon/src/run-deliverable-validation.ts:254— run-deliverable-validation.resolveDeliverable has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 10, ternaries 9, error handling 2 (nesting depth added 6). Of this number, 38 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
runs.buildExecutionDiagnostics (cognitive 42) apps/daemon/src/runtimes/runs.ts:373— runs.buildExecutionDiagnostics has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 28 (29 pts), if/else 8, boolean chains 5 (nesting depth added 1). Of this number, 30 points are the body's own statements and 12 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.
store.recoverStaleLiveArtifactRefreshes (cognitive 42) apps/daemon/src/live-artifacts/store.ts:1123— store.recoverStaleLiveArtifactRefreshes has cognitive complexity 42 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 5 (12 pts), ternaries 2 (7 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools-connectors-cli.runConnectorsToolCli (cognitive 42) apps/daemon/src/tools-connectors-cli.ts:2772— tools-connectors-cli.runConnectorsToolCli has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 12 (15 pts), error handling 4 (7 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update-lifecycle-observations.recordIncomingUpdateStageResults (cognitive 42) apps/desktop/src/main/update-lifecycle-observations.ts:114— update-lifecycle-observations.recordIncomingUpdateStageResults has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 7 (23 pts), if/else 5 (9 pts), boolean chains 6, error handling 2 (3 pts), loops 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LexicalComposerInput.readCaretRect (cognitive 42) apps/web/src/components/composer/LexicalComposerInput.tsx:77— LexicalComposerInput.readCaretRect has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SkillsSection.SkillRow (cognitive 42) apps/web/src/components/SkillsSection.tsx:830— SkillsSection.SkillRow has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 20 (35 pts), boolean chains 7 (nesting depth added 15). Of this number, 33 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TabLauncherMenu.TabLauncherMenu (cognitive 42) apps/web/src/components/workspace/TabLauncherMenu.tsx:56— TabLauncherMenu.TabLauncherMenu has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 13 (20 pts), if/else 16 (18 pts), boolean chains 3, loops 1 (nesting depth added 9). Most of this is not in the body itself: 9 of the 42 points are its own statements and the rest belongs to 16 function items inside it that branch (onInputKeyDown, a function literal at line 125, a function literal at line 99, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
import-prompt-templates.inferCategory (cognitive 42) scripts/import-prompt-templates.mjs:260— import-prompt-templates.inferCategory has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26 (42 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.
convergence.publish_command (cognitive 42) .github/scripts/convergence.py:2027— convergence.publish_command has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 4 (6 pts), error handling 2 (5 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pack.finalize (cognitive 42) .github/scripts/pack.py:260— pack.finalize has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 4 (11 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.backfillDesignSystemWorkspaceResources (cognitive 41) REDACTED:1659— index.backfillDesignSystemWorkspaceResources has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 6, ternaries 3 (6 pts), error handling 1, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
message-event-payload-heal.runMessageEventPayloadHealPass (cognitive 41) REDACTED:98— message-event-payload-heal.runMessageEventPayloadHealPass has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (24 pts), error handling 2 (6 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 15). Of this number, 30 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabClient.stabilizePresenceRoster (cognitive 41) apps/web/src/collab/collab-client.ts:700— CollabClient.stabilizePresenceRoster has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 6 (8 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projects.bootstrapProjectRoute (cognitive 41) apps/web/src/state/projects.ts:402— projects.bootstrapProjectRoute has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 6, ternaries 4 (5 pts), error handling 1 (nesting depth added 12). 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 417). 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.
api-proxy.streamProxyEndpoint (cognitive 41) apps/web/src/providers/api-proxy.ts:38— api-proxy.streamProxyEndpoint has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 7 (8 pts), boolean chains 4, loops 2 (3 pts), error handling 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.
NewProjectPanel.MediaModelCards (cognitive 41) apps/web/src/components/NewProjectPanel.tsx:2784— NewProjectPanel.MediaModelCards has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 11 (14 pts), boolean chains 3, loops 2 (nesting depth added 14). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 2806, 2842, 2851, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
file-ops.shellWords (cognitive 41) apps/web/src/runtime/file-ops.ts:295— file-ops.shellWords has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 5, loops 1 (nesting depth added 17). Of this number, 40 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
source-patches.applyManualEditPatch (cognitive 41) apps/web/src/edit-mode/source-patches.ts:109— source-patches.applyManualEditPatch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (33 pts), ternaries 3 (7 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.
AppWashKineticGrid.AppWashKineticGrid (cognitive 41) apps/web/src/components/AppWashKineticGrid.tsx:41— AppWashKineticGrid.AppWashKineticGrid has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 5 (8 pts), boolean chains 6, loops 4 (5 pts) (nesting depth added 9). None of this is in the body itself: all 41 points belong to 7 function literals inside it that branch (lines 167, 44, 83, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
GenUISurfaceRenderer.JsonSchemaFormSurface::submit (cognitive 41) apps/web/src/components/GenUISurfaceRenderer.tsx:680— GenUISurfaceRenderer.JsonSchemaFormSurface::submit has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (28 pts), ternaries 3 (8 pts), boolean chains 4, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
operations.convergeSidecarLaunch (cognitive 41) packages/sidecar/src/operations.ts:219— operations.convergeSidecarLaunch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 10, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScopeContract._validate (cognitive 41) .github/scripts/scopes.py:98— ScopeContract._validate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 5 (8 pts), boolean chains 6 (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.
updates.acpToolResultContent (cognitive 40) apps/daemon/src/agent-protocol/acp/updates.ts:737— updates.acpToolResultContent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.attachAcpSession.emitAcpExecutionObservability (cognitive 40) apps/daemon/src/agent-protocol/acp/session.ts:716— session.attachAcpSession.emitAcpExecutionObservability has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 23 (29 pts), if/else 4 (7 pts), boolean chains 4 (nesting depth added 9). Of this number, 36 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
detection.probe (cognitive 40) apps/daemon/src/runtimes/detection.ts:564— detection.probe has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 10 (12 pts), boolean chains 10, error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
projects.writeProjectFile (cognitive 40) REDACTED:864— projects.writeProjectFile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 8, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
run-failure-classification.classifyRunFailure (cognitive 40) apps/daemon/src/run-failure-classification.ts:1771— run-failure-classification.classifyRunFailure has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 12 (32 pts), if/else 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
langfuse-trace.postVelaBatch (cognitive 40) apps/daemon/src/langfuse-trace.ts:2711— langfuse-trace.postVelaBatch has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 5 (12 pts), boolean chains 9, error handling 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence-delivery.drainEvidence (cognitive 40) apps/daemon/src/services/evidence-delivery.ts:186— evidence-delivery.drainEvidence has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 8 (13 pts), boolean chains 4 (nesting depth added 15). Most of this is not in the body itself: 4 of the 40 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 195, 216, 222, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
runs.durableRunState (cognitive 40) apps/daemon/src/runtimes/runs.ts:566— runs.durableRunState has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 40. 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.
runs.createChatRunService.create (cognitive 40) apps/daemon/src/runtimes/runs.ts:948— runs.createChatRunService.create has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 17, ternaries 17, if/else 5, error handling 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.
task-observation-aggregation.validateParentGraph (cognitive 40) apps/daemon/src/observability/task-observation-aggregation.ts:321— task-observation-aggregation.validateParentGraph has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 5 (6 pts), boolean chains 5 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginPublish (cognitive 40) apps/daemon/src/cli.ts:5396— cli.runPluginPublish has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 6 (13 pts), boolean chains 7, error handling 2 (nesting depth added 11). Of this number, 39 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
conformance.runAdapterConformance (cognitive 40) apps/daemon/src/critique/conformance.ts:139— conformance.runAdapterConformance has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 4 (11 pts), boolean chains 3, error handling 1, 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.
task-analytics-operations.buildTaskAnalyticsReportV1 (cognitive 40) apps/daemon/src/observability/task-analytics-operations.ts:254— task-analytics-operations.buildTaskAnalyticsReportV1 has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 6 (11 pts), ternaries 3 (8 pts), boolean chains 2 (nesting depth added 22). Of this number, 36 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.
launcher-after-quit.inspectExistingDesktopForLauncher (cognitive 40) apps/packaged/src/launcher-after-quit.ts:217— launcher-after-quit.inspectExistingDesktopForLauncher has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 8 (16 pts), boolean chains 3, error handling 2 (3 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.
FigmaImportModal.FigmaImportModal (cognitive 40) apps/web/src/components/FigmaImportModal.tsx:43— FigmaImportModal.FigmaImportModal has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 11 (13 pts), boolean chains 4 (nesting depth added 14). Of this number, 24 points are the body's own statements and 16 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatPane.ChatMessageRail (cognitive 40) apps/web/src/components/ChatPane.tsx:4861— ChatPane.ChatMessageRail has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17, ternaries 12 (13 pts), boolean chains 10 (nesting depth added 1). Most of this is not in the body itself: 7 of the 40 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 5050, a function literal at line 4939, a function literal at line 5104, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FileViewer.LiveArtifactRefreshHistoryPanel (cognitive 40) REDACTED:3014— FileViewer.LiveArtifactRefreshHistoryPanel has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 19 (39 pts), boolean chains 1 (nesting depth added 20). Most of this is not in the body itself: 11 of the 40 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 3176, 3127). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FileViewer.styleTagIsInspectOverrideBlock (cognitive 40) REDACTED:5875— FileViewer.styleTagIsInspectOverrideBlock has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (12 pts), boolean chains 7 (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.
useConversationChat.useConversationChat.runSend (cognitive 40) apps/web/src/components/workspace/useConversationChat.ts:183— useConversationChat.useConversationChat.runSend has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26, ternaries 9 (11 pts), boolean chains 3 (nesting depth added 2). Most of this is not in the body itself: 15 of the 40 points are its own statements and the rest belongs to 18 function items inside it that branch (clearRefs, a function literal at line 310, 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.
capture.fontStyleName (cognitive 40) clipper/capture.js:302— capture.fontStyleName has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 9 (38 pts), boolean chains 1, if/else 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
guard.checkE2eLayout (cognitive 40) scripts/guard.ts:770— guard.checkE2eLayout has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.attachPiRpcSession.parser (cognitive 39) apps/daemon/src/agent-protocol/pi-rpc/session.ts:330— session.attachPiRpcSession.parser has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 9, error handling 2 (5 pts) (nesting depth added 13). Of this number, 33 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.
validate.validateBrand (cognitive 39) apps/daemon/src/brands/validate.ts:51— validate.validateBrand has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 19 (24 pts), boolean chains 7, if/else 5 (7 pts), loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
skill-shell-read.literalArgs (cognitive 39) apps/daemon/src/strategies/od-next/skill-shell-read.ts:2— skill-shell-read.literalArgs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 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.
discovery-observation.createObserver.push (cognitive 39) apps/daemon/src/strategies/od-next/discovery-observation.ts:17— discovery-observation.createObserver.push has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 4 (10 pts), boolean chains 9 (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.
index.renderVolcengineVideo (cognitive 39) apps/daemon/src/media/index.ts:1463— index.renderVolcengineVideo has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 13, ternaries 3 (4 pts), error handling 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
import-export-routes.buildProjectExportManifestResponse (cognitive 39) REDACTED:1839— import-export-routes.buildProjectExportManifestResponse has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 6 (12 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 18). Of this number, 29 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-handoff.resolveStrategyHandoff (cognitive 39) apps/daemon/src/strategies/od-next/task-handoff.ts:59— task-handoff.resolveStrategyHandoff has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 11, ternaries 3 (6 pts) (nesting depth added 12). Of this number, 35 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignSystemFlow.DesignSystemPackageCard (cognitive 39) apps/web/src/components/DesignSystemFlow.tsx:3215— DesignSystemFlow.DesignSystemPackageCard has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 27 (37 pts), boolean chains 2 (nesting depth added 10). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConvergenceContract.__init__ (cognitive 39) .github/scripts/convergence.py:211— ConvergenceContract.__init__ has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 4 (9 pts), boolean chains 8 (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.
vela-child-evidence.parseWireFact (cognitive 38) apps/daemon/src/runtimes/vela-child-evidence.ts:389— vela-child-evidence.parseWireFact has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 19, ternaries 15, if/else 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.
chat-prompt-inputs.renderCommentAttachmentHint (cognitive 38) apps/daemon/src/runtimes/chat-prompt-inputs.ts:579— chat-prompt-inputs.renderCommentAttachmentHint has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 12, ternaries 2 (5 pts), loops 1 (nesting depth added 13). Of this number, 34 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pull-profile.emitVelaResourcePullProfile (cognitive 38) apps/daemon/src/collab/pull-profile.ts:109— pull-profile.emitVelaResourcePullProfile has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 5, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-artifact-fs.diffRunArtifacts (cognitive 38) apps/daemon/src/run-artifact-fs.ts:386— run-artifact-fs.diffRunArtifacts has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-connectors.maybeEnrichNotionSearchResponse (cognitive 38) apps/daemon/src/memory-connectors.ts:958— memory-connectors.maybeEnrichNotionSearchResponse has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (15 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 20). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkspaceBillingRuntimeCoordinator.invalidate (cognitive 38) apps/daemon/src/collab/workspace-billing-runtime.ts:437— WorkspaceBillingRuntimeCoordinator.invalidate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 5 (11 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runMcpInstall (cognitive 38) apps/daemon/src/cli.ts:2837— cli.runMcpInstall has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 6, ternaries 3 (6 pts), error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginSimulate (cognitive 38) apps/daemon/src/cli.ts:4850— cli.runPluginSimulate has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 9 (11 pts), boolean chains 7, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginCandidates (cognitive 38) apps/daemon/src/cli.ts:5295— cli.runPluginCandidates has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 7 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runConfig (cognitive 38) apps/daemon/src/cli.ts:10989— cli.runConfig has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (23 pts), ternaries 3 (9 pts), error handling 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 15). Of this number, 35 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
design-md-parse.parseTypography (cognitive 38) REDACTED:227— design-md-parse.parseTypography has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 5 (12 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 16). Of this number, 36 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plugin-source.derivePluginSourceLinks (cognitive 38) apps/web/src/runtime/plugin-source.ts:116— plugin-source.derivePluginSourceLinks has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 5 (9 pts), boolean chains 5, error handling 1 (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.
NewProjectPanel.PromptTemplatePicker (cognitive 38) apps/web/src/components/NewProjectPanel.tsx:1803— NewProjectPanel.PromptTemplatePicker has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 15 (27 pts), if/else 6, boolean chains 4, error handling 1 (nesting depth added 12). Of this number, 22 points are the body's own statements and 16 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
question-form.parseLegacyForm (cognitive 38) apps/web/src/artifacts/question-form.ts:563— question-form.parseLegacyForm has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 4 (12 pts), boolean chains 8, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ToolCard.parseLegacyAskUserQuestion (cognitive 38) apps/web/src/components/ToolCard.tsx:139— ToolCard.parseLegacyAskUserQuestion has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (25 pts), ternaries 3 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewDrawOverlay.PreviewDrawOverlay (cognitive 38) REDACTED:128— PreviewDrawOverlay.PreviewDrawOverlay has cognitive complexity 38 (threshold 15). Drivers by points: if/else 109 (128 pts), ternaries 53 (92 pts), boolean chains 49, loops 9 (11 pts), error handling 2 (3 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (PreviewDrawOverlay.PreviewDrawOverlay::send) 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.
GenUISurfaceRenderer.renderFieldControl (cognitive 38) apps/web/src/components/GenUISurfaceRenderer.tsx:785— GenUISurfaceRenderer.renderFieldControl has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 14 (33 pts), if/else 4, boolean chains 1 (nesting depth added 19). Of this number, 36 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
client-metrics.processExitMetricFields (cognitive 38) packages/contracts/src/analytics/client-metrics.ts:136— client-metrics.processExitMetricFields has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 13 (35 pts), boolean chains 3 (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.
toolchain.wellKnownUserToolchainBins (cognitive 38) packages/platform/src/toolchain.ts:62— toolchain.wellKnownUserToolchainBins has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 4 (8 pts), ternaries 3 (8 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-cross-app-imports.collectCreateRequireBindings::collectCreateRequireImports (cognitive 38) scripts/check-cross-app-imports.ts:135— check-cross-app-imports.collectCreateRequireBindings::collectCreateRequireImports has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (9 pts), boolean chains 7, loops 2 (6 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
extract_strip_frames.connected_components (cognitive 38) skills/hatch-pet/scripts/extract_strip_frames.py:102— extract_strip_frames.connected_components has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (30 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
app-config.normalizeAgentCliEnvPrefs (cognitive 37) apps/daemon/src/app-config.ts:412— app-config.normalizeAgentCliEnvPrefs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 3 (5 pts), boolean chains 3, ternaries 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.attachCodexAppServerSession.handleFrame (cognitive 37) apps/daemon/src/agent-protocol/codex-app-server/session.ts:346— session.attachCodexAppServerSession.handleFrame has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 7 (13 pts), boolean chains 8 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp.mcpDeliveryFacts (cognitive 37) apps/daemon/src/mcp.ts:1709— mcp.mcpDeliveryFacts has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 17, ternaries 10 (14 pts), if/else 5 (6 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.
claude-stream.createClaudeStreamHandler.emitCanonicalTaskSnapshot (cognitive 37) apps/daemon/src/runtimes/claude-stream.ts:349— claude-stream.createClaudeStreamHandler.emitCanonicalTaskSnapshot has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 9 (20 pts), if/else 11 (14 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-lifecycle-analytics.foldEventIntoRunSideEffectLedger (cognitive 37) apps/daemon/src/runtimes/run-lifecycle-analytics.ts:260— run-lifecycle-analytics.foldEventIntoRunSideEffectLedger has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 4, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proactive-content-pull.createProactiveContentPull.runIntent (cognitive 37) apps/daemon/src/collab/proactive-content-pull.ts:1241— proactive-content-pull.createProactiveContentPull.runIntent has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 2 (7 pts), boolean chains 6, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
doctor.doctorPlugin (cognitive 37) apps/daemon/src/plugins/doctor.ts:43— doctor.doctorPlugin has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 8 (10 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qoder-stream.createQoderStreamHandler.handleObject (cognitive 37) apps/daemon/src/runtimes/qoder-stream.ts:86— qoder-stream.createQoderStreamHandler.handleObject has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 5 (10 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp-config.buildOpenCodeMcpConfigContent (cognitive 37) apps/daemon/src/mcp-config.ts:456— mcp-config.buildOpenCodeMcpConfigContent has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 5 (14 pts), boolean chains 4, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
langfuse-bridge.collectToolCalls (cognitive 37) apps/daemon/src/langfuse-bridge.ts:623— langfuse-bridge.collectToolCalls has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 2 (6 pts), boolean chains 5, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-connectors.guessFieldValue (cognitive 37) apps/daemon/src/memory-connectors.ts:292— memory-connectors.guessFieldValue has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 8 (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.
skill-installation.installSkillSourceCandidate (cognitive 37) apps/daemon/src/services/skill-installation.ts:388— skill-installation.installSkillSourceCandidate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 6 (12 pts), boolean chains 6, error handling 6 (nesting depth added 7). Of this number, 32 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.
cli.runDaemonDb (cognitive 37) apps/daemon/src/cli.ts:9779— cli.runDaemonDb has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 5 (10 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-capture.collectLayeredPptxBackgroundTargets (cognitive 37) apps/desktop/src/main/deck-capture.ts:583— deck-capture.collectLayeredPptxBackgroundTargets has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 70, if/else 33 (65 pts), loops 11 (21 pts), ternaries 4 (9 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (deck-capture.collectLayeredPptxBackgroundTargets::splitLayers, deck-capture.collectLayeredPptxBackgroundTargets::materializeLayeredPseudoBackground) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FileOpsSummary.FileOpsSummary (cognitive 37) apps/web/src/components/FileOpsSummary.tsx:125— FileOpsSummary.FileOpsSummary has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 12 (17 pts), if/else 8 (11 pts), boolean chains 9 (nesting depth added 8). Of this number, 30 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignSystemFlow.prepareCreatedDesignSystemProject (cognitive 37) apps/web/src/components/DesignSystemFlow.tsx:4403— DesignSystemFlow.prepareCreatedDesignSystemProject has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 11 (25 pts), boolean chains 6, if/else 4, error handling 2 (nesting depth added 14). Of this number, 34 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
convergence.successful_workload_jobs (cognitive 37) .github/scripts/convergence.py:612— convergence.successful_workload_jobs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validateInstallation (cognitive 37) shells/terminal/runtime/fossil.mjs:41— validateInstallation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 15, loops 3, other 1 (nesting depth added 4). Of this number, 36 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
imagery-fallback.imageSize (cognitive 36) REDACTED:232— imagery-fallback.imageSize has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 8, 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.
claude-child-evidence.createClaudeChildEvidenceCollector.terminal (cognitive 36) apps/daemon/src/runtimes/claude-child-evidence.ts:578— claude-child-evidence.createClaudeChildEvidenceCollector.terminal has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 19 (24 pts), if/else 6 (8 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
task-input-snapshot.createOdNextTaskInputSnapshot (cognitive 36) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:571— task-input-snapshot.createOdNextTaskInputSnapshot has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 5 (8 pts), boolean chains 7, ternaries 3 (4 pts) (nesting depth added 9). Of this number, 20 points are the body's own statements and 16 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-observation-otlp-exporter.legacyAndOtlpTaskMappingsMatch (cognitive 36) apps/daemon/src/observability/task-observation-otlp-exporter.ts:640— task-observation-otlp-exporter.legacyAndOtlpTaskMappingsMatch has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 9 (19 pts), boolean chains 9, if/else 5 (7 pts), loops 1 (nesting depth added 12). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runConversation (cognitive 36) apps/daemon/src/cli.ts:9544— cli.runConversation has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5, ternaries 3 (4 pts), match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommunityView.CommunityView (cognitive 36) apps/web/src/components/CommunityView.tsx:110— CommunityView.CommunityView has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 14 (17 pts), if/else 12, boolean chains 7 (nesting depth added 3). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 414, handleDetailsUse, typeTab, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
question-form.mapRawQuestion (cognitive 36) apps/web/src/artifacts/question-form.ts:670— question-form.mapRawQuestion has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 26 (28 pts), boolean chains 7, if/else 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
normalized-agent-observation-v1.NormalizedUsageEvidenceV1Schema (cognitive 36) packages/contracts/src/observability/normalized-agent-observation-v1.ts:290— normalized-agent-observation-v1.NormalizedUsageEvidenceV1Schema has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 12, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
state-machine.reduceGenerationState (cognitive 36) packages/standalone/src/state-machine.ts:138— state-machine.reduceGenerationState has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
garbage.liveStoreReferences (cognitive 36) packages/standalone/src/garbage.ts:17— garbage.liveStoreReferences has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 22). Of this number, 33 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
style-policy.collectCssHardcodedColorMatchesFromDeclarationValue (cognitive 36) scripts/style-policy.ts:225— style-policy.collectCssHardcodedColorMatchesFromDeclarationValue has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 6, 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.
ToolPackCache.acquire (cognitive 36) tools/pack/src/cache/index.ts:171— ToolPackCache.acquire has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 9 (11 pts), boolean chains 9, loops 3 (nesting depth added 8). None of this is in the body itself: all 36 points belong to 5 function items inside it that branch (a function literal at line 264, seedFromAlias, materializeTarget, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
lifecycleRequest (cognitive 36) shells/terminal/runtime/sidecar-host.mjs:95— lifecycleRequest has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (25 pts), ternaries 2 (4 pts), error handling 1 (3 pts), loops 1 (2 pts), other 2 (nesting depth added 13). Of this number, 34 points are the body's own statements and 2 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoutineService.start_ (cognitive 35) apps/daemon/src/routines.ts:553— RoutineService.start_ has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 6 (9 pts), ternaries 4 (8 pts), boolean chains 2 (nesting depth added 13). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 567, 694). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
memory.brandToMemoryEntries (cognitive 35) apps/daemon/src/brands/memory.ts:71— memory.brandToMemoryEntries has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (26 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (2 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.
eval-context.buildEvalContext (cognitive 35) apps/daemon/src/observability/eval-context.ts:69— eval-context.buildEvalContext has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 17 (19 pts), boolean chains 9, if/else 7 (nesting depth added 2). Of this number, 27 points are the body's own statements and 8 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.
chat-prompt-inputs.normalizeCommentAttachments (cognitive 35) apps/daemon/src/runtimes/chat-prompt-inputs.ts:500— chat-prompt-inputs.normalizeCommentAttachments has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 14 (18 pts), boolean chains 10, if/else 6 (7 pts) (nesting depth added 5). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to one function literal inside it that branches (line 503). 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.
update-apply-observations.replayUpdateStageMetrics (cognitive 35) apps/daemon/src/migration/update-apply-observations.ts:381— update-apply-observations.replayUpdateStageMetrics has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (19 pts), error handling 2 (8 pts), loops 3 (6 pts), boolean chains 2 (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.
verify.verifyPlugin (cognitive 35) apps/daemon/src/plugins/verify.ts:84— verify.verifyPlugin has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 10, boolean chains 6 (nesting depth added 11). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
figma-extract.downloadAssets (cognitive 35) apps/daemon/src/plugins/atoms/figma-extract.ts:199— figma-extract.downloadAssets has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 6 (13 pts), error handling 2 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginDetailView.PluginDetailView (cognitive 35) apps/web/src/components/PluginDetailView.tsx:179— PluginDetailView.PluginDetailView has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 15 (20 pts), if/else 9, boolean chains 6 (nesting depth added 5). Of this number, 16 points are the body's own statements and 19 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.
file-ops.deriveFileOps (cognitive 35) apps/web/src/runtime/file-ops.ts:142— file-ops.deriveFileOps has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 4 (8 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 13). Of this number, 25 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueuedSendStack.QueuedSendStack (cognitive 35) apps/web/src/components/chat/QueuedSendStack.tsx:27— QueuedSendStack.QueuedSendStack has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 13, ternaries 6, loops 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 35 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 87, 139, 177, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectView.mergeServerMessageWithLocal (cognitive 35) apps/web/src/components/ProjectView.tsx:699— ProjectView.mergeServerMessageWithLocal has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 15 (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.
WorkspaceTabsBar.WorkspaceTabsBar (cognitive 35) apps/web/src/components/WorkspaceTabsBar.tsx:860— WorkspaceTabsBar.WorkspaceTabsBar has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 84 (150 pts), if/else 114 (143 pts), boolean chains 72, loops 5 (nesting depth added 95). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (WorkspaceTabsBar.WorkspaceTabsBar::findTabDropTarget) 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.
touchpoint-component-v2.TouchpointComponentV2ManifestSchema (cognitive 35) packages/contracts/src/touchpoint-component-v2.ts:151— touchpoint-component-v2.TouchpointComponentV2ManifestSchema has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 7 (10 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-whats-new-publish-workflow.findWhatsNewWorkflowViolations (cognitive 35) scripts/check-whats-new-publish-workflow.ts:271— check-whats-new-publish-workflow.findWhatsNewWorkflowViolations has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 5 (7 pts), boolean chains 3, ternaries 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.
architecture.scriptsArchitectureErrors (cognitive 35) scripts/lib/guard/architecture.ts:119— architecture.scriptsArchitectureErrors has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 6, 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.
example.runExampleGenerator (cognitive 35) scripts/migrate-to-plugins/example.ts:55— example.runExampleGenerator has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 11 (21 pts), if/else 3 (7 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updates.acpToolName (cognitive 34) apps/daemon/src/agent-protocol/acp/updates.ts:623— updates.acpToolName has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 9, ternaries 6 (9 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.
env.spawnEnvForAgent (cognitive 34) apps/daemon/src/runtimes/env.ts:103— env.spawnEnvForAgent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
linked-page-delivery.findTouchedLinkedPage (cognitive 34) apps/daemon/src/artifacts/linked-page-delivery.ts:46— linked-page-delivery.findTouchedLinkedPage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 3 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
byok-tools.executeAIHubMixGenerateSpeech (cognitive 34) apps/daemon/src/byok-tools.ts:1144— byok-tools.executeAIHubMixGenerateSpeech has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 8 (13 pts), boolean chains 5, error handling 2 (nesting depth added 9). 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.
run-lifecycle-analytics.scanRunEventsForRetrySideEffects (cognitive 34) apps/daemon/src/runtimes/run-lifecycle-analytics.ts:87— run-lifecycle-analytics.scanRunEventsForRetrySideEffects has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 4 (9 pts), boolean chains 3, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
device-frames.materializeOdNextDeviceFrames (cognitive 34) apps/daemon/src/strategies/od-next/device-frames.ts:195— device-frames.materializeOdNextDeviceFrames has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 5 (9 pts), boolean chains 7, loops 2 (nesting depth added 11). Of this number, 31 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update-apply-observations.observeUpdateLifecycleStages (cognitive 34) apps/daemon/src/migration/update-apply-observations.ts:316— update-apply-observations.observeUpdateLifecycleStages has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 3 (7 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resolve-snapshot.resolvePluginSnapshot (cognitive 34) apps/daemon/src/plugins/resolve-snapshot.ts:190— resolve-snapshot.resolvePluginSnapshot has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, ternaries 4 (5 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runs.createChatRunService.replayRecordedEvents (cognitive 34) apps/daemon/src/runtimes/runs.ts:1856— runs.createChatRunService.replayRecordedEvents has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 7 (11 pts), boolean chains 6, loops 2 (nesting depth added 13). 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.
mcp-tokens.sanitizeToken (cognitive 34) apps/daemon/src/mcp-tokens.ts:86— mcp-tokens.sanitizeToken has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 12, boolean chains 11, if/else 11. 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.
ratchet.evaluateRollout (cognitive 34) apps/daemon/src/critique/ratchet.ts:137— ratchet.evaluateRollout has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 8, loops 2, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai.extractUrlCitations (cognitive 34) apps/daemon/src/routes/xai.ts:400— xai.extractUrlCitations has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (6 pts), ternaries 1 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stock-telemetry.createStockRecorder (cognitive 34) apps/daemon/src/media/stock-telemetry.ts:74— stock-telemetry.createStockRecorder has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 7 (11 pts), boolean chains 5, error handling 3 (4 pts), loops 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.
vela.proxyAmrApiRequest (cognitive 34) REDACTED:298— vela.proxyAmrApiRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 7, ternaries 2 (4 pts), loops 2 (nesting depth added 6). Of this number, 20 points are the body's own statements and 14 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
cli.runFigma (cognitive 34) apps/daemon/src/cli.ts:6707— cli.runFigma has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 4 (8 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release-lifecycle.scanReleaseCleanupEntries (cognitive 34) apps/desktop/src/main/updater/release-lifecycle.ts:289— release-lifecycle.scanReleaseCleanupEntries has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 6 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-kind.searchPattern (cognitive 34) apps/web/src/runtime/chat/tool-kind.ts:450— tool-kind.searchPattern has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, ternaries 3 (6 pts), loops 2 (3 pts) (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.
BrandReferencePicker.BrandReferencePicker (cognitive 34) apps/web/src/components/BrandReferencePicker.tsx:143— BrandReferencePicker.BrandReferencePicker has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 15 (18 pts), boolean chains 11, if/else 5 (nesting depth added 3). Most of this is not in the body itself: 12 of the 34 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 178, 255, 324, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pluginPopularity.comparePluginGalleryOrder (cognitive 34) apps/web/src/components/plugins-home/pluginPopularity.ts:61— pluginPopularity.comparePluginGalleryOrder has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 7, ternaries 3 (6 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.
PluginsHomeSection.PluginsHomeSection (cognitive 34) apps/web/src/components/PluginsHomeSection.tsx:67— PluginsHomeSection.PluginsHomeSection has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 14 (27 pts), if/else 7 (nesting depth added 13). Of this number, 24 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
split-shell-cards.splitShellCards (cognitive 34) apps/web/src/runtime/chat/split-shell-cards.ts:43— split-shell-cards.splitShellCards has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). Of this number, 31 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useAnchoredPopover.useAnchoredPopover (cognitive 34) apps/web/src/hooks/useAnchoredPopover.ts:214— useAnchoredPopover.useAnchoredPopover has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 12, ternaries 6 (7 pts) (nesting depth added 6). None of this is in the body itself: all 34 points belong to 3 function literals inside it that branch (lines 238, 347, 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.
ComposerModePicker.ComposerModePicker (cognitive 34) REDACTED:140— ComposerModePicker.ComposerModePicker has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 14 (17 pts), if/else 10 (12 pts), boolean chains 5 (nesting depth added 5). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 168, 200, 264, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
convergence.calculate (cognitive 34) .github/scripts/convergence.py:471— convergence.calculate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 4 (7 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
artifacts-cli.parseOptions (cognitive 33) apps/daemon/src/artifacts-cli.ts:47— artifacts-cli.parseOptions has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 4, loops 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.
config.writeConfig (cognitive 33) apps/daemon/src/media/config.ts:437— config.writeConfig has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (10 pts), ternaries 5 (9 pts), error handling 1 (3 pts), loops 1 (nesting depth added 11). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-lifecycle-analytics.foldEventIntoRunAdmissionEvidence (cognitive 33) apps/daemon/src/runtimes/run-lifecycle-analytics.ts:198— run-lifecycle-analytics.foldEventIntoRunAdmissionEvidence has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 13, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
owned-content-sync.createOwnedContentSync.perform (cognitive 33) apps/daemon/src/collab/owned-content-sync.ts:54— owned-content-sync.createOwnedContentSync.perform has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 11, ternaries 5 (9 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.
run-artifact-fs.snapshotProjectArtifacts::walk (cognitive 33) apps/daemon/src/run-artifact-fs.ts:211— run-artifact-fs.snapshotProjectArtifacts::walk has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, ternaries 2 (6 pts), error handling 2 (4 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.
finalize-design.finalizeDesignPackage (cognitive 33) apps/daemon/src/design/finalize-design.ts:263— finalize-design.finalizeDesignPackage has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 7 (11 pts), error handling 7 (10 pts), if/else 7 (10 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runChat (cognitive 33) apps/daemon/src/cli.ts:9654— cli.runChat has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 5 (10 pts), boolean chains 4, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iframe-error.trackVisiblePreview (cognitive 33) REDACTED:489— iframe-error.trackVisiblePreview has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 7, loops 3, ternaries 2 (3 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 33 points are its own statements and the rest belongs to 11 function items inside it that branch (update, onMessage, probe, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
registry.publishProjectFilePublic (cognitive 33) apps/web/src/providers/registry.ts:1962— registry.publishProjectFilePublic has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 13 (28 pts), boolean chains 4, if/else 1 (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.
modelOptions.SearchableModelSelect (cognitive 33) apps/web/src/components/modelOptions.tsx:201— modelOptions.SearchableModelSelect has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 47 (76 pts), if/else 23 (25 pts), boolean chains 19, loops 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (modelOptions.SearchableModelSelect::renderModelOption) 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.
NewProjectPanel.buildMetadata (cognitive 33) apps/web/src/components/NewProjectPanel.tsx:3086— NewProjectPanel.buildMetadata has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (20 pts), if/else 7 (10 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemoryToast.MemoryToast (cognitive 33) apps/web/src/components/MemoryToast.tsx:56— MemoryToast.MemoryToast has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 8 (12 pts), boolean chains 2, error handling 2 (nesting depth added 5). Most of this is not in the body itself: 12 of the 33 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 137, 70, 112, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
question-form.normalizeType (cognitive 33) apps/web/src/artifacts/question-form.ts:986— question-form.normalizeType has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17, boolean chains 14, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExamplesTab.ExampleCard (cognitive 33) apps/web/src/components/ExamplesTab.tsx:507— ExamplesTab.ExampleCard has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (16 pts), if/else 9 (10 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 19 points are the body's own statements and 14 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.
shared-lifecycle.validateSharedLifecycleState (cognitive 33) packages/standalone/src/shared-lifecycle.ts:88— shared-lifecycle.validateSharedLifecycleState has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 12, 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.
check-design-system-manifests.checkDesignSystemManifests (cognitive 33) scripts/check-design-system-manifests.ts:78— check-design-system-manifests.checkDesignSystemManifests has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 6 (11 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sync-hyperframes-skill.main (cognitive 33) scripts/sync-hyperframes-skill.mjs:52— sync-hyperframes-skill.main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 5 (8 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate.validateCatalog (cognitive 33) tools/release/src/catalog/validate.ts:125— validate.validateCatalog has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (27 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.
release.legacy_release_v1 (cognitive 33) .github/scripts/release.py:238— release.legacy_release_v1 has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (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.
vela-command.runVelaCommand (cognitive 32) apps/daemon/src/integrations/vela-command.ts:257— vela-command.runVelaCommand has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 305, 390, 287, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
codex.parseCodexDebugModels (cognitive 32) apps/daemon/src/runtimes/defs/codex.ts:59— codex.parseCodexDebugModels has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 6 (12 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp.startRun (cognitive 32) apps/daemon/src/mcp.ts:2613— mcp.startRun has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 12, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
claude-child-evidence.adaptClaudeChildRuntimeFactV1 (cognitive 32) apps/daemon/src/runtimes/claude-child-evidence.ts:879— claude-child-evidence.adaptClaudeChildRuntimeFactV1 has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 22 (28 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
deploy.analyzeDeployPlan (cognitive 32) REDACTED:1651— deploy.analyzeDeployPlan has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 7, loops 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.
handoff.runHandoffAtom (cognitive 32) apps/daemon/src/plugins/atoms/handoff.ts:159— handoff.runHandoffAtom has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 5 (8 pts), boolean chains 4, ternaries 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.
vela-cli-resource-pull-batcher.createVelaResourcePullBatcher.flush (cognitive 32) apps/daemon/src/collab/vela-cli-resource-pull-batcher.ts:58— vela-cli-resource-pull-batcher.createVelaResourcePullBatcher.flush has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 5 (8 pts), ternaries 2 (6 pts), boolean chains 2, error handling 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.
cli.runDoctor (cognitive 32) apps/daemon/src/cli.ts:10875— cli.runDoctor has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 4 (6 pts), loops 2 (5 pts), ternaries 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
deck-capture.measureSlide (cognitive 32) apps/desktop/src/main/deck-capture.ts:2981— deck-capture.measureSlide has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (18 pts), ternaries 7 (8 pts), boolean chains 5, loops 1 (nesting depth added 3). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to 4 function items inside it that branch (positiveCssNumber, measureAuthored, deckStageAuthoredSize, …). 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.
payload.runLauncherCleanupLifecycle (cognitive 32) apps/desktop/src/main/updater/payload.ts:681— payload.runLauncherCleanupLifecycle has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 5 (10 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
startup-telemetry.reportStartupFailure (cognitive 32) apps/packaged/src/startup-telemetry.ts:500— startup-telemetry.reportStartupFailure has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 14 (19 pts), if/else 4 (7 pts), boolean chains 5, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registry.fetchAgentsStream (cognitive 32) apps/web/src/providers/registry.ts:236— registry.fetchAgentsStream has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, error handling 3 (4 pts), loops 3 (4 pts), ternaries 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 14 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.
daemon.buildPriorRunContextWarning (cognitive 32) apps/web/src/providers/daemon.ts:167— daemon.buildPriorRunContextWarning has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
daemon.streamViaDaemon (cognitive 32) apps/web/src/providers/daemon.ts:977— daemon.streamViaDaemon has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 13 (17 pts), if/else 7 (11 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignSystemPreviewModal.DesignSystemPreviewModal (cognitive 32) apps/web/src/components/DesignSystemPreviewModal.tsx:46— DesignSystemPreviewModal.DesignSystemPreviewModal has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 6 (9 pts), boolean chains 6 (nesting depth added 6). Most of this is not in the body itself: 5 of the 32 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 100, 89, 134, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PluginScenarioDetail.PluginScenarioDetail (cognitive 32) apps/web/src/components/plugin-details/PluginScenarioDetail.tsx:38— PluginScenarioDetail.PluginScenarioDetail has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 13 (30 pts), if/else 2 (nesting depth added 17). Of this number, 22 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
McpClientSection.McpClientSection (cognitive 32) apps/web/src/components/McpClientSection.tsx:317— McpClientSection.McpClientSection has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (16 pts), if/else 9 (10 pts), boolean chains 5, loops 1 (nesting depth added 6). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 8 function items inside it that branch (save, a function literal at line 521, trackMcpClick, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
validation.validateApiKeyShape (cognitive 32) apps/web/src/components/byok/validation.ts:262— validation.validateApiKeyShape has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 7 (10 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginsView.AvailablePluginsPanel (cognitive 32) REDACTED:3028— PluginsView.AvailablePluginsPanel has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (26 pts), if/else 2 (4 pts), boolean chains 2 (nesting depth added 17). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 3135, 3081, 3106, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
project-events.createProjectEventsConnection.connect (cognitive 32) apps/web/src/providers/project-events.ts:136— project-events.createProjectEventsConnection.connect has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 6 (7 pts), boolean chains 6, loops 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 146, handleLiveArtifactEvent, a function literal at line 178, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useCharReveal.useCharReveal (cognitive 32) apps/web/src/components/chat/useCharReveal.ts:246— useCharReveal.useCharReveal has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 11). None of this is in the body itself: all 32 points belong to one function literal inside it that branches (line 248). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
FileWorkspace.DesignSystemProjectPanel::_renderReviewCard (cognitive 32) apps/web/src/components/FileWorkspace.tsx:5377— FileWorkspace.DesignSystemProjectPanel::_renderReviewCard has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 16 (27 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (FileWorkspace.DesignSystemProjectPanel) 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.
content.collectImagesInPage (cognitive 32) clipper/content.js:879— content.collectImagesInPage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 12, loops 2, error handling 1, ternaries 1 (nesting depth added 7). Of this number, 25 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
convergence.resolve_references (cognitive 32) .github/scripts/convergence.py:1045— convergence.resolve_references has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 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.
convergence.finalize_candidate (cognitive 32) .github/scripts/convergence.py:1299— convergence.finalize_candidate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 6, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db.upsertPreviewComment (cognitive 31) apps/daemon/src/db.ts:3868— db.upsertPreviewComment has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 21 (24 pts), boolean chains 5, if/else 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.
task-store.rowToTask (cognitive 31) apps/daemon/src/strategies/task-store.ts:868— task-store.rowToTask has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 10, boolean chains 8, 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.
opencode-child-evidence.createOpenCodeRootTaskEvidenceCollector.observe (cognitive 31) apps/daemon/src/runtimes/opencode-child-evidence.ts:146— opencode-child-evidence.createOpenCodeRootTaskEvidenceCollector.observe has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 10, if/else 10, ternaries 10, error handling 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.
imagery-fallback.findImageRefs (cognitive 31) REDACTED:140— imagery-fallback.findImageRefs has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (9 pts), ternaries 3 (6 pts), loops 4, error handling 1 (nesting depth added 5). Of this number, 24 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
byok-tools.executeGenerateImage (cognitive 31) apps/daemon/src/byok-tools.ts:593— byok-tools.executeGenerateImage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 7 (11 pts), boolean chains 6, error handling 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.
byok-tools.executeAIHubMixGenerateImage (cognitive 31) apps/daemon/src/byok-tools.ts:993— byok-tools.executeAIHubMixGenerateImage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 8 (12 pts), error handling 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
motion-cover.freezeMotionArtifactCovers (cognitive 31) apps/daemon/src/chat-artifacts/motion-cover.ts:69— motion-cover.freezeMotionArtifactCovers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, error handling 2 (4 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 13). Of this number, 27 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gc.sweepChatArtifactStorage (cognitive 31) apps/daemon/src/chat-artifacts/gc.ts:45— gc.sweepChatArtifactStorage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 3 (6 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 12). Of this number, 29 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.
team-mirror-promotion.promoteAuthorizedTeamProjectStage (cognitive 31) apps/daemon/src/collab/team-mirror-promotion.ts:282— team-mirror-promotion.promoteAuthorizedTeamProjectStage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 6 (11 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 8). Of this number, 27 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
runs.summarizeToolEvents (cognitive 31) apps/daemon/src/runtimes/runs.ts:108— runs.summarizeToolEvents has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, ternaries 2 (6 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
initial-prompt-bundle-service.createOdNextInitialPromptBundleService (cognitive 31) apps/daemon/src/strategies/od-next/initial-prompt-bundle-service.ts:183— initial-prompt-bundle-service.createOdNextInitialPromptBundleService has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 11 (12 pts), if/else 5 (7 pts), boolean chains 6, error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 6). None of this is in the body itself: all 31 points belong to one function literal inside it that branches (line 186). 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.
langfuse-bridge.reportRunCompletedFromDaemon::buildContext (cognitive 31) apps/daemon/src/langfuse-bridge.ts:1702— langfuse-bridge.reportRunCompletedFromDaemon::buildContext has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 23 (28 pts), boolean chains 2, 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. This shape REPEATS in the file: one other method here (langfuse-bridge.reportRunCompletedFromDaemon) 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.
task-observation-aggregation.buildLegacyTaskObservationPayload (cognitive 31) apps/daemon/src/observability/task-observation-aggregation.ts:1092— task-observation-aggregation.buildLegacyTaskObservationPayload has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 14 (27 pts), if/else 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.
transcript-export.exportProjectTranscript (cognitive 31) apps/daemon/src/transcript-export.ts:161— transcript-export.exportProjectTranscript has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 5 (8 pts), ternaries 4 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 11). Of this number, 17 points are the body's own statements and 14 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registry.uploadProjectFiles (cognitive 31) apps/web/src/providers/registry.ts:3305— registry.uploadProjectFiles has cognitive complexity 31 (threshold 15). Drivers by points: loops 7 (18 pts), if/else 4 (7 pts), ternaries 2 (4 pts), error handling 1 (2 pts) (nesting depth added 17). Of this number, 29 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.
GoPlanSunsetDialog.GoPlanSunsetDialog (cognitive 31) apps/web/src/components/GoPlanSunsetDialog.tsx:28— GoPlanSunsetDialog.GoPlanSunsetDialog has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13, boolean chains 9, ternaries 5 (6 pts), loops 2, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 31 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 82, a function literal at line 65, a function literal at line 44, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AssistantMessage.AssistantFeedback (cognitive 31) REDACTED:2398— AssistantMessage.AssistantFeedback has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 15 (17 pts), if/else 9, boolean chains 5 (nesting depth added 2). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 5 function items inside it that branch (submitReasons, toggleFeedback, a function literal at line 2444, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ManualEditPanel.normalizeManualEditStyles (cognitive 31) apps/web/src/components/ManualEditPanel.tsx:648— ManualEditPanel.normalizeManualEditStyles has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 1, 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.
FileViewer.serializeInspectOverrides (cognitive 31) REDACTED:5721— FileViewer.serializeInspectOverrides has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, ternaries 2 (4 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.
FileViewer.parseInspectOverridesFromSource (cognitive 31) REDACTED:5813— FileViewer.parseInspectOverridesFromSource has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectView.findTouchedProjectFile (cognitive 31) apps/web/src/components/ProjectView.tsx:15533— ProjectView.findTouchedProjectFile has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, loops 2 (4 pts), ternaries 3 (4 pts) (nesting depth added 10). Of this number, 26 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-html-plugin-preview-contracts.checkHtmlPluginPreviewContracts (cognitive 31) scripts/check-html-plugin-preview-contracts.ts:121— check-html-plugin-preview-contracts.checkHtmlPluginPreviewContracts has cognitive complexity 31 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 5 (9 pts), ternaries 3 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common.contentType (cognitive 31) tools/release/src/storage/common.ts:53— common.contentType has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, 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.
convergence.validate_products (cognitive 31) .github/scripts/convergence.py:681— convergence.validate_products has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 7, 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.
validate_atlas.main (cognitive 31) skills/hatch-pet/scripts/validate_atlas.py:37— validate_atlas.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 3 (4 pts), error handling 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pickImages (cognitive 31) clipper/content.js:1053— pickImages has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 8, ternaries 5 (6 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 11 function items inside it that branch (a function literal at line 1241, a function literal at line 1272, a function literal at line 1261, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
collab-cloud.parseMemberPage (cognitive 30) apps/daemon/src/integrations/collab-cloud.ts:369— collab-cloud.parseMemberPage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 7 (nesting depth added 5). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
workspace-project-home.collapseWorkspaceProjectHomes (cognitive 30) apps/daemon/src/collab/workspace-project-home.ts:149— workspace-project-home.collapseWorkspaceProjectHomes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (8 pts), boolean chains 3, loops 2 (nesting depth added 13). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 163). 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.
vela-child-evidence.createVelaChildEvidenceConsumer.observe (cognitive 30) apps/daemon/src/runtimes/vela-child-evidence.ts:600— vela-child-evidence.createVelaChildEvidenceConsumer.observe has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13, boolean chains 8, ternaries 5 (8 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
index.readDesignSystemSourceEvidence (cognitive 30) REDACTED:1192— index.readDesignSystemSourceEvidence has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6, loops 1 (3 pts), 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.
video.buildVideoRequest (cognitive 30) apps/daemon/src/media-adapters/video.ts:177— video.buildVideoRequest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (30 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.
deploy.setupCloudflarePagesCustomDomain (cognitive 30) REDACTED:874— deploy.setupCloudflarePagesCustomDomain has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 10, error handling 2, if/else 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.
LegacyBlockFilter.push (cognitive 30) apps/daemon/src/strategies/od-next/protocol.ts:16— LegacyBlockFilter.push has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools-connectors-cli.scoreDesignFile (cognitive 30) apps/daemon/src/tools-connectors-cli.ts:593— tools-connectors-cli.scoreDesignFile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 30. 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.
tools-connectors-cli.collectGithubEvidenceWithConnector (cognitive 30) apps/daemon/src/tools-connectors-cli.ts:784— tools-connectors-cli.collectGithubEvidenceWithConnector has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 5 (8 pts), error handling 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-artifacts.registerProjectChatArtifactRoutes (cognitive 30) REDACTED:43— chat-artifacts.registerProjectChatArtifactRoutes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, boolean chains 3, error handling 1, ternaries 1. None of this is in the body itself: all 30 points belong to 9 function items inside it that branch (sendSnapshotBlob, a function literal at line 152, authorizeRead, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
owned-content-files.applyOwnedProjectContent (cognitive 30) apps/daemon/src/collab/owned-content-files.ts:113— owned-content-files.applyOwnedProjectContent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 9). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.attachTerminal (cognitive 30) apps/daemon/src/cli.ts:8873— cli.attachTerminal has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 6 (9 pts), error handling 2 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). Of this number, 27 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
payload-desktop-handoff.prepareLegacyPayloadDesktopHandoff (cognitive 30) apps/daemon/src/sidecar/payload-desktop-handoff.ts:242— payload-desktop-handoff.prepareLegacyPayloadDesktopHandoff has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, if/else 10, ternaries 3 (4 pts), error handling 2 (3 pts) (nesting depth added 2). 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, 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.
updater.createDesktopUpdater.installUpdate (cognitive 30) apps/desktop/src/main/updater.ts:1213— updater.createDesktopUpdater.installUpdate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 3 (7 pts), error handling 3 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resource-error.readSrc (cognitive 30) apps/web/src/observability/resource-error.ts:409— resource-error.readSrc has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (28 pts), boolean chains 1, if/else 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
config.loadConfig (cognitive 30) apps/web/src/state/config.ts:681— config.loadConfig has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, loops 4, error handling 2 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeView.HomeView (cognitive 30) apps/web/src/components/HomeView.tsx:498— HomeView.HomeView has cognitive complexity 30 (threshold 15). Drivers by points: if/else 174 (209 pts), ternaries 139 (192 pts), boolean chains 101, error handling 6 (9 pts), loops 2, match/switch 1 (nesting depth added 91). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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. This shape REPEATS in the file: 5 other methods here (HomeView.HomeView::usePlugin, HomeView.HomeView::routePluginUse, HomeView.HomeView::pickChip, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
useCritiqueTheaterEnabled.setCritiqueTheaterEnabled (cognitive 30) apps/web/src/components/Theater/hooks/useCritiqueTheaterEnabled.ts:133— useCritiqueTheaterEnabled.setCritiqueTheaterEnabled has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 5 (7 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 11). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 195). 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.
PluginsView.TeamPanel (cognitive 30) REDACTED:4244— PluginsView.TeamPanel has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 8, boolean chains 6, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 6 function items inside it that branch (share, a function literal at line 4280, a function literal at line 4302, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Foldable.Foldable (cognitive 30) apps/web/src/components/chat/primitives/Foldable.tsx:33— Foldable.Foldable has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (10 pts), ternaries 7 (9 pts) (nesting depth added 4). Of this number, 16 points are the body's own statements and 14 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.
AssistantMessage.recoverLinkedProjectFilesFromContent (cognitive 30) REDACTED:1824— AssistantMessage.recoverLinkedProjectFilesFromContent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (5 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BoardComposerPopover.popoverAnchorStyle (cognitive 30) apps/web/src/components/BoardComposerPopover.tsx:160— BoardComposerPopover.popoverAnchorStyle has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 6 (11 pts), boolean chains 5 (nesting depth added 13). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 3 function items inside it that branch (sidePosition, a function literal at line 255, a function literal at line 218). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
content.shadow.querySelectorAll("button[data-act]").forEach() (cognitive 30) clipper/content.js:326— content.shadow.querySelectorAll("button[data-act]").forEach() has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 5 (12 pts), boolean chains 4, error handling 1 (nesting depth added 8). None of this is in the body itself: all 30 points belong to one function literal inside it that branches (line 327). 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.
normalize-plugin-scenarios.classify (cognitive 30) scripts/normalize-plugin-scenarios.ts:220— normalize-plugin-scenarios.classify has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 5 (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.
payload.buildWinLauncherPayloadArchive (cognitive 30) tools/pack/src/win/payload.ts:67— payload.buildWinLauncherPayloadArchive has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 3 (6 pts), error handling 3, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 239, runSegment, createArchiveFromInstallerBase, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
registry.queryWinRegistryEntries (cognitive 30) tools/pack/src/win/registry.ts:73— registry.queryWinRegistryEntries has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 13). Of this number, 27 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prerelease-progress-card.main (cognitive 30) tools/release/src/notifications/prerelease-progress-card.ts:549— prerelease-progress-card.main has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (7 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
convergence.project_matrices (cognitive 30) .github/scripts/convergence.py:1097— convergence.project_matrices has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 3 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 30) clipper/content.js:326— (anonymous) has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 5 (12 pts), boolean chains 4, error handling 1 (nesting depth added 8). None of this is in the body itself: all 30 points belong to one function literal inside it that branches (line 327). 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.
buildNode (cognitive 30) figma-plugin/code.js:175— buildNode has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 6 (9 pts), ternaries 2 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
task-store.compareAndTransitionStrategyTaskExecution (cognitive 29) apps/daemon/src/strategies/task-store.ts:621— task-store.compareAndTransitionStrategyTaskExecution has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 8 (10 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 4). None of this is in the body itself: all 29 points belong to one function literal inside it that branches (line 626). 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.
json-event-stream.handleKimiEvent (cognitive 29) apps/daemon/src/runtimes/json-event-stream.ts:528— json-event-stream.handleKimiEvent has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 6 (8 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-analytics-observability.summarizeToolAnalytics (cognitive 29) apps/daemon/src/run-analytics-observability.ts:1062— run-analytics-observability.summarizeToolAnalytics has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 3, ternaries 1 (3 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.
index.listDesignSystems (cognitive 29) REDACTED:320— index.listDesignSystems has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 3 (6 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prefetch.buildMaterialMd (cognitive 29) REDACTED:688— prefetch.buildMaterialMd has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11, loops 7 (10 pts), boolean chains 4, ternaries 2 (4 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.
run-capture.captureRunChatArtifactSnapshots (cognitive 29) apps/daemon/src/chat-artifacts/run-capture.ts:81— run-capture.captureRunChatArtifactSnapshots has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 2, ternaries 1 (2 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.
vela-cli-team-projects.toTeamProject (cognitive 29) apps/daemon/src/collab/vela-cli-team-projects.ts:426— vela-cli-team-projects.toTeamProject has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
policy.parseMediaExecutionPolicyInput (cognitive 29) apps/daemon/src/media/policy.ts:25— policy.parseMediaExecutionPolicyInput has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
team-resource-share.parseSharedResourceRecords (cognitive 29) apps/daemon/src/collab/team-resource-share.ts:331— team-resource-share.parseSharedResourceRecords has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 4 (7 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fig-decode.buildDocument.build (cognitive 29) apps/daemon/src/figma/fig-decode.ts:293— fig-decode.buildDocument.build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). Of this number, 24 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rollout.evaluateOdNextRollout (cognitive 29) apps/daemon/src/strategies/od-next/rollout.ts:119— rollout.evaluateOdNextRollout has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 10, if/else 10, ternaries 5 (9 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.
main-run-observation.buildStructuredMainRunObservationV1 (cognitive 29) apps/daemon/src/observability/main-run-observation.ts:246— main-run-observation.buildStructuredMainRunObservationV1 has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 22 (27 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
daemon.registerDaemonRoutes (cognitive 29) REDACTED:34— daemon.registerDaemonRoutes has cognitive complexity 29 (threshold 15). Drivers by points: error handling 8, if/else 7 (8 pts), ternaries 5 (8 pts), boolean chains 5 (nesting depth added 4). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 11 function items inside it that branch (a function literal at line 101, parsePositiveInt, parseRate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tools-connectors-cli.runGithubDesignContext (cognitive 29) apps/daemon/src/tools-connectors-cli.ts:1620— tools-connectors-cli.runGithubDesignContext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (10 pts), error handling 2 (4 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.
memory-llm.callLocalCli (cognitive 29) apps/daemon/src/memory-llm.ts:952— memory-llm.callLocalCli has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 6, error handling 2 (3 pts), ternaries 3 (nesting depth added 3). Of this number, 17 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
team-resource-share.registerTeamResourceShareRoutes (cognitive 29) apps/daemon/src/routes/team-resource-share.ts:80— team-resource-share.registerTeamResourceShareRoutes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 5 (7 pts), error handling 4, boolean chains 1 (nesting depth added 5). None of this is in the body itself: all 29 points belong to 5 function items inside it that branch (a function literal at line 138, a function literal at line 167, resolveScope, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
library-sync.reconcileProjects (cognitive 29) apps/daemon/src/library-sync.ts:265— library-sync.reconcileProjects has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 3 (6 pts), loops 2 (3 pts), ternaries 1 (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.
cli.runPluginCanon (cognitive 29) apps/daemon/src/cli.ts:4953— cli.runPluginCanon has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 3 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginApply (cognitive 29) apps/daemon/src/cli.ts:5172— cli.runPluginApply has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 6, loops 2 (4 pts), error handling 2 (3 pts), ternaries 1 (nesting depth added 8). 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.
cli.runAtoms (cognitive 29) apps/daemon/src/cli.ts:9960— cli.runAtoms has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-capture.isolateLayeredPptxBackground.paintsBehindTarget (cognitive 29) apps/desktop/src/main/deck-capture.ts:1061— deck-capture.isolateLayeredPptxBackground.paintsBehindTarget has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 8, loops 4 (6 pts) (nesting depth added 6). Of this number, 15 points are the body's own statements and 14 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.
useWorkspaceContext.useTeamProjects.loadFull (cognitive 29) apps/web/src/collab/useWorkspaceContext.ts:2087— useWorkspaceContext.useTeamProjects.loadFull has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 6 (11 pts), boolean chains 2, error handling 1 (nesting depth added 10). Of this number, 18 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-thumbnail-parser.parseDeckThumbnails (cognitive 29) REDACTED:106— deck-thumbnail-parser.parseDeckThumbnails has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 3 (4 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
design-kit.parsedToKit (cognitive 29) apps/web/src/runtime/design-kit.ts:511— design-kit.parsedToKit has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 16 (19 pts), boolean chains 8, if/else 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.
PluginMediaDetail.PluginMediaDetail (cognitive 29) apps/web/src/components/plugin-details/PluginMediaDetail.tsx:88— PluginMediaDetail.PluginMediaDetail has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (23 pts), boolean chains 5, if/else 1 (nesting depth added 12). Of this number, 28 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.
touchpoint-lifecycle.mountTouchpoint (cognitive 29) apps/web/src/components/touchpoint-lifecycle.ts:1001— touchpoint-lifecycle.mountTouchpoint has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 7). None of this is in the body itself: all 29 points belong to 7 function items inside it that branch (a function literal at line 1033, dispose, current, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
EntryShell.OnboardingByokSetupPanel (cognitive 29) apps/web/src/components/EntryShell.tsx:4146— EntryShell.OnboardingByokSetupPanel has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 16 (24 pts), boolean chains 5 (nesting depth added 8). 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.
comments.renderCommentAttachmentContext (cognitive 29) apps/web/src/comments.ts:475— comments.renderCommentAttachmentContext has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (12 pts), ternaries 2 (3 pts) (nesting depth added 4). None of this is in the body itself: all 29 points belong to 2 function literals inside it that branch (lines 482, 519). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FileViewer.FileViewer (cognitive 29) REDACTED:1876— FileViewer.FileViewer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 9 (nesting depth added 2). Of this number, 26 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FileViewer.CommentPreviewOverlays (cognitive 29) REDACTED:6094— FileViewer.CommentPreviewOverlays has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 16 (20 pts), boolean chains 5, if/else 3, loops 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 14 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.
animation-map.markCollisions (cognitive 29) design-templates/hyperframes/scripts/animation-map.mjs:318— animation-map.markCollisions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (21 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
entry-assets.stageCatalogEntryAssets (cognitive 29) tools/release/src/catalog/entry-assets.ts:86— entry-assets.stageCatalogEntryAssets has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 4, 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.
publish-metadata.uploadLatestMetadataWithCas (cognitive 29) tools/release/src/storage/publish-metadata.ts:199— publish-metadata.uploadLatestMetadataWithCas has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (7 pts), error handling 1 (3 pts), boolean chains 1, 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.
prerelease-progress-card.buildState (cognitive 29) tools/release/src/notifications/prerelease-progress-card.ts:451— prerelease-progress-card.buildState has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 6 (10 pts), boolean chains 7, 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.
comment-inbound-store.applyMemberPage (cognitive 28) apps/daemon/src/collab/comment-inbound-store.ts:223— comment-inbound-store.applyMemberPage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 4, boolean chains 3, loops 2 (3 pts) (nesting depth added 7). Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 229). 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.
vela-child-evidence.adaptVelaChildRuntimeFactV1 (cognitive 28) apps/daemon/src/runtimes/vela-child-evidence.ts:726— vela-child-evidence.adaptVelaChildRuntimeFactV1 has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 18 (23 pts), boolean chains 3, if/else 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
json-event-stream.handleOpenCodeEvent (cognitive 28) apps/daemon/src/runtimes/json-event-stream.ts:221— json-event-stream.handleOpenCodeEvent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (10 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
automation-ingestions.ingestAutomationSource (cognitive 28) apps/daemon/src/automation-ingestions.ts:365— automation-ingestions.ingestAutomationSource has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, ternaries 8 (12 pts), boolean chains 2 (nesting depth added 4). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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-context.parseWorkspaceCollabContext (cognitive 28) apps/daemon/src/collab/workspace-context.ts:251— workspace-context.parseWorkspaceCollabContext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13, boolean chains 8, ternaries 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
eval-context.attachmentContext (cognitive 28) apps/daemon/src/observability/eval-context.ts:24— eval-context.attachmentContext has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 3 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-artifacts.collectWrittenPathsMatching (cognitive 28) apps/daemon/src/runtimes/run-artifacts.ts:151— run-artifacts.collectWrittenPathsMatching has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
marketplaces.safeParseManifest (cognitive 28) apps/daemon/src/plugins/marketplaces.ts:405— marketplaces.safeParseManifest has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 7, if/else 4 (6 pts), error handling 2 (nesting depth added 6). Of this number, 15 points are the body's own statements and 13 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
marketplaces.resolvePluginInMarketplaces (cognitive 28) apps/daemon/src/plugins/marketplaces.ts:490— marketplaces.resolvePluginInMarketplaces has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fig-decode.decodeFigFile (cognitive 28) apps/daemon/src/figma/fig-decode.ts:57— fig-decode.decodeFigFile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 2 (4 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp-config.sanitizeMcpServer (cognitive 28) apps/daemon/src/mcp-config.ts:175— mcp-config.sanitizeMcpServer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, error handling 1 (2 pts), ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript-export.coalesceBlocks (cognitive 28) apps/daemon/src/transcript-export.ts:451— transcript-export.coalesceBlocks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, ternaries 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). Of this number, 24 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shadcn-import.writeShadcnFiles (cognitive 28) apps/daemon/src/design-systems/shadcn-import.ts:699— shadcn-import.writeShadcnFiles has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 5 (11 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-capture.compareBgraBitmaps (cognitive 28) apps/desktop/src/main/deck-capture.ts:1956— deck-capture.compareBgraBitmaps has cognitive complexity 28 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 4 (12 pts), boolean chains 3 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
runtime.pickAndImportFolder (cognitive 28) REDACTED:545— runtime.pickAndImportFolder has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 7 (10 pts), error handling 3 (4 pts), boolean chains 2 (nesting depth added 10). Of this number, 24 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
long-task.installLongTaskObserver (cognitive 28) apps/web/src/observability/long-task.ts:37— long-task.installLongTaskObserver has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 9, boolean chains 7, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 102, start, startCheckpoint, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WorkspaceBillingInterestRegistry.flush (cognitive 28) apps/web/src/collab/workspace-billing-interests.ts:120— WorkspaceBillingInterestRegistry.flush has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 8, ternaries 3 (5 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 162, 128, 220, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useWorkspaceContext.useTeamProjects (cognitive 28) apps/web/src/collab/useWorkspaceContext.ts:2018— useWorkspaceContext.useTeamProjects has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 12 (15 pts), if/else 9, boolean chains 4 (nesting depth added 3). Of this number, 14 points are the body's own statements and 14 belong to 8 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.
project-cover.HtmlProjectCoverFrame (cognitive 28) apps/web/src/components/project-cover.tsx:164— project-cover.HtmlProjectCoverFrame has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 13, ternaries 8, if/else 7. Of this number, 21 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.
tool-kind.outputRedirectionTargets (cognitive 28) apps/web/src/runtime/chat/tool-kind.ts:187— tool-kind.outputRedirectionTargets has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-thumbnail-parser.findCssImportEnd (cognitive 28) REDACTED:363— deck-thumbnail-parser.findCssImportEnd has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, 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.
BrandsTab.BrandsTab (cognitive 28) apps/web/src/components/BrandsTab.tsx:36— BrandsTab.BrandsTab has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 9, boolean chains 8 (nesting depth added 4). Of this number, 14 points are the body's own statements and 14 belong to 10 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.
PluginsView.PluginImportModal (cognitive 28) REDACTED:3699— PluginsView.PluginImportModal has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 7, if/else 6 (7 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 13 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PetOverlay.PetOverlay (cognitive 28) apps/web/src/components/pet/PetOverlay.tsx:140— PetOverlay.PetOverlay has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 19 (34 pts), if/else 28 (31 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (PetOverlay.PetOverlay::onPointerMove) 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.
manifest.inferLegacyManifest (cognitive 28) apps/web/src/artifacts/manifest.ts:151— manifest.inferLegacyManifest has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (23 pts), boolean chains 4, if/else 1 (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.
ChatComposer.DesignToolboxPanel (cognitive 28) apps/web/src/components/ChatComposer.tsx:5282— ChatComposer.DesignToolboxPanel has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 13 (23 pts), if/else 3 (4 pts), boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 7 of the 28 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 5465, a function literal at line 5429, a function literal at line 5359, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
auto-open-file.collectTurnCandidates (cognitive 28) apps/web/src/components/auto-open-file.ts:282— auto-open-file.collectTurnCandidates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 9, ternaries 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignFilesPanel.HtmlCardThumbnail (cognitive 28) apps/web/src/components/DesignFilesPanel.tsx:2057— DesignFilesPanel.HtmlCardThumbnail has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 7 (9 pts), boolean chains 3, loops 1 (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 9 function literals inside it that branch (lines 2138, 2114, 2123, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TerminalViewer.TerminalViewer (cognitive 28) apps/web/src/components/workspace/TerminalViewer.tsx:174— TerminalViewer.TerminalViewer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 8 (10 pts), boolean chains 4, error handling 3 (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 11 function literals inside it that branch (lines 207, 235, 305, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
App.resolveDeepLinkedTeamSharedProject (cognitive 28) apps/web/src/App.tsx:835— App.resolveDeepLinkedTeamSharedProject has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 2 (4 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.
comment-identity-selector.commentSelectorClaimsIdentity (cognitive 28) packages/contracts/src/runtime/comment-identity-selector.ts:4— comment-identity-selector.commentSelectorClaimsIdentity has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bake-plugin-previews.verticalDeckState (cognitive 28) scripts/bake-plugin-previews.mjs:289— bake-plugin-previews.verticalDeckState has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, if/else 6 (7 pts), ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 2). Of this number, 25 points are the body's own statements and 3 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.
guard.collectStylePolicyViolationsFromSource (cognitive 28) scripts/guard.ts:1257— guard.collectStylePolicyViolationsFromSource has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (8 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.
i18n-check.checkCoreDocLinks (cognitive 28) scripts/i18n-check.ts:261— i18n-check.checkCoreDocLinks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
system-tokens.loadCatalogSystemTokens (cognitive 28) tools/release/src/catalog/system-tokens.ts:57— system-tokens.loadCatalogSystemTokens has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, ternaries 4 (5 pts), loops 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render-previews.renderCatalogPreviews (cognitive 28) tools/release/src/catalog/render-previews.ts:474— render-previews.renderCatalogPreviews has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 12). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Workload.__init__ (cognitive 28) .github/scripts/convergence.py:80— Workload.__init__ has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, loops 3 (4 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
convergence.project_batches (cognitive 28) .github/scripts/convergence.py:959— convergence.project_batches has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (22 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.
deliverable-syntax-safe-fix.proposePatch (cognitive 27) apps/daemon/src/artifacts/deliverable-syntax-safe-fix.ts:256— deliverable-syntax-safe-fix.proposePatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, ternaries 4 (7 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.
task-object-summary.taskObjectMetadata (cognitive 27) apps/daemon/src/observability/task-object-summary.ts:2— task-object-summary.taskObjectMetadata has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (15 pts), boolean chains 7, if/else 3 (4 pts), loops 1 (nesting depth added 9). Of this number, 23 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-input-snapshot.loadOdNextTaskInputSnapshot (cognitive 27) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:853— task-input-snapshot.loadOdNextTaskInputSnapshot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 8, loops 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.
chat-run-messages.persistRunFailureClassification (cognitive 27) apps/daemon/src/runtimes/chat-run-messages.ts:373— chat-run-messages.persistRunFailureClassification has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 7, boolean chains 4, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
project-public-file-stop.createProjectPublicFileStop (cognitive 27) apps/daemon/src/collab/project-public-file-stop.ts:30— project-public-file-stop.createProjectPublicFileStop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 9, error handling 1 (2 pts), loops 1 (nesting depth added 8). None of this is in the body itself: all 27 points belong to 5 function literals inside it that branch (lines 31, 73, 44, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
team-mirror-promotion.recoverAuthorizedTeamProjectPromotions (cognitive 27) apps/daemon/src/collab/team-mirror-promotion.ts:526— team-mirror-promotion.recoverAuthorizedTeamProjectPromotions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), error handling 2 (3 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.
deploy.rewriteSrcset (cognitive 27) REDACTED:1845— deploy.rewriteSrcset has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 4 (8 pts), boolean chains 4 (nesting depth added 14). 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, 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.
server-services.createDesignSystemServerServices.resolveDesignSystemWorkspaceProject (cognitive 27) apps/daemon/src/design-systems/server-services.ts:664— server-services.createDesignSystemServerServices.resolveDesignSystemWorkspaceProject has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 6 (10 pts), boolean chains 5 (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.
patch-edit.parseUnifiedDiff (cognitive 27) apps/daemon/src/plugins/atoms/patch-edit.ts:253— patch-edit.parseUnifiedDiff has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (7 pts), ternaries 2 (4 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.
next-step-marker.createNextStepMarkerStripper.strip (cognitive 27) apps/daemon/src/next-step-marker.ts:221— next-step-marker.createNextStepMarkerStripper.strip has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (26 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.
ProductionMarkerStream.line (cognitive 27) apps/daemon/src/strategies/od-next/production-marker.ts:45— ProductionMarkerStream.line has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 3 (7 pts), boolean chains 5 (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.
lint-artifact.buildResolvedThemes (cognitive 27) apps/daemon/src/lint-artifact.ts:695— lint-artifact.buildResolvedThemes has cognitive complexity 27 (threshold 15). Drivers by points: loops 8 (20 pts), if/else 3 (7 pts) (nesting depth added 16). 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.
conformance-history.readConformanceHistory (cognitive 27) apps/daemon/src/critique/conformance-history.ts:78— conformance-history.readConformanceHistory has cognitive complexity 27 (threshold 15). Drivers by points: if/else 3 (11 pts), error handling 3 (8 pts), loops 4 (7 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.
import-export-routes.chooseExportManifestEntryFile (cognitive 27) REDACTED:1946— import-export-routes.chooseExportManifestEntryFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, loops 1, ternaries 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.
skill-installation.findSkillRoot (cognitive 27) apps/daemon/src/services/skill-installation.ts:258— skill-installation.findSkillRoot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 10 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runMessageCenterList (cognitive 27) apps/daemon/src/cli.ts:1768— cli.runMessageCenterList has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 8, boolean chains 3, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
runtime.pickAndReplaceWorkingDir (cognitive 27) REDACTED:659— runtime.pickAndReplaceWorkingDir has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 3 (6 pts), error handling 3 (4 pts), boolean chains 3 (nesting depth added 10). Of this number, 24 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-kind.splitTopLevel (cognitive 27) apps/web/src/runtime/chat/tool-kind.ts:75— tool-kind.splitTopLevel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, loops 1 (nesting depth added 11). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrandPreviewCard.BrandPreviewCard (cognitive 27) apps/web/src/components/BrandPreviewCard.tsx:46— BrandPreviewCard.BrandPreviewCard has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 7 (9 pts), boolean chains 5, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 129, 106, 75). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EntryNavRail.RailRecentSection (cognitive 27) apps/web/src/components/EntryNavRail.tsx:405— EntryNavRail.RailRecentSection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 10, boolean chains 4, loops 2, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 517, a function literal at line 512, a function literal at line 605, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
HomeHero.FooterInputOption (cognitive 27) apps/web/src/components/HomeHero.tsx:3134— HomeHero.FooterInputOption has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (19 pts), boolean chains 5, if/else 3 (nesting depth added 9). Of this number, 19 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
modelOptions.SearchableModelSelect::renderModelOption (cognitive 27) apps/web/src/components/modelOptions.tsx:478— modelOptions.SearchableModelSelect::renderModelOption has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 18 (22 pts), boolean chains 4, if/else 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (modelOptions.SearchableModelSelect) 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.
markdown.renderInline (cognitive 27) REDACTED:602— markdown.renderInline has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InlinePluginsRail.InlinePluginsRail (cognitive 27) apps/web/src/components/InlinePluginsRail.tsx:59— InlinePluginsRail.InlinePluginsRail has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10, boolean chains 8, if/else 8, error handling 1. Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (onClick, a function literal at line 199, a function literal at line 93, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ShareMoreMenu.ShareMoreMenu (cognitive 27) apps/web/src/components/share/ShareMoreMenu.tsx:21— ShareMoreMenu.ShareMoreMenu has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12, ternaries 6 (9 pts), boolean chains 6 (nesting depth added 3). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 78, a function literal at line 38, a function literal at line 64, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FileWorkspace.designSystemInitialGenerationSteps (cognitive 27) apps/web/src/components/FileWorkspace.tsx:6492— FileWorkspace.designSystemInitialGenerationSteps has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 8, if/else 2 (3 pts) (nesting depth added 6). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectView.extractTouchedFilePathsFromEvents (cognitive 27) apps/web/src/components/ProjectView.tsx:15762— ProjectView.extractTouchedFilePathsFromEvents has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 2 (7 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionModeToggle.SessionModeToggle (cognitive 27) apps/web/src/components/SessionModeToggle.tsx:204— SessionModeToggle.SessionModeToggle has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 7 (11 pts), boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 310, 288, 346, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
REDACTED.drawLineChart (cognitive 27) design-templates/social-media-matrix-tracker-template/assets/template.html:665— REDACTED.drawLineChart has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 9 (11 pts), loops 2, ternaries 1 (nesting depth added 2). 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.
REDACTED.drawLineChart (cognitive 27) design-templates/social-media-matrix-tracker-template/example.html:665— REDACTED.drawLineChart has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 9 (11 pts), loops 2, ternaries 1 (nesting depth added 2). 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.
artifact-markdown-context.computeSkipRanges (cognitive 27) packages/contracts/src/artifacts/artifact-markdown-context.ts:44— artifact-markdown-context.computeSkipRanges has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 9). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release.publish (cognitive 27) .github/scripts/release.py:93— release.publish has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rerun_infra_cancel.resolve_merge_group_open_pr (cognitive 27) .github/scripts/rerun_infra_cancel.py:544— rerun_infra_cancel.resolve_merge_group_open_pr has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
comment-file-facts.commentFilesAtReceipt (cognitive 26) apps/daemon/src/collab/comment-file-facts.ts:48— comment-file-facts.commentFilesAtReceipt has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (11 pts), loops 2 (3 pts) (nesting depth added 4). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
json-event-stream.extractErrorMessage (cognitive 26) apps/daemon/src/runtimes/json-event-stream.ts:121— json-event-stream.extractErrorMessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 7 (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.
analytics.createAnalyticsService.capture (cognitive 26) apps/daemon/src/analytics.ts:430— analytics.createAnalyticsService.capture has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 12 (21 pts), error handling 2, if/else 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp.validateRuntimeJsonSchema (cognitive 26) apps/daemon/src/mcp.ts:877— mcp.validateRuntimeJsonSchema has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 6, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp.getRun (cognitive 26) apps/daemon/src/mcp.ts:2734— mcp.getRun has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-run-messages.unboundedPersistedAgentEvent (cognitive 26) apps/daemon/src/runtimes/chat-run-messages.ts:454— chat-run-messages.unboundedPersistedAgentEvent has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 4 (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.
team-project-share.createDesignSystemBackingProjectPreparer (cognitive 26) apps/daemon/src/design-systems/team-project-share.ts:87— team-project-share.createDesignSystemBackingProjectPreparer has cognitive complexity 26 (threshold 15). Drivers by points: error handling 6 (15 pts), if/else 6 (7 pts), boolean chains 4 (nesting depth added 10). None of this is in the body itself: all 26 points belong to 2 function literals inside it that branch (lines 110, 90). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-map.runTokenMap (cognitive 26) apps/daemon/src/plugins/atoms/token-map.ts:117— token-map.runTokenMap has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (5 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 9). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
artifact-handler.handleCritiqueArtifact (cognitive 26) apps/daemon/src/critique/artifact-handler.ts:41— artifact-handler.handleCritiqueArtifact has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 5 (7 pts), boolean chains 5, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 60, 197). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
showcase.extractColors (cognitive 26) apps/daemon/src/design-systems/showcase.ts:660— showcase.extractColors has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, ternaries 1 (4 pts), loops 1 (nesting depth added 11). Of this number, 14 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.falQueueRun (cognitive 26) apps/daemon/src/media/index.ts:3662— index.falQueueRun has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.registerProjectFileRoutes::sendProjectFile (cognitive 26) REDACTED:6311— index.registerProjectFileRoutes::sendProjectFile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, ternaries 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-llm.collectProposedEntries (cognitive 26) apps/daemon/src/memory-llm.ts:1213— memory-llm.collectProposedEntries has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, ternaries 3 (4 pts), error handling 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
memory-connectors.collectLikelyTitleTexts (cognitive 26) apps/daemon/src/memory-connectors.ts:732— memory-connectors.collectLikelyTitleTexts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-connectors.titleFromNotionObject (cognitive 26) apps/daemon/src/memory-connectors.ts:774— memory-connectors.titleFromNotionObject has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (4 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.
import.walkProject (cognitive 26) apps/daemon/src/design-systems/import.ts:267— import.walkProject has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (16 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
daemon-startup.parseDaemonCliStartupArgs (cognitive 26) apps/daemon/src/daemon-startup.ts:45— daemon-startup.parseDaemonCliStartupArgs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 6, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginDoctor (cognitive 26) apps/daemon/src/cli.ts:6112— cli.runPluginDoctor has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 6 (7 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 9). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
use-cloud-sign-in.useCloudSignIn.begin (cognitive 26) apps/web/src/components/use-cloud-sign-in.ts:45— use-cloud-sign-in.useCloudSignIn.begin has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 7, 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.
CloudSignInTip.CloudSignInTip (cognitive 26) apps/web/src/components/CloudSignInTip.tsx:101— CloudSignInTip.CloudSignInTip has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 14 (19 pts), if/else 4, boolean chains 3 (nesting depth added 5). Of this number, 21 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.
project-cover-pipeline.resolveProjectCover (cognitive 26) apps/web/src/lib/project-cover-pipeline.ts:60— project-cover-pipeline.resolveProjectCover has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, error handling 3 (4 pts), 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.
EntrySettingsMenu.EntrySettingsMenu (cognitive 26) apps/web/src/components/EntrySettingsMenu.tsx:74— EntrySettingsMenu.EntrySettingsMenu has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 12 (nesting depth added 6). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 122, 131, 237, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LibrarySection.LibraryCard (cognitive 26) apps/web/src/components/LibrarySection.tsx:360— LibrarySection.LibraryCard has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (20 pts), if/else 4, boolean chains 2 (nesting depth added 9). Of this number, 21 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkingDirPicker.WorkingDirPicker (cognitive 26) apps/web/src/components/WorkingDirPicker.tsx:61— WorkingDirPicker.WorkingDirPicker has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13 (21 pts), if/else 4, boolean chains 1 (nesting depth added 8). Of this number, 22 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginShareMenu.PluginShareMenu (cognitive 26) apps/web/src/components/plugin-details/PluginShareMenu.tsx:111— PluginShareMenu.PluginShareMenu has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 8, boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 10 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 236, a function literal at line 125, a function literal at line 123, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ConnectorsBrowser.ConnectorsBrowser::runConnectorAction (cognitive 26) apps/web/src/components/ConnectorsBrowser.tsx:672— ConnectorsBrowser.ConnectorsBrowser::runConnectorAction has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (9 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ConnectorsBrowser.ConnectorsBrowser) 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.
useCritiqueReplay.useCritiqueReplay (cognitive 26) apps/web/src/components/Theater/hooks/useCritiqueReplay.ts:81— useCritiqueReplay.useCritiqueReplay has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (16 pts), ternaries 4 (6 pts), loops 2 (3 pts), error handling 1 (nesting depth added 4). None of this is in the body itself: all 26 points belong to 5 function literals inside it that branch (lines 125, 166, 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.
manifest.parseArtifactManifest (cognitive 26) apps/web/src/artifacts/manifest.ts:100— manifest.parseArtifactManifest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10, ternaries 8, boolean chains 7, error handling 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.
todos.parseTodoWriteInput (cognitive 26) apps/web/src/runtime/todos.ts:17— todos.parseTodoWriteInput has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (21 pts), if/else 3, boolean chains 2 (nesting depth added 12). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 26). 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.
PresenceBar.PresenceBar (cognitive 26) apps/web/src/collab/PresenceBar.tsx:73— PresenceBar.PresenceBar has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 7, boolean chains 5 (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 (enrich, a function literal at line 129, a function literal at line 131, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ImageRow.ImageRow (cognitive 26) apps/web/src/components/chat/primitives/ImageRow.tsx:102— ImageRow.ImageRow has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 5, if/else 4 (nesting depth added 7). Most of this is not in the body itself: 9 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 191, preview, a function literal at line 133). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PluginsSection.PluginsSection (cognitive 26) apps/web/src/components/PluginsSection.tsx:103— PluginsSection.PluginsSection has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 8 (10 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 203, 110, 133, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ChatComposer.StagedAttachmentTray (cognitive 26) apps/web/src/components/ChatComposer.tsx:4577— ChatComposer.StagedAttachmentTray has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 6 (7 pts), boolean chains 5 (nesting depth added 5). Most of this is not in the body itself: 6 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 4620, removeCard, a function literal at line 4602, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ChatPane.QueuedSendStrip (cognitive 26) apps/web/src/components/ChatPane.tsx:6001— ChatPane.QueuedSendStrip has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 6 (nesting depth added 1). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 5 function items inside it that branch (handleDragOver, handleDrop, a function literal at line 6114, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AmrArtifactUpgradeGate.AmrArtifactUpgradeGate (cognitive 26) apps/web/src/components/AmrArtifactUpgradeGate.tsx:82— AmrArtifactUpgradeGate.AmrArtifactUpgradeGate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, boolean chains 9, ternaries 4. Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 143, 255, 178, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ExperienceSurvey.ExperienceSurvey (cognitive 26) apps/web/src/components/ExperienceSurvey.tsx:107— ExperienceSurvey.ExperienceSurvey has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, ternaries 4 (5 pts), boolean chains 3, loops 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 142, 175, 196, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignSystemFlow.GitHubRepositoryAccessPanel (cognitive 26) apps/web/src/components/DesignSystemFlow.tsx:4102— DesignSystemFlow.GitHubRepositoryAccessPanel has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (18 pts), if/else 6, boolean chains 2 (nesting depth added 7). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignSystemFlow.buildSourceContextManifest (cognitive 26) apps/web/src/components/DesignSystemFlow.tsx:5575— DesignSystemFlow.buildSourceContextManifest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 2, ternaries 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, 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.
system.promptTemplateReferenceLines (cognitive 26) REDACTED:998— system.promptTemplateReferenceLines has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (7 pts), boolean chains 4 (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.
index.normalizeDesktopRenderSlidesInput (cognitive 26) packages/sidecar-proto/src/index.ts:952— index.normalizeDesktopRenderSlidesInput has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10, if/else 8 (9 pts), boolean chains 7 (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.
check-design-system-flag-parity.checkDesignSystemFlagParity (cognitive 26) scripts/check-design-system-flag-parity.ts:160— check-design-system-flag-parity.checkDesignSystemFlagParity has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 4 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate.validateCatalogProvenance (cognitive 26) tools/release/src/catalog/validate.ts:210— validate.validateCatalogProvenance has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 6, 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.
inspect_frames.inspect_state (cognitive 26) skills/hatch-pet/scripts/inspect_frames.py:109— inspect_frames.inspect_state has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, 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.
app-config.validateAgentCliEnv (cognitive 25) apps/daemon/src/app-config.ts:279— app-config.validateAgentCliEnv has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
task-store.validateTransition (cognitive 25) apps/daemon/src/strategies/task-store.ts:1543— task-store.validateTransition has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 11 (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.
json-event-stream.handleCursorEvent (cognitive 25) apps/daemon/src/runtimes/json-event-stream.ts:777— json-event-stream.handleCursorEvent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory.extractFromMessage (cognitive 25) REDACTED:1083— memory.extractFromMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 2 (5 pts), boolean chains 3, 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.
fonts.parseFontFaces (cognitive 25) apps/daemon/src/brands/fonts.ts:79— fonts.parseFontFaces has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.finalizeBrandCore (cognitive 25) apps/daemon/src/brands/index.ts:1393— index.finalizeBrandCore has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 5 (6 pts), ternaries 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-input-snapshot.mediaTypeFromBytes (cognitive 25) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:398— task-input-snapshot.mediaTypeFromBytes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, error handling 1 (3 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.
public-file-failure.classifyVelaCommandFailure (cognitive 25) apps/daemon/src/collab/public-file-failure.ts:38— public-file-failure.classifyVelaCommandFailure has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10, ternaries 5 (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.
versioning.comparePrerelease (cognitive 25) apps/daemon/src/registry/versioning.ts:159— versioning.comparePrerelease has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 2 (7 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.
tool-loop-guard.isReadOnlyShellCommand (cognitive 25) apps/daemon/src/tool-loop-guard.ts:220— tool-loop-guard.isReadOnlyShellCommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runs.createChatRunService.statusBody (cognitive 25) apps/daemon/src/runtimes/runs.ts:1525— runs.createChatRunService.statusBody has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 23, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
task-observation-otlp-exporter.postOtlpTaskPayload (cognitive 25) apps/daemon/src/observability/task-observation-otlp-exporter.ts:949— task-observation-otlp-exporter.postOtlpTaskPayload has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (9 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diagnostics-export.createDiagnosticsExportHandler (cognitive 25) apps/daemon/src/diagnostics-export.ts:339— diagnostics-export.createDiagnosticsExportHandler has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 5 (7 pts), loops 2 (4 pts), error handling 3, boolean chains 1 (nesting depth added 8). None of this is in the body itself: all 25 points belong to 3 function literals inside it that branch (lines 341, 441, 415). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tools-connectors-cli.collectGithubTreePathsFromDirectoryListings (cognitive 25) apps/daemon/src/tools-connectors-cli.ts:735— tools-connectors-cli.collectGithubTreePathsFromDirectoryListings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 12). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server.createFinalizedMessageTelemetryReporter::reportFinalized (cognitive 25) REDACTED:2407— server.createFinalizedMessageTelemetryReporter::reportFinalized has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4 (9 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runMediaStockSearch (cognitive 25) apps/daemon/src/cli.ts:2013— cli.runMediaStockSearch has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (10 pts), error handling 5 (6 pts), boolean chains 3, if/else 3, loops 2 (3 pts) (nesting depth added 6). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-capture.renderDeckSlides (cognitive 25) apps/desktop/src/main/deck-capture.ts:238— deck-capture.renderDeckSlides has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 7, boolean chains 5, error handling 3 (4 pts), loops 1 (nesting depth added 3). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
chat-interaction.installChatInteractionObserver (cognitive 25) apps/web/src/observability/chat-interaction.ts:37— chat-interaction.installChatInteractionObserver has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts), ternaries 3 (4 pts), loops 1 (2 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 2 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 110, start, keydown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
chat-scroll-jank.installChatScrollJankObserver (cognitive 25) apps/web/src/observability/chat-scroll-jank.ts:10— chat-scroll-jank.installChatScrollJankObserver has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5 (10 pts), boolean chains 4 (nesting depth added 6). None of this is in the body itself: all 25 points belong to 4 function items inside it that branch (a function literal at line 53, frame, activity, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
kit-upload.brandFromRaw (cognitive 25) apps/web/src/runtime/kit-upload.ts:168— kit-upload.brandFromRaw has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (22 pts), error handling 1 (2 pts), if/else 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.
LibraryPreviewModal.LibraryPreviewModal (cognitive 25) apps/web/src/components/LibraryPreviewModal.tsx:259— LibraryPreviewModal.LibraryPreviewModal has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 6, if/else 5 (nesting depth added 1). Of this number, 19 points are the body's own statements and 6 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.
touchpoint-component.verifyWebTouchpoint (cognitive 25) apps/web/src/components/touchpoint-component.ts:157— touchpoint-component.verifyWebTouchpoint has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, loops 3 (4 pts), error handling 1 (nesting depth added 3). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
chat-events.appendErrorStatusEvent (cognitive 25) apps/web/src/runtime/chat-events.ts:59— chat-events.appendErrorStatusEvent has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 13 (19 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnchoredMenuShell.AnchoredMenuShell (cognitive 25) apps/web/src/components/chat/AnchoredMenuShell.tsx:110— AnchoredMenuShell.AnchoredMenuShell has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, ternaries 8 (10 pts), boolean chains 2 (nesting depth added 2). Of this number, 19 points are the body's own statements and 6 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.
ChatComposer.buildComposerMentionEntities (cognitive 25) apps/web/src/components/ChatComposer.tsx:4043— ChatComposer.buildComposerMentionEntities has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7, boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatPane.UserMessageImpl (cognitive 25) apps/web/src/components/ChatPane.tsx:6657— ChatPane.UserMessageImpl has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 13 (21 pts), if/else 4 (nesting depth added 8). Of this number, 17 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignBrowserPanel.DesignBrowserPanel::savePageSnapshot (cognitive 25) REDACTED:1863— DesignBrowserPanel.DesignBrowserPanel::savePageSnapshot has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 7, boolean chains 6, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DesignBrowserPanel.DesignBrowserPanel) 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.
FileWorkspace.Tab (cognitive 25) apps/web/src/components/FileWorkspace.tsx:8581— FileWorkspace.Tab has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 20 (22 pts), boolean chains 2, if/else 1 (nesting depth added 2). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
DesignSystemFlow.DesignSystemCreationFlow::generate (cognitive 25) apps/web/src/components/DesignSystemFlow.tsx:859— DesignSystemFlow.DesignSystemCreationFlow::generate has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 6, boolean chains 5, error handling 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (DesignSystemFlow.DesignSystemCreationFlow) 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.
DesignSystemFlow.DesignSystemCreationFlow (cognitive 25) apps/web/src/components/DesignSystemFlow.tsx:343— DesignSystemFlow.DesignSystemCreationFlow has cognitive complexity 25 (threshold 15). Drivers by points: if/else 60 (62 pts), ternaries 38 (48 pts), boolean chains 17, error handling 6 (7 pts) (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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. This shape REPEATS in the file: one other method here (DesignSystemFlow.DesignSystemCreationFlow::generate) 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.
DesignSystemFlow.DropZone (cognitive 25) apps/web/src/components/DesignSystemFlow.tsx:3809— DesignSystemFlow.DropZone has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, ternaries 5, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 9 function items inside it that branch (beginFileDialogReturnLoading, processSelectedFiles, readDrop, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
PluginInputsForm.renderField (cognitive 25) apps/web/src/components/PluginInputsForm.tsx:110— PluginInputsForm.renderField has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 6 (7 pts), boolean chains 5 (nesting depth added 7). Of this number, 19 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.
REDACTED.normalizeImageFills (cognitive 25) REDACTED:151— REDACTED.normalizeImageFills has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (walk, prune, 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.
normalized-agent-observation-v1.PromptBoundaryEvidenceV1Schema (cognitive 25) packages/contracts/src/observability/normalized-agent-observation-v1.ts:148— normalized-agent-observation-v1.PromptBoundaryEvidenceV1Schema has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 10 (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.
od-next-strategy.composeOdNextStrategyStableRequestContextV2 (cognitive 25) packages/contracts/src/prompts/od-next-strategy.ts:489— od-next-strategy.composeOdNextStrategyStableRequestContextV2 has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, ternaries 8 (11 pts), boolean chains 2 (nesting depth added 3). Of this number, 19 points are the body's own statements and 6 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.
automatic.buildAutomaticDiagnostics::records (cognitive 25) packages/diagnostics/src/automatic.ts:103— automatic.buildAutomaticDiagnostics::records has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge.mergeCompat (cognitive 25) packages/plugin-runtime/src/merge.ts:38— merge.mergeCompat has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
source-check.parseArgs (cognitive 25) scripts/source-check.ts:94— source-check.parseArgs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 2, 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.
markdown.extractFirstProseParagraph (cognitive 25) tools/release/src/catalog/markdown.ts:81— markdown.extractFirstProseParagraph has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
publish-catalog.updateLatestPointer (cognitive 25) tools/release/src/storage/publish-catalog.ts:80— publish-catalog.updateLatestPointer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 1 (3 pts), boolean chains 1, 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.
R2Client.put_bytes (cognitive 25) .github/scripts/lib/r2.py:93— R2Client.put_bytes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (4 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
execute (cognitive 25) shells/terminal/runtime/fossil.mjs:277— execute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 3 (4 pts), other 3, boolean chains 2 (nesting depth added 4). Of this number, 23 points are the body's own statements and 2 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
vela-command.redactVelaCommandError (cognitive 24) apps/daemon/src/integrations/vela-command.ts:40— vela-command.redactVelaCommandError has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (8 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 8). Of this number, 16 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpObservabilitySession.resolveAttribution (cognitive 24) apps/daemon/src/mcp.ts:1238— McpObservabilitySession.resolveAttribution has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projects.collectFiles (cognitive 24) REDACTED:283— projects.collectFiles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fonts.harvestFonts (cognitive 24) apps/daemon/src/brands/fonts.ts:236— fonts.harvestFonts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (5 pts), boolean chains 4, loops 2 (nesting depth added 8). Of this number, 23 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonPathScanner.step (cognitive 24) apps/daemon/src/runtimes/tool-input-path-scanner.ts:255— JsonPathScanner.step has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 9 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
comment-file-authority.commitCommentFileFacts (cognitive 24) apps/daemon/src/collab/comment-file-authority.ts:11— comment-file-authority.commitCommentFileFacts has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts), error handling 2, loops 1, ternaries 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 6 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.
proactive-content-pull.createProactiveContentPull.requestCatchUp (cognitive 24) apps/daemon/src/collab/proactive-content-pull.ts:2238— proactive-content-pull.createProactiveContentPull.requestCatchUp has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 2273). 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.
schema.validateBoundedJsonInternal (cognitive 24) apps/daemon/src/live-artifacts/schema.ts:375— schema.validateBoundedJsonInternal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-loop-guard.createToolLoopGuard.observeToolResult (cognitive 24) apps/daemon/src/tool-loop-guard.ts:378— tool-loop-guard.createToolLoopGuard.observeToolResult has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (7 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-artifact-fs.snapshotProjectArtifactsAsync::walk (cognitive 24) apps/daemon/src/run-artifact-fs.ts:266— run-artifact-fs.snapshotProjectArtifactsAsync::walk has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-retry-policy.transientSuppressedReason (cognitive 24) apps/daemon/src/run-retry-policy.ts:176— run-retry-policy.transientSuppressedReason has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 7 (8 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.
tavily.tavilySearch (cognitive 24) apps/daemon/src/research/tavily.ts:46— tavily.tavilySearch has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 5, if/else 4 (5 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
marketplaces.registerPluginMarketplaceRoutes (cognitive 24) REDACTED:40— marketplaces.registerPluginMarketplaceRoutes has cognitive complexity 24 (threshold 15). Drivers by points: error handling 8, if/else 8, ternaries 5, boolean chains 3. None of this is in the body itself: all 24 points belong to 8 function items inside it that branch (a function literal at line 54, a function literal at line 102, a function literal at line 88, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
index.registerProjectPluginRoutes (cognitive 24) REDACTED:957— index.registerProjectPluginRoutes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, ternaries 3 (4 pts), boolean chains 1, error handling 1 (nesting depth added 1). None of this is in the body itself: all 24 points belong to 11 function literals inside it that branch (lines 1023, 974, 989, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
inline-assets.inlineRelativeAssets (cognitive 24) REDACTED:96— inline-assets.inlineRelativeAssets has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (20 pts), loops 3, boolean chains 1 (nesting depth added 4). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
terminal.registerTerminalRoutes (cognitive 24) REDACTED:22— terminal.registerTerminalRoutes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, boolean chains 4, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). None of this is in the body itself: all 24 points belong to 7 function items inside it that branch (a function literal at line 52, a function literal at line 111, resolveSession, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
memory-llm.describeFetchError (cognitive 24) apps/daemon/src/memory-llm.ts:746— memory-llm.describeFetchError has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5 (7 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-publish-watcher.createCollabPublishWatcher.reconcile (cognitive 24) apps/daemon/src/collab/collab-publish-watcher.ts:71— collab-publish-watcher.createCollabPublishWatcher.reconcile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), error handling 1 (2 pts), loops 2 (nesting depth added 10). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shadcn-import.resolveShadcnItem (cognitive 24) apps/daemon/src/design-systems/shadcn-import.ts:338— shadcn-import.resolveShadcnItem has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (6 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cloudflare-pages-helpers.checkCloudflarePagesDeploymentLinks (cognitive 24) apps/daemon/src/deploy/cloudflare-pages-helpers.ts:79— cloudflare-pages-helpers.checkCloudflarePagesDeploymentLinks has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, ternaries 5, error handling 1 (3 pts), if/else 2 (3 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tools-live-artifacts-cli.runLiveArtifactsToolCli (cognitive 24) apps/daemon/src/tools-live-artifacts-cli.ts:250— tools-live-artifacts-cli.runLiveArtifactsToolCli has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 3 (6 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.parseFlags (cognitive 24) apps/daemon/src/cli.ts:2479— cli.parseFlags has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (4 pts), boolean chains 3, 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.
cli.runPluginValidate (cognitive 24) apps/daemon/src/cli.ts:3225— cli.runPluginValidate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (6 pts), ternaries 3 (5 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runShare (cognitive 24) apps/daemon/src/cli.ts:6607— cli.runShare has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4 (5 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-sampler.startMemorySampler.sample (cognitive 24) apps/desktop/src/main/memory-sampler.ts:72— memory-sampler.startMemorySampler.sample has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (8 pts), boolean chains 4, error handling 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
payload.prepareLauncherPayloadRelease (cognitive 24) apps/desktop/src/main/updater/payload.ts:203— payload.prepareLauncherPayloadRelease has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 5 (9 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-scroll-freeze.adoptSurfaceParts (cognitive 24) apps/web/src/observability/chat-scroll-freeze.ts:928— chat-scroll-freeze.adoptSurfaceParts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (6 pts), ternaries 1 (3 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.
useWorkspaceContext.useTeamProjects.loadProjectMetadata (cognitive 24) apps/web/src/collab/useWorkspaceContext.ts:2171— useWorkspaceContext.useTeamProjects.loadProjectMetadata has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 7, boolean chains 2, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 2222, a function literal at line 2233, isStillCurrent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
DesignKitView.BrandLogo (cognitive 24) apps/web/src/components/DesignKitView.tsx:95— DesignKitView.BrandLogo has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 3, if/else 1 (nesting depth added 10). Of this number, 16 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmrBalanceDialog.AmrBalanceDialog (cognitive 24) apps/web/src/components/AmrBalanceDialog.tsx:114— AmrBalanceDialog.AmrBalanceDialog has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 10 (11 pts), boolean chains 1 (nesting depth added 2). Of this number, 12 points are the body's own statements and 12 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.
HomeHero.comparePluginPresetOrder (cognitive 24) apps/web/src/components/HomeHero.tsx:4225— HomeHero.comparePluginPresetOrder has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 6 (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.
modelProviderIcon.modelProviderIconSrc (cognitive 24) apps/web/src/components/modelProviderIcon.ts:8— modelProviderIcon.modelProviderIconSrc has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, boolean chains 8, ternaries 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.
RoutinesSection.RoutinesSection::submit (cognitive 24) apps/web/src/components/RoutinesSection.tsx:583— RoutinesSection.RoutinesSection::submit has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 5, if/else 4, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
visualScore.pluginVisualScore (cognitive 24) apps/web/src/components/plugins-home/visualScore.ts:98— visualScore.pluginVisualScore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
visualScore.sortByVisualAppeal (cognitive 24) apps/web/src/components/plugins-home/visualScore.ts:147— visualScore.sortByVisualAppeal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8 (nesting depth added 6). None of this is in the body itself: all 24 points belong to one function literal inside it that branches (line 157). 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.
question-form.parseDirectionCards (cognitive 24) apps/web/src/artifacts/question-form.ts:1119— question-form.parseDirectionCards has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 3 (5 pts), boolean chains 3, 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.
ToolCard.TodoCard (cognitive 24) apps/web/src/components/ToolCard.tsx:256— ToolCard.TodoCard has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 10, if/else 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 10 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.
IframeKeepAlivePool.IframeKeepAliveProvider (cognitive 24) apps/web/src/components/IframeKeepAlivePool.tsx:79— IframeKeepAlivePool.IframeKeepAliveProvider has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, loops 5 (nesting depth added 3). None of this is in the body itself: all 24 points belong to 6 function items inside it that branch (a function literal at line 123, enforceLimit, removeEntry, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
DesignFilesBuildingState.DesignFilesBuildingState (cognitive 24) REDACTED:79— DesignFilesBuildingState.DesignFilesBuildingState has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 7 (8 pts), loops 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 159, 88, 140, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SketchEditor.applySketchContextMenuSimplification (cognitive 24) apps/web/src/components/SketchEditor.tsx:772— SketchEditor.applySketchContextMenuSimplification has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileWorkspace.designSystemSectionActivity (cognitive 24) apps/web/src/components/FileWorkspace.tsx:6590— FileWorkspace.designSystemSectionActivity has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (22 pts), boolean chains 2 (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.
brand-capture.deriveBrandColors (cognitive 24) clipper/brand-capture.js:425— brand-capture.deriveBrandColors has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 16, if/else 4 (6 pts), loops 1, ternaries 1 (nesting depth added 2). Of this number, 22 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.
agent-skill.adaptAgentSkill (cognitive 24) packages/plugin-runtime/src/adapters/agent-skill.ts:36— agent-skill.adaptAgentSkill has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, ternaries 8 (9 pts), if/else 1 (2 pts), loops 1 (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.
check-design-system-manifests.validateDesignTokensJson (cognitive 24) scripts/check-design-system-manifests.ts:157— check-design-system-manifests.validateDesignTokensJson has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (6 pts), error handling 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-whats-new-publish-workflow.expressionSpans (cognitive 24) scripts/check-whats-new-publish-workflow.ts:115— check-whats-new-publish-workflow.expressionSpans has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
i18n-check.checkReadmeSwitchers (cognitive 24) scripts/i18n-check.ts:198— i18n-check.checkReadmeSwitchers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 11). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fossil.validateRequest (cognitive 24) shells/terminal/runtime/fossil.mjs:24— fossil.validateRequest has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 12. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
app-config.validateProjectLocations (cognitive 23) apps/daemon/src/app-config.ts:374— app-config.validateProjectLocations has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (6 pts), boolean chains 4, 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.
app-config.doWrite (cognitive 23) apps/daemon/src/app-config.ts:931— app-config.doWrite has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 6, error handling 2 (4 pts), if/else 2 (3 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updates.acpArtifactWritePathRanked (cognitive 23) apps/daemon/src/agent-protocol/acp/updates.ts:359— updates.acpArtifactWritePathRanked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), boolean chains 3, ternaries 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.
mcp.observeMcpToolCall (cognitive 23) apps/daemon/src/mcp.ts:1566— mcp.observeMcpToolCall has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 6, if/else 3, error handling 1 (nesting depth added 2). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
artifacts-cli.runArtifactsCli (cognitive 23) apps/daemon/src/artifacts-cli.ts:106— artifacts-cli.runArtifactsCli has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 5, boolean chains 4, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
projects.searchProjectFiles (cognitive 23) REDACTED:1688— projects.searchProjectFiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server-services.createDesignSystemServerServices.ensureUserDesignSystemWorkspaceProject (cognitive 23) apps/daemon/src/design-systems/server-services.ts:729— server-services.createDesignSystemServerServices.ensureUserDesignSystemWorkspaceProject has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (3 pts), ternaries 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
token-contract-rebuild.decideRebuild (cognitive 23) apps/daemon/src/design-systems/token-contract-rebuild.ts:133— token-contract-rebuild.decideRebuild has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 8 (10 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
rewrite-plan.composeSteps (cognitive 23) apps/daemon/src/plugins/atoms/rewrite-plan.ts:159— rewrite-plan.composeSteps has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (11 pts), boolean chains 4, if/else 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 9). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, 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.
figma-extract.walkNode (cognitive 23) apps/daemon/src/plugins/atoms/figma-extract.ts:298— figma-extract.walkNode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
token-map.matchOne (cognitive 23) apps/daemon/src/plugins/atoms/token-map.ts:320— token-map.matchOne has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, ternaries 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.
schema.validateRefreshSourceMetadata (cognitive 23) apps/daemon/src/live-artifacts/schema.ts:648— schema.validateRefreshSourceMetadata has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 1 (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.
runs.createChatRunService (cognitive 23) apps/daemon/src/runtimes/runs.ts:724— runs.createChatRunService has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
project-file-versions.createProjectFileVersionUnlocked (cognitive 23) apps/daemon/src/project-file-versions.ts:491— project-file-versions.createProjectFileVersionUnlocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8, ternaries 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.
provider-models.listProviderModels (cognitive 23) apps/daemon/src/integrations/provider-models.ts:294— provider-models.listProviderModels has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 8, error handling 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handoff-design.synthesizeHandoffPrompt (cognitive 23) apps/daemon/src/design/handoff-design.ts:157— handoff-design.synthesizeHandoffPrompt has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (9 pts), boolean chains 2, error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routine.registerRoutineRoutes::validateRoutineInput (cognitive 23) REDACTED:309— routine.registerRoutineRoutes::validateRoutineInput has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8 (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.
automation.registerAutomationRoutes (cognitive 23) REDACTED:31— automation.registerAutomationRoutes has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (10 pts), error handling 8, boolean chains 3, if/else 2 (nesting depth added 2). None of this is in the body itself: all 23 points belong to 8 function literals inside it that branch (lines 110, 34, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
stock-search.stockSearch (cognitive 23) apps/daemon/src/media/stock-search.ts:101— stock-search.stockSearch has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 4, boolean chains 3, error handling 3 (nesting depth added 5). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 119, 122, 132). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
comment-sync-state.createCommentSyncStateService.read (cognitive 23) apps/daemon/src/collab/comment-sync-state.ts:34— comment-sync-state.createCommentSyncStateService.read has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (8 pts), ternaries 4, error handling 1 (2 pts) (nesting depth added 4). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-connectors.buildNotionPageReadInput (cognitive 23) apps/daemon/src/memory-connectors.ts:915— memory-connectors.buildNotionPageReadInput has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shadcn-import.locateItemInRegistry (cognitive 23) apps/daemon/src/design-systems/shadcn-import.ts:414— shadcn-import.locateItemInRegistry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (3 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prompt-templates.listPromptTemplates (cognitive 23) apps/daemon/src/media/prompt-templates.ts:36— prompt-templates.listPromptTemplates has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 2 (5 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 13). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server.createAgentRuntimeEnv (cognitive 23) REDACTED:1841— server.createAgentRuntimeEnv has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 3 (6 pts), loops 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rename-args.parseDesignSystemRenameArgs (cognitive 23) apps/daemon/src/design-systems/rename-args.ts:32— rename-args.parseDesignSystemRenameArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runDesignSystemDownload (cognitive 23) apps/daemon/src/cli.ts:10455— cli.runDesignSystemDownload has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, error handling 2 (4 pts), ternaries 2 (3 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.
cli.runMemoryProfile (cognitive 23) apps/daemon/src/cli.ts:11497— cli.runMemoryProfile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.parseScheduleFlag (cognitive 23) apps/daemon/src/cli.ts:11882— cli.parseScheduleFlag has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-capture.scrollSegmentStitch (cognitive 23) apps/desktop/src/main/deck-capture.ts:1729— deck-capture.scrollSegmentStitch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
store.ensureOwnedUpdateRoot (cognitive 23) apps/desktop/src/main/updater/store.ts:228— store.ensureOwnedUpdateRoot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (4 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release-lifecycle.cleanupDeprecatedReleaseEntries (cognitive 23) apps/desktop/src/main/updater/release-lifecycle.ts:410— release-lifecycle.cleanupDeprecatedReleaseEntries has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (6 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updater.createDesktopUpdater.restoreStoreState (cognitive 23) apps/desktop/src/main/updater.ts:635— updater.createDesktopUpdater.restoreStoreState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, ternaries 3 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
provider.AnalyticsProvider (cognitive 23) apps/web/src/analytics/provider.tsx:170— provider.AnalyticsProvider has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 2 (5 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 6). None of this is in the body itself: all 23 points belong to 9 function literals inside it that branch (lines 292, 300, 265, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
amr-auth.reconcileAmrAuthAttemptId (cognitive 23) apps/web/src/analytics/amr-auth.ts:270— amr-auth.reconcileAmrAuthAttemptId has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projects.deleteProject (cognitive 23) apps/web/src/state/projects.ts:1144— projects.deleteProject has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, ternaries 3 (5 pts), error handling 2 (3 pts) (nesting depth added 7). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registry.connectConnector (cognitive 23) apps/web/src/providers/registry.ts:1503— registry.connectConnector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exports.exportAsPdf (cognitive 23) REDACTED:1426— exports.exportAsPdf has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
design-md-parse.parseColors (cognitive 23) REDACTED:165— design-md-parse.parseColors has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 4 (8 pts), boolean chains 3, loops 1 (nesting depth added 10). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeHero.buildHomeMentionEntities (cognitive 23) apps/web/src/components/HomeHero.tsx:2998— HomeHero.buildHomeMentionEntities has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 6, boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillDetailsModal.SkillDetailsModal (cognitive 23) apps/web/src/components/SkillDetailsModal.tsx:27— SkillDetailsModal.SkillDetailsModal has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 14, boolean chains 6, if/else 3. 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: 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.
ProjectLocationsSection.ProjectLocationsSection (cognitive 23) apps/web/src/components/ProjectLocationsSection.tsx:41— ProjectLocationsSection.ProjectLocationsSection has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 9, boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 10 function items inside it that branch (handleAddFolder, a function literal at line 210, a function literal at line 59, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
EntryShell.defaultPluginInputsForCreate (cognitive 23) apps/web/src/components/EntryShell.tsx:388— EntryShell.defaultPluginInputsForCreate has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 5, if/else 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser.createArtifactParser.feed (cognitive 23) REDACTED:171— parser.createArtifactParser.feed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (22 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.
partial-json.repairJsonPrefix (cognitive 23) apps/web/src/runtime/partial-json.ts:16— partial-json.repairJsonPrefix has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3, 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.
question-form.splitOnQuestionForms (cognitive 23) apps/web/src/artifacts/question-form.ts:226— question-form.splitOnQuestionForms has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build-turn-blocks.markerSearchViews (cognitive 23) apps/web/src/runtime/chat/build-turn-blocks.ts:161— build-turn-blocks.markerSearchViews has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 9). Of this number, 12 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
artifact-refs.indexArtifactRefs (cognitive 23) apps/web/src/runtime/chat/artifact-refs.ts:103— artifact-refs.indexArtifactRefs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 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.
QuestionForm.VisualDirectionStack (cognitive 23) apps/web/src/components/QuestionForm.tsx:1734— QuestionForm.VisualDirectionStack has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, ternaries 8, boolean chains 5. Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 9 function items inside it that branch (handleStackPointerDown, handleStackPointerDown::onUp, a function literal at line 1787, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
auto-open-file.selectSiteEntryFile (cognitive 23) apps/web/src/components/auto-open-file.ts:487— auto-open-file.selectSiteEntryFile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
export-error-code.exportErrorCode (cognitive 23) apps/web/src/analytics/export-error-code.ts:24— export-error-code.exportErrorCode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
QuickSwitcher.QuickSwitcher (cognitive 23) apps/web/src/components/QuickSwitcher.tsx:29— QuickSwitcher.QuickSwitcher has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 3 (4 pts), boolean chains 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (onKeyDown, a function literal at line 47, a function literal at line 97, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useFinalizeProject.useFinalizeProject.trigger (cognitive 23) apps/web/src/hooks/useFinalizeProject.ts:79— useFinalizeProject.useFinalizeProject.trigger has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (6 pts), boolean chains 4, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmrArtifactUpgradeDialog.AmrArtifactUpgradeDialog (cognitive 23) apps/web/src/components/AmrArtifactUpgradeDialog.tsx:66— AmrArtifactUpgradeDialog.AmrArtifactUpgradeDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9, boolean chains 7, ternaries 4 (5 pts), loops 2 (nesting depth added 1). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 108, 91, 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.
agent-skill.mapInputs (cognitive 23) packages/plugin-runtime/src/adapters/agent-skill.ts:153— agent-skill.mapInputs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (7 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.parseArgs (cognitive 23) scripts/migrate-to-plugins/main.ts:34— main.parseArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 3, 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.
render-previews.createPlaywrightPreviewRenderer::renderer (cognitive 23) tools/release/src/catalog/render-previews.ts:359— render-previews.createPlaywrightPreviewRenderer::renderer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (7 pts), error handling 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.
prerelease-card.renderPrereleaseCard (cognitive 23) tools/release/src/notifications/prerelease-card.ts:392— prerelease-card.renderPrereleaseCard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 2 (4 pts), ternaries 2 (3 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.
convergence.prepare_publication (cognitive 23) .github/scripts/convergence.py:1468— convergence.prepare_publication has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, 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.
vela.readRawVelaLoginStatus (cognitive 22) apps/daemon/src/integrations/vela.ts:490— vela.readRawVelaLoginStatus has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 2, if/else 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.
task-store.validateRunChain (cognitive 22) apps/daemon/src/strategies/task-store.ts:1463— task-store.validateRunChain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, loops 1 (nesting depth added 3). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-execution-lifecycle.projectToolExecutionLifecycleDiagnostic (cognitive 22) apps/daemon/src/agent-protocol/acp/tool-execution-lifecycle.ts:285— tool-execution-lifecycle.projectToolExecutionLifecycleDiagnostic has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 17 (19 pts), boolean chains 2, if/else 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
auth.probeAgentAuthStatus (cognitive 22) apps/daemon/src/runtimes/auth.ts:597— auth.probeAgentAuthStatus has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (8 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
normalize.toExecItem (cognitive 22) apps/daemon/src/agent-protocol/codex-app-server/normalize.ts:114— normalize.toExecItem has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4 (8 pts), boolean chains 2, match/switch 1 (nesting depth added 10). Of this number, 16 points are the body's own statements and 6 belong to one function literal inside it that branches. 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.
projects.collectArchiveEntries (cognitive 22) REDACTED:552— projects.collectArchiveEntries has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projects.reconcileHtmlArtifactManifest (cognitive 22) REDACTED:969— projects.reconcileHtmlArtifactManifest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, error handling 3, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
hub-events-subscriber.parseHubWorkspaceEvent (cognitive 22) apps/daemon/src/collab/hub-events-subscriber.ts:136— hub-events-subscriber.parseHubWorkspaceEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (17 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.
project-request-authority.enforceLocalProjectDataPlaneRequest (cognitive 22) apps/daemon/src/collab/project-request-authority.ts:42— project-request-authority.enforceLocalProjectDataPlaneRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 8, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
byok-tools.executeGenerateSpeech (cognitive 22) apps/daemon/src/byok-tools.ts:481— byok-tools.executeGenerateSpeech has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 4 (6 pts), error handling 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
cover.freezeAndRenderChatArtifactCovers (cognitive 22) apps/daemon/src/chat-artifacts/cover.ts:145— cover.freezeAndRenderChatArtifactCovers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-failure-evidence.runFailureEvidence (cognitive 22) apps/daemon/src/services/run-failure-evidence.ts:133— run-failure-evidence.runFailureEvidence has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 6, if/else 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-input-snapshot.removeManagedSnapshotDir (cognitive 22) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:175— task-input-snapshot.removeManagedSnapshotDir has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, error handling 2, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
chat-prompt-inputs.composeChatAgentTextPayload (cognitive 22) apps/daemon/src/runtimes/chat-prompt-inputs.ts:115— chat-prompt-inputs.composeChatAgentTextPayload has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 4 (6 pts), boolean chains 2 (nesting depth added 9). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-prompt-inputs.resolveSafePromptImagePaths (cognitive 22) apps/daemon/src/runtimes/chat-prompt-inputs.ts:929— chat-prompt-inputs.resolveSafePromptImagePaths has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, error handling 2 (4 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-sync.registerCollabSyncRoutes.pullAccessForRequest (cognitive 22) REDACTED:881— collab-sync.registerCollabSyncRoutes.pullAccessForRequest has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 6, error handling 1 (2 pts), if/else 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
collab-sync.registerCollabSyncRoutes.registerPreparedPulledProject (cognitive 22) REDACTED:1088— collab-sync.registerCollabSyncRoutes.registerPreparedPulledProject has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 6 (9 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.
patch-edit.applyPatchForStep (cognitive 22) apps/daemon/src/plugins/atoms/patch-edit.ts:122— patch-edit.applyPatchForStep has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 1 (2 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
patch-edit.applyOneFileHunks (cognitive 22) apps/daemon/src/plugins/atoms/patch-edit.ts:336— patch-edit.applyOneFileHunks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), error handling 2 (3 pts), boolean chains 2, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
marketplaces.marketplaceRegistryIdFromUrl (cognitive 22) apps/daemon/src/plugins/marketplaces.ts:116— marketplaces.marketplaceRegistryIdFromUrl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 3, error handling 1, loops 1 (nesting depth added 4). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
project-file-versions.renameProjectFileVersionStore (cognitive 22) apps/daemon/src/project-file-versions.ts:582— project-file-versions.renameProjectFileVersionStore has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 7). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 595). 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.
main-run-observation.usageValues (cognitive 22) apps/daemon/src/observability/main-run-observation.ts:82— main-run-observation.usageValues has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 19 (21 pts), if/else 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
lint-artifact.extractCssTokens (cognitive 22) apps/daemon/src/lint-artifact.ts:805— lint-artifact.extractCssTokens has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vela.renderVelaImage (cognitive 22) REDACTED:354— vela.renderVelaImage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 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.
index.renderLeonardoImage (cognitive 22) apps/daemon/src/media/index.ts:2238— index.renderLeonardoImage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, error handling 1, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiagnosticConsentFence.apply (cognitive 22) apps/daemon/src/services/diagnostic-consent.ts:93— DiagnosticConsentFence.apply has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, ternaries 2 (5 pts), loops 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
media.registerMediaRoutes::handleGenerate (cognitive 22) REDACTED:305— media.registerMediaRoutes::handleGenerate has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (12 pts), if/else 6 (7 pts), boolean chains 2, 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.
tools-connectors-cli.decodeBinaryContentPayload (cognitive 22) apps/daemon/src/tools-connectors-cli.ts:459— tools-connectors-cli.decodeBinaryContentPayload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-presence.readHeartbeat (cognitive 22) apps/daemon/src/routes/collab-presence.ts:337— collab-presence.readHeartbeat has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 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.
workspace-projects-reconciler.reconcileWorkspaceProjectsWithRemote (cognitive 22) apps/daemon/src/collab/workspace-projects-reconciler.ts:420— workspace-projects-reconciler.reconcileWorkspaceProjectsWithRemote has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (5 pts), loops 4, boolean chains 2 (nesting depth added 6). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
community-pets-sync.syncCommunityPets (cognitive 22) apps/daemon/src/community-pets-sync.ts:243— community-pets-sync.syncCommunityPets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 3 (5 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
cli.runMediaGenerate (cognitive 22) apps/daemon/src/cli.ts:2138— cli.runMediaGenerate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, boolean chains 6, ternaries 3, error handling 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli.projectShareHttpFailure (cognitive 22) apps/daemon/src/cli.ts:7398— cli.projectShareHttpFailure has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 5, if/else 3 (5 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runLibraryList (cognitive 22) apps/daemon/src/cli.ts:10290— cli.runLibraryList has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 5 (8 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runMemoryVerify (cognitive 22) apps/daemon/src/cli.ts:11741— cli.runMemoryVerify has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release-lifecycle.withUpdaterLifecycleLock (cognitive 22) apps/desktop/src/main/updater/release-lifecycle.ts:208— release-lifecycle.withUpdaterLifecycleLock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3 (7 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). Of this number, 19 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deck-slide-structure.sourceHasLegacyDeckScreenSlides (cognitive 22) apps/web/src/runtime/deck-slide-structure.ts:66— deck-slide-structure.sourceHasLegacyDeckScreenSlides has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
srcdoc.buildSrcdoc (cognitive 22) REDACTED:357— srcdoc.buildSrcdoc has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 18, 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.
LibraryPreviewModal.ElementPanel (cognitive 22) apps/web/src/components/LibraryPreviewModal.tsx:184— LibraryPreviewModal.ElementPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 5, if/else 2 (nesting depth added 7). Of this number, 20 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TemplatePicker.TemplatePicker (cognitive 22) apps/web/src/components/home-hero/TemplatePicker.tsx:20— TemplatePicker.TemplatePicker has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 5). Of this number, 12 points are the body's own statements and 10 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LexicalComposerInput.MentionAtomicNavigationPlugin (cognitive 22) apps/web/src/components/composer/LexicalComposerInput.tsx:488— LexicalComposerInput.MentionAtomicNavigationPlugin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 9. None of this is in the body itself: all 22 points belong to 4 function literals inside it that branch (lines 543, 501, 522, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LexicalComposerInput.LexicalComposerInput (cognitive 22) apps/web/src/components/composer/LexicalComposerInput.tsx:720— LexicalComposerInput.LexicalComposerInput has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 4, boolean chains 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 759, 798, 825, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HomeHero.modelOptionIcon (cognitive 22) apps/web/src/components/HomeHero.tsx:3552— HomeHero.modelOptionIcon has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
media-surfaces.normalizeHomeMediaInputs (cognitive 22) apps/web/src/components/home-hero/media-surfaces.ts:82— media-surfaces.normalizeHomeMediaInputs has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 14, ternaries 4 (5 pts), if/else 3 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
validation.validateByokDraft (cognitive 22) apps/web/src/components/byok/validation.ts:122— validation.validateByokDraft has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7 (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.
NewProjectModal.NewProjectModalBody (cognitive 22) apps/web/src/components/NewProjectModal.tsx:70— NewProjectModal.NewProjectModalBody has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 4, boolean chains 3, error handling 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 9 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.
EntryShell.OnboardingCliSetupPanel (cognitive 22) apps/web/src/components/EntryShell.tsx:4011— EntryShell.OnboardingCliSetupPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 14 (19 pts), boolean chains 3 (nesting depth added 5). 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.
useMemoryWrittenCard.useMemoryWrittenCard (cognitive 22) apps/web/src/runtime/useMemoryWrittenCard.ts:139— useMemoryWrittenCard.useMemoryWrittenCard has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (8 pts), boolean chains 6 (nesting depth added 7). None of this is in the body itself: all 22 points belong to 2 function literals inside it that branch (lines 233, 166). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
anchor.fuzzyFindSnapshot (cognitive 22) apps/web/src/comments/anchor.ts:88— anchor.fuzzyFindSnapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AssistantMessage.stripSystemReminders (cognitive 22) REDACTED:4158— AssistantMessage.stripSystemReminders has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, ternaries 2 (5 pts), loops 2 (3 pts) (nesting depth added 9). Of this number, 20 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
composer-draft.sanitizeAttachments (cognitive 22) apps/web/src/runtime/chat/composer-draft.ts:106— composer-draft.sanitizeAttachments has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (7 pts), boolean chains 4, 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.
ChatComposer.ToolsPluginsPanel (cognitive 22) apps/web/src/components/ChatComposer.tsx:5044— ChatComposer.ToolsPluginsPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (21 pts), boolean chains 1 (nesting depth added 10). Of this number, 13 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManualEditPanel.StyleInspector (cognitive 22) apps/web/src/components/ManualEditPanel.tsx:783— ManualEditPanel.StyleInspector has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 3, if/else 2 (nesting depth added 6). Of this number, 14 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useProjectRouteWorkspaceContext.useProjectRouteWorkspaceContext (cognitive 22) apps/web/src/collab/useProjectRouteWorkspaceContext.ts:44— useProjectRouteWorkspaceContext.useProjectRouteWorkspaceContext has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10, ternaries 8 (9 pts), boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 164, 204, 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.
brand-capture.collectFontFaces (cognitive 22) clipper/brand-capture.js:524— brand-capture.collectFontFaces has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 11). Of this number, 14 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.
od-card.parseFormAnswers (cognitive 22) packages/contracts/src/artifacts/od-card.ts:478— od-card.parseFormAnswers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 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.
system.contextPluginLines (cognitive 22) REDACTED:967— system.contextPluginLines has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (12 pts), boolean chains 4, if/else 2 (4 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
detection.isOpenDesignHostBridge (cognitive 22) packages/host/src/detection.ts:32— detection.isOpenDesignHostBridge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 10. 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.
generation.observeSidecarGenerations (cognitive 22) packages/sidecar/src/generation.ts:124— generation.observeSidecarGenerations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 13). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandaloneUpdater.prepareLatest (cognitive 22) REDACTED:96— StandaloneUpdater.prepareLatest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-html-plugin-preview-contracts.validateHtmlPluginPreviewContract (cognitive 22) scripts/check-html-plugin-preview-contracts.ts:49— check-html-plugin-preview-contracts.validateHtmlPluginPreviewContract has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, ternaries 4 (nesting depth added 1). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: 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.
cache-lifecycle-snapshot.summarizeDescriptor (cognitive 22) tools/pack/src/updates/cache-lifecycle-snapshot.ts:45— cache-lifecycle-snapshot.summarizeDescriptor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nsis.ensureNsisPersianLanguageAlias (cognitive 22) tools/pack/src/win/nsis.ts:159— nsis.ensureNsisPersianLanguageAlias has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), ternaries 4, loops 2 (3 pts), boolean chains 2 (nesting depth added 10). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
postinstall.consume_command (cognitive 22) .github/scripts/postinstall.py:118— postinstall.consume_command has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scopes.main (cognitive 22) .github/scripts/scopes.py:358— scopes.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 1 (2 pts), 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.
collectPalette (cognitive 22) clipper/brand-capture.js:313— collectPalette has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 6, if/else 4 (6 pts), loops 2 (nesting depth added 6). Of this number, 18 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
app-config.validateOrbit (cognitive 21) apps/daemon/src/app-config.ts:326— app-config.validateOrbit has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 6 (7 pts), boolean chains 6 (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.
opencode-child-evidence.childUsageFromSanitizedExport (cognitive 21) apps/daemon/src/runtimes/opencode-child-evidence.ts:274— opencode-child-evidence.childUsageFromSanitizedExport has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
analytics.cleanPosthogPersonProperties (cognitive 21) apps/daemon/src/analytics.ts:624— analytics.cleanPosthogPersonProperties has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, loops 1 (nesting depth added 9). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp.fetchRunAgentMessage (cognitive 21) apps/daemon/src/mcp.ts:2818— mcp.fetchRunAgentMessage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 2, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projects.parseByteRange (cognitive 21) REDACTED:1654— projects.parseByteRange has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 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.
routines.nextWallTimeMatching (cognitive 21) apps/daemon/src/routines.ts:304— routines.nextWallTimeMatching has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prefetch.extractFonts (cognitive 21) REDACTED:495— prefetch.extractFonts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (4 pts), boolean chains 3 (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.
store.patchMeta (cognitive 21) apps/daemon/src/brands/store.ts:115— store.patchMeta has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (21 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, 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.
index.reconcileProgrammaticExtractionTranscript (cognitive 21) apps/daemon/src/brands/index.ts:920— index.reconcileProgrammaticExtractionTranscript has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 6 (7 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.
run-diagnostics.summarizeRunToolProgress (cognitive 21) apps/daemon/src/run-diagnostics.ts:417— run-diagnostics.summarizeRunToolProgress has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TelemetryOutbox.drainPass (cognitive 21) apps/daemon/src/storage/telemetry-outbox.ts:97— TelemetryOutbox.drainPass has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 2 (6 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-prompt-inputs.formatDesignFilesWorkspaceHint (cognitive 21) apps/daemon/src/runtimes/chat-prompt-inputs.ts:878— chat-prompt-inputs.formatDesignFilesWorkspaceHint has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (8 pts), boolean chains 3 (nesting depth added 6). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-run-context.normalizeWorkspaceContextItems (cognitive 21) apps/daemon/src/runtimes/chat-run-context.ts:58— chat-run-context.normalizeWorkspaceContextItems has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 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.
ensure-core-stages.ensureCoreQualityStages (cognitive 21) apps/daemon/src/plugins/ensure-core-stages.ts:87— ensure-core-stages.ensureCoreQualityStages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, loops 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
versioning.resolveRequestedVersion (cognitive 21) apps/daemon/src/registry/versioning.ts:76— versioning.resolveRequestedVersion has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5 (nesting depth added 6). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 92). 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.
orchestrator.applyTimeouts (cognitive 21) apps/daemon/src/critique/orchestrator.ts:895— orchestrator.applyTimeouts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent 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-lifecycle-tracer.runLifecycleMarkersForStreamEvent (cognitive 21) apps/daemon/src/run-lifecycle-tracer.ts:85— run-lifecycle-tracer.runLifecycleMarkersForStreamEvent has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 9, 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.
project-file-versions.ensureCurrentProjectFileVersionUnlocked (cognitive 21) apps/daemon/src/project-file-versions.ts:680— project-file-versions.ensureCurrentProjectFileVersionUnlocked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 1 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
runtime-child-observations.adaptRuntimeChildObservationsV1 (cognitive 21) apps/daemon/src/observability/runtime-child-observations.ts:270— runtime-child-observations.adaptRuntimeChildObservationsV1 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (6 pts), boolean chains 2, error handling 1 (nesting depth added 5). None of this is in the body itself: all 21 points belong to 2 function literals inside it that branch (lines 272, 307). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.renderOpenAISpeech (cognitive 21) apps/daemon/src/media/index.ts:1382— index.renderOpenAISpeech has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, ternaries 3 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
attribution.createAttributionService (cognitive 21) apps/daemon/src/routes/attribution.ts:62— attribution.createAttributionService has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, ternaries 4, boolean chains 3, error handling 1. Of this number, 13 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.daemonFindRealTitleOffset (cognitive 21) REDACTED:1992— index.daemonFindRealTitleOffset has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
published-file-comment-backfill.enqueuePublishedFileComments (cognitive 21) apps/daemon/src/collab/published-file-comment-backfill.ts:25— published-file-comment-backfill.enqueuePublishedFileComments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, loops 2, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
prompt-templates.validateTemplate (cognitive 21) apps/daemon/src/media/prompt-templates.ts:93— prompt-templates.validateTemplate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 4, ternaries 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.
library.sniffImageDimensions (cognitive 21) apps/daemon/src/library.ts:186— library.sniffImageDimensions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server.filesystemWriteFileNamesFromRunEvents (cognitive 21) REDACTED:2062— server.filesystemWriteFileNamesFromRunEvents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, ternaries 3 (6 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp-live-artifacts-server.callTool (cognitive 21) apps/daemon/src/mcp-live-artifacts-server.ts:163— mcp-live-artifacts-server.callTool has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6, boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools-live-artifacts-cli.parseOptions (cognitive 21) apps/daemon/src/tools-live-artifacts-cli.ts:51— tools-live-artifacts-cli.parseOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginRun (cognitive 21) apps/daemon/src/cli.ts:3962— cli.runPluginRun has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 8 (9 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
sidecars.buildPackagedDaemonSpawnEnv (cognitive 21) apps/packaged/src/sidecars.ts:668— sidecars.buildPackagedDaemonSpawnEnv has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
obsolete-installed-outer.resolveInstalledOuterExecutable (cognitive 21) apps/packaged/src/obsolete-installed-outer.ts:67— obsolete-installed-outer.resolveInstalledOuterExecutable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7 (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.
protocol.fetchOdTargetWithTransientRetry (cognitive 21) apps/packaged/src/protocol.ts:350— protocol.fetchOdTargetWithTransientRetry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resource-error.installResourceErrorObserver (cognitive 21) apps/web/src/observability/resource-error.ts:105— resource-error.installResourceErrorObserver has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 2, loops 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (startWindow, listener, loadListener, …). 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.
amr-auth.observeAmrAuthTracking (cognitive 21) apps/web/src/analytics/amr-auth.ts:215— amr-auth.observeAmrAuthTracking has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (8 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.
Toast.Toast (cognitive 21) apps/web/src/components/Toast.tsx:74— Toast.Toast has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 5, if/else 2 (nesting depth added 1). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: 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.
openai-compatible.isOpenAICompatible (cognitive 21) apps/web/src/providers/openai-compatible.ts:26— openai-compatible.isOpenAICompatible has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
exports.buildDesignManifestContent (cognitive 21) REDACTED:189— exports.buildDesignManifestContent has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 6 (nesting depth added 6). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 211). 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.
projectRunStatus.foldRunsToProjectRunSummaries (cognitive 21) apps/web/src/state/projectRunStatus.ts:88— projectRunStatus.foldRunsToProjectRunSummaries has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, ternaries 2 (4 pts), loops 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.
HtmlSurface.HtmlSurface (cognitive 21) apps/web/src/components/plugins-home/cards/HtmlSurface.tsx:73— HtmlSurface.HtmlSurface has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 4 (5 pts) (nesting depth added 3). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 126, 88, 107, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LibraryPicker.LibraryPicker (cognitive 21) apps/web/src/components/LibraryPicker.tsx:61— LibraryPicker.LibraryPicker has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9, ternaries 7 (8 pts), boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 88, a function literal at line 102, a function literal at line 116, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
markdown.renderBlock (cognitive 21) REDACTED:253— markdown.renderBlock has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 4 (10 pts) (nesting depth added 7). Of this number, 11 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plugin-skill-descriptions.parseSkillFrontmatter (cognitive 21) apps/web/src/runtime/plugin-skill-descriptions.ts:43— plugin-skill-descriptions.parseSkillFrontmatter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
question-form.parseOption (cognitive 21) apps/web/src/artifacts/question-form.ts:1047— question-form.parseOption has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 6, if/else 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
OwnedContentUpdate.OwnedContentUpdate (cognitive 21) apps/web/src/components/OwnedContentUpdate.tsx:7— OwnedContentUpdate.OwnedContentUpdate has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 5, error handling 1, if/else 1 (nesting depth added 5). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuoteBar.QuoteBar (cognitive 21) apps/web/src/components/chat/QuoteBar.tsx:257— QuoteBar.QuoteBar has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 7, ternaries 2. Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 339, 366, 292, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PreviewDrawOverlay.PreviewDrawOverlay::send (cognitive 21) REDACTED:971— PreviewDrawOverlay.PreviewDrawOverlay::send has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, 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. This shape REPEATS in the file: one other method here (PreviewDrawOverlay.PreviewDrawOverlay) 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.
auto-open-file.selectBestRankedFile (cognitive 21) apps/web/src/components/auto-open-file.ts:518— auto-open-file.selectBestRankedFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 3, 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.
ProjectView.resolveRetryTarget (cognitive 21) apps/web/src/components/ProjectView.tsx:15210— ProjectView.resolveRetryTarget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 5). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkspaceTabsBar.normalizeTabsState (cognitive 21) apps/web/src/components/WorkspaceTabsBar.tsx:371— WorkspaceTabsBar.normalizeTabsState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserActionCard.UserActionCard (cognitive 21) apps/web/src/components/UserActionCard.tsx:32— UserActionCard.UserActionCard has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (16 pts), if/else 4, boolean chains 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
code.applyBoxProps (cognitive 21) figma-plugin/code.js:119— code.applyBoxProps has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mappers.deriveConfigureGlobals (cognitive 21) packages/contracts/src/analytics/events/mappers.ts:431— mappers.deriveConfigureGlobals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 4, ternaries 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.
brief.validateOpenDesignBriefCatalog (cognitive 21) packages/contracts/src/api/brief.ts:386— brief.validateOpenDesignBriefCatalog has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (6 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.
automatic.readAutomaticTextTail (cognitive 21) packages/diagnostics/src/automatic.ts:35— automatic.readAutomaticTextTail has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). Of this number, 16 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
blob.materializeStandaloneBlob (cognitive 21) packages/standalone/src/blob.ts:163— blob.materializeStandaloneBlob has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 5). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandaloneStore.withStateTransaction (cognitive 21) packages/standalone/src/store.ts:116— StandaloneStore.withStateTransaction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 2 (5 pts), loops 1 (nesting depth added 11). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extract-components-manifest.parseArgs (cognitive 21) scripts/extract-components-manifest.ts:56— extract-components-manifest.parseArgs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
i18n-coverage-report.buildCoverage (cognitive 21) scripts/i18n-coverage-report.ts:80— i18n-coverage-report.buildCoverage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
image-template.runJsonTemplateGenerator (cognitive 21) scripts/migrate-to-plugins/image-template.ts:92— image-template.runJsonTemplateGenerator has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 3 (6 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-env.parseLocalEnvFlags (cognitive 21) tools/dev/src/local-env.ts:70— local-env.parseLocalEnvFlags has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 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.
custom-installer.collectPathSnapshot::visit (cognitive 21) tools/pack/src/win/custom-installer.ts:1297— custom-installer.collectPathSnapshot::visit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (7 pts), error handling 2 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
convergence.normalize_product_archive (cognitive 21) .github/scripts/convergence.py:817— convergence.normalize_product_archive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stable-docker.image_identity (cognitive 21) .github/scripts/release/stable-docker.py:158— stable-docker.image_identity has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, 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.
template.parse_args (cognitive 21) .github/scripts/template.py:56— template.parse_args has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 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.
app-config.normalizeRetiredAgentPrefs (cognitive 20) apps/daemon/src/app-config.ts:484— app-config.normalizeRetiredAgentPrefs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
models.findModelConfigOption (cognitive 20) apps/daemon/src/agent-protocol/acp/models.ts:76— models.findModelConfigOption has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
models.normalizeModelConfigOptions (cognitive 20) apps/daemon/src/agent-protocol/acp/models.ts:108— models.normalizeModelConfigOptions has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vela.spawnVelaLoginAttempt (cognitive 20) apps/daemon/src/integrations/vela.ts:1269— vela.spawnVelaLoginAttempt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 6, error handling 1. Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (handleTerminal, a function literal at line 1425, a function literal at line 1420, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
diagnostics-evidence.createDiagnosticsEvidence.record (cognitive 20) apps/daemon/src/services/diagnostics-evidence.ts:183— diagnostics-evidence.createDiagnosticsEvidence.record has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (6 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.
daemon-health.createDaemonHealth.evaluate (cognitive 20) apps/daemon/src/services/daemon-health.ts:416— daemon-health.createDaemonHealth.evaluate has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 5 (6 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.
task-store.rowToTask.runs (cognitive 20) apps/daemon/src/strategies/task-store.ts:982— task-store.rowToTask.runs has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9, if/else 6 (8 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tool-execution-lifecycle.sanitizeToolExecutionLifecycleUpdate (cognitive 20) apps/daemon/src/agent-protocol/acp/tool-execution-lifecycle.ts:178— tool-execution-lifecycle.sanitizeToolExecutionLifecycleUpdate has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 14, boolean chains 3, if/else 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
session.attachCodexAppServerSession.openThread (cognitive 20) apps/daemon/src/agent-protocol/codex-app-server/session.ts:272— session.attachCodexAppServerSession.openThread has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, ternaries 5 (6 pts) (nesting depth added 4). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 2 function items inside it that branch (onThread, a function literal at line 310). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
deliverable-syntax-safe-fix.delimiterAtError (cognitive 20) apps/daemon/src/artifacts/deliverable-syntax-safe-fix.ts:225— deliverable-syntax-safe-fix.delimiterAtError has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, error handling 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
standalone-html.parseSrcset (cognitive 20) REDACTED:933— standalone-html.parseSrcset has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 3 (6 pts), boolean chains 5 (nesting depth added 7). 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.
projects.buildDesignManifest (cognitive 20) REDACTED:623— projects.buildDesignManifest has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 5 (nesting depth added 6). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 637). 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.
prefetch.normalizeColor (cognitive 20) REDACTED:312— prefetch.normalizeColor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). Of this number, 10 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-use-diagnostics.collectBrowserUseDiscoveryFacts (cognitive 20) apps/daemon/src/browser/browser-use-diagnostics.ts:25— browser-use-diagnostics.collectBrowserUseDiscoveryFacts has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 3 (6 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.
claude-child-evidence.adaptClaudeChildToolRuntimeFactV1 (cognitive 20) apps/daemon/src/runtimes/claude-child-evidence.ts:1023— claude-child-evidence.adaptClaudeChildToolRuntimeFactV1 has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 14 (20 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.
langfuse-trace.exportLegacyLangfuseRun (cognitive 20) apps/daemon/src/langfuse-trace.ts:3068— langfuse-trace.exportLegacyLangfuseRun has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-input-snapshot.createOdNextRunInputProjection (cognitive 20) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:1000— task-input-snapshot.createOdNextRunInputProjection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plain-stream.extractPlainStreamArtifacts (cognitive 20) REDACTED:76— plain-stream.extractPlainStreamArtifacts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deploy.ensureCloudflarePagesCnameRecord (cognitive 20) REDACTED:957— deploy.ensureCloudflarePagesCnameRecord has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update-apply-observations.observePendingInstallerApplyAttempts (cognitive 20) apps/daemon/src/migration/update-apply-observations.ts:243— update-apply-observations.observePendingInstallerApplyAttempts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (4 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
source-context.formatGithubContextNotes (cognitive 20) apps/daemon/src/design-systems/source-context.ts:287— source-context.formatGithubContextNotes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
installer.installFromLocalFolder (cognitive 20) apps/daemon/src/plugins/installer.ts:722— installer.installFromLocalFolder has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (5 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.
handoff.recordHandoff (cognitive 20) apps/daemon/src/plugins/atoms/handoff.ts:47— handoff.recordHandoff has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3 (nesting depth added 8). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
token-map.parseDesignSystemTokens (cognitive 20) apps/daemon/src/plugins/atoms/token-map.ts:226— token-map.parseDesignSystemTokens has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 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.
composio.normalizePersistedConnectorToolDefinition (cognitive 20) apps/daemon/src/connectors/composio.ts:1300— composio.normalizePersistedConnectorToolDefinition has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 6, if/else 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.
ConnectorService.execute (cognitive 20) apps/daemon/src/connectors/service.ts:756— ConnectorService.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (6 pts), boolean chains 3, error handling 2 (nesting depth added 2). 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.
memory-cleanup.runAutoExtractionCleanup (cognitive 20) apps/daemon/src/memory-cleanup.ts:61— memory-cleanup.runAutoExtractionCleanup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (5 pts), error handling 3 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-loop-guard.unwrapEnvPrefix (cognitive 20) apps/daemon/src/tool-loop-guard.ts:191— tool-loop-guard.unwrapEnvPrefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript.writeTranscript (cognitive 20) apps/daemon/src/critique/transcript.ts:31— transcript.writeTranscript has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, error handling 3 (4 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp-config.buildClaudeMcpJson (cognitive 20) apps/daemon/src/mcp-config.ts:312— mcp-config.buildClaudeMcpJson has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
langfuse-bridge.buildTraceObjectArtifactSources (cognitive 20) apps/daemon/src/langfuse-bridge.ts:1059— langfuse-bridge.buildTraceObjectArtifactSources has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
finalize-design.extractTokenUsage (cognitive 20) apps/daemon/src/design/finalize-design.ts:790— finalize-design.extractTokenUsage has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (14 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.
vela.parsePublishedProfiles (cognitive 20) REDACTED:189— vela.parsePublishedProfiles has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 4 (6 pts), boolean chains 4, loops 1 (nesting depth added 3). 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.
vela.renderVelaVideo (cognitive 20) REDACTED:574— vela.renderVelaVideo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.renderOpenAIImage (cognitive 20) apps/daemon/src/media/index.ts:963— index.renderOpenAIImage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 3 (4 pts), 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, 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.
index.renderMinimaxTTS (cognitive 20) apps/daemon/src/media/index.ts:2777— index.renderMinimaxTTS has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 4, 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.
diagnostic-faults.diagnosticFaultFromRun (cognitive 20) apps/daemon/src/services/diagnostic-faults.ts:29— diagnostic-faults.diagnosticFaultFromRun has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 6, ternaries 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.
refresh.executeProjectFilesSearch (cognitive 20) apps/daemon/src/live-artifacts/refresh.ts:544— refresh.executeProjectFilesSearch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
design-systems.registerDesignSystemRoutes.authorizeDesignSystemRead (cognitive 20) REDACTED:282— design-systems.registerDesignSystemRoutes.authorizeDesignSystemRead has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 4 (5 pts) (nesting depth added 2). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
duplicate-project.copyDirectoryContents (cognitive 20) apps/daemon/src/plugins/duplicate-project.ts:411— duplicate-project.copyDirectoryContents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, 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.
mcp-bootstrap.ensureMcpDaemonUrl (cognitive 20) apps/daemon/src/mcp-bootstrap.ts:125— mcp-bootstrap.ensureMcpDaemonUrl has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (7 pts), ternaries 2, loops 1 (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.
vela.proxyVelaMessageCenterRequest (cognitive 20) REDACTED:391— vela.proxyVelaMessageCenterRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 429, 439, 424). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
memory-connectors.collectNotionPageCandidates (cognitive 20) apps/daemon/src/memory-connectors.ts:859— memory-connectors.collectNotionPageCandidates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (6 pts), boolean chains 3, 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.
comment-batch-receipt.parseCommentBatchReceipt (cognitive 20) apps/daemon/src/collab/comment-batch-receipt.ts:4— comment-batch-receipt.parseCommentBatchReceipt has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (6 pts), if/else 3 (4 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-cloud-service.createCollabCloudService.drainMemberScope (cognitive 20) apps/daemon/src/collab/collab-cloud-service.ts:1311— collab-cloud-service.createCollabCloudService.drainMemberScope has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shadcn-import.parseShadcnReference (cognitive 20) apps/daemon/src/design-systems/shadcn-import.ts:195— shadcn-import.parseShadcnReference has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (5 pts), ternaries 4 (5 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
library.registerLibraryAsset (cognitive 20) apps/daemon/src/library.ts:324— library.registerLibraryAsset has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, ternaries 2, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
cli.emitPluginWorkflowResult (cognitive 20) apps/daemon/src/cli.ts:6003— cli.emitPluginWorkflowResult has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), 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.
feed.selectUpdateCandidate (cognitive 20) apps/desktop/src/main/updater/feed.ts:173— feed.selectUpdateCandidate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, ternaries 7 (9 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
release-lifecycle.isReleaseCleanupEntry (cognitive 20) apps/desktop/src/main/updater/release-lifecycle.ts:131— release-lifecycle.isReleaseCleanupEntry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
launcher-runtime.resolvePackagedLauncherRuntime (cognitive 20) apps/packaged/src/launcher-runtime.ts:451— launcher-runtime.resolvePackagedLauncherRuntime has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, ternaries 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.mergeDaemonConfig (cognitive 20) apps/web/src/state/config.ts:1089— config.mergeDaemonConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deck-thumbnail-parser.processSlideHtml (cognitive 20) REDACTED:579— deck-thumbnail-parser.processSlideHtml has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 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.
CodingPlanUsage.CodingPlanUsage (cognitive 20) apps/web/src/components/CodingPlanUsage.tsx:39— CodingPlanUsage.CodingPlanUsage has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (5 pts), ternaries 4 (5 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.
project-cover-pipeline.designSystemCoverFromBrandJson (cognitive 20) apps/web/src/lib/project-cover-pipeline.ts:343— project-cover-pipeline.designSystemCoverFromBrandJson has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 6, error handling 1. Of this number, 16 points are the body's own statements and 4 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.
ProjectSearchModal.ProjectSearchModal (cognitive 20) apps/web/src/components/ProjectSearchModal.tsx:47— ProjectSearchModal.ProjectSearchModal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 4). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 6 function items inside it that branch (onInputKeyDown, a function literal at line 151, a function literal at line 68, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
production-touchpoint-loader.loadProductionTouchpointDecision (cognitive 20) apps/web/src/components/production-touchpoint-loader.ts:86— production-touchpoint-loader.loadProductionTouchpointDecision has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (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.
SettingsDialog.NotificationsSection (cognitive 20) apps/web/src/components/SettingsDialog.tsx:9050— SettingsDialog.NotificationsSection has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 8, boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 10 function items inside it that branch (toggleDesktop, toggleSound, a function literal at line 9146, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useOpenFolderImport.useOpenFolderImport.openFolder (cognitive 20) apps/web/src/components/useOpenFolderImport.ts:29— useOpenFolderImport.useOpenFolderImport.openFolder has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginsView.readSkillFrontmatterString (cognitive 20) REDACTED:2718— PluginsView.readSkillFrontmatterString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PetOverlay.PetOverlay::onPointerMove (cognitive 20) apps/web/src/components/pet/PetOverlay.tsx:361— PetOverlay.PetOverlay::onPointerMove has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 8, 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. This shape REPEATS in the file: one other method here (PetOverlay.PetOverlay) 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.
taskCenter.buildPetTaskCenter (cognitive 20) apps/web/src/components/pet/taskCenter.ts:7— taskCenter.buildPetTaskCenter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, ternaries 1 (3 pts), 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.
file-ops.extractSimpleBashDeletes (cognitive 20) apps/web/src/runtime/file-ops.ts:273— file-ops.extractSimpleBashDeletes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
brand-enrichment.buildBrandEnrichmentContextBlock (cognitive 20) apps/web/src/runtime/brand-enrichment.ts:87— brand-enrichment.buildBrandEnrichmentContextBlock has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (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.
useBrandReadyPrompt.useBrandReadyPrompt (cognitive 20) apps/web/src/runtime/useBrandReadyPrompt.ts:114— useBrandReadyPrompt.useBrandReadyPrompt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 139, 124, 197). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
visual-style-deck.fill (cognitive 20) apps/web/src/runtime/visual-style-deck.ts:164— visual-style-deck.fill has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useCommentSyncState.useCommentSyncState (cognitive 20) apps/web/src/components/share/useCommentSyncState.ts:31— useCommentSyncState.useCommentSyncState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 6, ternaries 4, error handling 1. Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 59, 47, 82, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
markdown-scroll-sync.measureEditorBlockOffsets (cognitive 20) apps/web/src/components/markdown-scroll-sync.ts:106— markdown-scroll-sync.measureEditorBlockOffsets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file-viewer-render-mode.shouldUrlLoadHtmlPreview (cognitive 20) apps/web/src/components/file-viewer-render-mode.ts:104— file-viewer-render-mode.shouldUrlLoadHtmlPreview has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, 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.
useGlideIndicator.useGlideIndicator (cognitive 20) apps/web/src/hooks/useGlideIndicator.ts:53— useGlideIndicator.useGlideIndicator has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 20 points belong to 6 function literals inside it that branch (lines 70, 95, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
brand-capture.pickCard (cognitive 20) clipper/brand-capture.js:767— brand-capture.pickCard has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (6 pts), ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
manifest.schema.validateSource (cognitive 20) design-systems/_schema/manifest.schema.ts:231— manifest.schema.validateSource has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
animation-map.detectStaggers (cognitive 20) design-templates/hyperframes/scripts/animation-map.mjs:419— animation-map.detectStaggers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), ternaries 1 (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.
media.mediaFailureNextStep (cognitive 20) packages/contracts/src/api/media.ts:225— media.mediaFailureNextStep has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 4, 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.
question-form-markup.scanQuestionForms (cognitive 20) packages/contracts/src/api/question-form-markup.ts:225— question-form-markup.scanQuestionForms has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
client.assertEnvelope (cognitive 20) packages/sidecar/src/client.ts:192— client.assertEnvelope has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, 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.
bootloader-handoff.createStandaloneGenerationBootloader (cognitive 20) packages/standalone/src/bootloader-handoff.ts:265— bootloader-handoff.createStandaloneGenerationBootloader has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 3). None of this is in the body itself: all 20 points belong to 2 function literals inside it that branch (lines 269, 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.
guard.checkPackageDependencySpecs (cognitive 20) scripts/guard.ts:464— guard.checkPackageDependencySpecs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (7 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
guard.checkToolsLayout (cognitive 20) scripts/guard.ts:1062— guard.checkToolsLayout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (5 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build.packWin (cognitive 20) tools/pack/src/win/build.ts:61— build.packWin has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 5 (6 pts), boolean chains 4, error handling 1 (nesting depth added 2). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
render-previews.previewJobsForRecord (cognitive 20) tools/release/src/catalog/render-previews.ts:59— render-previews.previewJobsForRecord has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 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.
convergence.handoff_command (cognitive 20) .github/scripts/convergence.py:1425— convergence.handoff_command has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 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.
scopes.changed_files_for_environment (cognitive 20) .github/scripts/scopes.py:280— scopes.changed_files_for_environment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
installation.doWrite (cognitive 19) apps/daemon/src/installation.ts:172— installation.doWrite has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-params.buildAcpSessionNewParams.mcpServers (cognitive 19) apps/daemon/src/agent-protocol/acp/session-params.ts:54— session-params.buildAcpSessionNewParams.mcpServers has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 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.
models.normalizeModels (cognitive 19) apps/daemon/src/agent-protocol/acp/models.ts:145— models.normalizeModels has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 4, if/else 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
models.detectAcpModels (cognitive 19) apps/daemon/src/agent-protocol/acp/models.ts:215— models.detectAcpModels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, error handling 2, ternaries 1 (2 pts) (nesting depth added 3). None of this is in the body itself: all 19 points belong to 6 function literals inside it that branch (lines 270, 241, 303, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
db.compactAdjacentMessageAgentEvents (cognitive 19) apps/daemon/src/db.ts:3443— db.compactAdjacentMessageAgentEvents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qwen-settings.parseQwenSettingsModelIds (cognitive 19) apps/daemon/src/runtimes/qwen-settings.ts:68— qwen-settings.parseQwenSettingsModelIds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp-observability.normalizeExternalPluginRunAnalyticsHints (cognitive 19) apps/daemon/src/mcp-observability.ts:198— mcp-observability.normalizeExternalPluginRunAnalyticsHints has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
projects.collectFolders (cognitive 19) REDACTED:175— projects.collectFolders has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
automation-proposals.createAutomationProposal (cognitive 19) apps/daemon/src/automation-proposals.ts:69— automation-proposals.createAutomationProposal has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8, boolean chains 7, if/else 4. 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: 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.
hub-events-subscriber.startHubEventsSubscriber (cognitive 19) apps/daemon/src/collab/hub-events-subscriber.ts:372— hub-events-subscriber.startHubEventsSubscriber has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 744). 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.
vela-workspace-context.mapVelaWorkspaceContext (cognitive 19) apps/daemon/src/collab/vela-workspace-context.ts:117— vela-workspace-context.mapVelaWorkspaceContext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 4, ternaries 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.
index.buildDesignSystemPullIndex (cognitive 19) REDACTED:957— index.buildDesignSystemPullIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.migrateLegacyDesignSystemPackage (cognitive 19) REDACTED:2046— index.migrateLegacyDesignSystemPackage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 4, boolean chains 2, ternaries 2 (nesting depth added 4). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (copyIfMissing, writeIfMissing). 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.
brand-routes.createBrandStatusContext (cognitive 19) REDACTED:736— brand-routes.createBrandStatusContext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 6, boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
langfuse-trace.postLegacyTelemetryBatch (cognitive 19) apps/daemon/src/langfuse-trace.ts:2864— langfuse-trace.postLegacyTelemetryBatch has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
langfuse-trace.ingestionDropReasonFromStatus (cognitive 19) apps/daemon/src/langfuse-trace.ts:2955— langfuse-trace.ingestionDropReasonFromStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (19 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
installer.parseGithubSource (cognitive 19) apps/daemon/src/plugins/installer.ts:284— installer.parseGithubSource has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
skill-candidates.detectSkillPluginCandidate (cognitive 19) apps/daemon/src/plugins/skill-candidates.ts:40— skill-candidates.detectSkillPluginCandidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), ternaries 3, boolean chains 2 (nesting depth added 6). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runs.createChatRunService.commitFinish (cognitive 19) apps/daemon/src/runtimes/runs.ts:1616— runs.createChatRunService.commitFinish has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6, boolean chains 5, if/else 4, error handling 1 (2 pts), loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
orbit.normalizeSummaryStore (cognitive 19) apps/daemon/src/orbit.ts:222— orbit.normalizeSummaryStore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (7 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
refresh.writeMappedValue (cognitive 19) apps/daemon/src/live-artifacts/refresh.ts:318— refresh.writeMappedValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, 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.
comment-preparation.prepareStaticCommentSource (cognitive 19) apps/daemon/src/services/comment-preparation.ts:87— comment-preparation.prepareStaticCommentSource has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (nesting depth added 6). 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.
project-design-token-suggestions.scoreCandidate (cognitive 19) apps/daemon/src/project-design-token-suggestions.ts:243— project-design-token-suggestions.scoreCandidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 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.
tools-connectors-cli.collectLocalDesignEvidence (cognitive 19) apps/daemon/src/tools-connectors-cli.ts:943— tools-connectors-cli.collectLocalDesignEvidence has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-connectors.collectOutputDigest (cognitive 19) apps/daemon/src/memory-connectors.ts:631— memory-connectors.collectOutputDigest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collab-cloud-service.createCollabCloudService.flushPendingComments (cognitive 19) apps/daemon/src/collab/collab-cloud-service.ts:1066— collab-cloud-service.createCollabCloudService.flushPendingComments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 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.
codex-pets.scanRoot (cognitive 19) apps/daemon/src/codex-pets.ts:99— codex-pets.scanRoot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (5 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
token-contract.validateDesignTokenOutputs (cognitive 19) apps/daemon/src/design-systems/token-contract.ts:171— token-contract.validateDesignTokenOutputs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (7 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.
handoff-cli.runProjectHandoff (cognitive 19) apps/daemon/src/handoff-cli.ts:134— handoff-cli.runProjectHandoff has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, ternaries 5 (6 pts), boolean chains 1, 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.
cli.runMedia (cognitive 19) apps/daemon/src/cli.ts:1979— cli.runMedia has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 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.
cli.runPluginScaffold (cognitive 19) apps/daemon/src/cli.ts:3164— cli.runPluginScaffold has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 4 (5 pts), boolean chains 3, 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.
cli.runPluginWhoami (cognitive 19) apps/daemon/src/cli.ts:3414— cli.runPluginWhoami has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 2 (3 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.
cli.runPluginDiff (cognitive 19) apps/daemon/src/cli.ts:5034— cli.runPluginDiff has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (7 pts), boolean chains 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.
cli.runDeploy (cognitive 19) apps/daemon/src/cli.ts:12690— cli.runDeploy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, ternaries 6, boolean chains 3, error handling 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
updater.loadVerifiedReleaseForCandidate (cognitive 19) apps/desktop/src/main/updater.ts:364— updater.loadVerifiedReleaseForCandidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.createDesktopRuntime.tick (cognitive 19) REDACTED:2924— runtime.createDesktopRuntime.tick has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
launcher-runtime.resolvePayloadConfig (cognitive 19) apps/packaged/src/launcher-runtime.ts:285— launcher-runtime.resolvePayloadConfig has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 6, if/else 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
chat-scroll-freeze-detector.classifyActivityRole (cognitive 19) apps/web/src/observability/chat-scroll-freeze-detector.ts:894— chat-scroll-freeze-detector.classifyActivityRole has cognitive complexity 19 (threshold 15). Drivers by points: if/else 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.
CollabClient.pollStatus (cognitive 19) apps/web/src/collab/collab-client.ts:502— CollabClient.pollStatus has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 5, 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-kind.shellWords (cognitive 19) apps/web/src/runtime/chat/tool-kind.ts:117— tool-kind.shellWords has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exports.runExportCapture (cognitive 19) REDACTED:1764— exports.runExportCapture has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (nesting depth added 5). None of this is in the body itself: all 19 points belong to 3 function literals inside it that branch (lines 1777, 1809, 1770). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
design-kit.brandToKit (cognitive 19) apps/web/src/runtime/design-kit.ts:362— design-kit.brandToKit has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, ternaries 7. Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
kit-upload.useKitModuleUpload.uploadModule (cognitive 19) apps/web/src/runtime/kit-upload.ts:37— kit-upload.useKitModuleUpload.uploadModule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
amr-funding-feedback.checkAmrFundingFeedback (cognitive 19) apps/web/src/runtime/amr-funding-feedback.ts:43— amr-funding-feedback.checkAmrFundingFeedback has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). 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 literals inside it that branch (lines 61, 58). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
inlineMentions.buildInlineMentionParts (cognitive 19) apps/web/src/utils/inlineMentions.ts:33— inlineMentions.buildInlineMentionParts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (5 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.
markdown.MarkdownCodeBlock (cognitive 19) REDACTED:420— markdown.MarkdownCodeBlock has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 5, boolean chains 3 (nesting depth added 3). Of this number, 12 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MemorySection.extractionCardMeta (cognitive 19) apps/web/src/components/MemorySection.tsx:684— MemorySection.extractionCardMeta has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (6 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.
preflight.byokPreflightBlockReason (cognitive 19) apps/web/src/components/byok/preflight.ts:12— preflight.byokPreflightBlockReason has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InterruptButton.InterruptButton (cognitive 19) apps/web/src/components/Theater/InterruptButton.tsx:21— InterruptButton.InterruptButton has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, ternaries 2 (nesting depth added 4). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 26, 24). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UseEverywhereModal.UseEverywhereGuidePanel (cognitive 19) apps/web/src/components/UseEverywhereModal.tsx:143— UseEverywhereModal.UseEverywhereGuidePanel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, ternaries 3 (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 8 function items inside it that branch (onCopySnippet, onCopyGuide, a function literal at line 183, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
NewProjectPanel.PlatformPicker (cognitive 19) apps/web/src/components/NewProjectPanel.tsx:1210— NewProjectPanel.PlatformPicker has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (16 pts), if/else 3 (nesting depth added 3). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1294, togglePlatform, a function literal at line 1230, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
NewAutomationModal.NewAutomationModal::submit (cognitive 19) apps/web/src/components/NewAutomationModal.tsx:444— NewAutomationModal.NewAutomationModal::submit has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 3, if/else 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (NewAutomationModal.NewAutomationModal) 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.
useDeletedShareNotices.useDeletedShareNotices.retry (cognitive 19) apps/web/src/components/project-actions/useDeletedShareNotices.ts:142— useDeletedShareNotices.useDeletedShareNotices.retry has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 5 (6 pts), error handling 1 (nesting depth added 2). Of this number, 12 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Orb.Orb (cognitive 19) apps/web/src/components/chat/primitives/Orb.tsx:61— Orb.Orb has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3, loops 2 (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 5 function literals inside it that branch (lines 64, 124, 90, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ChatComposer.buildDesignToolboxResources (cognitive 19) apps/web/src/components/ChatComposer.tsx:5687— ChatComposer.buildDesignToolboxResources has cognitive complexity 19 (threshold 15). Drivers by points: loops 6, boolean chains 5, if/else 2 (4 pts), 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.
DeckSlideThumbnail.DeckSlideThumbnail (cognitive 19) apps/web/src/components/DeckSlideThumbnail.tsx:101— DeckSlideThumbnail.DeckSlideThumbnail has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, error handling 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). None of this is in the body itself: all 19 points belong to 4 function literals inside it that branch (lines 109, 175, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProjectView.computeProducedFiles (cognitive 19) apps/web/src/components/ProjectView.tsx:15475— ProjectView.computeProducedFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts), ternaries 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.
ProjectView.amrInsufficientBalanceFailure (cognitive 19) apps/web/src/components/ProjectView.tsx:15889— ProjectView.amrInsufficientBalanceFailure has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkspaceTabsBar.reviveTab (cognitive 19) apps/web/src/components/WorkspaceTabsBar.tsx:320— WorkspaceTabsBar.reviveTab has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 6 (7 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkspaceTabsBar.readPersistedTabsStore (cognitive 19) apps/web/src/components/WorkspaceTabsBar.tsx:526— WorkspaceTabsBar.readPersistedTabsStore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (2 pts), 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.
components-manifest.extractSelectorTokenReferences (cognitive 19) packages/contracts/src/design-systems/components-manifest.ts:283— components-manifest.extractSelectorTokenReferences has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
preview-observability.parsePreviewObservabilityMessage (cognitive 19) packages/contracts/src/runtime/preview-observability.ts:198— preview-observability.parsePreviewObservabilityMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
system.audioLines (cognitive 19) REDACTED:898— system.audioLines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proxy-env.parseMacosScutilProxyOutput (cognitive 19) REDACTED:253— proxy-env.parseMacosScutilProxyOutput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4, 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.
maintenance.withStandaloneMaintenanceLock (cognitive 19) packages/standalone/src/maintenance.ts:14— maintenance.withStandaloneMaintenanceLock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
backfill-failed-runs-with-artifacts.messageProducedArtifact (cognitive 19) scripts/backfill-failed-runs-with-artifacts.ts:91— backfill-failed-runs-with-artifacts.messageProducedArtifact has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bake-plugin-previews.loadPreviewOptions (cognitive 19) scripts/bake-plugin-previews.mjs:229— bake-plugin-previews.loadPreviewOptions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, error handling 1, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-design-system-package-quality.checkDesignSystemPackageQuality (cognitive 19) scripts/check-design-system-package-quality.ts:85— check-design-system-package-quality.checkDesignSystemPackageQuality has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (6 pts), ternaries 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
example.sideFiles (cognitive 19) scripts/migrate-to-plugins/example.ts:237— example.sideFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
postinstall.selectedBuildTargets (cognitive 19) scripts/postinstall.mjs:390— postinstall.selectedBuildTargets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 6). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
refresh-slide-template-commercialization.refreshTemplate (cognitive 19) scripts/refresh-slide-template-commercialization.ts:328— refresh-slide-template-commercialization.refreshTemplate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
lifecycle.collectLaunchAssessment (cognitive 19) tools/pack/src/mac/lifecycle.ts:95— lifecycle.collectLaunchAssessment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, 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.
system-tokens.groupOf (cognitive 19) tools/release/src/catalog/system-tokens.ts:39— system-tokens.groupOf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, 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.
publish-platform.targetConfig (cognitive 19) tools/release/src/storage/publish-platform.ts:174— publish-platform.targetConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (8 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.
publication.verifyReleaseNotePublication (cognitive 19) tools/release/src/release-note/publication.ts:85— publication.verifyReleaseNotePublication has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
feishu.post (cognitive 19) tools/release/src/notifications/feishu.ts:235— feishu.post has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
feishu-notice.post (cognitive 19) tools/release/src/notifications/feishu-notice.ts:75— feishu-notice.post has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConvergenceContract.validate_graph (cognitive 19) .github/scripts/convergence.py:291— ConvergenceContract.validate_graph has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (7 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.
stable-docker.metadata_identity (cognitive 19) .github/scripts/release/stable-docker.py:63— stable-docker.metadata_identity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run-event-payload-budget.capStringLeaves (cognitive 18) apps/daemon/src/runtimes/run-event-payload-budget.ts:173— run-event-payload-budget.capStringLeaves has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), 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.
skills.listSkillFiles::walk (cognitive 18) apps/daemon/src/skills.ts:1125— skills.listSkillFiles::walk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex.parseCodexServiceTiers (cognitive 18) apps/daemon/src/runtimes/defs/codex.ts:15— codex.parseCodexServiceTiers has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-profiles.createLocalAgentDef (cognitive 18) apps/daemon/src/runtimes/local-profiles.ts:125— local-profiles.createLocalAgentDef has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7, if/else 5 (6 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
auth.classifyAgentAuthFailure (cognitive 18) apps/daemon/src/runtimes/auth.ts:228— auth.classifyAgentAuthFailure has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 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.
run-analytics-observability.foldEventIntoPerRequestUsageLedger (cognitive 18) apps/daemon/src/run-analytics-observability.ts:233— run-analytics-observability.foldEventIntoPerRequestUsageLedger has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (5 pts), boolean chains 4, 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.
deliverable-syntax.inspectHtml (cognitive 18) apps/daemon/src/artifacts/deliverable-syntax.ts:291— deliverable-syntax.inspectHtml has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2, boolean chains 1, 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.
hyperframes-audio.prepareHyperFramesAudio (cognitive 18) apps/daemon/src/media/hyperframes-audio.ts:14— hyperframes-audio.prepareHyperFramesAudio has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
standalone-html.parseCssUrlFunction (cognitive 18) REDACTED:1007— standalone-html.parseCssUrlFunction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
standalone-html.consumeBalancedCss (cognitive 18) REDACTED:1117— standalone-html.consumeBalancedCss has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routines.validateSchedule (cognitive 18) apps/daemon/src/routines.ts:395— routines.validateSchedule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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-resource-mutation.enforceVerifiedWorkspaceResourceRead (cognitive 18) apps/daemon/src/collab/workspace-resource-mutation.ts:802— workspace-resource-mutation.enforceVerifiedWorkspaceResourceRead has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (6 pts), if/else 5 (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.
vela-workspace-context.createVelaWorkspaceContextProvider.current (cognitive 18) apps/daemon/src/collab/vela-workspace-context.ts:274— vela-workspace-context.createVelaWorkspaceContextProvider.current has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
logo-fallback.harvestFallbackLogos (cognitive 18) REDACTED:172— logo-fallback.harvestFallbackLogos has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 5). Of this number, 16 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.
brand-routes.reconcileBrandMetaStatus (cognitive 18) REDACTED:821— brand-routes.reconcileBrandMetaStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.readMaskedConfig (cognitive 18) apps/daemon/src/media/config.ts:393— config.readMaskedConfig has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (9 pts), boolean chains 8, 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.
run-failure-classification.inferFailureStageFromEvents (cognitive 18) apps/daemon/src/run-failure-classification.ts:169— run-failure-classification.inferFailureStageFromEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
langfuse-trace.postRelayBatch (cognitive 18) apps/daemon/src/langfuse-trace.ts:2545— langfuse-trace.postRelayBatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-run-context.formatContextRefList (cognitive 18) apps/daemon/src/runtimes/chat-run-context.ts:163— chat-run-context.formatContextRefList has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 5, if/else 2 (4 pts), loops 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 171, 187). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
deploy.deployToCloudflarePages (cognitive 18) REDACTED:726— deploy.deployToCloudflarePages has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 4, if/else 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.
deploy.htmlReferenceSites (cognitive 18) REDACTED:1433— deploy.htmlReferenceSites has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 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.
server-services.createDesignSystemServerServices.listAllDesignSystems (cognitive 18) apps/daemon/src/design-systems/server-services.ts:360— server-services.createDesignSystemServerServices.listAllDesignSystems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 432, 426). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
team-project-share.createLinkedProjectTeamResourceShareService (cognitive 18) apps/daemon/src/design-systems/team-project-share.ts:187— team-project-share.createLinkedProjectTeamResourceShareService has cognitive complexity 18 (threshold 15). Drivers by points: error handling 7 (13 pts), if/else 3, 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.
simulate.parseSignalKv (cognitive 18) apps/daemon/src/plugins/simulate.ts:177— simulate.parseSignalKv has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
token-evidence.extractCSSCustomProperties (cognitive 18) apps/daemon/src/design-systems/token-evidence.ts:112— token-evidence.extractCSSCustomProperties has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 7, 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.
diff-review.runDiffReview (cognitive 18) apps/daemon/src/plugins/atoms/diff-review.ts:75— diff-review.runDiffReview has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 4 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bundled.registerBundledPlugins (cognitive 18) apps/daemon/src/plugins/bundled.ts:64— bundled.registerBundledPlugins has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runs.createChatRunService.emit (cognitive 18) apps/daemon/src/runtimes/runs.ts:1486— runs.createChatRunService.emit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
runs.createChatRunService.drop (cognitive 18) apps/daemon/src/runtimes/runs.ts:2572— runs.createChatRunService.drop has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 6, boolean chains 3, loops 2, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-child-evidence.collectCodexChildEvidence (cognitive 18) apps/daemon/src/runtimes/codex-child-evidence.ts:785— codex-child-evidence.collectCodexChildEvidence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
finalize-design.resolveCurrentArtifact (cognitive 18) apps/daemon/src/design/finalize-design.ts:158— finalize-design.resolveCurrentArtifact has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3, boolean chains 2, error handling 1 (2 pts) (nesting depth added 6). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.renderSenseAudioImage (cognitive 18) apps/daemon/src/media/index.ts:3133— index.renderSenseAudioImage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 3, error handling 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.
DiagnosticRelay.post (cognitive 18) apps/daemon/src/integrations/diagnostic-relay.ts:25— DiagnosticRelay.post has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (8 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.
routine.routineDbRowToContract (cognitive 18) REDACTED:95— routine.routineDbRowToContract has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 4, error handling 1 (2 pts), if/else 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
duplicate-project.resolveFirstDuplicateEntry (cognitive 18) apps/daemon/src/plugins/duplicate-project.ts:192— duplicate-project.resolveFirstDuplicateEntry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 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.
index.registerPluginEventRoutes (cognitive 18) REDACTED:303— index.registerPluginEventRoutes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, boolean chains 4, ternaries 4, loops 2, error handling 1. None of this is in the body itself: all 18 points belong to 8 function items inside it that branch (a function literal at line 359, a function literal at line 335, a function literal at line 368, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
xai.extractAnswerText (cognitive 18) apps/daemon/src/routes/xai.ts:376— xai.extractAnswerText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools-connectors-cli.collectGithubEvidenceWithGitClone (cognitive 18) apps/daemon/src/tools-connectors-cli.ts:880— tools-connectors-cli.collectGithubEvidenceWithGitClone has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 4, 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.
comments.registerCommentSyncStateRoutes (cognitive 18) REDACTED:215— comments.registerCommentSyncStateRoutes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 7). 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 221). 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.
memory-connectors.errorDetailMessage (cognitive 18) apps/daemon/src/memory-connectors.ts:460— memory-connectors.errorDetailMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 2, 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.
workspace-projects-reconciler.planWorkspaceProjectReconciliation (cognitive 18) apps/daemon/src/collab/workspace-projects-reconciler.ts:176— workspace-projects-reconciler.planWorkspaceProjectReconciliation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2, ternaries 1 (2 pts) (nesting depth added 6). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
library.detectMime (cognitive 18) apps/daemon/src/library.ts:147— library.detectMime has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli.runPluginYank (cognitive 18) apps/daemon/src/cli.ts:6039— cli.runPluginYank has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 7, boolean chains 3 (nesting depth added 4). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
open-path.openValidatedDirectory (cognitive 18) apps/desktop/src/main/open-path.ts:32— open-path.openValidatedDirectory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (5 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.fetchResolvedProjectDir (cognitive 18) REDACTED:196— runtime.fetchResolvedProjectDir has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (5 pts), if/else 4, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
design-md-parse.parsePreamble (cognitive 18) REDACTED:349— design-md-parse.parsePreamble has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignKitView.HeaderActionsMenu (cognitive 18) apps/web/src/components/DesignKitView.tsx:1987— DesignKitView.HeaderActionsMenu has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 4, boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 2037, 1999, 1997, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DesignSystemsTab.DesignSystemsTab::handleShareToTeam (cognitive 18) apps/web/src/components/DesignSystemsTab.tsx:579— DesignSystemsTab.DesignSystemsTab::handleShareToTeam has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5, boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryNavRail.teamConsoleUrl (cognitive 18) apps/web/src/components/EntryNavRail.tsx:730— EntryNavRail.teamConsoleUrl has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5, boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updater.deriveUpdaterModel (cognitive 18) apps/web/src/lib/updater.ts:119— updater.deriveUpdaterModel has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, ternaries 4 (5 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HomeHero.pluginMatchesExampleChip (cognitive 18) apps/web/src/components/HomeHero.tsx:4273— HomeHero.pluginMatchesExampleChip has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 17, match/switch 1. Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
media-surfaces.metadataForHomeMediaComposer (cognitive 18) apps/web/src/components/home-hero/media-surfaces.ts:164— media-surfaces.metadataForHomeMediaComposer has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 2, 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.
DeepSeekV4FlashCampaign.DeepSeekV4FlashCampaign (cognitive 18) apps/web/src/components/DeepSeekV4FlashCampaign.tsx:138— DeepSeekV4FlashCampaign.DeepSeekV4FlashCampaign has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, ternaries 8, boolean chains 1. Most of this is not in the body itself: 6 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 172, a function literal at line 155, takeAction, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
pickAndImportError.formatPickAndImportErrorDetails (cognitive 18) apps/web/src/utils/pickAndImportError.ts:11— pickAndImportError.formatPickAndImportErrorDetails has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6 (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.
useDeletedShareNotices.useDeletedShareNotices (cognitive 18) apps/web/src/components/project-actions/useDeletedShareNotices.ts:28— useDeletedShareNotices.useDeletedShareNotices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, loops 4, error handling 1 (nesting depth added 2). None of this is in the body itself: all 18 points belong to 6 function literals inside it that branch (lines 66, 86, 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.
question-form.parseForm (cognitive 18) apps/web/src/artifacts/question-form.ts:509— question-form.parseForm has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 5, boolean chains 2, error handling 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ExecutionShell.ExecutionShell (cognitive 18) apps/web/src/components/chat/ExecutionShell.tsx:113— ExecutionShell.ExecutionShell has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 9 points are the body's own statements and 9 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.
AssistantMessage.ProseBlock (cognitive 18) REDACTED:2934— AssistantMessage.ProseBlock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 3062, 3092, 3008, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
composer-draft.sanitizeQuotes (cognitive 18) apps/web/src/runtime/chat/composer-draft.ts:153— composer-draft.sanitizeQuotes has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (7 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SketchPreview.excalidrawElementToSketchItem (cognitive 18) REDACTED:220— SketchPreview.excalidrawElementToSketchItem has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 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.
validate-save-target.validateCommentSaveTarget (cognitive 18) REDACTED:6— validate-save-target.validateCommentSaveTarget has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 5. 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 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.
ManualEditPanel.readableManualEditTargetName (cognitive 18) apps/web/src/components/ManualEditPanel.tsx:456— ManualEditPanel.readableManualEditTargetName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5 (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.
WorkspaceTabsBar.syncStateToRoute (cognitive 18) apps/web/src/components/WorkspaceTabsBar.tsx:642— WorkspaceTabsBar.syncStateToRoute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (7 pts), boolean chains 2 (nesting depth added 7). Of this number, 10 points are the body's own statements and 8 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.
DesignSystemAssetDropzone.DesignSystemAssetDropzone::renderLightbox (cognitive 18) apps/web/src/components/DesignSystemAssetDropzone.tsx:380— DesignSystemAssetDropzone.DesignSystemAssetDropzone::renderLightbox has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 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.
DesignSystemFlow.fallbackWorkspaceSteps (cognitive 18) apps/web/src/components/DesignSystemFlow.tsx:3546— DesignSystemFlow.fallbackWorkspaceSteps has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 3 (nesting depth added 7). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabDemoView.CollabDemoView (cognitive 18) apps/web/src/collab/CollabDemoView.tsx:51— CollabDemoView.CollabDemoView has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 6, if/else 4 (5 pts) (nesting depth added 4). Of this number, 11 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server.proxyHttpRequest (cognitive 18) REDACTED:526— server.proxyHttpRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 552, 569). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-completeness.markdownCodeRanges (cognitive 18) packages/contracts/src/api/run-completeness.ts:148— run-completeness.markdownCodeRanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, 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.
critique.isPanelEvent (cognitive 18) packages/contracts/src/critique.ts:190— critique.isPanelEvent has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 14, if/else 3, match/switch 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.
sources.findMacOSCrashReports (cognitive 18) packages/diagnostics/src/sources.ts:145— sources.findMacOSCrashReports has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.execute (cognitive 18) packages/dsh-runtime/src/index.ts:254— index.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4 (5 pts), boolean chains 2, error handling 2 (nesting depth added 3). Of this number, 13 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
proxy-env.mergeProxyAwareEnv (cognitive 18) REDACTED:79— proxy-env.mergeProxyAwareEnv has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shell-update.validateShellUpdaterSnapshot (cognitive 18) packages/standalone/src/shell-update.ts:109— shell-update.validateShellUpdaterSnapshot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
check-plugin-preview-manifest.collectPluginIds (cognitive 18) scripts/check-plugin-preview-manifest.ts:45— check-plugin-preview-manifest.collectPluginIds has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
guard.checkHtmlBoundaryLookups (cognitive 18) scripts/guard.ts:1426— guard.checkHtmlBoundaryLookups has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). Of this number, 13 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
normalize-plugin-scenarios.main (cognitive 18) scripts/normalize-plugin-scenarios.ts:322— normalize-plugin-scenarios.main has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (6 pts), error handling 2 (4 pts), if/else 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-env.loadWorkspaceLocalEnv (cognitive 18) tools/dev/src/local-env.ts:16— local-env.loadWorkspaceLocalEnv has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.startDaemon (cognitive 18) tools/dev/src/index.ts:654— index.startDaemon has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
publish-catalog.publishCatalogSnapshot (cognitive 18) tools/release/src/storage/publish-catalog.ts:209— publish-catalog.publishCatalogSnapshot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 3 (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.
rollback-latest.planLatestRollback (cognitive 18) tools/release/src/storage/rollback-latest.ts:203— rollback-latest.planLatestRollback has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
convergence.retry_public_read (cognitive 18) .github/scripts/convergence.py:867— convergence.retry_public_read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
postinstall_plan._dependency_map (cognitive 18) .github/scripts/lib/postinstall_plan.py:44— postinstall_plan._dependency_map has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (7 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.
release.validate_acceptances (cognitive 18) .github/scripts/release.py:142— release.validate_acceptances has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
finalize_pet_run.validate_mirror_hash (cognitive 18) skills/hatch-pet/scripts/finalize_pet_run.py:81— finalize_pet_run.validate_mirror_hash has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, 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.
finalize_pet_run.main (cognitive 18) skills/hatch-pet/scripts/finalize_pet_run.py:220— finalize_pet_run.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
vela.cancelVelaLogin (cognitive 17) apps/daemon/src/integrations/vela.ts:1028— vela.cancelVelaLogin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db.dropTrailingMessageAgentDeltas (cognitive 17) apps/daemon/src/db.ts:3706— db.dropTrailingMessageAgentDeltas has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), ternaries 3 (4 pts), loops 2 (nesting depth added 2). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
db.normalizePreviewComment (cognitive 17) apps/daemon/src/db.ts:4868— db.normalizePreviewComment has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
db.normalizeMessage (cognitive 17) apps/daemon/src/db.ts:5333— db.normalizeMessage has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7, boolean chains 5, if/else 4 (5 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
task-store.strategyTaskTurnsForRunIds (cognitive 17) apps/daemon/src/strategies/task-store.ts:531— task-store.strategyTaskTurnsForRunIds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.attachAcpSession.writeRpc (cognitive 17) apps/daemon/src/agent-protocol/acp/session.ts:640— session.attachAcpSession.writeRpc has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 3, if/else 1 (2 pts), error handling 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 650). 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.
codex-config-normalize.extractCodexProviderEnvKey (cognitive 17) REDACTED:107— codex-config-normalize.extractCodexProviderEnvKey has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), loops 2, 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.
auth.reportsToolPrincipalAuthFailure (cognitive 17) apps/daemon/src/runtimes/auth.ts:437— auth.reportsToolPrincipalAuthFailure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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.
json-event-stream.codexFileChanges (cognitive 17) apps/daemon/src/runtimes/json-event-stream.ts:996— json-event-stream.codexFileChanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (7 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
motion-delivery.readMotionExportSpec (cognitive 17) apps/daemon/src/artifacts/motion-delivery.ts:16— motion-delivery.readMotionExportSpec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 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: 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.
stub-guard.findPriorArtifactSiblings (cognitive 17) apps/daemon/src/artifacts/stub-guard.ts:172— stub-guard.findPriorArtifactSiblings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.summarizeTokenContractReport (cognitive 17) REDACTED:1234— index.summarizeTokenContractReport has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.normalizeRevisionFileChanges (cognitive 17) REDACTED:3088— index.normalizeRevisionFileChanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
origin-validation.configuredAllowedInternalHosts (cognitive 17) REDACTED:51— origin-validation.configuredAllowedInternalHosts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reconcile.recoverPathIntent (cognitive 17) apps/daemon/src/chat-artifacts/reconcile.ts:135— reconcile.recoverPathIntent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, ternaries 5, boolean chains 4, error handling 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.
trust.requiredCapabilities (cognitive 17) apps/daemon/src/plugins/trust.ts:37— trust.requiredCapabilities has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codex-model-preflight.extractCodexRootModelConfig (cognitive 17) REDACTED:96— codex-model-preflight.extractCodexRootModelConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
comment-file-identity-recovery.rebindLocalCommentFileIdentity (cognitive 17) apps/daemon/src/collab/comment-file-identity-recovery.ts:10— comment-file-identity-recovery.rebindLocalCommentFileIdentity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proactive-content-pull.createProactiveContentPull.shouldPull (cognitive 17) apps/daemon/src/collab/proactive-content-pull.ts:678— proactive-content-pull.createProactiveContentPull.shouldPull has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, ternaries 2, error handling 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
deploy.uploadCloudflarePagesAssets (cognitive 17) REDACTED:1307— deploy.uploadCloudflarePagesAssets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (3 pts) (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.
deploy.waitForReachableDeploymentUrl (cognitive 17) REDACTED:2020— deploy.waitForReachableDeploymentUrl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, 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.
project-locations.readProjectManifest (cognitive 17) apps/daemon/src/project-locations.ts:88— project-locations.readProjectManifest has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 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.
library-install.installFromGithub (cognitive 17) apps/daemon/src/library-install.ts:74— library-install.installFromGithub has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (8 pts), if/else 6, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
plugin-asset-cache.expandIpv6 (cognitive 17) apps/daemon/src/plugins/plugin-asset-cache.ts:86— plugin-asset-cache.expandIpv6 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 3). Of this number, 14 points are the body's own statements and 3 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
apply.validateInputs (cognitive 17) apps/daemon/src/plugins/apply.ts:271— apply.validateInputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
installer.safeCopyTree (cognitive 17) apps/daemon/src/plugins/installer.ts:944— installer.safeCopyTree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pack.walk (cognitive 17) apps/daemon/src/plugins/pack.ts:140— pack.walk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schema.validateProvenance (cognitive 17) apps/daemon/src/live-artifacts/schema.ts:697— schema.validateProvenance has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 710). 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.
strategy-recipe.buildValidatedStage (cognitive 17) apps/daemon/src/plugins/strategy-recipe.ts:43— strategy-recipe.buildValidatedStage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
strategy-recipe.resolveOdNextStrategyRequestRecipeV2 (cognitive 17) apps/daemon/src/plugins/strategy-recipe.ts:98— strategy-recipe.resolveOdNextStrategyRequestRecipeV2 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent-process.classifyLeftoverAgentRecord (cognitive 17) apps/daemon/src/runtimes/agent-process.ts:348— agent-process.classifyLeftoverAgentRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
codex-rollout-usage.extractCodexLastTurnFirstCallUsage (cognitive 17) apps/daemon/src/codex-rollout-usage.ts:61— codex-rollout-usage.extractCodexLastTurnFirstCallUsage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
internal-run-service.createInternalRunCreationService.prepare (cognitive 17) apps/daemon/src/services/internal-run-service.ts:140— internal-run-service.createInternalRunCreationService.prepare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
project-file-versions.normalizeArtifactOrigin (cognitive 17) apps/daemon/src/project-file-versions.ts:212— project-file-versions.normalizeArtifactOrigin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 6, 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.
task-observation-rollout.createTaskObservationRolloutService.diagnostic (cognitive 17) apps/daemon/src/observability/task-observation-rollout.ts:888— task-observation-rollout.createTaskObservationRolloutService.diagnostic has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (17 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.
index.renderSenseAudioTTS (cognitive 17) apps/daemon/src/media/index.ts:3023— index.renderSenseAudioTTS has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 5, error handling 1, 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.
index.renderAIHubMixImage (cognitive 17) apps/daemon/src/media/index.ts:3230— index.renderAIHubMixImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.renderFalVideo (cognitive 17) apps/daemon/src/media/index.ts:3801— index.renderFalVideo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 5). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiagnosticOutbox.prune (cognitive 17) apps/daemon/src/storage/diagnostic-outbox.ts:126— DiagnosticOutbox.prune has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 2 (nesting depth added 4). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 127, 148). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
failure-detail.classifyDeployFailure (cognitive 17) apps/daemon/src/deploy/failure-detail.ts:56— failure-detail.classifyDeployFailure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (7 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.
deploy.registerDeploymentCheckRoutes (cognitive 17) REDACTED:276— deploy.registerDeploymentCheckRoutes has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 5, if/else 4, error handling 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 284). 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.
tools-connectors-cli.decodeContentPayload (cognitive 17) apps/daemon/src/tools-connectors-cli.ts:429— tools-connectors-cli.decodeContentPayload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
comments.registerProjectCommentRoutes::callerMayMutate (cognitive 17) REDACTED:452— comments.registerProjectCommentRoutes::callerMayMutate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (5 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.
chat.registerChatRoutes::streamUpstreamNdjson (cognitive 17) REDACTED:585— chat.registerChatRoutes::streamUpstreamNdjson has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memory-rules.parseRuleBody (cognitive 17) apps/daemon/src/memory-rules.ts:73— memory-rules.parseRuleBody has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 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.
WorkspaceBillingRuntimeCoordinator.setClientInterests (cognitive 17) apps/daemon/src/collab/workspace-billing-runtime.ts:253— WorkspaceBillingRuntimeCoordinator.setClientInterests has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, 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.
collab-cloud-service.createCollabCloudService.pushOutboxRecord (cognitive 17) apps/daemon/src/collab/collab-cloud-service.ts:757— collab-cloud-service.createCollabCloudService.pushOutboxRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 4 (5 pts), boolean chains 4, 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.
persistent-sync-cache.createPersistentSyncCache::read (cognitive 17) apps/daemon/src/collab/persistent-sync-cache.ts:114— persistent-sync-cache.createPersistentSyncCache::read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
telemetry.validateMcpAnalyticsEventProperties (cognitive 17) REDACTED:597— telemetry.validateMcpAnalyticsEventProperties has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
community-pets-sync.listPetSharePets (cognitive 17) apps/daemon/src/community-pets-sync.ts:109— community-pets-sync.listPetSharePets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp-live-artifacts-server.handleLiveArtifactsMcpRequest (cognitive 17) apps/daemon/src/mcp-live-artifacts-server.ts:204— mcp-live-artifacts-server.handleLiveArtifactsMcpRequest has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4, boolean chains 2, 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.
marketplace-doctor.doctorMarketplace (cognitive 17) apps/daemon/src/plugins/marketplace-doctor.ts:13— marketplace-doctor.doctorMarketplace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runDirectionsToolCli (cognitive 17) apps/daemon/src/cli.ts:1101— cli.runDirectionsToolCli has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.repeatableFlagValues (cognitive 17) apps/daemon/src/cli.ts:2546— cli.repeatableFlagValues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (3 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.
cli.runBrandExtractFromHtml (cognitive 17) apps/daemon/src/cli.ts:7069— cli.runBrandExtractFromHtml has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, error handling 4 (5 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
observability.describeHostEvents (cognitive 17) apps/desktop/src/main/observability.ts:120— observability.describeHostEvents has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (16 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
payload.clearLauncherStateForManualClear (cognitive 17) apps/desktop/src/main/updater/payload.ts:602— payload.clearLauncherStateForManualClear has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 3 (4 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 5). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
startup-telemetry.observedDaemonOom (cognitive 17) apps/packaged/src/startup-telemetry.ts:627— startup-telemetry.observedDaemonOom has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, error handling 3 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-scroll-freeze.scanSurfaceParts (cognitive 17) apps/web/src/observability/chat-scroll-freeze.ts:984— chat-scroll-freeze.scanSurfaceParts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 3 (4 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.
chat-scroll-forensics.collectRuntimeSection (cognitive 17) apps/web/src/observability/chat-scroll-forensics.ts:487— chat-scroll-forensics.collectRuntimeSection has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 13, boolean chains 3, error handling 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.
client.compactPersonProperties (cognitive 17) apps/web/src/analytics/client.ts:552— client.compactPersonProperties has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1, 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.
amr-auth.confirmAmrAuthTracking (cognitive 17) apps/web/src/analytics/amr-auth.ts:171— amr-auth.confirmAmrAuthTracking has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
router.handlePopstate (cognitive 17) apps/web/src/router.ts:364— router.handlePopstate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 2). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
daemon.startVelaLogin (cognitive 17) apps/web/src/providers/daemon.ts:1445— daemon.startVelaLogin has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 3, error handling 1, 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.
ProjectDeleteConfirmDialog.ProjectDeleteConfirmDialog (cognitive 17) apps/web/src/components/project-actions/ProjectDeleteConfirmDialog.tsx:18— ProjectDeleteConfirmDialog.ProjectDeleteConfirmDialog has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 3, if/else 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
exports.exportProjectAsPptx (cognitive 17) REDACTED:983— exports.exportProjectAsPptx has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 3 (4 pts), ternaries 3 (4 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.
ProjectHoverPreview.HoverHtmlCover (cognitive 17) apps/web/src/components/entry-nav-rail/ProjectHoverPreview.tsx:171— ProjectHoverPreview.HoverHtmlCover has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 4, boolean chains 2 (nesting depth added 3). Of this number, 11 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
UpdaterPopup.UpdaterPopup::installAndQuit (cognitive 17) apps/web/src/components/UpdaterPopup.tsx:308— UpdaterPopup.UpdaterPopup::installAndQuit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WhatsNewPopup.WhatsNewPopup (cognitive 17) apps/web/src/components/WhatsNewPopup.tsx:74— WhatsNewPopup.WhatsNewPopup 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: 5 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 91, 88, 118, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ConnectorsBrowser.ConnectorsBrowser (cognitive 17) apps/web/src/components/ConnectorsBrowser.tsx:431— ConnectorsBrowser.ConnectorsBrowser has cognitive complexity 17 (threshold 15). Drivers by points: if/else 48 (62 pts), ternaries 19 (34 pts), boolean chains 8, error handling 5 (7 pts), loops 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ConnectorsBrowser.ConnectorsBrowser::runConnectorAction) 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.
SettingsDialog.CodexInstallToggle (cognitive 17) apps/web/src/components/SettingsDialog.tsx:8343— SettingsDialog.CodexInstallToggle has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 6, error handling 2, boolean chains 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 8370, a function literal at line 8350, onClick). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
NewProjectPanel.TemplatePicker (cognitive 17) apps/web/src/components/NewProjectPanel.tsx:1679— NewProjectPanel.TemplatePicker has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 4 (5 pts), boolean chains 1, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (runDelete, a function literal at line 1737). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
todos.latestTodoWriteInputForPinnedCard (cognitive 17) apps/web/src/runtime/todos.ts:191— todos.latestTodoWriteInputForPinnedCard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api-attachment-context.renderApiAttachmentBlock (cognitive 17) apps/web/src/api-attachment-context.ts:126— api-attachment-context.renderApiAttachmentBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 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.
visual-style-deck.pullIn (cognitive 17) apps/web/src/runtime/visual-style-deck.ts:137— visual-style-deck.pullIn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThinkingOrb.rubikTwist (cognitive 17) apps/web/src/components/composer/ThinkingOrb.tsx:124— ThinkingOrb.rubikTwist has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ChatPane.useMeasuredVirtualWindow (cognitive 17) apps/web/src/components/ChatPane.tsx:5749— ChatPane.useMeasuredVirtualWindow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 3. None of this is in the body itself: all 17 points belong to 6 function literals inside it that branch (lines 5842, 5787, 5794, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FileViewer.resolveDesktopPreviewContentMeasurement (cognitive 17) REDACTED:1283— FileViewer.resolveDesktopPreviewContentMeasurement has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 4 (5 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FileViewer.hasPrecisionSensitiveJsonNumberText (cognitive 17) REDACTED:19791— FileViewer.hasPrecisionSensitiveJsonNumberText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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.
SketchEditor.applySketchDomI18nOverrides (cognitive 17) apps/web/src/components/SketchEditor.tsx:940— SketchEditor.applySketchDomI18nOverrides has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileWorkspace.browserTabsFromState (cognitive 17) apps/web/src/components/FileWorkspace.tsx:8797— FileWorkspace.browserTabsFromState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
WorkspaceTabsBar.WorkspaceTabsBar::findTabDropTarget (cognitive 17) apps/web/src/components/WorkspaceTabsBar.tsx:2001— WorkspaceTabsBar.WorkspaceTabsBar::findTabDropTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (WorkspaceTabsBar.WorkspaceTabsBar) 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.
DesignSystemFlow.buildCreationAgentPrompt (cognitive 17) apps/web/src/components/DesignSystemFlow.tsx:5465— DesignSystemFlow.buildCreationAgentPrompt has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 15 (17 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.
brand-capture.pickButton (cognitive 17) clipper/brand-capture.js:722— brand-capture.pickButton has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 4, if/else 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-cells.pair (cognitive 17) docs/design/chat-mirror/diff-cells.mjs:394— diff-cells.pair has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, loops 5 (6 pts), if/else 3 (4 pts), ternaries 1 (nesting depth added 2). Of this number, 11 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
html-injection-points.prependAfterDoctype (cognitive 17) REDACTED:800— html-injection-points.prependAfterDoctype has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
preview-runtime-state.isPreviewRuntimeState (cognitive 17) packages/contracts/src/runtime/preview-runtime-state.ts:78— preview-runtime-state.isPreviewRuntimeState has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 15, if/else 2. 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
protocol.validateStandaloneShellMetadata (cognitive 17) REDACTED:316— protocol.validateStandaloneShellMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
state-machine.validateGenerationState (cognitive 17) packages/standalone/src/state-machine.ts:98— state-machine.validateGenerationState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, 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.
VersionedLauncher.startWith (cognitive 17) packages/standalone/src/launcher.ts:91— VersionedLauncher.startWith has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
architecture.importsFrom::visit (cognitive 17) scripts/lib/guard/architecture.ts:40— architecture.importsFrom::visit has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (6 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sync-community-pets.listPetSharePets (cognitive 17) scripts/sync-community-pets.ts:179— sync-community-pets.listPetSharePets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BubbleScene.Bubble (cognitive 17) skills/chat-motion-overlay/assets/remotion-template/src/components/BubbleScene.tsx:87— BubbleScene.Bubble has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 12, boolean chains 4, if/else 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
export.loadBakedPreviews (cognitive 17) tools/release/src/catalog/export.ts:100— export.loadBakedPreviews has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 2 (3 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.
pack.packCatalogSnapshot (cognitive 17) tools/release/src/catalog/pack.ts:166— pack.packCatalogSnapshot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (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.
dsh-bootstrap-latest.updateDshBootstrapLatestPointer (cognitive 17) tools/release/src/storage/dsh-bootstrap-latest.ts:119— dsh-bootstrap-latest.updateDshBootstrapLatestPointer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workload_products.materialize_products (cognitive 17) .github/scripts/lib/workload_products.py:17— workload_products.materialize_products has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rerun_infra_cancel.self_check (cognitive 17) .github/scripts/rerun_infra_cancel.py:698— rerun_infra_cancel.self_check has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 17. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
linkPnpmPublicHoist (cognitive 17) tools/pack/resources/web-standalone-after-pack.cjs:200— linkPnpmPublicHoist has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (4 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
app-config.validateAgentCliEnvIntent (cognitive 16) apps/daemon/src/app-config.ts:302— app-config.validateAgentCliEnvIntent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
env.openDesignAmrTraceEnv (cognitive 16) apps/daemon/src/runtimes/env.ts:241— env.openDesignAmrTraceEnv has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11, if/else 3, boolean chains 2. Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: 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-event-payload-budget.jsonCertainlyWithin (cognitive 16) apps/daemon/src/runtimes/run-event-payload-budget.ts:95— run-event-payload-budget.jsonCertainlyWithin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (7 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.
db.mergeMessageAgentEvents (cognitive 16) apps/daemon/src/db.ts:3495— db.mergeMessageAgentEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
skills.importUserSkill (cognitive 16) apps/daemon/src/skills.ts:936— skills.importUserSkill has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 5, boolean chains 2, error handling 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
frozen-skill-package.captureSelection (cognitive 16) apps/daemon/src/strategies/od-next/frozen-skill-package.ts:464— frozen-skill-package.captureSelection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 4 (5 pts), boolean chains 3, 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.
amr.normalizeKnownVelaVersionId (cognitive 16) apps/daemon/src/runtimes/defs/amr.ts:73— amr.normalizeKnownVelaVersionId has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 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.
amr.parseVelaModelJson (cognitive 16) apps/daemon/src/runtimes/defs/amr.ts:136— amr.parseVelaModelJson has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 4 (5 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
byok-opencode.buildProviderEntry (cognitive 16) apps/daemon/src/runtimes/byok-opencode.ts:177— byok-opencode.buildProviderEntry has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-profiles.normalizeModelOptions (cognitive 16) apps/daemon/src/runtimes/local-profiles.ts:86— local-profiles.normalizeModelOptions has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 4, if/else 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
normalize.createCodexAppServerNormalizer.handlePatchUpdated (cognitive 16) apps/daemon/src/agent-protocol/codex-app-server/normalize.ts:260— normalize.createCodexAppServerNormalizer.handlePatchUpdated has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, ternaries 2 (4 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.
artifact-focus-marker.findMarkerStart (cognitive 16) apps/daemon/src/artifact-focus-marker.ts:171— artifact-focus-marker.findMarkerStart has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deliverable-syntax-metrics.recordDeliverableSyntaxCheck (cognitive 16) apps/daemon/src/artifacts/deliverable-syntax-metrics.ts:15— deliverable-syntax-metrics.recordDeliverableSyntaxCheck has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
projects.updateArtifactManifestRefsForRename (cognitive 16) REDACTED:1238— projects.updateArtifactManifestRefsForRename has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.addSnippetIndexEntries (cognitive 16) REDACTED:1141— index.addSnippetIndexEntries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.createUserDesignSystem (cognitive 16) REDACTED:1282— index.createUserDesignSystem has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 3, if/else 2 (3 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.
index.isProjectManifest (cognitive 16) REDACTED:4116— index.isProjectManifest has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
imagery-fallback.harvestSiteImagery (cognitive 16) REDACTED:352— imagery-fallback.harvestSiteImagery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), error handling 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.
index.launchProgrammaticBackgroundExtraction (cognitive 16) apps/daemon/src/brands/index.ts:558— index.launchProgrammaticBackgroundExtraction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 7, boolean chains 1. 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 619, 590, 609, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.renderBrandPreviewIntoProject (cognitive 16) apps/daemon/src/brands/index.ts:1839— index.renderBrandPreviewIntoProject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 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.
JsonPathScanner.stepInString (cognitive 16) apps/daemon/src/runtimes/tool-input-path-scanner.ts:313— JsonPathScanner.stepInString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai-tokens.sanitizeToken (cognitive 16) apps/daemon/src/integrations/xai-tokens.ts:62— xai-tokens.sanitizeToken has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6, boolean chains 5, 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.
FsChatArtifactBlobStore.listObjectKeys (cognitive 16) apps/daemon/src/chat-artifacts/blob-store.ts:224— FsChatArtifactBlobStore.listObjectKeys has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), loops 3 (6 pts), if/else 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
video-cover.freezeVideoFirstFrame (cognitive 16) apps/daemon/src/chat-artifacts/video-cover.ts:150— video-cover.freezeVideoFirstFrame has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5, boolean chains 4, if/else 4, ternaries 2 (3 pts) (nesting depth added 1). To reduce it, split the body into named stages: move each independent 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-failure-classification.processExitDetail (cognitive 16) apps/daemon/src/run-failure-classification.ts:634— run-failure-classification.processExitDetail has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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.
langfuse-trace.postLangfuseBatch (cognitive 16) apps/daemon/src/langfuse-trace.ts:2468— langfuse-trace.postLangfuseBatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
langfuse-trace.dropReasonFromPerEventErrors (cognitive 16) apps/daemon/src/langfuse-trace.ts:2977— langfuse-trace.dropReasonFromPerEventErrors has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), if/else 3 (5 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-input-snapshot.removeOdNextRunInputProjection (cognitive 16) apps/daemon/src/strategies/od-next/task-input-snapshot.ts:1098— task-input-snapshot.removeOdNextRunInputProjection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
trace-object-manifest.buildTraceObjectManifests (cognitive 16) apps/daemon/src/trace-object-manifest.ts:685— trace-object-manifest.buildTraceObjectManifests has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 6 (7 pts), boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 714, 704). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
chat-run-messages.persistRunEventToAssistantMessage (cognitive 16) apps/daemon/src/runtimes/chat-run-messages.ts:240— chat-run-messages.persistRunEventToAssistantMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
codex-model-preflight.preflightCodexDefaultModel (cognitive 16) REDACTED:401— codex-model-preflight.preflightCodexDefaultModel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, error handling 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.
local-comment-files.createLocalCommentFiles.admit (cognitive 16) apps/daemon/src/collab/local-comment-files.ts:59— local-comment-files.createLocalCommentFiles.admit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 2, 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 2 function literals inside it that branch (lines 65, 81). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
share-alias-recovery.reserveFileShareAlias (cognitive 16) apps/daemon/src/collab/share-alias-recovery.ts:10— share-alias-recovery.reserveFileShareAlias has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
deploy.normalizeCloudflarePagesConfigHints (cognitive 16) REDACTED:229— deploy.normalizeCloudflarePagesConfigHints has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
apply.applyPlugin (cognitive 16) apps/daemon/src/plugins/apply.ts:108— apply.applyPlugin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 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.
patch-edit.applyHunkBody (cognitive 16) apps/daemon/src/plugins/atoms/patch-edit.ts:392— patch-edit.applyHunkBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 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.
schema.validateLiveArtifactRefreshLogEntry (cognitive 16) apps/daemon/src/live-artifacts/schema.ts:818— schema.validateLiveArtifactRefreshLogEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 3, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
composio.normalizePersistedConnectorDefinition (cognitive 16) apps/daemon/src/connectors/composio.ts:1269— composio.normalizePersistedConnectorDefinition 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.
FileConnectorCredentialStore.readRecords (cognitive 16) apps/daemon/src/connectors/service.ts:228— FileConnectorCredentialStore.readRecords has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
amr-image-staging.stageAmrImagePaths (cognitive 16) apps/daemon/src/media/amr-image-staging.ts:40— amr-image-staging.stageAmrImagePaths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fig-decode.mapPaints (cognitive 16) apps/daemon/src/figma/fig-decode.ts:358— fig-decode.mapPaints has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runs.createChatRunService.noteMediaTaskFailure (cognitive 16) apps/daemon/src/runtimes/runs.ts:1186— runs.createChatRunService.noteMediaTaskFailure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 5, 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.
agent-process.recordAgentProcessUntilGroupExits (cognitive 16) apps/daemon/src/runtimes/agent-process.ts:184— agent-process.recordAgentProcessUntilGroupExits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 3 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). Of this number, 10 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
marker-settlement.settleMarkerTurn (cognitive 16) apps/daemon/src/strategies/od-next/marker-settlement.ts:15— marker-settlement.settleMarkerTurn has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 3, if/else 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
run-terminal-reconciliation.reconcileMessages (cognitive 16) apps/daemon/src/runtimes/run-terminal-reconciliation.ts:298— run-terminal-reconciliation.reconcileMessages has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (9 pts), boolean chains 3, if/else 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-observation-rollout.createTaskObservationRolloutService.seedRepresentationFromRunFact (cognitive 16) apps/daemon/src/observability/task-observation-rollout.ts:832— task-observation-rollout.createTaskObservationRolloutService.seedRepresentationFromRunFact has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude-design-import.importClaudeDesignZip (cognitive 16) apps/daemon/src/design/claude-design-import.ts:25— claude-design-import.importClaudeDesignZip 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.
index.renderOpenRouterImage (cognitive 16) apps/daemon/src/media/index.ts:1875— index.renderOpenRouterImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, ternaries 2, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.renderMinimaxImage (cognitive 16) apps/daemon/src/media/index.ts:2885— index.renderMinimaxImage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7, 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.
index.rewriteOutsideExecutableHtmlRanges (cognitive 16) REDACTED:178— index.rewriteOutsideExecutableHtmlRanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, loops 3, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 228, 185, 199, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.registerProjectRoutes::collectBundledScenarios (cognitive 16) REDACTED:3148— index.registerProjectRoutes::collectBundledScenarios has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, 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.
collab-cloud-service.previewCommentToCloud (cognitive 16) apps/daemon/src/collab/collab-cloud-service.ts:276— collab-cloud-service.previewCommentToCloud has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, ternaries 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.
collab-cloud-service.createCollabCloudService.pollOnce (cognitive 16) apps/daemon/src/collab/collab-cloud-service.ts:1642— collab-cloud-service.createCollabCloudService.pollOnce has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
comment-alignment.parseCommentAlignmentResult (cognitive 16) apps/daemon/src/collab/comment-alignment.ts:50— comment-alignment.parseCommentAlignmentResult has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 5, if/else 4, 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.
owned-content-files.preserveLocalEntries (cognitive 16) apps/daemon/src/collab/owned-content-files.ts:61— owned-content-files.preserveLocalEntries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, loops 1 (nesting depth added 8). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools-design-systems-cli.parseOptions (cognitive 16) apps/daemon/src/tools-design-systems-cli.ts:36— tools-design-systems-cli.parseOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.runPluginPack (cognitive 16) apps/daemon/src/cli.ts:3320— cli.runPluginPack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), error handling 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.applyPluginFilters (cognitive 16) apps/daemon/src/cli.ts:4188— cli.applyPluginFilters has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10, boolean chains 3, if/else 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli.runMemoryConfig (cognitive 16) apps/daemon/src/cli.ts:11797— cli.runMemoryConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
S3ProjectStorage.listFiles (cognitive 16) REDACTED:256— S3ProjectStorage.listFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scheduler.createDesktopUpdaterScheduler.tick (cognitive 16) apps/desktop/src/main/updater/scheduler.ts:95— scheduler.createDesktopUpdaterScheduler.tick has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, error handling 2 (3 pts), 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.
updater.createDesktopUpdater.snapshot (cognitive 16) apps/desktop/src/main/updater.ts:543— updater.createDesktopUpdater.snapshot has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
updater.createDesktopUpdater.clearCacheAndResetState (cognitive 16) apps/desktop/src/main/updater.ts:1372— updater.createDesktopUpdater.clearCacheAndResetState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 7). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.runDesktopMainWithTiming (cognitive 16) apps/desktop/src/main/index.ts:707— index.runDesktopMainWithTiming has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, loops 2, ternaries 2 (nesting depth added 1). Of this number, 9 points are the body's own statements and 7 belong to 6 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.
obsolete-installed-outer.retireObsoleteInstalledOuter (cognitive 16) apps/packaged/src/obsolete-installed-outer.ts:101— obsolete-installed-outer.retireObsoleteInstalledOuter 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.
resource-error.userArtifactRoute (cognitive 16) apps/web/src/observability/resource-error.ts:331— resource-error.userArtifactRoute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (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.
chat-scroll-freeze.armActivity (cognitive 16) apps/web/src/observability/chat-scroll-freeze.ts:814— chat-scroll-freeze.armActivity has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (5 pts), error handling 2 (4 pts), if/else 3, ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registry.fetchProjectFilePublicShareState (cognitive 16) apps/web/src/providers/registry.ts:2058— registry.fetchProjectFilePublicShareState has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 3 (4 pts), boolean chains 2, 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.
anthropic.streamMessage (cognitive 16) apps/web/src/providers/anthropic.ts:40— anthropic.streamMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 2, 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.
tool-events.dropSupersededInFlightToolUses (cognitive 16) apps/web/src/runtime/tool-events.ts:95— tool-events.dropSupersededInFlightToolUses has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 118, 102). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
daemon.extractBalancedJsonObject (cognitive 16) apps/web/src/providers/daemon.ts:881— daemon.extractBalancedJsonObject 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.
useBatchProjectShareCount.useBatchProjectShareCount (cognitive 16) apps/web/src/components/project-actions/useBatchProjectShareCount.ts:20— useBatchProjectShareCount.useBatchProjectShareCount has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (5 pts), ternaries 3, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 38, 31, 40). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
exports.exportProjectImageDataUrl (cognitive 16) REDACTED:1161— exports.exportProjectImageDataUrl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignKitView.DesignKitViewInner::handleKitKeyDown (cognitive 16) apps/web/src/components/DesignKitView.tsx:772— DesignKitView.DesignKitViewInner::handleKitKeyDown has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (DesignKitView.DesignKitViewInner) 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.
DesignSystemsTab.useProjectLogoSrc (cognitive 16) apps/web/src/components/DesignSystemsTab.tsx:1306— DesignSystemsTab.useProjectLogoSrc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), ternaries 4 (5 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1326, 1315). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LibraryPicker.AssetThumb (cognitive 16) apps/web/src/components/LibraryPicker.tsx:296— LibraryPicker.AssetThumb has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (5 pts), boolean chains 1 (nesting depth added 7). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntegrationsView.IntegrationsView (cognitive 16) apps/web/src/components/IntegrationsView.tsx:47— IntegrationsView.IntegrationsView has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 2, if/else 1 (nesting depth added 2). Of this number, 9 points are the body's own statements and 7 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.
question-form.parseLegacyOptions (cognitive 16) apps/web/src/artifacts/question-form.ts:629— question-form.parseLegacyOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
question-form.parseDefaultValue (cognitive 16) apps/web/src/artifacts/question-form.ts:1096— question-form.parseDefaultValue has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 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.
in-project-link.resolveAgainstResolvedDir (cognitive 16) apps/web/src/runtime/in-project-link.ts:129— in-project-link.resolveAgainstResolvedDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
anchor.resolveCommentAnchor (cognitive 16) apps/web/src/comments/anchor.ts:54— anchor.resolveCommentAnchor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PixelLiquid.PixelLiquid (cognitive 16) apps/web/src/components/PixelLiquid.tsx:29— PixelLiquid.PixelLiquid has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, ternaries 3. Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 32, 45, 67). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
QuestionForm.parseSubmittedAnswers (cognitive 16) apps/web/src/components/QuestionForm.tsx:2930— QuestionForm.parseSubmittedAnswers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2, ternaries 2, 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.
ThinkingOrb.ThinkingOrb (cognitive 16) apps/web/src/components/composer/ThinkingOrb.tsx:300— ThinkingOrb.ThinkingOrb has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 16 points belong to 5 function literals inside it that branch (lines 303, 342, 349, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ChatComposer.designToolboxDefaultResources (cognitive 16) apps/web/src/components/ChatComposer.tsx:5866— ChatComposer.designToolboxDefaultResources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 5). Of this number, 11 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatPane.ChatRows::renderItem (cognitive 16) apps/web/src/components/ChatPane.tsx:5424— ChatPane.ChatRows::renderItem has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 13, if/else 2, 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.
auto-open-file.selectBuildPreviewHtmlEntry (cognitive 16) apps/web/src/components/auto-open-file.ts:166— auto-open-file.selectBuildPreviewHtmlEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
markdown-scroll-sync.extractMarkdownBlockLines (cognitive 16) apps/web/src/components/markdown-scroll-sync.ts:62— markdown-scroll-sync.extractMarkdownBlockLines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
source-patches.setBrandKitTextValue (cognitive 16) apps/web/src/edit-mode/source-patches.ts:331— source-patches.setBrandKitTextValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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.
source-patches.findSoleMeaningfulTextNode (cognitive 16) apps/web/src/edit-mode/source-patches.ts:626— source-patches.findSoleMeaningfulTextNode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). 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.
FileViewer.InspectPanel (cognitive 16) REDACTED:5424— FileViewer.InspectPanel has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 6 (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.
FileViewer.inlineRelativeAssets (cognitive 16) REDACTED:19285— FileViewer.inlineRelativeAssets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 4 (6 pts), boolean chains 2, loops 2 (nesting depth added 5). Of this number, 10 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.
SketchEditor.applySketchEditorTooltips (cognitive 16) apps/web/src/components/SketchEditor.tsx:715— SketchEditor.applySketchEditorTooltips has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileWorkspace.designSystemReviewSubtitle (cognitive 16) apps/web/src/components/FileWorkspace.tsx:6141— FileWorkspace.designSystemReviewSubtitle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useDesignMdState.useDesignMdState.compute (cognitive 16) apps/web/src/hooks/useDesignMdState.ts:91— useDesignMdState.useDesignMdState.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 6 (7 pts), boolean chains 1, error handling 1 (nesting depth added 2). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
DesignSystemFlow.GenerationStatusCard (cognitive 16) apps/web/src/components/DesignSystemFlow.tsx:3664— DesignSystemFlow.GenerationStatusCard has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 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.
capture.absolutizeUrls (cognitive 16) clipper/capture.js:156— capture.absolutizeUrls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 1 (nesting depth added 4). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 157). 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.
capture.buildFigmaIr::textNode (cognitive 16) clipper/capture.js:435— capture.buildFigmaIr::textNode has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 5, if/else 4 (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.
animation-map.findDeadZones (cognitive 16) design-templates/hyperframes/scripts/animation-map.mjs:381— animation-map.findDeadZones has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 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.
contrast-report.probeTextElements (cognitive 16) design-templates/hyperframes/scripts/contrast-report.mjs:104— contrast-report.probeTextElements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 4). None of this is in the body itself: all 16 points belong to 4 function literals inside it that branch (lines 108, 118, 112, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
mirror-exec.html.pt (cognitive 16) docs/design/chat-mirror/mirror-exec.html:9217— mirror-exec.html.pt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (5 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.
html-injection-points.findScriptClose (cognitive 16) REDACTED:257— html-injection-points.findScriptClose has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
canonical-xml.parseNode (cognitive 16) packages/contracts/src/prompts/canonical-xml.ts:267— canonical-xml.parseNode has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 4 (6 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
preview-build-focus.parsePreviewBuildFocusSections (cognitive 16) packages/contracts/src/runtime/preview-build-focus.ts:160— preview-build-focus.parsePreviewBuildFocusSections has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.selectLauncherRuntimeTarget (cognitive 16) packages/launcher-proto/src/index.ts:643— index.selectLauncherRuntimeTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (5 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proxy-env.parseWindowsInternetSettingsProxyOutput (cognitive 16) REDACTED:321— proxy-env.parseWindowsInternetSettingsProxyOutput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, 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.
operations.waitForBootstrappedSidecarReady (cognitive 16) packages/sidecar/src/operations.ts:556— operations.waitForBootstrappedSidecarReady has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lock.withDirectoryLock (cognitive 16) tools/pack/src/cache/lock.ts:66— lock.withDirectoryLock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 1 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registry.queryWinNamespaceRegistryEntry (cognitive 16) tools/pack/src/win/registry.ts:119— registry.queryWinNamespaceRegistryEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, error handling 1, 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.
pack.verifyCatalogChecksums (cognitive 16) tools/release/src/catalog/pack.ts:129— pack.verifyCatalogChecksums has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 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.
feishu.buildCard (cognitive 16) tools/release/src/notifications/feishu.ts:152— feishu.buildCard has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 6, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FeishuAppClient.#request (cognitive 16) tools/release/src/notifications/feishu-app.ts:75— FeishuAppClient.#request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (4 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
convergence.plan_command (cognitive 16) .github/scripts/convergence.py:1189— convergence.plan_command has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 4, if/else 3, loops 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.
convergence.main (cognitive 16) .github/scripts/convergence.py:2212— convergence.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScopeContract._validate_match (cognitive 16) .github/scripts/scopes.py:70— ScopeContract._validate_match has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 1 (5 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cross-context type DesktopExportArtifactFormat (sidecar-proto → daemon) apps/daemon/src/pdf-export.ts:49— DesktopExportArtifactFormat (context sidecar-proto) is exposed in daemon's public surface via BuildDesktopArtifactExportInputOptions.format — couples the contexts.
Cross-context type DesktopExportArtifactImageFormat (sidecar-proto → daemon) apps/daemon/src/pdf-export.ts:50— DesktopExportArtifactImageFormat (context sidecar-proto) is exposed in daemon's public surface via BuildDesktopArtifactExportInputOptions.imageFormat — couples the contexts.
Cross-context type MintImportTokenResult (sidecar-proto → daemon) apps/daemon/src/sidecar/server.ts:75— MintImportTokenResult (context sidecar-proto) is exposed in daemon's public surface via server.mintImportTokenForCli — couples the contexts.
Cross-context type Platform (daemon → desktop) apps/desktop/src/main/mailto-open.ts:221— Platform (context daemon) is exposed in desktop's public surface via OpenFirstPartyMailtoDeps.platform — couples the contexts.
Cross-context type DesktopUpdateReleaseLifecycleState (sidecar-proto → desktop) apps/desktop/src/main/updater/release-lifecycle.ts:109— DesktopUpdateReleaseLifecycleState (context sidecar-proto) is exposed in desktop's public surface via release-lifecycle.isReleaseLifecycleState — couples the contexts.
Cross-context type DesktopUpdateCacheLifecycleTrigger (sidecar-proto → desktop) apps/desktop/src/main/updater/release-lifecycle.ts:477— DesktopUpdateCacheLifecycleTrigger (context sidecar-proto) is exposed in desktop's public surface via release-lifecycle.runUpdateReleaseLifecycle — couples the contexts.
Cross-context type PluginShareAction (daemon → web) apps/web/src/state/projects.ts:2363— PluginShareAction (context daemon) is exposed in web's public surface via projects.createPluginShareProject — couples the contexts.
D23 · Boundary Type-Coupling· Cross-context type Result (daemon → web) · ×1
Cross-context type Result (daemon → web) apps/web/src/lib/use-stable-handler.ts:11— Result (context daemon) is exposed in web's public surface via use-stable-handler.useStableHandler — couples the contexts.
Cross-context type MediaTaskStatus (daemon → contracts) packages/contracts/src/api/media.ts:281— MediaTaskStatus (context daemon) is exposed in contracts's public surface via ProjectMediaTask.status — couples the contexts.
Cross-context type ChatArtifactSnapshotState (daemon → contracts) packages/contracts/src/api/chat.ts:1345— ChatArtifactSnapshotState (context daemon) is exposed in contracts's public surface via ChatArtifactRef.snapshotState — couples the contexts.
Cross-context type ReleaseChannel (release → contracts) packages/contracts/src/analytics/events/result-events.ts:928— ReleaseChannel (context release) is exposed in contracts's public surface via UpdateApplyObservedProps.channel — couples the contexts.
Cross-context type ReleaseChannel (release → host) packages/host/src/protocol.ts:203— ReleaseChannel (context release) is exposed in host's public surface via OpenDesignHostUpdaterChannel.OpenDesignHostUpdaterChannel — couples the contexts.
Cross-context type ReleaseChannel (release → launcher-proto) packages/launcher-proto/src/index.ts:20— ReleaseChannel (context release) is exposed in launcher-proto's public surface via LauncherChannel.LauncherChannel — couples the contexts.
Cross-context type ReleaseChannel (release → sidecar-proto) packages/sidecar-proto/src/index.ts:141— ReleaseChannel (context release) is exposed in sidecar-proto's public surface via DesktopUpdateChannel.DesktopUpdateChannel — couples the contexts.
Change-coupling hub: REDACTED → env.ts, server-context.ts, REDACTED REDACTED— `REDACTED` changes together with 3 other files — `apps/daemon/src/runtimes/env.ts`, `apps/daemon/src/server-context.ts`, `apps/daemon/src/sidecar/server.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.
Duplicated block (37–40 lines × 2) .github/scripts/rerun_infra_cancel.py:978— .github/scripts/rerun_infra_cancel.py:978-1017 | .github/scripts/rerun_infra_cancel.py:1019-1055 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `.github/scripts/rerun_infra_cancel.py:978` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24 lines × 2) .github/scripts/rerun_infra_cancel.py:881— .github/scripts/rerun_infra_cancel.py:881-904 | .github/scripts/rerun_infra_cancel.py:912-936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–21 lines × 3) .github/scripts/rerun_infra_cancel.py:1076— .github/scripts/rerun_infra_cancel.py:1076-1095 | .github/scripts/rerun_infra_cancel.py:1278-1298 | .github/scripts/rerun_infra_cancel.py:1363-1382 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 2) .github/scripts/rerun_infra_cancel.py:478— .github/scripts/rerun_infra_cancel.py:478-494 | .github/scripts/rerun_infra_cancel.py:607-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `.github/scripts/rerun_infra_cancel.py:478` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–17 lines × 2) .github/scripts/rerun_infra_cancel.py:938— .github/scripts/rerun_infra_cancel.py:938-953 | .github/scripts/rerun_infra_cancel.py:974-990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `.github/scripts/rerun_infra_cancel.py:974` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–17 lines × 2) .github/scripts/rerun_infra_cancel.py:1058— .github/scripts/rerun_infra_cancel.py:1058-1074 | .github/scripts/rerun_infra_cancel.py:1247-1261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 3) .github/scripts/rerun_infra_cancel.py:879— .github/scripts/rerun_infra_cancel.py:879-891 | .github/scripts/rerun_infra_cancel.py:1055-1068 | .github/scripts/rerun_infra_cancel.py:1244-1257 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `.github/scripts/rerun_infra_cancel.py:1055` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) .github/scripts/release.py:193— .github/scripts/release.py:193-205 | .github/scripts/release.py:281-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `.github/scripts/release.py:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 4) .github/scripts/rerun_infra_cancel.py:880— .github/scripts/rerun_infra_cancel.py:880-892 | .github/scripts/rerun_infra_cancel.py:911-923 | .github/scripts/rerun_infra_cancel.py:1057-1069 | .github/scripts/rerun_infra_cancel.py:1246-1258 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 2) .github/scripts/release.py:180— .github/scripts/release.py:180-190 | .github/scripts/release.py:268-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) skills/hatch-pet/scripts/generate_pet_images.py:113— skills/hatch-pet/scripts/generate_pet_images.py:113-120 | skills/hatch-pet/scripts/generate_pet_images.py:142-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `skills/hatch-pet/scripts/generate_pet_images.py:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 2) .github/scripts/pack.py:215— .github/scripts/pack.py:215-221 | .github/scripts/pack.py:222-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 5) skills/hatch-pet/scripts/derive_running_left_from_running_right.py:37— skills/hatch-pet/scripts/derive_running_left_from_running_right.py:37-41 | skills/hatch-pet/scripts/finalize_pet_run.py:27-31 | skills/hatch-pet/scripts/generate_pet_images.py:164-168 | skills/hatch-pet/scripts/record_imagegen_result.py:52-56 | skills/oil-motion/scripts/production_gate.py:53-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — apps/closure/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
P12 · CI test-gate honesty· Changed-file filter skips the test gate for code the tests depend on · ×1
Changed-file filter skips the test gate for code the tests depend on REDACTED:8— `paths` runs `pnpm --filter @open-design/tools-release test` (the tests of `tools/release`) only when a change touches `skills/**`, `design-templates/**`, `design-systems/**`, `craft/**`, `templates/live-artifacts/**`, `plugins/**`, `data/plugin-previews/**`, `tools/release/src/catalog/**`, `tools/release/src/storage/publish-catalog.ts`, `tools/release/src/storage/common.ts`, `tools/release/src/storage/s3-upload.ts`, `tools/release/tests/catalog-*.test.ts`, `tools/release/tests/fixtures/catalog/**`, `REDACTED`, `REDACTED`, but those tests also depend on `packages/launcher-proto`, `packages/release`, `packages/sidecar-proto`, `tools/release` (e.g. `packages/launcher-proto/esbuild.config.mjs`, `packages/release/esbuild.config.ts`) — a change there merges with them not run, and no unfiltered gate runs them. List the package's tests and its workspace dependencies in the filter, or drop it.
P12 · CI test-gate honesty· Tests run only outside the merge gate · ×1
Tests run only outside the merge gate REDACTED:133— `pnpm --filter @open-design/daemon test --shard=${{ matrix.shard }}/4` is the only CI command that runs 45488 test(s) in 1030 file(s) (e.g. `apps/daemon/tests/aborted-error.test.ts`, `apps/daemon/tests/acp-format-usage.test.ts`), and the workflow runs only on workflow_dispatch — a failure there is found after the change merged, when the only remedy is a revert. Run them on pull requests (or in the merge queue).
Duplication concentrated across 4 sibling directories (143 clone groups) apps/daemon/src/runtimes/chat-run-messages.ts:546— 143 duplicated blocks under apps/ have copies in at least two of the sibling directories daemon, desktop, packaged, web — 70 of them are reported below, and 73 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 143 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 143 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 143 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 8 sibling directories (129 clone groups) REDACTED:941— 129 duplicated blocks under the repository root have copies in at least two of the sibling directories apps, clipper, design-templates, packages, scripts, shells (+2 more sibling(s) not listed) — 58 of them are reported below, and 71 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 129 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 129 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 129 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 28 sibling directories (110 clone groups) apps/daemon/src/design-systems/workspace-team-binding.ts:7— 110 duplicated blocks under apps/daemon/src/ have copies in at least two of the sibling directories agent-protocol, artifacts, automations, brands, chat-artifacts, collab (+22 more sibling(s) not listed) — 59 of them are reported below, and 51 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 110 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 110 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 110 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 14 sibling directories (74 clone groups) apps/web/src/components/Theater/state/sse.ts:115— 74 duplicated blocks under apps/web/src/ have copies in at least two of the sibling directories analytics, artifacts, collab, comments, components, edit-mode (+8 more sibling(s) not listed) — 49 of them are reported below, and 25 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 74 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 74 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 74 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 (21 clone groups) tools/pack/src/mac/app.ts:51— 21 duplicated blocks under tools/pack/src/ have copies in at least two of the sibling directories mac, win — 17 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 21 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 21 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 21 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 12 sibling directories (18 clone groups) packages/host/esbuild.config.mjs:3— 18 duplicated blocks under packages/ have copies in at least two of the sibling directories agui-adapter, contracts, download, host, launcher-proto, platform (+6 more sibling(s) not listed) — 13 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 18 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 18 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 18 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 8 sibling directories (8 clone groups) apps/web/src/components/entry-nav-rail/RailRecentRow.tsx:238— 8 duplicated blocks under apps/web/src/components/ have copies in at least two of the sibling directories chat, composer, entry-nav-rail, home-hero, pet, plugin-details (+2 more sibling(s) not listed) — 3 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 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 8 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 5 sibling directories (7 clone groups) packages/contracts/src/analytics/events/result-events.ts:480— 7 duplicated blocks under packages/contracts/src/ have copies in at least two of the sibling directories analytics, api, artifacts, observability, plugins — 3 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 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 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 7 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 5 sibling directories (6 clone groups) tools/release/src/catalog/pack.ts:42— 6 duplicated blocks under tools/release/src/ have copies in at least two of the sibling directories catalog, notifications, release-note, report, storage — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (394 matched lines × 2 locations) · ×1
Duplicated block with local edits (394 matched lines × 2 locations) REDACTED:941— REDACTED:941 · REDACTED:318 — the two spans are one implementation copied and then locally edited — 2428 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.
Wholesale file copy (232 identical lines × 8 files) REDACTED:52— REDACTED:52 · REDACTED:52 · REDACTED:52 · REDACTED:52 · +4 more site(s) not listed — these 8 files are line-for-line copies of one another — 232 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (166 matched lines × 2 locations) · ×1
Duplicated block with local edits (166 matched lines × 2 locations) apps/daemon/src/community-pets-sync.ts:81— apps/daemon/src/community-pets-sync.ts:81 · scripts/sync-community-pets.ts:133 — the two spans are one implementation copied and then locally edited — 1260 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.
Wholesale file copy (131 identical lines × 2 files) apps/daemon/src/prompts/directions.ts:25— apps/daemon/src/prompts/directions.ts:25 · packages/contracts/src/prompts/directions.ts:25 — these 2 files are line-for-line copies of one another — 131 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (127 matched lines × 2 locations) · ×1
Duplicated block with local edits (127 matched lines × 2 locations) apps/daemon/src/integrations/xai-tokens.ts:23— apps/daemon/src/integrations/xai-tokens.ts:23 · apps/daemon/src/mcp-tokens.ts:26 — the two spans are one implementation copied and then locally edited — 902 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (124 identical lines × 2 files) apps/daemon/src/design-systems/frontmatter.ts:7— apps/daemon/src/design-systems/frontmatter.ts:7 · packages/plugin-runtime/src/parsers/frontmatter.ts:15 — these 2 files are line-for-line copies of one another — 124 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (105 matched lines × 2 locations) · ×1
Duplicated block with local edits (105 matched lines × 2 locations) apps/daemon/src/live-artifacts/schema.ts:4— apps/daemon/src/live-artifacts/schema.ts:4 · packages/contracts/src/api/live-artifacts.ts:5 — the two spans are one implementation copied and then locally edited — 479 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 (94 matched lines × 2 locations) · ×1
Duplicated block with local edits (94 matched lines × 2 locations) apps/web/src/components/ProductionCampaignBadge.tsx:97— apps/web/src/components/ProductionCampaignBadge.tsx:97 · apps/web/src/components/ProductionCampaignModal.tsx:418 — the two spans are one implementation copied and then locally edited — 469 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 (92 lines × 2 locations) REDACTED:227— REDACTED:227 · REDACTED:376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (90 lines × 2 locations) tools/pack/src/mac/app.ts:51— tools/pack/src/mac/app.ts:51 · tools/pack/src/win/app.ts:293 — 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) apps/daemon/src/design-systems/preview.ts:301— apps/daemon/src/design-systems/preview.ts:301 · apps/daemon/src/design-systems/showcase.ts:643 — the two spans are one implementation copied and then locally edited — 860 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) apps/web/src/providers/registry.ts:899— apps/web/src/providers/registry.ts:899 · apps/web/src/providers/registry.ts:1045 — the two spans are one implementation copied and then locally edited — 483 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (83 matched lines × 2 locations) · ×1
Duplicated block with local edits (83 matched lines × 2 locations) REDACTED:2050— REDACTED:2050 · apps/daemon/src/routes/handoff.ts:48 — the two spans are one implementation copied and then locally edited — 545 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 (81 matched lines × 2 locations) · ×1
Duplicated block with local edits (81 matched lines × 2 locations) REDACTED:293— REDACTED:293 · REDACTED:463 — the two spans are one implementation copied and then locally edited — 556 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (78 matched lines × 2 locations) · ×1
Duplicated block with local edits (78 matched lines × 2 locations) apps/daemon/src/tools-deliverable-syntax-cli.ts:40— apps/daemon/src/tools-deliverable-syntax-cli.ts:40 · apps/daemon/src/tools-design-systems-cli.ts:32 — the two spans are one implementation copied and then locally edited — 636 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 (77 matched lines × 2 locations) · ×1
Duplicated block with local edits (77 matched lines × 2 locations) apps/web/src/components/Theater/state/sse.ts:115— apps/web/src/components/Theater/state/sse.ts:115 · apps/web/src/providers/project-events.ts:113 — the two spans are one implementation copied and then locally edited — 454 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 (76 matched lines × 2 locations) · ×1
Duplicated block with local edits (76 matched lines × 2 locations) apps/daemon/src/runtimes/chat-run-messages.ts:546— apps/daemon/src/runtimes/chat-run-messages.ts:546 · apps/web/src/providers/daemon.ts:2538 — the two spans are one implementation copied and then locally edited — 560 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 (71 lines × 2 locations) apps/daemon/src/http/oauth-result-page.ts:7— apps/daemon/src/http/oauth-result-page.ts:7 · apps/daemon/src/mcp-routes.ts:414 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication· Duplicated block with local edits (69 matched lines × 2 locations) · ×1
Duplicated block with local edits (69 matched lines × 2 locations) tools/pack/src/mac/builder.ts:29— tools/pack/src/mac/builder.ts:29 · tools/pack/src/win/builder.ts:91 — the two spans are one implementation copied and then locally edited — 381 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (68 matched lines × 2 locations) · ×1
Duplicated block with local edits (68 matched lines × 2 locations) apps/web/src/components/AmrLoginPill.tsx:554— apps/web/src/components/AmrLoginPill.tsx:554 · apps/web/src/components/InlineModelSwitcher.tsx:390 — the two spans are one implementation copied and then locally edited — 336 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 (66 lines × 2 locations) REDACTED:2138— REDACTED:2138 · REDACTED:1084 — 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 (65 lines × 2 locations) apps/daemon/src/tools-connectors-cli.ts:1398— apps/daemon/src/tools-connectors-cli.ts:1398 · apps/daemon/src/tools-connectors-cli.ts:1475 — 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 (62 matched lines × 2 locations) · ×1
Duplicated block with local edits (62 matched lines × 2 locations) apps/daemon/src/brands/engine/seed.ts:69— apps/daemon/src/brands/engine/seed.ts:69 · apps/daemon/src/brands/seed.ts:36 — the two spans are one implementation copied and then locally edited — 470 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 (61 lines × 2 locations) tools/pack/src/mac/prebundle.ts:96— tools/pack/src/mac/prebundle.ts:96 · tools/pack/src/win/prebundle.ts:85 — 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 (60 lines × 2 locations) apps/web/src/components/ChatComposer.tsx:4783— apps/web/src/components/ChatComposer.tsx:4783 · apps/web/src/components/ChatPane.tsx:7124 — 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.
Complex function HtmlViewer (cyclomatic 660, cognitive 546) REDACTED:7238— HtmlViewer has cyclomatic complexity 660 and cognitive complexity 546; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 startChatRun (cyclomatic 508, cognitive 639) REDACTED:11395— startChatRun has cyclomatic complexity 508 and cognitive complexity 639; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 415, cognitive 424) REDACTED:1339— (anonymous) has cyclomatic complexity 415 and cognitive complexity 424; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 handleRunCreate (cyclomatic 385, cognitive 511) apps/daemon/src/routes/runs.ts:1393— handleRunCreate has cyclomatic complexity 385 and cognitive complexity 511; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 AppInner (cyclomatic 228, cognitive 209) apps/web/src/App.tsx:982— AppInner has cyclomatic complexity 228 and cognitive complexity 209; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ProjectView (cyclomatic 226, cognitive 183) apps/web/src/components/ProjectView.tsx:2168— ProjectView has cyclomatic complexity 226 and cognitive complexity 183; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 212, cognitive 309) REDACTED:16572— (anonymous) has cyclomatic complexity 212 and cognitive complexity 309; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 parseLayeredBackgroundProbe (cyclomatic 184, cognitive 181) apps/desktop/tests/main/pptx-layered-background.test.ts:3232— parseLayeredBackgroundProbe has cyclomatic complexity 184 and cognitive complexity 181; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 SettingsDialog (cyclomatic 182, cognitive 170) apps/web/src/components/SettingsDialog.tsx:1502— SettingsDialog has cyclomatic complexity 182 and cognitive complexity 170; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 composeDaemonSystemPrompt (cyclomatic 176, cognitive 271) REDACTED:10334— composeDaemonSystemPrompt has cyclomatic complexity 176 and cognitive complexity 271; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 runAutomation (cyclomatic 167, cognitive 303) apps/daemon/src/cli.ts:12098— runAutomation has cyclomatic complexity 167 and cognitive complexity 303; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 167, cognitive 225) apps/web/src/components/ProjectView.tsx:8712— (anonymous) has cyclomatic complexity 167 and cognitive complexity 225; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 runProject (cyclomatic 166, cognitive 264) apps/daemon/src/cli.ts:7528— runProject has cyclomatic complexity 166 and cognitive complexity 264; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 158, cognitive 194) REDACTED:3948— (anonymous) has cyclomatic complexity 158 and cognitive complexity 194; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 148, cognitive 283) apps/daemon/src/agent-protocol/acp/session.ts:1041— (anonymous) has cyclomatic complexity 148 and cognitive complexity 283; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 composeSystemPrompt (cyclomatic 148, cognitive 157) REDACTED:899— composeSystemPrompt has cyclomatic complexity 148 and cognitive complexity 157; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 attachRecoverableRuns (cyclomatic 143, cognitive 210) apps/web/src/components/ProjectView.tsx:6748— attachRecoverableRuns has cyclomatic complexity 143 and cognitive complexity 210; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 DesignKitViewInner (cyclomatic 136, cognitive 131) apps/web/src/components/DesignKitView.tsx:313— DesignKitViewInner has cyclomatic complexity 136 and cognitive complexity 131; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 generateMedia (cyclomatic 135, cognitive 151) apps/daemon/src/media/index.ts:351— generateMedia has cyclomatic complexity 135 and cognitive complexity 151; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 consumeDaemonPhysicalRun (cyclomatic 132, cognitive 318) apps/web/src/providers/daemon.ts:1764— consumeDaemonPhysicalRun has cyclomatic complexity 132 and cognitive complexity 318; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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: 20090 lines of code REDACTED:1— REDACTED has 20090 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: 18268 lines of code REDACTED:1— REDACTED has 18268 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· apps/web/src/components/ProjectView.tsx · ×1
apps/web/src/components/ProjectView.tsx: 15962 lines of code apps/web/src/components/ProjectView.tsx:1— apps/web/src/components/ProjectView.tsx has 15962 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
apps/daemon/src/cli.ts: 12218 lines of code apps/daemon/src/cli.ts:1— apps/daemon/src/cli.ts has 12218 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· apps/web/src/components/SettingsDialog.tsx · ×1
apps/web/src/components/SettingsDialog.tsx: 9032 lines of code apps/web/src/components/SettingsDialog.tsx:1— apps/web/src/components/SettingsDialog.tsx has 9032 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· apps/web/src/components/FileWorkspace.tsx · ×1
apps/web/src/components/FileWorkspace.tsx: 8556 lines of code apps/web/src/components/FileWorkspace.tsx:1— apps/web/src/components/FileWorkspace.tsx has 8556 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: 8001 lines of code REDACTED:1— REDACTED has 8001 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· apps/web/src/components/ChatPane.tsx · ×1
apps/web/src/components/ChatPane.tsx: 7010 lines of code apps/web/src/components/ChatPane.tsx:1— apps/web/src/components/ChatPane.tsx has 7010 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· apps/web/src/components/ChatComposer.tsx · ×1
apps/web/src/components/ChatComposer.tsx: 6633 lines of code apps/web/src/components/ChatComposer.tsx:1— apps/web/src/components/ChatComposer.tsx has 6633 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
apps/web/src/App.tsx: 6065 lines of code apps/web/src/App.tsx:1— apps/web/src/App.tsx has 6065 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
apps/daemon/src/db.ts: 5618 lines of code apps/daemon/src/db.ts:1— apps/daemon/src/db.ts has 5618 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· apps/web/src/components/DesignSystemFlow.tsx · ×1
apps/web/src/components/DesignSystemFlow.tsx: 5580 lines of code apps/web/src/components/DesignSystemFlow.tsx:1— apps/web/src/components/DesignSystemFlow.tsx has 5580 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· apps/web/src/components/HomeHero.tsx · ×1
apps/web/src/components/HomeHero.tsx: 5229 lines of code apps/web/src/components/HomeHero.tsx:1— apps/web/src/components/HomeHero.tsx has 5229 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· apps/web/src/components/EntryShell.tsx · ×1
apps/web/src/components/EntryShell.tsx: 4710 lines of code apps/web/src/components/EntryShell.tsx:1— apps/web/src/components/EntryShell.tsx has 4710 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: 4343 lines of code REDACTED:1— REDACTED has 4343 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: 4304 lines of code REDACTED:1— REDACTED has 4304 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: 4180 lines of code REDACTED:1— REDACTED has 4180 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· apps/daemon/src/media/index.ts · ×1
apps/daemon/src/media/index.ts: 4170 lines of code apps/daemon/src/media/index.ts:1— apps/daemon/src/media/index.ts has 4170 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: 3994 lines of code REDACTED:1— REDACTED has 3994 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· apps/web/src/providers/registry.ts · ×1
apps/web/src/providers/registry.ts: 3958 lines of code apps/web/src/providers/registry.ts:1— apps/web/src/providers/registry.ts has 3958 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· apps/web/src/components/HomeView.tsx · ×1
apps/web/src/components/HomeView.tsx: 3748 lines of code apps/web/src/components/HomeView.tsx:1— apps/web/src/components/HomeView.tsx has 3748 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: 3718 lines of code REDACTED:1— REDACTED has 3718 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
apps/daemon/src/mcp.ts: 3454 lines of code apps/daemon/src/mcp.ts:1— apps/daemon/src/mcp.ts has 3454 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· apps/daemon/src/routes/runs.ts · ×1
apps/daemon/src/routes/runs.ts: 3337 lines of code apps/daemon/src/routes/runs.ts:1— apps/daemon/src/routes/runs.ts has 3337 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· apps/web/src/components/NewProjectPanel.tsx · ×1
apps/web/src/components/NewProjectPanel.tsx: 3180 lines of code apps/web/src/components/NewProjectPanel.tsx:1— apps/web/src/components/NewProjectPanel.tsx has 3180 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· apps/daemon/src/langfuse-trace.ts · ×1
apps/daemon/src/langfuse-trace.ts: 3168 lines of code apps/daemon/src/langfuse-trace.ts:1— apps/daemon/src/langfuse-trace.ts has 3168 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· apps/web/src/components/QuestionForm.tsx · ×1
apps/web/src/components/QuestionForm.tsx: 3087 lines of code apps/web/src/components/QuestionForm.tsx:1— apps/web/src/components/QuestionForm.tsx has 3087 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· apps/daemon/src/connectionTest.ts · ×1
apps/daemon/src/connectionTest.ts: 3082 lines of code apps/daemon/src/connectionTest.ts:1— apps/daemon/src/connectionTest.ts has 3082 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· apps/desktop/src/main/deck-capture.ts · ×1
apps/desktop/src/main/deck-capture.ts: 3075 lines of code apps/desktop/src/main/deck-capture.ts:1— apps/desktop/src/main/deck-capture.ts has 3075 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: 2995 lines of code REDACTED:1— REDACTED has 2995 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: 2905 lines of code REDACTED:1— REDACTED has 2905 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· apps/web/src/components/EntryNavRail.tsx · ×1
apps/web/src/components/EntryNavRail.tsx: 2813 lines of code apps/web/src/components/EntryNavRail.tsx:1— apps/web/src/components/EntryNavRail.tsx has 2813 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· apps/web/src/state/projects.ts · ×1
apps/web/src/state/projects.ts: 2789 lines of code apps/web/src/state/projects.ts:1— apps/web/src/state/projects.ts has 2789 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· apps/web/src/components/WorkspaceTabsBar.tsx · ×1
apps/web/src/components/WorkspaceTabsBar.tsx: 2739 lines of code apps/web/src/components/WorkspaceTabsBar.tsx:1— apps/web/src/components/WorkspaceTabsBar.tsx has 2739 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· apps/web/src/providers/daemon.ts · ×1
apps/web/src/providers/daemon.ts: 2672 lines of code apps/web/src/providers/daemon.ts:1— apps/web/src/providers/daemon.ts has 2672 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· apps/daemon/src/tools-connectors-cli.ts · ×1
apps/daemon/src/tools-connectors-cli.ts: 2640 lines of code apps/daemon/src/tools-connectors-cli.ts:1— apps/daemon/src/tools-connectors-cli.ts has 2640 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· apps/web/src/components/MemorySection.tsx · ×1
apps/web/src/components/MemorySection.tsx: 2629 lines of code apps/web/src/components/MemorySection.tsx:1— apps/web/src/components/MemorySection.tsx has 2629 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· apps/daemon/src/runtimes/runs.ts · ×1
apps/daemon/src/runtimes/runs.ts: 2557 lines of code apps/daemon/src/runtimes/runs.ts:1— apps/daemon/src/runtimes/runs.ts has 2557 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· apps/web/src/components/RecentProjectsStrip.tsx · ×1
apps/web/src/components/RecentProjectsStrip.tsx: 2412 lines of code apps/web/src/components/RecentProjectsStrip.tsx:1— apps/web/src/components/RecentProjectsStrip.tsx has 2412 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· apps/web/src/components/DesignFilesPanel.tsx · ×1
apps/web/src/components/DesignFilesPanel.tsx: 2345 lines of code apps/web/src/components/DesignFilesPanel.tsx:1— apps/web/src/components/DesignFilesPanel.tsx has 2345 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 (~406 LoC) apps/desktop/src/main/preload.cts— no import path from any entry point (859 application, 107 tooling, 3062 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 (~379 LoC) scripts/generate-design-system-system-assets.ts— no import path from any entry point (859 application, 107 tooling, 3062 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 (~366 LoC) scripts/refresh-slide-template-commercialization.ts— no import path from any entry point (859 application, 107 tooling, 3062 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 (~273 LoC) figma-plugin/code.js— no import path from any entry point (859 application, 107 tooling, 3062 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 (~208 LoC) plugins/_official/video-templates/frame-data-rollup/source/DataRollup.tsx— no import path from any entry point (859 application, 107 tooling, 3062 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (plugins/_official/video-templates/frame-data-rollup/source/Root.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~72 LoC) apps/daemon/src/collab/public-share-team-visibility.ts— no import path from any entry point (859 application, 107 tooling, 3062 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 (~69 LoC) apps/web/src/components/home-hero/PixelScanLogo.tsx— no import path from any entry point (859 application, 107 tooling, 3062 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 (~68 LoC) apps/web/src/components/FinalizeDesignButton.tsx— no import path from any entry point (859 application, 107 tooling, 3062 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/web/src/components/ProjectActionsToolbar.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~50 LoC) packages/sidecar/src/json-file.ts— no import path from any entry point (859 application, 107 tooling, 3062 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 (~49 LoC) apps/web/src/components/ProjectActionsToolbar.tsx— no import path from any entry point (859 application, 107 tooling, 3062 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 (~40 LoC) plugins/_official/video-templates/frame-data-rollup/source/Root.tsx— no import path from any entry point (859 application, 107 tooling, 3062 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (plugins/_official/video-templates/frame-data-rollup/source/entry.ts) — 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 (~21 LoC) apps/web/src/campaigns/use-go-plan-campaign.ts— no import path from any entry point (859 application, 107 tooling, 3062 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 (~7 LoC) plugins/_official/video-templates/frame-data-rollup/source/entry.ts— no import path from any entry point (859 application, 107 tooling, 3062 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
Unused dependency '@formkit/auto-animate' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'lucide-react' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'parse5' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Third-party script without Subresource Integrity apps/daemon/src/tools-connectors-cli.ts:76— `https://unpkg.com/react@18.3.1/umd/react.development.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 46 such include(s) across the repository's markup.
Orphaned file design-templates/last30days/scripts/lib/setup_wizard.py: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 apps/daemon/src/agent-protocol/pi-rpc/session.ts: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 design-templates/last30days/scripts/lib/normalize.py: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 design-templates/last30days/scripts/lib/html_render.py: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 apps/web/src/components/workspace/TerminalViewer.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 scripts/refresh-slide-template-commercialization.ts: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 design-templates/last30days/scripts/lib/rerank.py: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 design-templates/last30days/scripts/lib/instagram.py: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 packages/contracts/src/api/library.ts: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 apps/daemon/src/automation-ingestions.ts: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 apps/web/src/components/TooltipLayer.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 REDACTED: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 apps/web/src/components/LibraryPreviewModal.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 apps/daemon/src/figma/fig-decode.ts: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 apps/daemon/src/design-systems/token-contract.ts: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 apps/daemon/src/migration/legacy-data-migrator.ts: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 design-templates/last30days/scripts/lib/providers.py: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 apps/daemon/src/plugins/duplicate-project.ts: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 plugins/community/humanize-ppt/scripts/pptx_qa.py: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 design-templates/last30days/scripts/lib/bird_x.py: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 scripts/generate-design-system-system-assets.ts: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 apps/daemon/src/role-marker-guard.ts: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 apps/daemon/src/plugins/skill-candidates.ts: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 apps/daemon/src/brands/design-md-input.ts: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 skills/hatch-pet/scripts/finalize_pet_run.py: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.
Mock-dominated test: posts run correlation fields and reports run metadata callbacks apps/web/tests/providers/sse.test.ts:2229— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 7 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: follows daemon-projected successor Runs until the logical strategy task is terminal apps/web/tests/providers/sse.test.ts:2268— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: keeps a production turn the gate blocked on the Run's own success apps/web/tests/providers/sse.test.ts:2552— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: keeps top backdrop clicks from dismissing while allowing normal backdrop clicks apps/web/tests/hooks/useModalWindowDragGuard.test.tsx:40— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not block controls inside the top band apps/web/tests/hooks/useModalWindowDragGuard.test.tsx:61— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: still sends real typed text even while the placeholder carousel is mounted apps/web/tests/components/ChatComposer.empty-send-guard.test.tsx:91— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: tags entry_from=mark on a draw annotation sent while a run is streaming apps/web/tests/components/ChatComposer.search.test.tsx:471— This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: tracks run_failed_toast exposure for AMR sign-in guidance apps/web/tests/components/ChatPane.conversation-title.test.tsx:149— This test sets up 10 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: keeps a bounded terminal confirmation poll until the completed file is registered apps/web/tests/components/ChatPane.media-task-polling.test.tsx:109— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: keeps reconciling a watched run’s completed media file after it goes terminal apps/web/tests/components/ChatPane.media-task-polling.test.tsx:231— This test sets up 9 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not re-poll a settled media file replayed from history apps/web/tests/components/ChatPane.media-task-polling.test.tsx:334— This test sets up 5 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: stops terminal file confirmation after the bounded retry budget apps/web/tests/components/ChatPane.media-task-polling.test.tsx:390— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: routes the persistent retry action back to the host with the failed user row apps/web/tests/components/ChatPane.send-failed.test.tsx:12— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: reorders queued prompts with the drag handle apps/web/tests/components/ChatPane.streaming.test.tsx:1484— This test sets up 5 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: invokes each direct row handler apps/web/tests/components/ComposerPlusMenu.test.tsx:555— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: invokes every submenu pick and "Add …" row handler apps/web/tests/components/ComposerPlusMenu.test.tsx:613— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not re-fire the snapshot ticker when the parent recreates onPageSnapshotToast apps/web/tests/components/DesignBrowserPanel.webview.test.tsx:380— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: shows prioritized project starter actions in the empty state apps/web/tests/components/DesignFilesPanel.test.tsx:174— This test sets up 5 test doubles (for example `vi.fn`) against 0 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: routes create and edit actions to the dedicated design-system flow apps/web/tests/components/DesignSystemsTab.test.tsx:192— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: waits for the Workspace authority before reading project metadata apps/web/tests/components/DesignsTab.empty.test.tsx:246— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: reuses a resolved project cover decision across remounts apps/web/tests/components/DesignsTab.empty.test.tsx:332— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: refreshes the projects list from the toolbar button apps/web/tests/components/DesignsTab.select-mode.test.tsx:84— This test sets up 5 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: auto-refreshes while the projects tab is active apps/web/tests/components/DesignsTab.select-mode.test.tsx:201— This test sets up 6 test doubles (for example `vi.spyOn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not auto-refresh while the projects tab is inactive apps/web/tests/components/DesignsTab.select-mode.test.tsx:251— This test sets up 5 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: opens a materialized local Team row without hydration or pull apps/web/tests/components/EntryShell.blank-project-naming.test.tsx:324— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
+ 102 more in this group — see findings.md.
GD1 · Unfinished & placeholder code· Placeholder literal left in code · ×40
Placeholder literal left in code apps/daemon/src/prompts/discovery.ts:132— A placeholder string ("## RULE 3 — TodoWrite the plan, then liv…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/daemon/src/prompts/panel.ts:209— A placeholder string ("rounds the orchestrator applies the fall…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:50— A placeholder string ("استخدم قالب Magazine Article لتحويل محتو…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:92— A placeholder string ("استخدم قالب Twitter Share Card لتحويل مح…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:98— A placeholder string ("استخدم قالب Xiaohongshu Card لتحويل محتو…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:134— A placeholder string ("استخدم قالب Data Visualization Report لت…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:140— A placeholder string ("استخدم قالب Guizang Editorial E-Ink Deck…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:146— A placeholder string ("استخدم قالب Open-Slide 1920 Canvas Deck …") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:152— A placeholder string ("استخدم قالب Swiss International Deck لتح…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:194— A placeholder string ("استخدم قالب Kami Parchment Document لتحو…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:374— A placeholder string ("استخدم قالب NYT-Style Data Chart Frame ل…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:380— A placeholder string ("استخدم قالب Sticky Flowchart Frame لتحوي…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:386— A placeholder string ("استخدم قالب Glitch Title Frame لتحويل مح…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:392— A placeholder string ("استخدم قالب Light-Leak Cinematic Frame ل…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:398— A placeholder string ("استخدم قالب Liquid Background Hero لتحوي…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:404— A placeholder string ("استخدم قالب Logo Outro Frame لتحويل محتو…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:410— A placeholder string ("استخدم قالب macOS Notification Banner لت…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:596— A placeholder string ("استخدم قالب Device 3D Showcase لتحويل مح…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:644— A placeholder string ("استخدم قالب الملصق التسويقي لتحويل محتوا…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:650— A placeholder string ("استخدم قالب الشرائح بنمط Keynote لتحويل …") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:716— A placeholder string ("استخدم قالب السيرة الذاتية العصرية لتحوي…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:758— A placeholder string ("استخدم قالب بطاقة منشور Reddit لتحويل مح…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:764— A placeholder string ("استخدم قالب بطاقة Spotify Now-Playing لت…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:770— A placeholder string ("استخدم قالب بطاقة منشور X / Twitter لتحو…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code apps/web/src/i18n/content.ar.ts:890— A placeholder string ("استخدم قالب VFX Text Cursor لتحويل محتوا…") is still in shipped code — typical of generated boilerplate that was never filled in.
Hand-rolled JSON/XML parsing via regex scripts/i18n-check.ts:141— 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 scripts/refresh-slide-template-commercialization.ts:313— 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 plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py:848— 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 Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py:1837— 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 Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py:1854— 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 Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py:1895— 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 Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex docs/design/chat-mirror/build-compare.mjs:21— 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 docs/design/chat-mirror/diff-cells.mjs:93— 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 design-templates/last30days/scripts/lib/youtube_yt.py:350— 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 Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex apps/web/src/runtime/speaker-notes.ts:637— 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 apps/web/src/runtime/chat/build-turn-blocks.ts:2057— 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 apps/web/src/runtime/chat/split-shell-cards.ts:72— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:4167— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:19322— 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 apps/web/src/components/FileWorkspace.tsx:6911— 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 apps/web/src/components/FileWorkspace.tsx:7789— 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 apps/daemon/src/agent-session-resume.ts:508— 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 apps/daemon/src/cli.ts:5982— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:152— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:185— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:187— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:192— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:197— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:213— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:1829— 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.
+ 15 more in this group — see findings.md.
P2 · Observability· Console output used as the logging channel · ×39
Console output used as the logging channel apps/daemon/src/agent-companion-setup.ts:236— `apps/daemon/src/agent-companion-setup.ts` reports through `console.*` at line 236 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 apps/daemon/src/app-config.ts:851— `apps/daemon/src/app-config.ts` reports through `console.*` at line 851 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 apps/daemon/src/app-config.ts:857— `apps/daemon/src/app-config.ts` reports through `console.*` at line 857 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 REDACTED:299— `REDACTED` reports through `console.*` at line 299 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 REDACTED:309— `REDACTED` reports through `console.*` at line 309 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 REDACTED:469— `REDACTED` reports through `console.*` at line 469 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 REDACTED:482— `REDACTED` reports through `console.*` at line 482 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 apps/daemon/src/byok-tools.ts:653— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 653 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 apps/daemon/src/byok-tools.ts:919— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 919 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 apps/daemon/src/byok-tools.ts:1050— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1050 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 apps/daemon/src/byok-tools.ts:1061— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1061 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 apps/daemon/src/byok-tools.ts:1196— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1196 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 apps/daemon/src/byok-tools.ts:1236— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1236 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 apps/daemon/src/byok-tools.ts:1486— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1486 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 apps/daemon/src/byok-tools.ts:1520— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1520 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 apps/daemon/src/byok-tools.ts:1590— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1590 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 apps/daemon/src/byok-tools.ts:1628— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1628 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 apps/daemon/src/byok-tools.ts:1641— `apps/daemon/src/byok-tools.ts` reports through `console.*` at line 1641 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 REDACTED:324— `REDACTED` reports through `console.*` at line 324 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 apps/daemon/src/connectionTest.ts:424— `apps/daemon/src/connectionTest.ts` reports through `console.*` at line 424 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 apps/daemon/src/connectionTest.ts:1694— `apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1694 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 apps/daemon/src/connectionTest.ts:1710— `apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1710 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 apps/daemon/src/connectionTest.ts:1730— `apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1730 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 apps/daemon/src/connectionTest.ts:1753— `apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1753 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 apps/daemon/src/connectionTest.ts:1772— `apps/daemon/src/connectionTest.ts` reports through `console.*` at line 1772 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Silent fallback default in catch apps/daemon/src/installation.ts:130— `readInstallationFileSync` 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 apps/daemon/src/integrations/vela-console-origin.ts:47— `originsByProfile` 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 apps/daemon/src/runtimes/launch.ts:203— `existingDirectories` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch apps/daemon/src/runtimes/env.ts:59— `amrAnalyticsIdentityEnv` 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 apps/daemon/src/db.ts:3125— `messageChatArtifactRefs` 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 apps/daemon/src/skills.ts:470— `collectDerivedExamples` 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 apps/daemon/src/strategies/task-store.ts:1632— `readHistoricalPlan` 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 apps/daemon/src/runtimes/byok-opencode.ts:260— `safeUrlPathname` 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 apps/daemon/src/runtimes/local-profiles.ts:206— `readLocalAgentProfileDefs` 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 apps/daemon/src/runtimes/opencode-child-evidence.ts:366— `collectOpenCodeChildRuntimeFacts` 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 apps/daemon/src/mcp.ts:3562— `safeText` 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 apps/daemon/src/artifacts/javascript-image-references.ts:23— `javascriptImageReferences` 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 apps/daemon/src/artifacts/stub-guard.ts:190— `findPriorArtifactSiblings` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch REDACTED:352— `listMemoryEntries` 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 apps/daemon/src/automation-templates.ts:280— `readUserAutomationTemplates` 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 apps/daemon/src/automation-proposals.ts:48— `listAutomationProposals` 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 apps/daemon/src/automation-ingestions.ts:75— `listAutomationSourcePackets` 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 apps/daemon/src/routines.ts:231— `tzWallToUtcCandidates` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch REDACTED:1548— `listUserDesignSystemRevisions` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch REDACTED:1666— `backfillDesignSystemWorkspaceResources` 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 REDACTED:2317— `readGeneratedManifest` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch REDACTED:2980— `readUserMetadata` 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 apps/daemon/src/brands/fonts.ts:173— `readFontManifest` 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 apps/daemon/src/brands/store.ts:204— `listBrandIds` 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 apps/daemon/src/brands/store.ts:220— `statMtime` 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.
Duplicated predicate apps/daemon/src/design-systems/import.ts:503— `!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug) || seen.has(slug)` appears character-identically in 2 files — apps/daemon/src/design-systems/import.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 apps/daemon/src/connectionTest.ts:1523— `!Array.isArray(candidates) || candidates.length === 0` appears character-identically in 2 files — apps/daemon/src/connectionTest.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 apps/daemon/src/connectionTest.ts:968— `!Array.isArray(choices) || choices.length === 0` appears character-identically in 2 files — apps/daemon/src/connectionTest.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 apps/web/src/observability/chat-scroll-freeze.ts:616— `!Number.isFinite(deltaY) || deltaY === 0` appears character-identically in 2 files — apps/web/src/observability/chat-scroll-freeze.ts, apps/web/src/runtime/chat-scroll-takeover.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 apps/daemon/src/routes/runs.ts:3212— `!Number.isFinite(lastEventId) || record.id > lastEventId` appears character-identically in 2 files — apps/daemon/src/routes/runs.ts, apps/daemon/src/terminals.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 apps/daemon/src/design-systems/shadcn-import.ts:299— `!Number.isInteger(n) || n < 0 || n > 255` appears character-identically in 2 files — apps/daemon/src/design-systems/shadcn-import.ts, apps/daemon/src/plugins/plugin-asset-cache.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 apps/daemon/src/sidecar/server.ts:64— `!Number.isInteger(port) || port < 0 || port > 65535` appears character-identically in 4 files — apps/daemon/src/sidecar/server.ts, REDACTED, packages/sidecar/src/client.ts, tools/serve/src/index.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:767— `!Number.isInteger(port) || port <= 0 || port > 65535` appears character-identically in 3 files — REDACTED, packages/sidecar-proto/src/index.ts, packages/sidecar/src/port.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/launcher-proto/src/index.ts:239— `!Number.isSafeInteger(parsed) || parsed <= 0` appears character-identically in 2 files — packages/launcher-proto/src/index.ts, tools/dev/src/config.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 apps/daemon/src/live-artifacts/refresh.ts:286— `!SAFE_MAPPING_SEGMENT.test(segment) || UNSAFE_MAPPING_SEGMENTS.has(segment)` appears character-identically in 2 files — apps/daemon/src/live-artifacts/refresh.ts, apps/daemon/src/live-artifacts/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 REDACTED:2276— `!activeCommentTarget || !onSavePreviewComment` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:2299— `!activeCommentTarget || !onSendBoardCommentAttachments` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate apps/web/src/components/DesignSystemKitPreview.tsx:148— `!cancelled && read.isStillCurrent(resourceReadIdentityRef.current)` appears character-identically in 2 files — apps/web/src/components/DesignSystemKitPreview.tsx, apps/web/src/components/DesignSystemsTab.tsx. 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 apps/daemon/src/agent-protocol/dsh-profile/probe.ts:47— `!candidate || typeof candidate !== 'object' || Array.isArray(candidate)` appears character-identically in 2 files — apps/daemon/src/agent-protocol/dsh-profile/probe.ts, apps/daemon/src/collab/pull-profile.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 apps/web/src/components/ProductionCampaignBadge.tsx:106— `!container || !decision || !authenticated || decision.sessionSubject !== sessionSubject` appears character-identically in 2 files — apps/web/src/components/ProductionCampaignBadge.tsx, apps/web/src/components/ProductionCampaignModal.tsx. 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 apps/daemon/src/collab/resource-principal.ts:23— `!context || !workspaceContextHasTeamIdentity(context)` appears character-identically in 3 files — apps/daemon/src/collab/resource-principal.ts, apps/web/src/components/DesignSystemsTab.tsx, 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 apps/daemon/src/strategies/od-next/automatic-simple-production.ts:110— `!current || current.latestRunId !== input.runId || current.outcome !== 'running'` appears character-identically in 2 files — apps/daemon/src/strategies/od-next/automatic-simple-production.ts, apps/daemon/src/strategies/task-store.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate apps/daemon/src/observability/task-observation-rollout.ts:457— `!data || typeof data !== 'object' || Array.isArray(data)` appears character-identically in 3 files — apps/daemon/src/observability/task-observation-rollout.ts, apps/daemon/src/run-diagnostics.ts, packages/contracts/src/artifacts/od-card.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 apps/web/src/components/AmrArtifactUpgradeDialog.tsx:113— `!element.hasAttribute('hidden') && element.getAttribute('aria-hidden') !== 'true'` appears character-identically in 2 files — apps/web/src/components/AmrArtifactUpgradeDialog.tsx, apps/web/src/components/GoPlanSunsetDialog.tsx. 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 apps/daemon/src/collab/sync-snapshot-store.ts:121— `!entry || typeof entry !== 'object' || Array.isArray(entry)` appears character-identically in 2 files — apps/daemon/src/collab/sync-snapshot-store.ts, apps/daemon/src/plugins/marketplaces.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:332— `!entry.isDirectory() && !entry.isSymbolicLink()` appears character-identically in 4 files — REDACTED, apps/daemon/src/skills.ts, packages/platform/src/toolchain.ts, scripts/check-design-system-flag-parity.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 tools/pack/src/mac/fs.ts:57— `!entry.isDirectory() || !includeChild(entry.name)` appears character-identically in 2 files — tools/pack/src/mac/fs.ts, tools/pack/src/win/fs.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/check-design-system-manifests.ts:70— `!entry.isDirectory() || SKIPPED_DIRECTORIES.has(entry.name)` appears character-identically in 2 files — scripts/check-design-system-manifests.ts, scripts/check-design-system-package-quality.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 apps/desktop/src/main/updater/release-lifecycle.ts:77— `!entry.isDirectory() || entry.isSymbolicLink()` appears character-identically in 3 files — apps/desktop/src/main/updater/release-lifecycle.ts, apps/desktop/src/main/updater/store.ts, packages/download/src/store.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate apps/daemon/src/collab/hub-events-subscriber.ts:263— `!epoch || !/^(?:0|[1-9]\d*)$/.test(counter)` appears character-identically in 3 files — apps/daemon/src/collab/hub-events-subscriber.ts, apps/daemon/src/collab/workspace-billing-runtime.ts, apps/daemon/src/integrations/vela-billing.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.
Blanket warning suppression apps/daemon/src/agents.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/engine/build.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/engine/derive.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/engine/export.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/engine/index.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/engine/kit.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/engine/palette.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/engine/seed.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/engine/types.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/brands/fonts.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression REDACTED:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/cli.ts:2— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/library-install.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/memory-extractions.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/memory-llm.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression REDACTED:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression REDACTED:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression apps/daemon/src/runtimes/runs.ts:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Blanket warning suppression REDACTED:1— A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
Silent fallback default on parse failure .github/scripts/pack.py:145— `previous_requirements` returns `{}` when `(KeyError, TypeError, ValueError, OSError, subprocess.SubprocessError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure design-templates/last30days/scripts/lib/dates.py:85— `get_date_confidence` returns `'low'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure design-templates/last30days/scripts/lib/polymarket.py:460— `_parse_outcome_prices` returns `[]` when `(json.JSONDecodeError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure design-templates/last30days/scripts/lib/polymarket.py:617— `market_volume` (in `parse_polymarket_response`) returns `0` when `(ValueError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure design-templates/last30days/scripts/lib/render.py:28— `_skill_version` returns `'?'` when `(json.JSONDecodeError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure design-templates/last30days/scripts/lib/signals.py:73— `log1p_safe` returns `0.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure design-templates/last30days/scripts/lib/xiaohongshu_api.py:34— `_to_int` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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 on parse failure skills/oil-motion/scripts/optimize_motion.py:83— `parse_rate` returns `0` when `(ValueError, ZeroDivisionError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 38 significant file(s) lose their only recent owner: apps/daemon/src/collab/workspace-resource-mutation.ts, apps/web/src/observability/chat-scroll-freeze-detector.ts, apps/web/src/observability/chat-scroll-forensics.ts, apps/web/src/runtime/chat-scroll-takeover.ts, apps/daemon/src/collab/vela-workspace-context.ts, apps/packaged/src/startup-telemetry.ts, tools/release/src/notifications/prerelease-progress-card.ts, apps/web/src/runtime/chat/stick-to-bottom.ts (+30 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 25 significant file(s) lose their only recent owner: packages/launcher-proto/src/index.ts, apps/desktop/src/main/updater/release-lifecycle.ts, tools/pack/src/mac/lifecycle.ts, apps/desktop/src/main/updater/feed.ts, tools/pack/src/cache/index.ts, apps/desktop/src/main/updater/store.ts, tools/pack/src/win/payload.ts, tools/serve/src/updater-fixture.ts (+17 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 22 significant file(s) lose their only recent owner: REDACTED, apps/daemon/src/plugins/atoms/figma-extract.ts, apps/daemon/src/plugins/atoms/patch-edit.ts, apps/daemon/src/plugins/atoms/token-map.ts, apps/daemon/src/plugins/atoms/handoff.ts, apps/daemon/src/plugins/atoms/rewrite-plan.ts, apps/daemon/src/plugins/atoms/code-import.ts, apps/daemon/src/plugins/diff.ts (+14 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 13 significant file(s) lose their only recent owner: apps/web/src/components/remix-icon-paths.ts, apps/web/src/components/entry-nav-rail/RailRecentRow.tsx, apps/web/src/campaigns/go-plan-content.ts, apps/web/src/hooks/useProjectRunStatuses.ts, apps/daemon/src/services/automatic-diagnostics.ts, apps/web/src/components/chat/QueuedSendStack.tsx, apps/web/src/components/project-split-layout.ts, packages/diagnostics/src/automatic.ts (+5 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 6 significant file(s) lose their only recent owner: apps/daemon/src/critique/orchestrator.ts, packages/contracts/src/critique.ts, apps/daemon/src/critique/persistence.ts, apps/web/src/components/Theater/hooks/useCritiqueTheaterEnabled.ts, apps/web/src/components/Theater/state/reducer.ts, apps/daemon/src/critique/interrupt-handler.ts. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 5 significant file(s) lose their only recent owner: packages/contracts/src/design-systems/components-manifest.ts, scripts/check-components-fixtures.ts, scripts/extract-components-manifest.ts, apps/web/src/components/byok/ByokKeyField.tsx, apps/web/src/components/byok/ByokProviderBaseUrl.tsx. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 4 significant file(s) lose their only recent owner: REDACTED, packages/platform/src/command.ts, packages/platform/src/fs.ts, packages/host/src/normalize.ts. Pair on, review, or document these before any departure.
IC1 · Incompleteness & stubs· Empty method body · ×2
Empty method body apps/web/src/collab/collab-context.tsx:42— `reportChange` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body apps/web/src/collab/collab-context.tsx:43— `requestPublish` has an empty body — confirm it's an intentional no-op and not an unfinished method.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 22 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (147 single-owned of 1531 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1531 of the 2074 production source files in this repository met that bar). They are anonymized user #8 (2 file(s)), anonymized user #9 (2 file(s)), anonymized user #10 (2 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 file(s)), anonymized user #13 (1 file(s)) (+16 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: apps/daemon/src/project-design-token-suggestions.ts, apps/daemon/src/brands/engine/palette.ts, apps/daemon/src/sandbox-mode.ts, apps/daemon/src/workspace-contract.ts, apps/web/src/hooks/useCoalescedCallback.ts, apps/web/src/utils/uuid.ts, apps/daemon/src/library.ts, apps/daemon/src/qa/cta-hierarchy.ts (+17 more).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 5 of 29 project(s) overshoot their size bounds, lowering Project Cohesion to 6.6/10. The most over is `apps/web` (439205 LoC, 1529 module-visible types across 43 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 261 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: design-templates/last30days/scripts/lib/setup_wizard.py, apps/daemon/src/agent-protocol/pi-rpc/session.ts, design-templates/last30days/scripts/lib/normalize.py, design-templates/last30days/scripts/lib/html_render.py, scripts/refresh-slide-template-commercialization.ts, design-templates/last30days/scripts/lib/rerank.py, design-templates/last30days/scripts/lib/instagram.py, apps/daemon/src/automation-ingestions.ts (and 253 more) (299 orphaned of 1531 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1531 of the 2074 production source files in this repository met that bar). 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.
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
No runtime threat detection — No runtime threat-detection engine (Tetragon TracingPolicy / Falco) is committed. These observe process, file and network activity in-kernel and can alert or kill on malicious behaviour a static scan cannot catch.
Classify ADR enforcement: 0001. Centralize daemon startup docs/adr/0001-centralize-daemon-startup.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Disabled test apps/daemon/tests/opend-2623-form-answer-constraint-carriage.test.ts:57— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Logging is not universal — Only 4/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `apps/web`, `packages/sidecar`.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 718557 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
R7 · Dead Code· Unused export 'DEFAULT_DSH_PROFILE_MAX_FRAME_BYTES' · ×1
Unused export 'DEFAULT_DSH_PROFILE_MAX_FRAME_BYTES' apps/daemon/src/agent-protocol/dsh-profile/stream.ts:14— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/agent-protocol/dsh-profile/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 apps/daemon/src/agent-protocol/dsh-profile/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'DSH_PROFILE_NAME' · ×1
Unused export 'DSH_PROFILE_NAME' apps/daemon/src/agent-protocol/dsh-profile/types.ts:9— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/agent-protocol/dsh-profile/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 apps/daemon/src/agent-protocol/dsh-profile/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'DshProfileModelsFrame' · ×1
Unused export 'DshProfileModelsFrame' apps/daemon/src/agent-protocol/dsh-profile/types.ts:30— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/agent-protocol/dsh-profile/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 apps/daemon/src/agent-protocol/dsh-profile/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'HOST_SYNTAX_MAX_EDITED_CHARACTERS' · ×1
Unused export 'HOST_SYNTAX_MAX_EDITED_CHARACTERS' apps/daemon/src/artifacts/deliverable-syntax-finalization.ts:29— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'HOST_SYNTAX_REPAIR_BUDGET_MS' · ×1
Unused export 'HOST_SYNTAX_REPAIR_BUDGET_MS' apps/daemon/src/artifacts/deliverable-syntax-finalization.ts:30— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'emitWithTextSuppressor' · ×1
Unused export 'emitWithTextSuppressor' apps/daemon/src/artifacts/text-suppression.ts:261— Nothing imports this binding — it is safe to review for removal.
Unused export 'buildFromUrl' apps/daemon/src/brands/engine/build.ts:421— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/brands/engine/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 apps/daemon/src/brands/engine/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'divider' apps/daemon/src/brands/engine/kit.ts:370— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'listSystemArtifacts' · ×1
Unused export 'listSystemArtifacts' apps/daemon/src/brands/system.ts:162— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'readSystemSummary' · ×1
Unused export 'readSystemSummary' apps/daemon/src/brands/system.ts:167— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CHAT_ARTIFACT_COVER_MAX_PER_RUN' · ×1
Unused export 'CHAT_ARTIFACT_COVER_MAX_PER_RUN' apps/daemon/src/chat-artifacts/cover.ts:90— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CommentFileCatalog' · ×1
Unused export 'CommentFileCatalog' apps/daemon/src/collab/comment-file-authority.ts:5— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CONNECTOR_MAX_OUTPUT_BYTES' · ×1
Unused export 'CONNECTOR_MAX_OUTPUT_BYTES' apps/daemon/src/connectors/service.ts:472— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'DesignTokenEvidenceCollector' · ×1
Unused export 'DesignTokenEvidenceCollector' apps/daemon/src/design-systems/token-evidence.ts:31— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'buildSurfaceTimeoutEvent' · ×1
Unused export 'buildSurfaceTimeoutEvent' apps/daemon/src/genui/events.ts:50— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/genui/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 apps/daemon/src/genui/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'markTimeout' apps/daemon/src/genui/store.ts:252— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/genui/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 apps/daemon/src/genui/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'validationError' · ×1
Unused export 'validationError' apps/daemon/src/http/parse.ts:13— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/daemon/src/http/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 apps/daemon/src/http/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'hasExplicitCollabCloudConfig' · ×1
Unused export 'hasExplicitCollabCloudConfig' apps/daemon/src/integrations/collab-cloud.ts:36— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'XAI_CALLBACK_PATH' · ×1
Unused export 'XAI_CALLBACK_PATH' REDACTED:24— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'updateLibraryTask' · ×1
Unused export 'updateLibraryTask' apps/daemon/src/library-store.ts:592— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isAllowedExtensionOrigin' · ×1
Unused export 'isAllowedExtensionOrigin' apps/daemon/src/library-tokens.ts:52— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'LIVE_ARTIFACT_RENDER_FORMAT' · ×1
Unused export 'LIVE_ARTIFACT_RENDER_FORMAT' REDACTED:3— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'LIVE_ARTIFACT_TEMPLATE_ENTRY' · ×1
Unused export 'LIVE_ARTIFACT_TEMPLATE_ENTRY' REDACTED:4— Nothing imports this binding — it is safe to review for removal.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 151/530 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 50/52 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Null assertions (`!`) reduce the strict null checking score — ~0.9 `!` null assertions per 1k TypeScript source lines — 776 assertion(s) across the 869738 source line(s) of the 1980 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: apps/daemon/src/observability/task-observation-rollout.ts (21), apps/web/src/components/ProjectView.tsx (20), REDACTED (17). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Subsumed condition operand tools/release/src/storage/common.ts:79— `name.endsWith(".tar.zst")` can never decide this `||` — every value satisfying `name.endsWith(".tar.zst")` also satisfies `name.endsWith(".zst")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Skipped (documented): (unnamed test) tools/pack/tests/win-builder.test.ts:193— 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) tools/pack/tests/win-identity.test.ts:155— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tools/pack/tests/win-lifecycle.test.ts:415— 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) tools/pack/tests/prebundle/macos.test.ts:115— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tools/pack/tests/launcher/windows/payload.test.ts:189— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tools/pack/tests/launcher/windows/payload.test.ts:219— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tools/pack/tests/launcher/windows/payload.test.ts:251— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tools/pack/tests/launcher/windows/payload.test.ts:303— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tools/pack/tests/launcher/macos/payload.test.ts:117— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) shells/terminal/tests/mac.test.ts:10— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) shells/terminal/tests/win.test.ts:10— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/sidecar/tests/client-endpoint.test.ts:25— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/sidecar/tests/convergence.test.ts:1003— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/sidecar/tests/private-ipc-path.test.ts:89— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) packages/platform/tests/process-tree.test.ts:172— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) e2e/tests/actions-cache-workflows.test.ts:52— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) e2e/tests/dialog/codex-patch-stream.test.ts:17— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) e2e/tests/dialog/opencode-preview-recovery.test.ts:14— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) e2e/tests/dialog/tool-argument-stream.test.ts:14— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) e2e/tests/amr/tool-preview.test.ts:15— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): lands on the home agent picker with AMR selected after accepting the AMR default apps/web/tests/components/App.onboarding-amr-e2e.test.tsx:428— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): (unnamed test) apps/web/tests/components/FileWorkspace.test.tsx:904— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) apps/web/tests/components/FileWorkspace.test.tsx:983— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) apps/web/tests/components/FileWorkspace.test.tsx:1087— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) apps/web/tests/components/TerminalViewer.test.tsx:27— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency — This repository's Python dependencies were read: 3 shipped distribution(s) across 1 manifest(s) (0 development or optional declaration(s) excluded, because a consumer does not install them). Whether any of them is behind its current release is the dependency-CURRENCY question, and no declaration here carries an EXACT pin to ask it about — every one is a floor or a range, which installs the newest release it admits and therefore cannot be behind one. That is a healthy declaration style, NOT a defect and NOT a gap in this analyzer; there is simply no currency question to answer. This is NOT a finding that these dependencies are current or healthy. Lockfiles are deliberately not read (poetry.lock, uv.lock, Pipfile.lock, pdm.lock): the four disagree about dev/optional membership, and misreading one would charge a test-only package a consumer never receives. Known CVEs in the same dependency graph are a separate question, reported under D30.
Off the main sequence: @open-design/contracts — @open-design/contracts: abstractness 0.02, instability 0.14, 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 117 file(s) — `.github/scripts/lib/feishu/release.ts`, `apps/daemon/src/analytics.ts`, `apps/daemon/src/chat-artifacts/store.ts`, `apps/daemon/src/collab/project-content-transfer-state.ts`, `apps/daemon/src/collab/team-resource-list-cache.ts`, … (+112 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
Run 01a17831-da7c-760d-bd2c-d2463a988d89 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 598 · Warnings: 4593 · Recommendations: 674 · Info: 60 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 12:31 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.