Public report of anomalyco/opencode, published 23 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). Watchdog 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, 23 October 2026, 08:37 UTC · Survey ID cd_ddbcedd09a2740e5a4371d328185c3df
anomalyco/opencode
Measured 23 October 2026, 07:26 UTC, at code version 4d30794
No regression since the last survey
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.
CAI scoreAt riskDown 13 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: 500,802 lines of product code in 42 projects, tests not counted · Estimated rebuild effort: about 6.4 person-years · Weakest lens: Domain Modelling, 10
Findings by how serious they are
192 critical2682 serious290 minor
9 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
23 October 2026, 07:26 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 ▸
87of 92 dimensions measured by tools. The other 5 are advisory notes from an AI model, which explain the code but don't count towards the score.
3010of 3164 findings point to an exact file and line, so you can open each one in the code. The other 154 concern the repository as a whole, such as missing documentation.
92dimensions across 8 lenses, read from 500,802 lines of product code in 42 projects.
anomalyco/opencode scores 30 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged.
The weakest lens counts most in the score, and here that is Domain Modelling, which scores 10 and is rated Critical. Its Domain ↔ infrastructure boundary dimension scores 1 out of 10, and until that reaches 4, Domain Modelling can't be rated higher than Adequate. The first actions are to keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository) and to resolve the 3 Deprecated finding(s) in Dependency Hygiene, and if Domain Modelling rose to 70, the score would rise from 30 to about 47.
192 findings are critical: 54 in Secrets (history), 50 in Dependency Vulnerabilities, 14 in Forms & labels, 14 in Keyboard semantics, 11 in Static Analysis (SAST), ten in Circular Imports, ten in Domain ↔ infrastructure boundary, seven in IaC & Container Security, six in Dependency Hygiene, five in Change Coupling, three in Dependency direction, three in Test Quality, two in Text alternatives, two in Web-Security Posture and one in ARIA correctness.
Watchdog couldn't measure 6 dimensions in this code, among them Code Coverage, Test Reliability and Navigability, so they are left out of the score. The product code is 500,802 lines, which would take an estimated 6.4 person-years, around €930,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 Domain Modelling rose from 10 to 70, the lowest score rated Strong, the score would rise from 30 to about 47.
Code composition: what the lines of code are
Product code 62%Tests 38%
New since the last survey: 2366 findings
These 2366 critical or serious findings weren't in the previous survey, on 9 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: 3281 findings
These 3281 critical or serious findings were in the previous survey, on 9 October 2026, and are gone from this one. The first 100 are listed here.
€310,000 to €1,600,000, for 5,156 to 16,356 hours of work, about 6.4 person-years for 3 to 13 engineers
Difficulty of the problem
High, 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 30. 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: 500,802 lines of product code
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
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
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 €930,000 to build again, about 6.4 person-years of work. Its weakest lens is Domain Modelling, at 10 (Critical). Domain Modelling is about whether the code protects the rules the business depends on. Because the weakest lens counts most in the score, work on Domain Modelling also moves the score most.
Based on: the rebuild estimate · the Domain Modelling grade · how much each lens counts
What to do: Start with the Domain Modelling actions in Top priorities.
If you do one thing first · First action
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository). Of all the actions in this report, it raises the score most for the work it takes: about 17 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 4.7 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 8% to 19% on every change. The history of the code shows how much it changes: about 1,105,031 lines over the last 90 days, which is about 4,481,515 lines a year. At that pace, the extra work comes to an estimated 933.6 to 5601.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of 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; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph 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.
1249 modules, with 1529 dependencies between them. 5 loops run through 20 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1209 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.
ai.src.route.auth uses session-ui.src.timeline.timeline-row, so a change to session-ui.src.timeline.timeline-row can break ai.src.route.auth, while a change to ai.src.route.auth can't break session-ui.src.timeline.timeline-row.
Position
Below the diagonal: ai.src.route.auth uses a module listed above it, which is the healthy direction.
ai.src.schema.events uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.schema.events, while a change to ai.src.schema.events can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.schema.events uses a module listed above it, which is the healthy direction.
ai.src.testing uses core.src.session.inbox, so a change to core.src.session.inbox can break ai.src.testing, while a change to ai.src.testing can't break core.src.session.inbox.
Position
Below the diagonal: ai.src.testing uses a module listed above it, which is the healthy direction.
core.src.instructions uses schema.src.credential, so a change to schema.src.credential can break core.src.instructions, while a change to core.src.instructions can't break schema.src.credential.
Position
Below the diagonal: core.src.instructions uses a module listed above it, which is the healthy direction.
gui-extensions.src.sdk.core uses core.src.session.inbox, so a change to core.src.session.inbox can break gui-extensions.src.sdk.core, while a change to gui-extensions.src.sdk.core can't break core.src.session.inbox.
Position
Below the diagonal: gui-extensions.src.sdk.core uses a module listed above it, which is the healthy direction.
gui-extensions.src.sdk.core uses protocol.src.simulation, so a change to protocol.src.simulation can break gui-extensions.src.sdk.core, while a change to gui-extensions.src.sdk.core can't break protocol.src.simulation.
Position
Below the diagonal: gui-extensions.src.sdk.core uses a module listed above it, which is the healthy direction.
gui-extensions.src.sdk.core uses schema.src.credential, so a change to schema.src.credential can break gui-extensions.src.sdk.core, while a change to gui-extensions.src.sdk.core can't break schema.src.credential.
Position
Below the diagonal: gui-extensions.src.sdk.core uses a module listed above it, which is the healthy direction.
plugin.src.effect.plugin uses core.src.project.schema, so a change to core.src.project.schema can break plugin.src.effect.plugin, while a change to plugin.src.effect.plugin can't break core.src.project.schema.
Position
Below the diagonal: plugin.src.effect.plugin uses a module listed above it, which is the healthy direction.
plugin.src.promise.plugin uses core.src.project.schema, so a change to core.src.project.schema can break plugin.src.promise.plugin, while a change to plugin.src.promise.plugin can't break core.src.project.schema.
Position
Below the diagonal: plugin.src.promise.plugin uses a module listed above it, which is the healthy direction.
ai.src.route.media-protocol uses ai.src.protocols.openai-images, so a change to ai.src.protocols.openai-images can break ai.src.route.media-protocol, while a change to ai.src.route.media-protocol can't break ai.src.protocols.openai-images.
Position
Below the diagonal: ai.src.route.media-protocol uses a module listed above it, which is the healthy direction.
ai.src.route.media-protocol uses ai.src.schema.errors, so a change to ai.src.schema.errors can break ai.src.route.media-protocol, while a change to ai.src.route.media-protocol can't break ai.src.schema.errors.
Position
Below the diagonal: ai.src.route.media-protocol uses a module listed above it, which is the healthy direction.
ai.src.route.media-protocol uses gui-extensions.src.sdk.core, so a change to gui-extensions.src.sdk.core can break ai.src.route.media-protocol, while a change to ai.src.route.media-protocol can't break gui-extensions.src.sdk.core.
Position
Below the diagonal: ai.src.route.media-protocol uses a module listed above it, which is the healthy direction.
22→34 ai.src.route.media-protocol uses ai.src.generationpart of a loop✕
Connections
1 pair of types, where a type in ai.src.route.media-protocol uses a type in ai.src.generation.
ai.src.route.media-protocol uses ai.src.generation, so a change to ai.src.generation can break ai.src.route.media-protocol, while a change to ai.src.route.media-protocol can't break ai.src.generation.
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.
gui-extensions.src.sdk.host-apis uses protocol.src.simulation, so a change to protocol.src.simulation can break gui-extensions.src.sdk.host-apis, while a change to gui-extensions.src.sdk.host-apis can't break protocol.src.simulation.
Position
Below the diagonal: gui-extensions.src.sdk.host-apis uses a module listed above it, which is the healthy direction.
gui-extensions.src.sdk.host-apis uses gui-extensions.src.sdk.core, so a change to gui-extensions.src.sdk.core can break gui-extensions.src.sdk.host-apis, while a change to gui-extensions.src.sdk.host-apis can't break gui-extensions.src.sdk.core.
Position
Below the diagonal: gui-extensions.src.sdk.host-apis uses a module listed above it, which is the healthy direction.
ai.src.media-model uses ai.src.protocols.openai-images, so a change to ai.src.protocols.openai-images can break ai.src.media-model, while a change to ai.src.media-model can't break ai.src.protocols.openai-images.
Position
Below the diagonal: ai.src.media-model uses a module listed above it, which is the healthy direction.
ai.src.media-model uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.media-model, while a change to ai.src.media-model can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.media-model uses a module listed above it, which is the healthy direction.
ai.src.media-model uses ai.src.route.media-protocol, so a change to ai.src.route.media-protocol can break ai.src.media-model, while a change to ai.src.media-model can't break ai.src.route.media-protocol.
Position
Below the diagonal: ai.src.media-model uses a module listed above it, which is the healthy direction.
24→29 ai.src.media-model uses ai.src.schema.optionspart of a loop✕
Connections
2 pairs of types, where a type in ai.src.media-model uses a type in ai.src.schema.options.
ai.src.media-model uses ai.src.schema.options, so a change to ai.src.schema.options can break ai.src.media-model, while a change to ai.src.media-model can't break ai.src.schema.options.
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.
24→31 ai.src.media-model uses ai.src.route.clientpart of a loop✕
Connections
2 pairs of types, where a type in ai.src.media-model uses a type in ai.src.route.client.
ai.src.media-model uses ai.src.route.client, so a change to ai.src.route.client can break ai.src.media-model, while a change to ai.src.media-model can't break ai.src.route.client.
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.
ai.src.route.media uses ai.src.protocols.openai-images, so a change to ai.src.protocols.openai-images can break ai.src.route.media, while a change to ai.src.route.media can't break ai.src.protocols.openai-images.
Position
Below the diagonal: ai.src.route.media uses a module listed above it, which is the healthy direction.
ai.src.route.media uses ai.src.route.auth, so a change to ai.src.route.auth can break ai.src.route.media, while a change to ai.src.route.media can't break ai.src.route.auth.
Position
Below the diagonal: ai.src.route.media uses a module listed above it, which is the healthy direction.
ai.src.route.media uses ai.src.schema.events, so a change to ai.src.schema.events can break ai.src.route.media, while a change to ai.src.route.media can't break ai.src.schema.events.
Position
Below the diagonal: ai.src.route.media uses a module listed above it, which is the healthy direction.
ai.src.route.media uses ai.src.testing, so a change to ai.src.testing can break ai.src.route.media, while a change to ai.src.route.media can't break ai.src.testing.
Position
Below the diagonal: ai.src.route.media uses a module listed above it, which is the healthy direction.
ai.src.route.media uses gui-extensions.src.sdk.core, so a change to gui-extensions.src.sdk.core can break ai.src.route.media, while a change to ai.src.route.media can't break gui-extensions.src.sdk.core.
Position
Below the diagonal: ai.src.route.media uses a module listed above it, which is the healthy direction.
ai.src.route.media uses ai.src.route.media-protocol, so a change to ai.src.route.media-protocol can break ai.src.route.media, while a change to ai.src.route.media can't break ai.src.route.media-protocol.
Position
Below the diagonal: ai.src.route.media uses a module listed above it, which is the healthy direction.
25→29 ai.src.route.media uses ai.src.schema.optionspart of a loop✕
Connections
2 pairs of types, where a type in ai.src.route.media uses a type in ai.src.schema.options.
ai.src.route.media uses ai.src.schema.options, so a change to ai.src.schema.options can break ai.src.route.media, while a change to ai.src.route.media can't break ai.src.schema.options.
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.
25→34 ai.src.route.media uses ai.src.generationpart of a loop✕
Connections
1 pair of types, where a type in ai.src.route.media uses a type in ai.src.generation.
ai.src.route.media uses ai.src.generation, so a change to ai.src.generation can break ai.src.route.media, while a change to ai.src.route.media can't break ai.src.generation.
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.
ai.src.route.transport uses ai.src.protocols.openai-images, so a change to ai.src.protocols.openai-images can break ai.src.route.transport, while a change to ai.src.route.transport can't break ai.src.protocols.openai-images.
Position
Below the diagonal: ai.src.route.transport uses a module listed above it, which is the healthy direction.
ai.src.route.transport uses ai.src.schema.errors, so a change to ai.src.schema.errors can break ai.src.route.transport, while a change to ai.src.route.transport can't break ai.src.schema.errors.
Position
Below the diagonal: ai.src.route.transport uses a module listed above it, which is the healthy direction.
ai.src.route.transport uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.route.transport, while a change to ai.src.route.transport can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.route.transport uses a module listed above it, which is the healthy direction.
ai.src.route.transport uses ai.src.route.auth, so a change to ai.src.route.auth can break ai.src.route.transport, while a change to ai.src.route.transport can't break ai.src.route.auth.
Position
Below the diagonal: ai.src.route.transport uses a module listed above it, which is the healthy direction.
ai.src.route.transport uses ai.src.route.media-protocol, so a change to ai.src.route.media-protocol can break ai.src.route.transport, while a change to ai.src.route.transport can't break ai.src.route.media-protocol.
Position
Below the diagonal: ai.src.route.transport uses a module listed above it, which is the healthy direction.
gui-extensions.src.sdk.context uses gui-extensions.src.sdk.core, so a change to gui-extensions.src.sdk.core can break gui-extensions.src.sdk.context, while a change to gui-extensions.src.sdk.context can't break gui-extensions.src.sdk.core.
Position
Below the diagonal: gui-extensions.src.sdk.context uses a module listed above it, which is the healthy direction.
gui-extensions.src.sdk.context uses gui-extensions.src.sdk.host-apis, so a change to gui-extensions.src.sdk.host-apis can break gui-extensions.src.sdk.context, while a change to gui-extensions.src.sdk.context can't break gui-extensions.src.sdk.host-apis.
Position
Below the diagonal: gui-extensions.src.sdk.context uses a module listed above it, which is the healthy direction.
plugin.src.tui.context uses tui.src.devtools, so a change to tui.src.devtools can break plugin.src.tui.context, while a change to plugin.src.tui.context can't break tui.src.devtools.
Position
Below the diagonal: plugin.src.tui.context uses a module listed above it, which is the healthy direction.
plugin.src.tui.context uses gui-extensions.src.sdk.host-apis, so a change to gui-extensions.src.sdk.host-apis can break plugin.src.tui.context, while a change to plugin.src.tui.context can't break gui-extensions.src.sdk.host-apis.
Position
Below the diagonal: plugin.src.tui.context uses a module listed above it, which is the healthy direction.
ai.src.schema.options uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.schema.options, while a change to ai.src.schema.options can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.schema.options uses a module listed above it, which is the healthy direction.
ai.src.schema.options uses ai.src.media-model, so a change to ai.src.media-model can break ai.src.schema.options, while a change to ai.src.schema.options can't break ai.src.media-model.
Position
Below the diagonal: ai.src.schema.options uses a module listed above it, which is the healthy direction.
ai.src.schema.options uses ai.src.route.media, so a change to ai.src.route.media can break ai.src.schema.options, while a change to ai.src.schema.options can't break ai.src.route.media.
Position
Below the diagonal: ai.src.schema.options uses a module listed above it, which is the healthy direction.
tui.src.mini uses ai.src.schema.messages, so a change to ai.src.schema.messages can break tui.src.mini, while a change to tui.src.mini can't break ai.src.schema.messages.
Position
Below the diagonal: tui.src.mini uses a module listed above it, which is the healthy direction.
tui.src.mini uses client.src.promise.generated.types, so a change to client.src.promise.generated.types can break tui.src.mini, while a change to tui.src.mini can't break client.src.promise.generated.types.
Position
Below the diagonal: tui.src.mini uses a module listed above it, which is the healthy direction.
tui.src.mini uses schema.src.location, so a change to schema.src.location can break tui.src.mini, while a change to tui.src.mini can't break schema.src.location.
Position
Below the diagonal: tui.src.mini uses a module listed above it, which is the healthy direction.
tui.src.mini uses schema.src.session, so a change to schema.src.session can break tui.src.mini, while a change to tui.src.mini can't break schema.src.session.
Position
Below the diagonal: tui.src.mini uses a module listed above it, which is the healthy direction.
tui.src.mini uses ai.src.schema.events, so a change to ai.src.schema.events can break tui.src.mini, while a change to tui.src.mini can't break ai.src.schema.events.
Position
Below the diagonal: tui.src.mini uses a module listed above it, which is the healthy direction.
tui.src.mini uses ai.src.route.media, so a change to ai.src.route.media can break tui.src.mini, while a change to tui.src.mini can't break ai.src.route.media.
Position
Below the diagonal: tui.src.mini uses a module listed above it, which is the healthy direction.
ai.src.route.client uses ai.src.protocols.openai-images, so a change to ai.src.protocols.openai-images can break ai.src.route.client, while a change to ai.src.route.client can't break ai.src.protocols.openai-images.
Position
Below the diagonal: ai.src.route.client uses a module listed above it, which is the healthy direction.
ai.src.route.client uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.route.client, while a change to ai.src.route.client can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.route.client uses a module listed above it, which is the healthy direction.
ai.src.route.client uses ai.src.route.auth, so a change to ai.src.route.auth can break ai.src.route.client, while a change to ai.src.route.client can't break ai.src.route.auth.
Position
Below the diagonal: ai.src.route.client uses a module listed above it, which is the healthy direction.
ai.src.route.client uses ai.src.schema.events, so a change to ai.src.schema.events can break ai.src.route.client, while a change to ai.src.route.client can't break ai.src.schema.events.
Position
Below the diagonal: ai.src.route.client uses a module listed above it, which is the healthy direction.
ai.src.route.client uses ai.src.route.media-protocol, so a change to ai.src.route.media-protocol can break ai.src.route.client, while a change to ai.src.route.client can't break ai.src.route.media-protocol.
Position
Below the diagonal: ai.src.route.client uses a module listed above it, which is the healthy direction.
ai.src.route.client uses ai.src.route.transport, so a change to ai.src.route.transport can break ai.src.route.client, while a change to ai.src.route.client can't break ai.src.route.transport.
Position
Below the diagonal: ai.src.route.client uses a module listed above it, which is the healthy direction.
ai.src.route.client uses ai.src.schema.options, so a change to ai.src.schema.options can break ai.src.route.client, while a change to ai.src.route.client can't break ai.src.schema.options.
Position
Below the diagonal: ai.src.route.client uses a module listed above it, which is the healthy direction.
31→34 ai.src.route.client uses ai.src.generationpart of a loop✕
Connections
2 pairs of types, where a type in ai.src.route.client uses a type in ai.src.generation.
ai.src.route.client uses ai.src.generation, so a change to ai.src.generation can break ai.src.route.client, while a change to ai.src.route.client can't break ai.src.generation.
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.
core.src uses ai.src.route.executor-service, so a change to ai.src.route.executor-service can break core.src, while a change to core.src can't break ai.src.route.executor-service.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses ai.src.schema.errors, so a change to ai.src.schema.errors can break core.src, while a change to core.src can't break ai.src.schema.errors.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses ai.src.schema.messages, so a change to ai.src.schema.messages can break core.src, while a change to core.src can't break ai.src.schema.messages.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses core.src.project.schema, so a change to core.src.project.schema can break core.src, while a change to core.src can't break core.src.project.schema.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses core.src.session.inbox, so a change to core.src.session.inbox can break core.src, while a change to core.src can't break core.src.session.inbox.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses schema.src.credential, so a change to schema.src.credential can break core.src, while a change to core.src can't break schema.src.credential.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses session-ui.src.timeline.timeline-row, so a change to session-ui.src.timeline.timeline-row can break core.src, while a change to core.src can't break session-ui.src.timeline.timeline-row.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses ai.src.schema.events, so a change to ai.src.schema.events can break core.src, while a change to core.src can't break ai.src.schema.events.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses core.src.instructions, so a change to core.src.instructions can break core.src, while a change to core.src can't break core.src.instructions.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses gui-extensions.src.sdk.host-apis, so a change to gui-extensions.src.sdk.host-apis can break core.src, while a change to core.src can't break gui-extensions.src.sdk.host-apis.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src uses ai.src.schema.options, so a change to ai.src.schema.options can break core.src, while a change to core.src can't break ai.src.schema.options.
Position
Below the diagonal: core.src uses a module listed above it, which is the healthy direction.
core.src.session.runner uses ai.src.route.executor-service, so a change to ai.src.route.executor-service can break core.src.session.runner, while a change to core.src.session.runner can't break ai.src.route.executor-service.
Position
Below the diagonal: core.src.session.runner uses a module listed above it, which is the healthy direction.
core.src.session.runner uses ai.src.schema.errors, so a change to ai.src.schema.errors can break core.src.session.runner, while a change to core.src.session.runner can't break ai.src.schema.errors.
Position
Below the diagonal: core.src.session.runner uses a module listed above it, which is the healthy direction.
core.src.session.runner uses ai.src.schema.messages, so a change to ai.src.schema.messages can break core.src.session.runner, while a change to core.src.session.runner can't break ai.src.schema.messages.
Position
Below the diagonal: core.src.session.runner uses a module listed above it, which is the healthy direction.
core.src.session.runner uses core.src.project.schema, so a change to core.src.project.schema can break core.src.session.runner, while a change to core.src.session.runner can't break core.src.project.schema.
Position
Below the diagonal: core.src.session.runner uses a module listed above it, which is the healthy direction.
core.src.session.runner uses schema.src.location, so a change to schema.src.location can break core.src.session.runner, while a change to core.src.session.runner can't break schema.src.location.
Position
Below the diagonal: core.src.session.runner uses a module listed above it, which is the healthy direction.
core.src.session.runner uses schema.src.session, so a change to schema.src.session can break core.src.session.runner, while a change to core.src.session.runner can't break schema.src.session.
Position
Below the diagonal: core.src.session.runner uses a module listed above it, which is the healthy direction.
core.src.session.runner uses session-ui.src.timeline.timeline-row, so a change to session-ui.src.timeline.timeline-row can break core.src.session.runner, while a change to core.src.session.runner can't break session-ui.src.timeline.timeline-row.
Position
Below the diagonal: core.src.session.runner uses a module listed above it, which is the healthy direction.
core.src.session.runner uses ai.src.schema.options, so a change to ai.src.schema.options can break core.src.session.runner, while a change to core.src.session.runner can't break ai.src.schema.options.
Position
Below the diagonal: core.src.session.runner uses a module listed above it, which is the healthy direction.
ai.src.generation uses ai.src.schema.errors, so a change to ai.src.schema.errors can break ai.src.generation, while a change to ai.src.generation can't break ai.src.schema.errors.
Position
Below the diagonal: ai.src.generation uses a module listed above it, which is the healthy direction.
ai.src.generation uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.generation, while a change to ai.src.generation can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.generation uses a module listed above it, which is the healthy direction.
ai.src.generation uses ai.src.testing, so a change to ai.src.testing can break ai.src.generation, while a change to ai.src.generation can't break ai.src.testing.
Position
Below the diagonal: ai.src.generation uses a module listed above it, which is the healthy direction.
ai.src.generation uses ai.src.route.client, so a change to ai.src.route.client can break ai.src.generation, while a change to ai.src.generation can't break ai.src.route.client.
Position
Below the diagonal: ai.src.generation uses a module listed above it, which is the healthy direction.
ai.src uses ai.src.protocols.openai-images, so a change to ai.src.protocols.openai-images can break ai.src, while a change to ai.src can't break ai.src.protocols.openai-images.
Position
Below the diagonal: ai.src uses a module listed above it, which is the healthy direction.
ai.src uses ai.src.route.executor-service, so a change to ai.src.route.executor-service can break ai.src, while a change to ai.src can't break ai.src.route.executor-service.
Position
Below the diagonal: ai.src uses a module listed above it, which is the healthy direction.
ai.src uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src, while a change to ai.src can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src uses a module listed above it, which is the healthy direction.
ai.src uses gui-extensions.src.sdk.core, so a change to gui-extensions.src.sdk.core can break ai.src, while a change to ai.src can't break gui-extensions.src.sdk.core.
Position
Below the diagonal: ai.src uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in ai.src.protocols uses a type in ai.src.protocols.openai-images. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
ai.src.protocols uses ai.src.protocols.openai-images, so a change to ai.src.protocols.openai-images can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.protocols.openai-images.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.schema.errors, so a change to ai.src.schema.errors can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.schema.errors.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses core.src.project.schema, so a change to core.src.project.schema can break ai.src.protocols, while a change to ai.src.protocols can't break core.src.project.schema.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses protocol.src.simulation, so a change to protocol.src.simulation can break ai.src.protocols, while a change to ai.src.protocols can't break protocol.src.simulation.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.route.auth, so a change to ai.src.route.auth can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.route.auth.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.schema.events, so a change to ai.src.schema.events can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.schema.events.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses core.src.instructions, so a change to core.src.instructions can break ai.src.protocols, while a change to ai.src.protocols can't break core.src.instructions.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses gui-extensions.src.sdk.core, so a change to gui-extensions.src.sdk.core can break ai.src.protocols, while a change to ai.src.protocols can't break gui-extensions.src.sdk.core.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.route.media-protocol, so a change to ai.src.route.media-protocol can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.route.media-protocol.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.media-model, so a change to ai.src.media-model can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.media-model.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.route.media, so a change to ai.src.route.media can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.route.media.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.route.transport, so a change to ai.src.route.transport can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.route.transport.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.schema.options, so a change to ai.src.schema.options can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.schema.options.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols uses ai.src.generation, so a change to ai.src.generation can break ai.src.protocols, while a change to ai.src.protocols can't break ai.src.generation.
Position
Below the diagonal: ai.src.protocols uses a module listed above it, which is the healthy direction.
ai.src.protocols.utils uses ai.src.schema.errors, so a change to ai.src.schema.errors can break ai.src.protocols.utils, while a change to ai.src.protocols.utils can't break ai.src.schema.errors.
Position
Below the diagonal: ai.src.protocols.utils uses a module listed above it, which is the healthy direction.
ai.src.protocols.utils uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.protocols.utils, while a change to ai.src.protocols.utils can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.protocols.utils uses a module listed above it, which is the healthy direction.
ai.src.protocols.utils uses protocol.src.simulation, so a change to protocol.src.simulation can break ai.src.protocols.utils, while a change to ai.src.protocols.utils can't break protocol.src.simulation.
Position
Below the diagonal: ai.src.protocols.utils uses a module listed above it, which is the healthy direction.
ai.src.protocols.utils uses ai.src.schema.events, so a change to ai.src.schema.events can break ai.src.protocols.utils, while a change to ai.src.protocols.utils can't break ai.src.schema.events.
Position
Below the diagonal: ai.src.protocols.utils uses a module listed above it, which is the healthy direction.
ai.src.protocols.utils uses ai.src.route.media-protocol, so a change to ai.src.route.media-protocol can break ai.src.protocols.utils, while a change to ai.src.protocols.utils can't break ai.src.route.media-protocol.
Position
Below the diagonal: ai.src.protocols.utils uses a module listed above it, which is the healthy direction.
ai.src.protocols.utils uses ai.src.schema.options, so a change to ai.src.schema.options can break ai.src.protocols.utils, while a change to ai.src.protocols.utils can't break ai.src.schema.options.
Position
Below the diagonal: ai.src.protocols.utils uses a module listed above it, which is the healthy direction.
ai.src.protocols.utils uses ai.src.route.client, so a change to ai.src.route.client can break ai.src.protocols.utils, while a change to ai.src.protocols.utils can't break ai.src.route.client.
Position
Below the diagonal: ai.src.protocols.utils uses a module listed above it, which is the healthy direction.
ai.src.protocols.utils uses ai.src.generation, so a change to ai.src.generation can break ai.src.protocols.utils, while a change to ai.src.protocols.utils can't break ai.src.generation.
Position
Below the diagonal: ai.src.protocols.utils uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.protocols.openai-images, so a change to ai.src.protocols.openai-images can break ai.src.route, while a change to ai.src.route can't break ai.src.protocols.openai-images.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.route.executor-service, so a change to ai.src.route.executor-service can break ai.src.route, while a change to ai.src.route can't break ai.src.route.executor-service.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.schema.errors, so a change to ai.src.schema.errors can break ai.src.route, while a change to ai.src.route can't break ai.src.schema.errors.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.schema.messages, so a change to ai.src.schema.messages can break ai.src.route, while a change to ai.src.route can't break ai.src.schema.messages.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses protocol.src.simulation, so a change to protocol.src.simulation can break ai.src.route, while a change to ai.src.route can't break protocol.src.simulation.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.route.auth, so a change to ai.src.route.auth can break ai.src.route, while a change to ai.src.route can't break ai.src.route.auth.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.schema.events, so a change to ai.src.schema.events can break ai.src.route, while a change to ai.src.route can't break ai.src.schema.events.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses gui-extensions.src.sdk.core, so a change to gui-extensions.src.sdk.core can break ai.src.route, while a change to ai.src.route can't break gui-extensions.src.sdk.core.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.route.media-protocol, so a change to ai.src.route.media-protocol can break ai.src.route, while a change to ai.src.route can't break ai.src.route.media-protocol.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.route.media, so a change to ai.src.route.media can break ai.src.route, while a change to ai.src.route can't break ai.src.route.media.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.route.transport, so a change to ai.src.route.transport can break ai.src.route, while a change to ai.src.route can't break ai.src.route.transport.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.route.client, so a change to ai.src.route.client can break ai.src.route, while a change to ai.src.route can't break ai.src.route.client.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
ai.src.route uses ai.src.generation, so a change to ai.src.generation can break ai.src.route, while a change to ai.src.route can't break ai.src.generation.
Position
Below the diagonal: ai.src.route uses a module listed above it, which is the healthy direction.
cli.src.acp uses ai.src.route.executor-service, so a change to ai.src.route.executor-service can break cli.src.acp, while a change to cli.src.acp can't break ai.src.route.executor-service.
Position
Below the diagonal: cli.src.acp uses a module listed above it, which is the healthy direction.
cli.src.acp uses ai.src.schema.messages, so a change to ai.src.schema.messages can break cli.src.acp, while a change to cli.src.acp can't break ai.src.schema.messages.
Position
Below the diagonal: cli.src.acp uses a module listed above it, which is the healthy direction.
cli.src.acp uses core.src.project.schema, so a change to core.src.project.schema can break cli.src.acp, while a change to cli.src.acp can't break core.src.project.schema.
Position
Below the diagonal: cli.src.acp uses a module listed above it, which is the healthy direction.
cli.src.acp uses schema.src.location, so a change to schema.src.location can break cli.src.acp, while a change to cli.src.acp can't break schema.src.location.
Position
Below the diagonal: cli.src.acp uses a module listed above it, which is the healthy direction.
cli.src.acp uses session-ui.src.timeline.timeline-row, so a change to session-ui.src.timeline.timeline-row can break cli.src.acp, while a change to cli.src.acp can't break session-ui.src.timeline.timeline-row.
Position
Below the diagonal: cli.src.acp uses a module listed above it, which is the healthy direction.
cli.src.acp uses ai.src.schema.events, so a change to ai.src.schema.events can break cli.src.acp, while a change to cli.src.acp can't break ai.src.schema.events.
Position
Below the diagonal: cli.src.acp uses a module listed above it, which is the healthy direction.
cli.src.acp uses ai.src.route.media-protocol, so a change to ai.src.route.media-protocol can break cli.src.acp, while a change to cli.src.acp can't break ai.src.route.media-protocol.
Position
Below the diagonal: cli.src.acp uses a module listed above it, which is the healthy direction.
cli.src.acp uses ai.src.generation, so a change to ai.src.generation can break cli.src.acp, while a change to cli.src.acp can't break ai.src.generation.
Position
Below the diagonal: cli.src.acp uses a module listed above it, which is the healthy direction.
core.src.session uses ai.src.route.executor-service, so a change to ai.src.route.executor-service can break core.src.session, while a change to core.src.session can't break ai.src.route.executor-service.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses ai.src.schema.errors, so a change to ai.src.schema.errors can break core.src.session, while a change to core.src.session can't break ai.src.schema.errors.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses ai.src.schema.messages, so a change to ai.src.schema.messages can break core.src.session, while a change to core.src.session can't break ai.src.schema.messages.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses core.src.project.schema, so a change to core.src.project.schema can break core.src.session, while a change to core.src.session can't break core.src.project.schema.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses core.src.session.inbox, so a change to core.src.session.inbox can break core.src.session, while a change to core.src.session can't break core.src.session.inbox.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses schema.src.credential, so a change to schema.src.credential can break core.src.session, while a change to core.src.session can't break schema.src.credential.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses schema.src.session, so a change to schema.src.session can break core.src.session, while a change to core.src.session can't break schema.src.session.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses session-ui.src.timeline.timeline-row, so a change to session-ui.src.timeline.timeline-row can break core.src.session, while a change to core.src.session can't break session-ui.src.timeline.timeline-row.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses ai.src.schema.events, so a change to ai.src.schema.events can break core.src.session, while a change to core.src.session can't break ai.src.schema.events.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses core.src.instructions, so a change to core.src.instructions can break core.src.session, while a change to core.src.session can't break core.src.instructions.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses core.src.session.runner, so a change to core.src.session.runner can break core.src.session, while a change to core.src.session can't break core.src.session.runner.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
core.src.session uses ai.src.generation, so a change to ai.src.generation can break core.src.session, while a change to core.src.session can't break ai.src.generation.
Position
Below the diagonal: core.src.session uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 62% · Adequate · gated by D1, D2 ·
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
A03:2025 — Software Supply Chain Failures
72
High / Critical
A07:2025 — Authentication Failures
55
High / Critical
A05:2025 — Injection
54
High / Critical
A02:2025 — Security Misconfiguration
15
High / Critical
Roadmap
First, enforce a strict boundary between the domain and infrastructure by keeping entities framework-free and using repositories for data mapping. Second, implement encryption for sensitive data at rest and manage keys securely in a vault, while resolving all deprecated and outdated npm dependencies to maintain hygiene. Finally, integrate a static analysis security tool into the CI pipeline to automatically block security regressions before they are merged.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
Resolve the 3 No assertions (empty test) finding(s) in Test Quality — start with solid-data.test.ts, completion-notices.test.tsx, dialog-select.test.tsx.
Encrypt sensitive data at rest (AES-256-GCM through node:crypto createCipheriv, or a column-encryption layer such as typeorm-encrypted / prisma-field-encryption / MongoDB CSFLE) and manage keys in a vault (AWS KMS, Azure Key Vault, GCP KMS, HashiCorp Vault). Skip if delegated to infra (Postgres TDE, KMS, etc.).
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.
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 — 192
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 — 2682
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 — 290
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 9
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. 87 of 92 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. 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 — 92 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, 3010 of 3164 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.
D8 Code Coverage — 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. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for packages/ai/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
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 MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for packages/ai/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
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 for the bun:test suite in packages/ai/ was NOT MEASURED: the dependency install for packages/ai/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/cli/ was NOT MEASURED: the dependency install for packages/cli/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/client/ was NOT MEASURED: the dependency install for packages/client/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/codemode/ was NOT MEASURED: the dependency install for packages/codemode/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/console/app/ was NOT MEASURED: the dependency install for packages/console/app/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/desktop/ was NOT MEASURED: the dependency install for packages/desktop/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/function/ was NOT MEASURED: the dependency install for packages/function/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/gui-extensions/ was NOT MEASURED: the dependency install for packages/gui-extensions/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/http-recorder/ was NOT MEASURED: the dependency install for packages/http-recorder/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/httpapi-codegen/ was NOT MEASURED: the dependency install for packages/httpapi-codegen/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 for the bun:test suite in packages/latex/ was NOT MEASURED: the dependency install for packages/latex/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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.
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. `packages/ai/src/experimental/evaluation-client.ts`, `packages/ai/src/experimental/evaluation.ts`, `packages/ai/src/image.ts`, `packages/ai/src/llm.ts`, `packages/ai/src/promise.ts`, … (+293 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.
AC6 Visual & motion safety — 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.
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/desktop/src/main/extension/host.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 DevServer (dev). the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence.
DM9 Scattered domain decisions — 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. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
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. 404 further occurrence(s) are not listed individually; the score already reflects all 444.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
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. 1044 further occurrence(s) are not listed individually; the score already reflects all 1084.
R11 Import Boundaries — 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. 28 further occurrence(s) are not listed individually; the score already reflects all 68.
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. 185 further occurrence(s) are not listed individually; the score already reflects all 225.
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. 320 further occurrence(s) are not listed individually; the score already reflects all 360.
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. 69 further occurrence(s) are not listed individually; the score already reflects all 109.
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. 101 further occurrence(s) are not listed individually; the score already reflects all 141.
X4 Structured logging — 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 C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations: 10 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
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.
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.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
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.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
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.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
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.
C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: 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".
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.
The LLM boundary
LLM-set scores this run (5): D19, D20, D21, D22, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
552 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was scan.scanPowerShellList at 375. A further 17 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being model-resolver.usesAPIKeyAuth at 34 — they are counted neither in the figure above nor in this dimension's score. 8 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: packages/core/src/model-resolver.ts (model-resolver.usesAPIKeyAuth at 34), packages/tui/src/plugin/api.tsx (api.createPluginContext at 29), packages/core/src/aisdk.ts (aisdk.streamPartEvents at 22), packages/session-ui/src/components/markdown-worker.ts (markdown-worker.getWorker at 21), packages/app/src/settings/search-field.tsx (search-field.SettingsSearchField at 17), and 3 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.
+ 541 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with scan.scanPowerShellList (cyclomatic 375), index.Session (cyclomatic 260). — 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 2 together lifts Cyclomatic Complexity from 2.0 to about 2.7/10, projected with the scoring formula itself and assuming each lands exactly at 240; 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.
+ 612 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 17 bodies over 120 down to 120 or less in Cognitive Complexity — start with scan.scanPowerShellList (cognitive 439), index.Session (cognitive 229), html-markdown.convertHTMLToMarkdown (cognitive 218). — 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 17 together lifts Cognitive Complexity from 2.0 to about 3.5/10, projected with the scoring formula itself and assuming each lands exactly at 120; 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 Classes6.9 / 10Adequate✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 325 FunctionTooLong finding(s) in God Classes — start with index.tsx (19), dialog.tsx (9), model.ts (5). — One of this dimension's main actionable groups (325 warning-level).
Resolve the 104 FileTooLong finding(s) in God Classes — start with index.tsx (7), REDACTED (4), layout.ts (3). — One of this dimension's main actionable groups (104 warning-level).
Resolve the 7 MethodTooLong finding(s) in God Classes — start with openai-responses-language-model.ts (3), openai-compatible-chat-language-model.ts, footer.ts. — One of this dimension's main actionable groups (7 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.
Do you agree with this assessment?
D5 · Coupling7.8 / 10Strong✓ 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.
38 production modules (npm), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; 8 module(s) off the main sequence, with abstractness counted on 36 of the 38 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: @opencode/console-resource · ×8
Unstable project @opencode/gui-extensions
Unstable project @opencode/tui
What to do
Resolve the 8 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 1 Unstable project @opencode/gui-extensions finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project @opencode/tui finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Prevented (currently Verified). — Hardens enforcement from Verified 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.
All 2 mechanizable ADR(s) are enforced: 1 by analyzers, 1 by tests. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
✓ On the Gold path — maintain.
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D9 · Test Distribution9.1 / 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.
6166 test methods: 5761 unit, 0 integration, 0 BDD, 405 e2e. The JavaScript/TypeScript suite contributes 6166 `it`/`test` case(s) across 857 test file(s) declaring at least one; its tier split is read from package names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.9 / 10Adequategated by 3 critical findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
27 skipped (25 with a documented reason), 36 zero-assertion, 3 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 6166 tests.
No assertions (empty test): revalidates after an event overtakes an active session read · ×3packages/client/test/solid-data.test.ts:235
No assertions: cycles from $name · ×33packages/app/src/providers/models/variant.test.ts:26
Fixed-sleep synchronisation: accepts a surviving contender after a failure without recruiting replacements · ×3packages/client/test/service.test.ts:387
Skipped test: direct footer recreates the frame across command panel transitions · ×2packages/tui/test/mini/footer.view.test.tsx:1588
Resolve the 3 No assertions (empty test) finding(s) in Test Quality — start with solid-data.test.ts, completion-notices.test.tsx, dialog-select.test.tsx. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 33 No assertions finding(s) in Test Quality — start with flowchart.test.ts (8), diagram.test.ts (6), session-tabs.test.tsx (4). — One of this dimension's main actionable groups (33 warning-level).
Resolve the 3 Fixed-sleep synchronisation finding(s) in Test Quality — start with service.test.ts, promise-service.test.ts, servers.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 dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
111 outdated direct production npm dependency(ies) of 158 graded, 1 pinning defect(s), across 42 package.json (42 of them the product) and 4 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 3 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.
Resolve the 3 Deprecated finding(s) in Dependency Hygiene — start with package.json (3). — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 Outdated (npm) finding(s) in Dependency Hygiene — start with package.json (3). — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 One package at two majors across the workspace finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
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 158 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 158 production dependency(ies) this repository's committed lockfile resolves, across 42 product package.json manifest(s). Its 321 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under MIT, which is its own choice and is not judged here.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: packages/tui/src/routes/session/index.tsx (172×260=44720); packages/tui/src/component/prompt/index.tsx (74×275=20350); packages/client/src/solid/data.ts (59×307=18113) Repeated repair below the complexity floor: packages/stats/core/src/domain/model-normalization.ts (19 of 24 changes were fixes); packages/stats/core/src/domain/inference.ts (14 of 18 changes were fixes); packages/core/src/plugin/models-dev.ts (13 of 21 changes were fixes)
Resolve the 307 Hotspot finding(s) in Churn × Complexity Hotspots — start with dialog.tsx (6), model.ts (5), index.tsx (4). — One of this dimension's main actionable groups (307 warning-level).
Resolve the 36 Repeated repair finding(s) in Churn × Complexity Hotspots — start with index.tsx (2), app-assets.ts (2), model-normalization.ts. — One of this dimension's main actionable groups (36 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.1 / 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.
138 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is packages/core/src/shell/scan.ts. Counted over 1537 of the 3153 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.
41 deducted task-comment markers across 500287 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 41 TodoComment finding(s) in Explicit Debt — start with file-mutation.ts (5), write.ts (4), workspace.ts (3). — One of this dimension's main actionable groups (41 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: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The root README is a multi-paragraph branding banner with links to multilingual versions and an OpenCode logo, then dives into the GitHub Action as a standalone document. The packages/ai README is a code example showing Effect imports and LLM.generate usage, while packages/app's Usage section explains pnpm dependency management and E2E testing commands. All four READMEs are directory-specific; none of them address the repository's overarching overview, installation, or contribution guidance. The repository's READMEs are well written and each documents its own directory (e.g., packages/desktop/README.md for desktop app, packages/plugin-browser/README.md for browser plugin), with clear installation/build/run steps, architecture/design docs, and a strong Starlight starter-kit README. The root README is the only one that needs to cover overview/installation/usage/contributing/license; it does all four and more (contribution guidance, licence) as well as the package-level documentation. The repository's READMEs are strong and well-organized for their respective directories. The changelog Worker README is a focused service doc with content (routes, versioning, release rendering) that matches its directory; the files README covers environment setup, Wrangler deployment, R2 upload semantics, and an outline of Deployment/Uploading/Release Binaries/Caching/Verification; the update Worker README describes its role, rollout configuration, desktop feeds, channel eligibility, and a clipped Channel rollouts section. All four service READMEs are well written for their tiers.
What to do
Improve Documentation Quality — currently 8.6/10. — The root README is a multi-paragraph branding banner with links to multilingual versions and an OpenCode logo, then dives into the GitHub Action as a standalone document. The packages/ai README is a code example showing Effect imports and LLM.generate usage, while packages/app's Usage section explains pnpm dependency management and E2E testing commands. All four READMEs are directory-specific; none of them address the repository's overarching overview, installation, or contribution guidance. The repository's READMEs are well written and each documents its own directory (e.g., packages/desktop/README.md for desktop app, packages/plugin-browser/README.md for browser plugin), with clear installation/build/run steps, architecture/design docs, and a strong Starlight starter-kit README. The root README is the only one that needs to cover overview/installation/usage/contributing/license; it does all four and more (contribution guidance, licence) as well as the package-level documentation. The repository's READMEs are strong and well-organized for their respective directories. The changelog Worker README is a focused service doc with content (routes, versioning, release rendering) that matches its directory; the files README covers environment setup, Wrangler deployment, R2 upload semantics, and an outline of Deployment/Uploading/Release Binaries/Caching/Verification; the update Worker README describes its role, rollout configuration, desktop feeds, channel eligibility, and a clipped Channel rollouts section. All four service READMEs are well written for their tiers.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR QualityExemplary◐ Sampled · 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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyStronggated by 2 serious findings◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
2 API inconsistencies across a 400-member sample of 645 exposed types.
Redundant authentication helper methods. `auth.bearer` appears to be a convenience wrapper for `auth.bearerHeader` (likely defaulting the header name to 'Authorization'). Having both exposes unnecessary complexity to the user.
Ambiguous naming for similar input types. `parseDataUrl` suggests returning a parsed structure or validation, while `fromDataUrl` suggests creating an `Asset`. If both create Assets, the names are confusingly distinct. If `parse` returns a raw object and `from` returns an Asset, the distinction is valid but `parse` is a poor name for a constructor-like function.
What to do
Resolve the 1 Redundant authentication helper methods. `auth.bearer` appears to be a… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Ambiguous naming for similar input types. `parseDataUrl` suggests… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.
Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.
Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.
130 domain type(s) cross context boundaries across 34 contexts.
Cross-context type Token (gui-extensions → ai) · ×21packages/ai/src/route/media-protocol.ts:88
Cross-context type SessionMessageInfo (client → tui) · ×12packages/tui/src/routes/session/grouping/session.ts:94
Cross-context type FormField (client → tui) · ×10REDACTED:11
Cross-context type FormValue (client → tui) · ×6REDACTED:63
Cross-context type Json (app → core) · ×6packages/core/src/instructions/index.ts:45
+ 41 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 21 Cross-context type Token (gui-extensions → ai) finding(s) in Boundary Type-Coupling — start with media-protocol.ts (9), media.ts (2), image.ts (2). — One of this dimension's main actionable groups (21 warning-level).
Resolve the 12 Cross-context type SessionMessageInfo (client → tui) finding(s) in Boundary Type-Coupling — start with rows.ts (5), session.ts (3), todo.ts. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 10 Cross-context type FormField (client → tui) finding(s) in Boundary Type-Coupling — start with REDACTED (7), form.shared.ts (3). — One of this dimension's main actionable groups (10 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.
Do you agree with this assessment?
D26 · Project Cohesion4.4 / 10Weak✓ Tool-verified
What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.
12 of 42 build units (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: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
54 finding(s): 0 critical, 54 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 54 REDACTED finding(s) in Secrets (history) — start with REDACTED (46), REDACTED (4), REDACTED. — One of this dimension's main actionable groups (54 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
58 finding(s): 0 critical, 11 high, 43 medium, 4 low. semgrep hit a parse error in 344 file(s) — `packages/ai/src/experimental/evaluation-client.ts` (line 15, line 22), `packages/ai/src/experimental/evaluation.ts` (line 208, line 221), `packages/ai/src/image.ts` (line 181, line 195, line 203, …), `packages/ai/src/llm.ts` (line 39, line 47, line 58, …), `packages/ai/src/promise.ts` (line 135, line 137, line 142, …), … (+339 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 9 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
+ 11 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 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.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 42 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (42). — One of this dimension's main actionable groups (42 issue-level).
Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 3 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 7 High IaC finding(s) in IaC & Container Security — start with REDACTED (7). — One of this dimension's main actionable groups (7 issue-level).
Resolve the 8 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (8). — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
2 of 1537 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is packages/web/src/components/share/content-diff.tsx. Counted over 1537 of the 3153 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 5 Boundary-crossing change coupling finding(s) in Change Coupling — start with platform.tsx (4), stats-proxy.ts. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 12 Change coupling finding(s) in Change Coupling — start with index.tsx (4), api.ts, devtools-bar.tsx. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with types.ts, [model].tsx. — One of this dimension's main actionable groups (2 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.
+ 1 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, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 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 the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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 0 platform declaration(s) and 5 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 alternatives5.5 / 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.
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. (×2) — packages/app/src/providers/connect/go-upsell-hero.tsx:10, packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:1028
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). (×2) — packages/console/app/src/routes/changelog/index.tsx:57, packages/gui-extensions/src/file/artifact-view.tsx:600
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) — packages/ui/src/data-display/avatar/avatar.tsx:59, packages/ui/src/data-display/project-avatar/project-avatar.tsx:101
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.0 / 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. (×6) — packages/app/src/new-session/project/selector.tsx:346, packages/app/src/providers/models/select-dialog.tsx:624, packages/session-ui/src/components/file-search.tsx:30, …
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — packages/app/src/providers/connect/dialog.tsx:313, packages/app/src/shell/commands/dialog.tsx:147, packages/ui/src/components/list.tsx:314
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. (×2) — packages/app/src/providers/credentials/dialog.tsx:192, packages/app/src/providers/credentials/dialog.tsx:236
This <span> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — packages/app/src/shell/titlebar/tab-nav.tsx:318
This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — packages/app/src/workspaces/selection/dialog.tsx:336
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×2) — packages/console/app/src/routes/enterprise/index.tsx:224, packages/gui-extensions/src/terminal/tab.tsx:154
This <video> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — packages/gui-extensions/src/file/artifact-view.tsx:600
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). — packages/gui-extensions/src/updater/whats-new.tsx:279
This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — packages/session-ui/src/components/message-nav.tsx:51
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.
Do you agree with this assessment?
AC3 · Page structure7.3 / 10Strong✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×6) — packages/console/app/src/routes/changelog/index.tsx:152, packages/console/app/src/routes/enterprise/index.tsx:338, packages/console/app/src/routes/go/index.tsx:173, …
A document must expose only one main landmark. Multiple visible <main> (or role="main") elements confuse the landmark map and the "skip to content" target. Keep one; remove or hide the rest. — services/www/src/docs/layouts/DocsLayout.astro:26
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — services/www/src/pages/index.astro:7
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".
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) — packages/app/src/composer/editor/editor.tsx:695, packages/app/src/session/screen.tsx:379, packages/session-ui/src/components/basic-tool.tsx:251, …
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×6) — packages/app/src/home/projects/view.tsx:396, packages/gui-extensions/src/file/artifact-view.tsx:422, packages/gui-extensions/src/file/artifact-view.tsx:591, …
This <span> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — packages/gui-extensions/src/terminal/tab.tsx:143
This <div> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its only behaviour is bound to pointerdown, pointer gestures a keyboard cannot produce, and there is no key handler. The tab stop leads nowhere. Bind the same behaviour to a key handler, or provide an equivalent control elsewhere. Give it a role as well, so assistive tech can announce what it is. — packages/session-ui/src/components/file.tsx:759
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. (×3) — packages/stats/app/src/component/model-compare-detail.tsx:543, packages/stats/app/src/routes/compare/index.tsx:332, packages/stats/app/src/routes/stats-shell.tsx:435
This <circle> 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. — packages/stats/app/src/routes/compare-radar.tsx:111
This <span> carries its own click handler, but it sits inside a <button> that performs a different action. A keyboard user reaches the <button> and activating it runs the <button>'s handler, never this one, so this action has no keyboard path at all. Role and tabindex cannot supply one: HTML forbids a <button> from containing interactive content or any descendant with a tabindex, so the browser will not put this element in the tab order however it is marked up. Move it out of the <button> and make it a sibling <button>, so each action has its own control. — packages/stats/app/src/routes/index.tsx:1173
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.
A plain <span> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <span> a role that supports aria-expanded. — packages/app/src/home/projects/view.tsx:396
What to do
Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×3) — packages/app/src/composer/editor/editor.tsx:228, packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:997, packages/session-ui/src/components/file.tsx:759
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×8) — packages/app/src/composer/editor/editor.tsx:1014, packages/app/src/home/sessions/view.tsx:332, packages/app/src/new-session/project/selector.tsx:346, …
<button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — packages/app/src/providers/connect/dialog.tsx:1403, packages/app/src/settings/workspaces/project-row.tsx:130
<span> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — packages/app/src/shell/titlebar/tab-nav.tsx:318
<rect> moves — its inline style sets `animation: square.corner` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — packages/ui/src/components/spinner.tsx:35
`.search-bar input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — services/www/src/docs/styles/global.css:1144
`[data-component="dialog-v2"] [data-slot="dialog-container"] [data-slot="dialog-content"] [data-slot="dialog-body"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/overlays/dialog/dialog.css:152
`[data-component="dialog-v2"] [data-slot="dialog-container"] [data-slot="dialog-content"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/overlays/dialog/dialog.css:156
`[data-component="tabs-v2"] [data-slot="tabs-v2-trigger"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/tabs/tabs-current.css:53
`[data-component="tabs-v2"] [data-slot="tabs-v2-trigger"]:is(:focus, :focus-visible)` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/tabs/tabs-current.css:63
`[data-component="tabs"] [data-slot="tabs-trigger-wrapper"] [data-slot="tabs-trigger"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/tabs/tabs.css:73
`[data-component="tabs"] [data-slot="tabs-trigger-wrapper"] [data-slot="tabs-trigger"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/tabs/tabs.css:67
`[data-component="tabs"] [data-slot="tabs-trigger-wrapper"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/tabs/tabs.css:101
`[data-component="tabs"] [data-slot="tabs-content"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/tabs/tabs.css:139
`[data-component="menu-v2-content"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/menu/menu.css:30
`[data-component="menu-v2-content"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/menu/menu.css:20
`[data-component="menu-v2-item"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/navigation/menu/menu.css:62
`[data-component="textarea-v2"] [data-slot="textarea-v2-textarea"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/forms/textarea/textarea.css:55
`[data-component="text-input-v2"] [data-slot="text-input-v2-input"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/forms/text-input/text-input.css:95
`[data-component="switch"][data-appearance="standard"]:not([data-readonly]) [data-slot="switch-input"]:focus-visible ~ [data-slot="switch-control"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/forms/switch/switch.css:230
`[data-component="select-v2"] [data-slot="select-v2-value-text"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/forms/select/select.css:130
`[data-component="select-v2"][data-appearance="inline"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/forms/select/select.css:194
`[data-component="select-v2"][data-appearance="inline"]:where([data-expanded]):not([data-disabled], [data-invalid])` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/forms/select/select.css:206
`[data-component="menu-v2-content"][data-slot="select-v2-content"] [data-slot="select-v2-listbox"]:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/forms/select/select.css:245
`[data-component="menu-v2-content"][data-slot="select-v2-content"] [data-slot="select-v2-listbox"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/forms/select/select.css:241
`[data-component="accordion"] [data-slot="accordion-item"] [data-slot="accordion-header"] [data-slot="accordion-trigger"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/data-display/accordion/accordion.css:59
`[data-component="context-menu-content"]:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/components/context-menu.css:16
`[data-component="context-menu-content"] [data-slot="context-menu-item"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/components/context-menu.css:44
`[data-component="context-menu-content"] [data-slot="context-menu-sub-trigger"][data-expanded]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/components/context-menu.css:71
`[data-component="image-preview"] [data-slot="image-preview-container"] [data-slot="image-preview-content"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/components/image-preview.css:35
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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 — your oxlint config does not list the `jsx-a11y` plugin (its a11y rules are off until it does) and there's no axe/pa11y/Lighthouse in tests or CI. Start by enabling that plugin to catch issues at author time. What was searched, so you can tell an absence from a miss: the 390 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 you already use: add `jsx-a11y` to the `plugins` array in your oxlint config (its a11y rules are off until the plugin is listed), then assert with @axe-core/playwright 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 dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
`@opencode/app` is a Application project but references `@opencode/gui-extensions`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one. — packages/app/package.json:67
`@opencode/app` is a Application project but references `@opencode/session-ui`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one. — packages/app/package.json:68
`@opencode/app` is a Application project but references `@opencode/ui`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one. — packages/app/package.json:69
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.
`Interface` declares 34 required operations: `list`, `create`, `fork`, `get`, `environment`, `view`, `remove`, `messages`, `message`, `context`, `diff`, `inbox`, `cancelInbox`, `steerInbox`, `queueInbox`, `log`, `switchAgent`, `switchModel`, `rename`, `archive`, `unarchive`, `setMetadata`, `setPermissions`, `prompt`, `generate`, `command`, `shell`, `skill`, `compact`, `wait`, `background`, `resume`, `interrupt`, `synthetic`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — packages/core/src/session.ts:123
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
C1 · Data Protection0.0 / 10Critical✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
No encryption usage (node:crypto createCipheriv, Web Crypto subtle.encrypt, crypto-js AES, tweetnacl/libsodium secretbox, a column-encryption layer such as typeorm-encrypted, prisma-field-encryption or mongoose-field-encryption, or MongoDB client-side field-level encryption) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore. — packages/core/src/account/sql.ts:7
What to do
Encrypt sensitive data at rest (AES-256-GCM through node:crypto createCipheriv, or a column-encryption layer such as typeorm-encrypted / prisma-field-encryption / MongoDB CSFLE) and manage keys in a vault (AWS KMS, Azure Key Vault, GCP KMS, HashiCorp Vault). Skip if delegated to infra (Postgres TDE, KMS, etc.).
Enforce HTTPS (serve through https.createServer / NestJS httpsOptions, or redirect plain HTTP with express-sslify behind your TLS terminator) so data in transit is always encrypted.
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.
Do you agree with this assessment?
C4 · Data Retention7.5 / 10Strong✓ Tool-verified
Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).
Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.
A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a cron task that deletes rows past their retention — purgeExpired… / deleteOld…).
What to do
Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (TypeORM/Prisma/MikroORM/Sequelize/Mongoose) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
`packages/stats/core/src/domain/catalog-identity.ts` (domain layer) depends on `fetch` (global fetch) — a HTTP module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/catalog-identity.ts:14
`packages/stats/core/src/domain/geo.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/geo.ts:1
`packages/stats/core/src/domain/geo.ts` (domain layer) depends on `../database` (import of `packages/stats/core/src/database.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/geo.ts:4
`packages/stats/core/src/domain/model.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/model.ts:1
`packages/stats/core/src/domain/model.ts` (domain layer) depends on `../database` (import of `packages/stats/core/src/database.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/model.ts:4
`packages/stats/core/src/domain/provider.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/provider.ts:1
`packages/stats/core/src/domain/provider.ts` (domain layer) depends on `../database` (import of `packages/stats/core/src/database.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/provider.ts:4
`packages/stats/core/src/domain/retention.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/retention.ts:1
`packages/stats/core/src/domain/retention.ts` (domain layer) depends on `../database` (import of `packages/stats/core/src/database.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/retention.ts:3
`packages/stats/core/src/domain/stat.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/stats/core/src/domain/stat.ts:1
What to do
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
packages.merman.src.core.geometry.DiagramBounds's [left, top] are judged in packages.merman.src.flowchart.layout, packages.merman.src.flowchart.routing — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
packages.merman.src.core.geometry.DiagramPoint's [x, y] are judged in packages.merman.src.core.geometry, packages.merman.src.core.spatial, packages.merman.src.flowchart.routing, packages.merman.src.state.layout, packages.merman.src.state.search, packages.merman.src.test.layout-audit.harness — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
packages.merman.src.core.spatial.SpatialSpan's [fromX, toX, y] are judged in packages.merman.src.core.spatial, packages.merman.src.core.spatial.SpatialIndex, packages.merman.src.state.routing — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
packages.merman.src.flowchart.types.FlowchartSubgraph's [id, parentId] are judged in packages.merman.src.flowchart.layout, packages.merman.src.flowchart.routing — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
packages.merman.src.state.layout.StateDiagramBoxBounds's [height, width] are judged in packages.merman.src.state.routing, packages.merman.src.test.layout-audit.harness — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
packages.merman.src.state.layout.StateDiagramBoxBounds's [left, top] are judged in packages.merman.src.state.layout, packages.merman.src.state.routing, packages.merman.src.test.layout-audit.harness — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
packages.merman.src.state.types.StateDiagramTransition's [from, to] are judged in packages.merman.src.state.layout, packages.merman.src.state.routing, packages.merman.src.state.visible-model, packages.merman.src.test.layout-audit.harness — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
What to do
Move each repeated judgement onto the type that owns the members it reads, so the rule has one home and cannot drift.
Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
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.
`renderTool` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/cli/src/run/run.ts:226
`renderToolError` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/cli/src/run/run.ts:242
`runProject` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/session-ui/src/components/markdown.worker.ts:65
`highlight` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/session-ui/src/components/markdown.worker.ts:80
`scrollWriteStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/tui/src/mini/tool.ts:725
`scrollEditStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/tui/src/mini/tool.ts:729
`scrollPatchStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/tui/src/mini/tool.ts:733
`scrollTaskStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/tui/src/mini/tool.ts:781
`scrollTodoStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/tui/src/mini/tool.ts:817
`scrollQuestionStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/tui/src/mini/tool.ts:821
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. (×9) — packages/ui/src/theme/resolve.ts:289, packages/ui/src/theme/resolve.ts:290, packages/ui/src/theme/resolve.ts:292, …
A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×9) — packages/ai/test/lib/effect.ts:30, packages/ai/test/lib/effect.ts:39, packages/ai/test/recorded-runner.ts:67, …
`cycle` has an empty body — confirm it's an intentional no-op and not an unfinished method. — packages/app/src/session/story-model.tsx:64
`set` has an empty body — confirm it's an intentional no-op and not an unfinished method. — packages/app/src/session/story-model.tsx:65
`setVisibility` has an empty body — confirm it's an intentional no-op and not an unfinished method. — packages/app/src/session/story-model.tsx:67
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
Maturity · Maturity — Whether the 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 an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 20 of 41 project(s) that lack one — worth up to 1 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
2 ADR-shaped document(s) detected by content — `specs/v2/event-stream-architecture.md`, `specs/v2/provider-policy.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
What to do
Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
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.
salesforce/README.md names `packages/core/src/crm.ts`, but no file or folder `packages/core/src/crm.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — salesforce/README.md:16
services/README.md links to `./updates`, but `services/updates` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — services/README.md:9
packages/ai/README.md names `providers/google-vertex/gemini`, but no file or folder `providers/google-vertex/gemini` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/ai/README.md:1331
packages/http-recorder/README.md installs `@effect/vitest` (`bun add -d @opencode/http-recorder @effect/vitest@4.0.0-beta.107 vitest@^4`), but no package.json declares it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/http-recorder/README.md:13
packages/http-recorder/README.md installs `vitest` (`bun add -d @opencode/http-recorder @effect/vitest@4.0.0-beta.107 vitest@^4`), but no package.json declares it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/http-recorder/README.md:13
packages/codemode/test/test262/README.md runs `bun run script/sync-test262.ts ~/development/test262`, but `script/sync-test262.ts` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/codemode/test/test262/README.md:8
packages/codemode/test/test262/README.md runs `bun run script/test262-report.ts [--write] [dir]`, but `script/test262-report.ts` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/codemode/test/test262/README.md:38
packages/web/src/content/docs/agents.mdx documents the environment variable `OPENCODE_EXPERIMENTAL_PLAN_MODE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/agents.mdx:69
packages/web/src/content/docs/agents.mdx names `.opencode/agents/`, but no file or folder `.opencode/agents` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/agents.mdx:206
packages/web/src/content/docs/agents.mdx links to `/docs/config#models`, but `docs/config` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/agents.mdx:369
packages/web/src/content/docs/agents.mdx links to `/docs/permissions`, but `docs/permissions` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/agents.mdx:569
packages/web/src/content/docs/cli.mdx links to `/docs/github`, but `docs/github` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:213
packages/web/src/content/docs/cli.mdx links to `/docs/config/`, but `docs/config` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:326
packages/web/src/content/docs/cli.mdx links to `/docs/server`, but `docs/server` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:399
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_TUI_CONFIG`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:755
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_PRUNE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:759
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_TERMINAL_TITLE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:760
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_PERMISSION`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:761
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_DEFAULT_PLUGINS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:762
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_LSP_DOWNLOAD`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:763
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_ENABLE_EXPERIMENTAL_MODELS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:764
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_AUTOCOMPACT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:765
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_CLAUDE_CODE_PROMPT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:767
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_MOUSE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:770
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_FAKE_VCS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:771
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_ENABLE_EXA`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:773
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_ENABLE_PARALLEL`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:774
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_EXTERNAL_SKILLS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:782
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_ENABLE_QUESTION_TOOL`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:785
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_AUTO_HEAP_SNAPSHOT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:790
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_EXPERIMENTAL`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:800
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:802
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:803
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:804
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_EXPERIMENTAL_OXFMT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:806
packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_EXPERIMENTAL_LSP_TOOL`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/cli.mdx:807
packages/web/src/content/docs/commands.mdx links to `/docs/tui#commands`, but `docs/tui` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/commands.mdx:12
packages/web/src/content/docs/commands.mdx links to `/docs/config`, but `docs/config` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/commands.mdx:51
packages/web/src/content/docs/commands.mdx names `.opencode/commands/`, but no file or folder `.opencode/commands` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/commands.mdx:83
packages/web/src/content/docs/commands.mdx links to `/docs/agents`, but `docs/agents` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/src/content/docs/commands.mdx:259
What to do
Reconcile the README with reality: salesforce/README.md names `packages/core/src/crm.ts`, but no file or folder `packages/core/src/crm.ts` exists; services/README.md links to `./updates`, but `services/updates` does not exist; packages/ai/README.md names `providers/google-vertex/gemini`, but no file or folder `providers/google-vertex/gemini` exists; packages/http-recorder/README.md installs `@effect/vitest` (`bun add -d @opencode/http-recorder @effect/vitest@4.0.0-beta.107 vitest@^4`), but no package.json declares it; packages/http-recorder/README.md installs `vitest` (`bun add -d @opencode/http-recorder @effect/vitest@4.0.0-beta.107 vitest@^4`), but no package.json declares it.
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.
Do you agree with this assessment?
P2 · Observability7.8 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 3/11 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `packages/console/app`, `packages/core`, `packages/desktop`, `packages/function`, `packages/gui-extensions` and 3 more.
`packages/tui/src/audio.ts` reports through `console.*` at line 12 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/audio.ts:12
`packages/tui/src/audio.ts` reports through `console.*` at line 17 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/audio.ts:17
`packages/tui/src/audio.ts` reports through `console.*` at line 31 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/audio.ts:31
`packages/tui/src/attention.ts` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/attention.ts:114
`packages/tui/src/attention.ts` reports through `console.*` at line 123 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/attention.ts:123
`packages/tui/src/attention.ts` reports through `console.*` at line 149 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/attention.ts:149
`packages/tui/src/attention.ts` reports through `console.*` at line 174 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/attention.ts:174
`packages/tui/src/app.tsx` reports through `console.*` at line 548 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/app.tsx:548
`packages/tui/src/component/session-frame.tsx` reports through `console.*` at line 54 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/component/session-frame.tsx:54
`packages/tui/src/context/session-terminals.tsx` reports through `console.*` at line 61 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/context/session-terminals.tsx:61
`packages/tui/src/context/session-terminals.tsx` reports through `console.*` at line 77 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/context/session-terminals.tsx:77
`packages/tui/src/context/session-terminals.tsx` reports through `console.*` at line 83 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/context/session-terminals.tsx:83
`packages/tui/src/context/session-tabs.tsx` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/context/session-tabs.tsx:114
`packages/tui/src/feature-plugins/sidebar/todo.tsx` reports through `console.*` at line 29 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/feature-plugins/sidebar/todo.tsx:29
`packages/tui/src/feature-plugins/sidebar/mcp.tsx` reports through `console.*` at line 33 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/feature-plugins/sidebar/mcp.tsx:33
`packages/tui/src/feature-plugins/sidebar/footer.tsx` reports through `console.*` at line 51 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/feature-plugins/sidebar/footer.tsx:51
`packages/tui/src/prompt/directory-recents.ts` reports through `console.*` at line 28 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/prompt/directory-recents.ts:28
`packages/tui/src/prompt/directory-recents.ts` reports through `console.*` at line 33 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/prompt/directory-recents.ts:33
`packages/tui/src/util/watch.ts` reports through `console.*` at line 17 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/util/watch.ts:17
`packages/tui/src/util/watch.ts` reports through `console.*` at line 21 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/tui/src/util/watch.ts:21
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 91659 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.
What to do
Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where Watchdog can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
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.
`existsSync` in `_tryGetApplicationCredentialsFromWellKnownFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/ai/src/providers/google-vertex-shared.ts:27
`spawnSync` in `desktopBenchmarkContext` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — packages/app/e2e/performance/devex/desktop-startup.ts:89, packages/app/e2e/performance/devex/desktop-startup.ts:92, packages/app/e2e/performance/devex/desktop-startup.ts:95
`existsSync` in `restrictToOwner` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/database/database.ts:89
`closeSync` in `restrictToOwner` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/database/database.ts:89
`openSync` in `restrictToOwner` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/core/src/database/database.ts:89
`rmSync` in `launch` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:354
`writeFileSync` in `join` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:450
`existsSync` in `callback to waitFor` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:476
`statSync` in `callback to waitFor` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:476
`writeFileSync` in `metric` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:533
`writeFileSync` in `windowRaiser` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:751
`existsSync` in `identity` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:896
`readFileSync` in `identity` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:896
`statSync` in `identity` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:896
`existsSync` in `warmService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:906
`readFileSync` in `warmService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:907
`existsSync` in `stopService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:923
`readFileSync` in `stopService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:924
`rmSync` in `stopService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/desktop/scripts/bench-startup.ts:932
`gunzipSync` in `json` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/gui-extensions/src/browser/profiling.ts:53
`gzipSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/gui-extensions/src/browser/profiling.ts:167
`gzipSync` in `heap` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/gui-extensions/src/browser/profiling.ts:282
`readFileSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/plugin/src/source.bun.ts:32
`existsSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/tui/src/editor.ts:24
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 Safety10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
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.
188 duplicated blocks under packages/ have copies in at least two of the sibling directories ai, app, cli, client, codemode, console (+20 more sibling(s) not listed) — 94 of them are reported below, and 94 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 188 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 188 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 188 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/app/happydom.ts:1
48 duplicated blocks under packages/tui/src/ have copies in at least two of the sibling directories component, config, context, feature-plugins, mini, plugin (+5 more sibling(s) not listed) — 22 of them are reported below, and 26 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 48 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 48 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 48 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/tui/src/component/session-tabs.tsx:435
39 duplicated blocks under packages/app/src/ have copies in at least two of the sibling directories composer, home, new-session, providers, runtime, servers (+4 more sibling(s) not listed) — 23 of them are reported below, and 16 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 39 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 39 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 39 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/app/src/home/sessions/command-palette.tsx:29
18 duplicated blocks under packages/core/src/ have copies in at least two of the sibling directories config, filesystem, instructions, mcp, permission, plugin (+6 more sibling(s) not listed) — 12 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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/core/src/reference/instructions.ts:31
18 duplicated blocks under packages/plugin/src/ have copies in at least two of the sibling directories effect, promise, tui — 9 of them are reported below, and 9 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/plugin/src/effect/session.ts:2
16 of the duplicated blocks reported below have copies in at least two of the sibling directories component, lib, routes under packages/stats/app/src/. That concentration is one structural fact, not 16 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 16 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/stats/app/src/component/model-compare-detail.tsx:525
15 duplicated blocks under packages/merman/src/ have copies in at least two of the sibling directories core, flowchart, gantt, gitgraph, sequence, state (+1 more sibling(s) not listed) — 9 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 15 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 15 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 15 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/merman/src/core/drawing.ts:127
13 duplicated blocks under packages/gui-extensions/src/ have copies in at least two of the sibling directories browser, btw, context, debug, details, file (+7 more sibling(s) not listed) — 9 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 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/gui-extensions/src/browser/index.ts:21
13 duplicated blocks under packages/session-ui/src/ have copies in at least two of the sibling directories components, message, pierre, timeline, tools, v2 — 6 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/session-ui/src/components/line-comment-annotations.tsx:407
8 duplicated blocks under packages/app/src/settings/ have copies in at least two of the sibling directories appearance, experimental, general, notifications, providers, workspaces — 6 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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. — packages/app/src/settings/appearance/appearance.tsx:35
8 duplicated blocks under packages/cli/src/commands/handlers/ have copies in at least two of the sibling directories auth, debug, mcp, plugin, service, session — 7 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 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. — packages/cli/src/commands/handlers/auth/export.ts:21
7 duplicated blocks under packages/console/app/src/routes/ have copies in at least two of the sibling directories brand, changelog, enterprise, go, s, t (+1 more sibling(s) not listed) — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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/console/app/src/routes/go/index.tsx:175
7 duplicated blocks under packages/ui/src/ have copies in at least two of the sibling directories actions, components, data-display, feedback, forms, navigation — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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/ui/src/components/context-menu.tsx:107
5 duplicated blocks under packages/stats/app/src/routes/ have copies in at least two of the sibling directories [lab], compare — 2 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/stats/app/src/routes/[lab]/[model].tsx:1449
packages/stats/core/src/domain/geo.ts:56 · packages/stats/core/src/domain/model.ts:47 — the two spans are one implementation copied and then locally edited — 1045 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/stats/core/src/domain/geo.ts:56
packages/plugin/src/effect/session.ts:2 · packages/plugin/src/promise/session.ts:2 — these 2 files are line-for-line copies of one another — 101 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — packages/plugin/src/effect/session.ts:2
packages/console/app/src/component/go-plan-chart.tsx:16 · packages/console/app/src/component/limits-graph.tsx:9 — the two spans are one implementation copied and then locally edited — 702 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/console/app/src/component/go-plan-chart.tsx:16
packages/core/src/database/drizzle/sqlite-core/effect/delete.ts:50 · packages/core/src/database/drizzle/sqlite-core/effect/update.ts:78 — the two spans are one implementation copied and then locally edited — 510 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/core/src/database/drizzle/sqlite-core/effect/delete.ts:50
packages/codemode/src/stdlib/headers.ts:40 · packages/codemode/src/stdlib/url.ts:186 — the two spans are one implementation copied and then locally edited — 702 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/codemode/src/stdlib/headers.ts:40
packages/stats/app/src/component/model-compare-detail.tsx:525 · packages/stats/app/src/routes/compare/index.tsx:314 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/stats/app/src/component/model-compare-detail.tsx:525
packages/ai/src/image.ts:20 · packages/ai/src/video.ts:20 — the two spans are one implementation copied and then locally edited — 634 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/ai/src/image.ts:20
packages/core/src/tool/plugin/glob.ts:26 · packages/core/src/tool/plugin/grep.ts:36 — the two spans are one implementation copied and then locally edited — 486 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/core/src/tool/plugin/glob.ts:26
packages/core/src/plugin/vcs/git.ts:27 · packages/core/src/plugin/vcs/hg.ts:25 — the two spans are one implementation copied and then locally edited — 541 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/core/src/plugin/vcs/git.ts:27
packages/schema/src/v1/session.ts:103 · packages/schema/src/v1/session.ts:398 — the two spans are one implementation copied and then locally edited — 517 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/schema/src/v1/session.ts:103
packages/stats/core/src/domain/geo.ts:89 · packages/stats/core/src/domain/provider.ts:61 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/stats/core/src/domain/geo.ts:89
packages/gui-extensions/src/file/list.tsx:70 · packages/gui-extensions/src/file/tree-v2.tsx:162 — the two spans are one implementation copied and then locally edited — 436 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/gui-extensions/src/file/list.tsx:70
packages/app/happydom.ts:1 · packages/gui-extensions/happydom.ts:1 — these 2 files are line-for-line copies of one another — 69 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — packages/app/happydom.ts:1
packages/core/src/database/sqlite.bun.ts:16 · packages/core/src/database/sqlite.node.ts:18 — the two spans are one implementation copied and then locally edited — 591 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/core/src/database/sqlite.bun.ts:16
packages/gui-extensions/src/browser/index.ts:21 · packages/gui-extensions/src/context/index.ts:6 · packages/gui-extensions/src/debug/index.ts:7 · packages/gui-extensions/src/details/index.ts:18 · +6 more site(s) not listed — the 10 copies are spread across 10 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/gui-extensions/src/browser/index.ts:21
packages/app/src/settings/appearance/appearance.tsx:35 · packages/app/src/settings/notifications/notifications.tsx:31 — the two spans are one implementation copied and then locally edited — 386 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/app/src/settings/appearance/appearance.tsx:35
packages/session-ui/src/components/line-comment-annotations.tsx:407 · packages/session-ui/src/v2/components/line-comment-annotations-v2.tsx:125 — 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. — packages/session-ui/src/components/line-comment-annotations.tsx:407
packages/app/src/settings/shell.tsx:345 · packages/app/src/settings/shell.tsx:465 — the two spans are one implementation copied and then locally edited — 391 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/settings/shell.tsx:345
packages/core/src/reference/instructions.ts:31 · packages/core/src/skill/instructions.ts:35 — the two spans are one implementation copied and then locally edited — 455 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/core/src/reference/instructions.ts:31
packages/ai/src/providers/moonshot.ts:35 · packages/ai/src/providers/zai-coding-plan.ts:17 — the two spans are one implementation copied and then locally edited — 423 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/ai/src/providers/moonshot.ts:35
packages/ai/src/providers/google-vertex-chat.ts:34 · packages/ai/src/providers/google-vertex-responses.ts:35 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ai/src/providers/google-vertex-chat.ts:34
packages/ai/src/providers/google-vertex-messages.ts:64 · packages/ai/src/providers/google-vertex-mistral.ts:50 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ai/src/providers/google-vertex-messages.ts:64
packages/app/src/providers/connect/dialog.tsx:994 · packages/app/src/providers/connect/dialog.tsx:1073 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/app/src/providers/connect/dialog.tsx:994
packages/client/src/effect/service.ts:40 · packages/client/src/promise/service.ts:22 — the two spans are one implementation copied and then locally edited — 373 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/client/src/effect/service.ts:40
packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:316 · packages/core/src/github-copilot/responses/openai-responses-language-model.ts:679 — the two spans are one implementation copied and then locally edited — 266 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/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:316
packages/console/app/src/routes/go/index.tsx:175 · packages/console/app/src/routes/zen/index.tsx:153 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/console/app/src/routes/go/index.tsx:175
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.
packages/ai/script/publish.ts:2 imports @opencode/script, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — packages/ai/script/publish.ts:2
packages/app/e2e/performance/markdown/lifetime.bench.ts:6 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/performance/markdown-lifetime/answer) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/e2e/performance/markdown/lifetime.bench.ts:6
packages/app/e2e/performance/patch-groups/fixture.tsx:7 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/src/storybook/current-session-story) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/e2e/performance/patch-groups/fixture.tsx:7
packages/app/e2e/performance/patch-groups/fixture.tsx:8 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/src/storybook/current-session-fixtures) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/e2e/performance/patch-groups/fixture.tsx:8
packages/app/e2e/performance/patch-groups/fixture.tsx:9 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/src/tools/tool-renderer) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/e2e/performance/patch-groups/fixture.tsx:9
packages/app/e2e/performance/patch-groups/fixture.tsx:10 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/src/components/apply-patch-file) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/e2e/performance/patch-groups/fixture.tsx:10
packages/app/e2e/performance/terminals/probe.ts:2 reaches past another workspace package's public entry into its internals with a relative path (../../../../gui-extensions/src/terminal/serialize) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/e2e/performance/terminals/probe.ts:2
packages/app/src/shell/titlebar/titlebar.tsx:37 reaches into another package with a relative path (../../../../desktop/icons/dev/64x64.png) — import the package by name instead. — packages/app/src/shell/titlebar/titlebar.tsx:37
packages/app/src/shell/titlebar/titlebar.tsx:38 reaches into another package with a relative path (../../../../desktop/icons/beta/64x64.png) — import the package by name instead. — packages/app/src/shell/titlebar/titlebar.tsx:38
packages/app/test-browser/extension-migrations.test.ts:9 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/context/index) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/test-browser/extension-migrations.test.ts:9
packages/app/test-browser/extension-migrations.test.ts:10 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/context/renderer) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/test-browser/extension-migrations.test.ts:10
packages/app/test-browser/extension-migrations.test.ts:11 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/details/index) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/test-browser/extension-migrations.test.ts:11
packages/app/test-browser/extension-migrations.test.ts:12 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/review/index) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/test-browser/extension-migrations.test.ts:12
packages/app/test-browser/extension-migrations.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/updater/index) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/app/test-browser/extension-migrations.test.ts:13
packages/cli/dev/entry.ts:13 reaches into another package with a relative path (../../tui/src/index) — import the package by name instead. — packages/cli/dev/entry.ts:13
packages/cli/dev/error-overlay.tsx:5 reaches into another package with a relative path (../../tui/src/context/theme) — import the package by name instead. — packages/cli/dev/error-overlay.tsx:5
packages/cli/dev/error-overlay.tsx:6 reaches into another package with a relative path (../../tui/src/ui/dialog) — import the package by name instead. — packages/cli/dev/error-overlay.tsx:6
packages/cli/dev/error-overlay.tsx:7 reaches into another package with a relative path (../../tui/src/context/keymap) — import the package by name instead. — packages/cli/dev/error-overlay.tsx:7
packages/cli/dev/host.d.ts:4 reaches into another package with a relative path (../../tui/src/context/route) — import the package by name instead. — packages/cli/dev/host.d.ts:4
packages/cli/dev/refresh.ts:3 imports solid-refresh/dist/solid-refresh.mjs, 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. — packages/cli/dev/refresh.ts:3
packages/cli/dev/refresh.ts:13 imports solid-refresh/dist/solid-refresh.mjs, 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. — packages/cli/dev/refresh.ts:13
packages/cli/dev/route.tsx:4 reaches into another package with a relative path (../../tui/src/context/route) — import the package by name instead. — packages/cli/dev/route.tsx:4
packages/cli/dev/route.tsx:6 reaches into another package with a relative path (../../tui/src/context/route) — import the package by name instead. — packages/cli/dev/route.tsx:6
packages/cli/dev/tui.ts:56 imports solid-js/dist/dev.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. — packages/cli/dev/tui.ts:56
packages/cli/script/build-node.ts:17 reaches into another package with a relative path (../../../script/native-arch) — import the package by name instead. — packages/cli/script/build-node.ts:17
packages/cli/script/build.ts:15 reaches into another package with a relative path (../../../script/native-arch) — import the package by name instead. — packages/cli/script/build.ts:15
packages/cli/script/publish-aur.ts:7 reaches into another package with a relative path (../../../script/update-artifact) — import the package by name instead. — packages/cli/script/publish-aur.ts:7
packages/cli/script/publish-homebrew.ts:7 reaches into another package with a relative path (../../../script/update-artifact) — import the package by name instead. — packages/cli/script/publish-homebrew.ts:7
packages/cli/script/publish.ts:9 reaches into another package with a relative path (../../../script/update-artifact) — import the package by name instead. — packages/cli/script/publish.ts:9
packages/cli/test/vite-route.test.tsx:6 reaches past another workspace package's public entry into its internals with a relative path (../../tui/src/context/runtime) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/vite-route.test.tsx:6
packages/client/script/publish.ts:3 imports @opencode/script, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — packages/client/script/publish.ts:3
packages/codemode/script/publish.ts:3 imports @opencode/script, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — packages/codemode/script/publish.ts:3
packages/codemode/script/test262-report.ts:6 imports packages/codemode/test/test262/run.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/codemode/script/test262-report.ts:6
packages/core/script/benchmark-location-memory.ts:32 imports packages/core/test/fixture/location.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/core/script/benchmark-location-memory.ts:32
packages/core/script/benchmark-location-memory.ts:33 imports packages/core/test/plugin/host.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — packages/core/script/benchmark-location-memory.ts:33
packages/core/script/publish.ts:3 imports @opencode/script, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — packages/core/script/publish.ts:3
packages/desktop/scripts/prepare.ts:2 imports @opencode/script, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — packages/desktop/scripts/prepare.ts:2
packages/desktop/scripts/publish.ts:3 imports @opencode/script, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — packages/desktop/scripts/publish.ts:3
packages/desktop/scripts/publish.ts:4 reaches into another package with a relative path (../../../script/update-artifact) — import the package by name instead. — packages/desktop/scripts/publish.ts:4
packages/desktop/src/main/windows/defaults.ts:4 reaches into another package with a relative path (../../../../ui/src/theme/themes/oc-2.json) — import the package by name instead. — packages/desktop/src/main/windows/defaults.ts:4
What to do
Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (46 rows); declare the workspace packages these files import in the importing package's own package.json dependencies (16 rows) — those imports are already bare package specifiers, so the import statements do not change, only the manifest; move the shared test helper into a source directory production code may depend on (6 rows).
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.
scanPowerShellList has cyclomatic complexity 358 and cognitive complexity 475; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/shell/scan.ts:1740
resolveThemeVariant has cyclomatic complexity 180 and cognitive complexity 209; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/theme/resolve.ts:4
apply has cyclomatic complexity 128 and cognitive complexity 190; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/tui/src/mini/stream-v2.transport.ts:1025
handleEvent has cyclomatic complexity 120 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/client/src/solid/data.ts:632
consume has cyclomatic complexity 102 and cognitive complexity 173; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/cli/src/run/noninteractive.ts:209
scanBash has cyclomatic complexity 96 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/shell/scan.ts:430
execute has cyclomatic complexity 94 and cognitive complexity 99; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/gui-extensions/src/browser/chromium.ts:687
scanBashKeyword has cyclomatic complexity 86 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/shell/scan.ts:858
(anonymous) has cyclomatic complexity 75 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/session/runner/step.ts:142
transform has cyclomatic complexity 73 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/github-copilot/responses/openai-responses-language-model.ts:763
onclosetag has cyclomatic complexity 72 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/tool/html-markdown.ts:471
onopentag has cyclomatic complexity 72 and cognitive complexity 99; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/tool/html-markdown.ts:264
(anonymous) has cyclomatic complexity 72 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ai/src/protocols/openai-chat.ts:1016
scanBashUnit has cyclomatic complexity 71 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/shell/scan.ts:1030
scanBashCommandStart has cyclomatic complexity 69 and cognitive complexity 89; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/core/src/shell/scan.ts:743
parseCommand has cyclomatic complexity 67 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/latex/src/parser.ts:201
reduce has cyclomatic complexity 65 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/tui/src/mini/stream-v2.subagent.ts:658
analyzeVisualObservations has cyclomatic complexity 62 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/app/e2e/utils/visual-stability/analyzer.ts:4
submitInner has cyclomatic complexity 60 and cognitive complexity 74; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/tui/src/component/prompt/index.tsx:1114
diagramLineGlyph has cyclomatic complexity 58 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/merman/src/core/drawing.ts:116
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files6.8 / 10Adequate✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
packages/client/src/promise/generated/types.ts has 5405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/client/src/promise/generated/types.ts:1
packages/tui/src/routes/session/index.tsx has 3691 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/routes/session/index.tsx:1
packages/client/src/promise/generated/client.ts has 2385 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/client/src/promise/generated/client.ts:1
packages/core/src/shell/scan.ts has 2340 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/shell/scan.ts:1
packages/codemode/src/interpreter/interpreter.ts has 2173 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/codemode/src/interpreter/interpreter.ts:1
packages/session-ui/src/tools/tool-renderer.tsx has 2127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/session-ui/src/tools/tool-renderer.tsx:1
packages/client/src/solid/data.ts has 1963 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/client/src/solid/data.ts:1
packages/tui/src/component/prompt/index.tsx has 1925 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/component/prompt/index.tsx:1
packages/httpapi-codegen/src/index.ts has 1855 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/httpapi-codegen/src/index.ts:1
packages/tui/src/mini/stream-v2.transport.ts has 1833 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/mini/stream-v2.transport.ts:1
packages/stats/app/src/routes/index.tsx has 1781 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/stats/app/src/routes/index.tsx:1
packages/tui/src/component/session-tabs.tsx has 1763 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/component/session-tabs.tsx:1
packages/ai/src/protocols/anthropic-messages.ts has 1554 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ai/src/protocols/anthropic-messages.ts:1
packages/gui-extensions/src/browser/chromium.ts has 1490 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/gui-extensions/src/browser/chromium.ts:1
packages/core/src/github-copilot/responses/openai-responses-language-model.ts has 1489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/github-copilot/responses/openai-responses-language-model.ts:1
packages/app/src/providers/connect/dialog.tsx has 1439 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/providers/connect/dialog.tsx:1
packages/merman/src/state/routing.ts has 1436 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/merman/src/state/routing.ts:1
packages/tui/src/app.tsx has 1432 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/app.tsx:1
packages/stats/app/src/routes/[lab]/[model].tsx has 1411 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/stats/app/src/routes/[lab]/[model].tsx:1
packages/tui/src/mini/footer.prompt.tsx has 1411 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/mini/footer.prompt.tsx:1
packages/ai/src/protocols/open-responses.ts has 1402 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ai/src/protocols/open-responses.ts:1
REDACTED has 1347 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
packages/console/app/src/routes/legal/privacy-policy/index.tsx has 1344 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/console/app/src/routes/legal/privacy-policy/index.tsx:1
packages/merman/src/flowchart/routing.ts has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/merman/src/flowchart/routing.ts:1
packages/tui/src/feature-plugins/system/diff-viewer.tsx has 1335 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/feature-plugins/system/diff-viewer.tsx:1
packages/tui/src/component/dialog-integration.tsx has 1231 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/component/dialog-integration.tsx:1
packages/ai/src/protocols/openai-chat.ts has 1215 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ai/src/protocols/openai-chat.ts:1
packages/tui/src/mini/tool.ts has 1215 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/mini/tool.ts:1
packages/core/src/database/v1-migration.bun.ts has 1189 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/database/v1-migration.bun.ts:1
packages/session-ui/src/storybook/current-session-fixtures.ts has 1173 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/session-ui/src/storybook/current-session-fixtures.ts:1
packages/gui-extensions/src/browser/panel.tsx has 1147 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/gui-extensions/src/browser/panel.tsx:1
packages/tui/src/mini/footer.command.tsx has 1141 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/mini/footer.command.tsx:1
packages/tui/src/routes/session/form.tsx has 1130 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/routes/session/form.tsx:1
packages/stats/app/src/component/model-compare-detail.tsx has 1127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/stats/app/src/component/model-compare-detail.tsx:1
packages/tui/src/mini/stream-v2.subagent.ts has 1100 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/mini/stream-v2.subagent.ts:1
packages/gui-extensions/src/sdk/host-apis.ts has 1099 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/gui-extensions/src/sdk/host-apis.ts:1
packages/core/src/session/compaction.ts has 1087 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/core/src/session/compaction.ts:1
packages/stats/core/src/domain/home.ts has 1077 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/stats/core/src/domain/home.ts:1
packages/app/src/composer/editor/editor.tsx has 1068 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/app/src/composer/editor/editor.tsx:1
packages/merman/src/flowchart/layout.ts has 1067 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/merman/src/flowchart/layout.ts: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 Coverage8.6 / 10Strong✓ 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.
packages/app/e2e/performance/composer-history/vite.config.ts:7 imports '../../../public', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/app/e2e/performance/composer-history/vite.config.ts:7
packages/app/e2e/performance/patch-groups/vite.config.ts:10 imports '../../../public', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/app/e2e/performance/patch-groups/vite.config.ts:10
packages/desktop/scripts/picker.test.ts:25 imports './fixtures/picker', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/desktop/scripts/picker.test.ts:25
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. (×37) — packages/stats/app/src/routes/index.tsx:1, packages/console/app/src/routes/legal/privacy-policy/index.tsx:1, packages/stats/app/src/routes/[lab]/[model].tsx: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 package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
This repository declares test tooling, and the ✓ above records that declaration — but packages/app/e2e/performance/composer-history/vite.config.ts and 2 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — packages/app/e2e/performance/composer-history/vite.config.ts:7
Do you agree with this assessment?
R7 · Dead Code7.9 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 1631 application, 223 tooling and 1548 test entry point(s) detected in this repo. Gate removals on `bun run typecheck` — an undetected custom entry would make these reachable.
no import path from any entry point (1631 application, 223 tooling, 1548 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 (×25) — packages/stats/app/src/routes/index.tsx, packages/stats/app/src/routes/[lab]/[model].tsx, packages/stats/app/src/routes/[lab]/index.tsx, …
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/stats/app/src/routes/compare/[firstFamily]/[secondFamily].tsx, packages/stats/app/src/routes/compare/[firstLab]/[firstModel]/[secondLab]/[secondModel].tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/stats/app/src/component/model-compare-detail.tsx
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/web/src/components/Share.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/web/src/components/share/part.tsx
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 5 in-repo import(s) from 5 other file(s) do name it (packages/stats/app/src/component/model-compare-detail.tsx, packages/stats/app/src/routes/[lab]/[model].tsx, packages/stats/app/src/routes/[lab]/index.tsx and 2 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/stats/app/src/routes/stats-shell.tsx
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 3 in-repo import(s) from 3 other file(s) do name it (packages/web/src/components/Share.tsx, packages/web/src/components/share/copy-button.tsx, packages/web/src/components/share/part.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/web/src/components/icons/index.tsx
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/web/src/components/share/part.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 (×3) — packages/web/src/components/share/content-diff.tsx, packages/web/src/components/share/content-markdown.tsx, packages/web/src/components/share/content-bash.tsx
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/cli/dev/vite.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 — packages/cli/dev/tui.ts
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 4 in-repo import(s) from 4 other file(s) do name it (packages/console/app/src/routes/data/[...path].ts, packages/console/app/src/routes/data/index.ts, packages/console/app/src/routes/stats/[...path].ts and 1 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/console/app/src/lib/stats-proxy.ts
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 6 in-repo import(s) from 6 other file(s) do name it (packages/stats/app/src/component/model-compare-detail.tsx, packages/stats/app/src/routes/[lab]/[model].tsx, packages/stats/app/src/routes/[lab]/index.tsx and 3 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/stats/app/src/routes/compare-cards.tsx
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/web/src/middleware.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 — packages/web/src/i18n/locales.ts
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 7 in-repo import(s) from 7 other file(s) do name it (packages/web/src/components/Share.tsx, packages/web/src/components/share/content-bash.tsx, packages/web/src/components/share/content-error.tsx and 4 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/web/src/components/share/common.tsx
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/web/src/components/Share.tsx, packages/web/src/components/share/part.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/web/src/components/icons/custom.tsx
no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/stats/app/src/routes/[lab]/[model].tsx, packages/stats/app/src/routes/[lab]/index.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/stats/app/src/routes/breadcrumb-select.tsx
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 only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json. (×2) — REDACTED:8, REDACTED:61
Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×6) — packages/app/src/custom-elements.d.ts:1, packages/storybook/.storybook/mocks/gui-extensions/ssh.tsx:5, packages/storybook/.storybook/mocks/app/hooks/use-providers.ts:2, …
Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
Every import is type-only — move it to devDependencies. — packages/console/resource/resource.node.ts:1
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.
packages/app/src/runtime/server/client.tsx → packages/app/src/runtime/server/current.tsx → packages/app/src/runtime/server/runtime.tsx → packages/app/src/runtime/server/client.tsx (one verified cycle inside a mutually-dependent group of 5 files) — packages/app/src/runtime/server/client.tsx:11
packages/core/src/aisdk-native.ts → packages/core/src/aisdk-native.ts (one verified cycle inside a mutually-dependent group of 2 files) — packages/core/src/aisdk-native.ts:1
packages/core/src/environment/environment.ts → packages/core/src/environment/environment.ts (one verified cycle inside a mutually-dependent group of 2 files) — packages/core/src/environment/environment.ts:43
packages/core/src/image.ts → packages/core/src/image.ts (one verified cycle inside a mutually-dependent group of 2 files) — packages/core/src/image.ts:1
packages/core/src/plugin.ts → packages/core/src/plugin.ts (one verified cycle inside a mutually-dependent group of 3 files) — packages/core/src/plugin.ts:1
What to do
Break each cycle by extracting the shared piece into a module both sides can import.
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. 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. (×4) — packages/core/script/snapshot-parity.ts:626, packages/core/script/snapshot-parity.ts:694, packages/core/src/mcp/index.ts:208, …
`password === original.http.password` checks a password against the stored one in plaintext, so the store holds the password itself and whoever reads it holds every account. — packages/app/src/servers/connect/dialog.tsx:386
`found.password === info.password` checks a password against the stored one in plaintext, so the store holds the password itself and whoever reads it holds every account. — packages/cli/src/services/service-registration.ts:38
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 4 sites, not one: `packages/core/script/snapshot-parity.ts:626` (createHash("sha1")), `packages/core/script/snapshot-parity.ts:694` (createHash("sha1")), `packages/core/src/mcp/index.ts:208` (createHash("sha1")), `packages/util/src/hash.ts:5` (createHash("sha1")). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Store passwords with a salted, deliberately slow KDF — scrypt or PBKDF2 from node:crypto, or bcrypt/Argon2 — and compare with a constant-time check. A fast digest of a password, however it is encoded, is reversed by precomputed tables or GPU guessing. Start in `packages/app/src/servers/connect/dialog.tsx:386`.
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 document1.3 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`getTextLength` is exported and takes `node: Node` from its caller, and it calls itself at line 14 (`getTextLength`) with a piece of `node` — and nowhere in `getTextLength` 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 `getTextLength` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/app/src/composer/editor/dom.ts:14
`errorStatus` is exported, takes a document from its caller (line 14) and hands it to `visit`, which calls itself at line 28 (`visit`) with a piece of `value` — and nowhere in `visit` 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 `visit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/app/src/shell/errors/description.ts:28
`redactConfig` is exported and takes `value: unknown` from its caller, and it calls itself at line 5 (`redactConfig`) with a piece of `value` (and at line 17) — and nowhere in `redactConfig` 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 `redactConfig` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/cli/src/commands/handlers/debug/redact.ts:5
`fromJson` is exported and takes `value: Json | undefined` from its caller, and it calls itself at line 113 (`fromJson`) with a piece of `value` (and at line 116) — and nowhere in `fromJson` 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 `fromJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/codemode/src/data.ts:113
`normalizeError` is exported and takes `error: unknown` from its caller, and it calls itself at line 51 (`normalizeError`) with a piece of `error` — and nowhere in `normalizeError` 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 `normalizeError` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/codemode/src/interpreter/errors.ts:51
`orderSelectedFields` is exported and takes `fields: Record<string, unknown>` from its caller, and it calls itself at line 49 (`orderSelectedFields`) with a piece of `fields` — and nowhere in `orderSelectedFields` 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 `orderSelectedFields` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/core/src/database/drizzle/internal/drizzle-utils.ts:49
`hash` is exported, takes a document from its caller (line 194) and hands it to `canonical`, which calls itself at line 244 (`canonical`) with a piece of `value` (and at line 248) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/core/src/instructions/index.ts:244
`toSessionError` is exported and takes `cause: unknown` from its caller, and it calls itself at line 74 (`toSessionError`) with a piece of `cause` — and nowhere in `toSessionError` 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 `toSessionError` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/core/src/session/to-session-error.ts:74
`omitUndefined` is exported and takes `value: unknown` from its caller, and it calls itself at line 15 (`omitUndefined`) with a piece of `value` (and at line 20) — and nowhere in `omitUndefined` 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 `omitUndefined` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/desktop/src/shared/ipc-transport.ts:15
`secretFindings` is exported, takes a document from its caller (line 36) and hands it to `stringEntries`, which calls itself at line 27 (`stringEntries`) with a piece of `value` (and at line 29) — and nowhere in `stringEntries` 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 `stringEntries` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/http-recorder/src/redaction/secrets.ts:27
`canonicalizeJson` is exported and takes `value: unknown` from its caller, and it calls itself at line 10 (`canonicalizeJson`) with a piece of `value` (and at line 15) — and nowhere in `canonicalizeJson` 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 `canonicalizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/http-recorder/src/replay/comparison.ts:10
`stabilizeOpenApi` is exported, takes a document from its caller (line 3) and hands it to `canonical`, which calls itself at line 17 (`canonical`) with a piece of `node` (and at line 28, line 34) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/protocol/script/openapi-stabilize.ts:17
`stabilizeOpenApi` is exported, takes a document from its caller (line 3) and hands it to `rewrite`, which calls itself at line 47 (`rewrite`) with a piece of `node` (and at line 52) — and nowhere in `rewrite` 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 `rewrite` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/protocol/script/openapi-stabilize.ts:47
`isMissingUniqueUsersColumn` is exported, takes a document from its caller (line 151) and hands it to `errorText`, which calls itself at line 268 (`errorText`) with a piece of `cause` (and at line 271) — and nowhere in `errorText` 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 `errorText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/stats/core/src/domain/stat.ts:268
`isMissingRetentionTable` is exported, takes a document from its caller (line 98) and hands it to `errorText`, which calls itself at line 104 (`errorText`) with a piece of `cause` (and at line 107) — and nowhere in `errorText` 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 `errorText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/stats/core/src/domain/retention.ts:104
`cliErrorMessage` is exported and takes `input: unknown` from its caller, and it calls itself at line 7 (`cliErrorMessage`) with a piece of `input` — and nowhere in `cliErrorMessage` 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 `cliErrorMessage` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/tui/src/util/error.ts:7
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 36/61 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.
`getAccessToken` 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:367
`getUserPrompt` 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:400
`subscribeSessionEvents` 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:480
`revokeAppToken` 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:1045
`encode` 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/app/src/runtime/persistence/drafts.ts:232
`blobDataUrl` 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/app/src/runtime/persistence/drafts.ts:553
`compileExecutable` 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/cli/script/build.ts:228
`resolveTargetNode` 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/cli/script/build-node.ts:178
`execute` 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/client/src/promise/generated/client.ts:345
`fetchSvgContent` 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/console/app/src/component/header.tsx:27
`login` 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/console/app/src/lib/salesforce.ts:3
`createLead` 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/console/app/src/lib/salesforce.ts:51
`loadChangelog` 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/console/app/src/lib/changelog.ts:41
`targets` 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/desktop/scripts/bench-startup.ts:627
`warmService` 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/desktop/scripts/bench-startup.ts:889
`fetchCatalogPayload` 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/stats/app/src/routes/model-catalog.ts:352
`fetchLabCatalogPayload` 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/stats/app/src/routes/model-catalog.ts:358
`waitUntilConnected` awaits `wait(…)` 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: `wait(url, { signal })`. — packages/tui/src/mini/stream-v2.transport.ts:524
`loadThemeFromUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/ui/src/theme/loader.ts:82
`publish` 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 })`. — script/update-artifact.ts:14
`credentials` 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 })`. — script/update-artifact.ts:95
`fetchNpmDownloads` 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:52
`fetchReleases` 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:70
`ensureCleanupLabel` 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 })`. — script/github/close-prs.ts:274
`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 })`. — script/github/close-issues.ts:42
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.
`logDebug` at line 140 is called with an argument built by `skills.map((skill) => skill.id)` (line 144), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because logDebug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — packages/core/src/config/plugin/skill.ts:140
`logDebug` at line 194 is called with an argument built by `files.map((item) => item.path)` (line 197), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because logDebug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — packages/core/src/config/plugin/instruction.ts:194
What to do
Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is JavaScript's evaluation order, not a guess — then put the construction behind the level check the logger offers (`if (logger.isLevelEnabled('debug'))` for pino and winston, `isDebugEnabled()` for log4js, the repository's own debug flag where it has one), or hand the logger the object and a format string (`logger.debug({ payload }, 'raw request')`) so the serialising happens only when the line is written. Moving the call is not the fix: it is the join/projection/stringify in the argument that is paid, wherever the call sits.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped6.3 / 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.
`(icon as SVGElement).outerHTML+(text as HTMLSpanElement).outerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/gui-extensions/src/file/drag.ts:14
`html` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/session-ui/src/components/markdown-solid.tsx:68
`svg` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/session-ui/src/components/markdown.tsx:279
`block.html` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/session-ui/src/components/markdown.tsx:917
`ranges.join("\n")` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/tui/src/component/prompt/index.tsx:170
`escape(href)` 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. — services/changelog/src/markdown.ts:96
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.
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 element5.4 / 10Adequate✓ Tool-verified
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
This loop runs once per element of `input`, and the statement it guards acts on the element it is on — `input[index]`. The test deciding whether that statement runs does not: `quote === '"'` reads `input[start + 1]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2349, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — packages/core/src/shell/scan.ts:2365
What to do
Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×18) — REDACTED:284, REDACTED:549, packages/ai/src/protocols/utils/partial-json.ts:45, …
`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. (×4) — REDACTED:70, packages/app/src/runtime/i18n/language.tsx:216, packages/app/src/runtime/persistence/base64.ts:8, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×18) — packages/app/src/home/sessions/controller.tsx:144, packages/app/src/home/sessions/controller.tsx:198, packages/cli/src/run/noninteractive.ts:182, …
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 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.
39/40 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.
~1.5 `!` null assertions per 1k TypeScript source lines — 792 assertion(s) across the 542324 source line(s) of the 3484 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: packages/merman/src/flowchart/layout.ts (67), packages/merman/src/sequence/placement.ts (38), packages/merman/src/flowchart/routing.ts (33). 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 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 11 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 — Repo shows no audit-logging mechanism (an audit-log table or model, an ORM write hook that records changes — a TypeORM/MikroORM subscriber, a Sequelize or Mongoose hook, Prisma middleware — or a change-history plugin such as mongoose-history or sequelize-paper-trail) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 43 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — Not applicable: 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).
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence 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.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
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.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — none of 2 ADRs are conformance-checkable — unverifiable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.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.
D32 Data Compliance (PII/GDPR) — 298 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
D4 Code Duplication — This repository's production source (.ts, .tsx) is not read by D4's token comparison, which compares .NET source: duplication in it is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream. Not scored here — read the R10 card for this repository's duplication.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
DM1 Aggregate boundaries — no aggregates detected — aggregate-boundary check not applicable
DM10 One transaction, one aggregate — no repository writes detected — no operation to judge against the one-aggregate rule
DM11 Constructible invalid state — no entities detected — construction-time invariants not assessable
DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM4 Rich vs anemic model — no data-bearing entities detected — rich-vs-anemic model not assessable
DM5 Encapsulated state — no domain entities found — DM5 grades how entities protect their state, and this repository declares none
DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — no outbound HTTP usage detected — no HTTP client call or construction in the JavaScript/TypeScript source (service entry point: packages/function/src/share.ts:163 (new Hono())
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 package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not 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 bun lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Domain depends on infrastructure: catalog-identity packages/stats/core/src/domain/catalog-identity.ts:14— `packages/stats/core/src/domain/catalog-identity.ts` (domain layer) depends on `fetch` (global fetch) — a HTTP module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: geo packages/stats/core/src/domain/geo.ts:1— `packages/stats/core/src/domain/geo.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: geo packages/stats/core/src/domain/geo.ts:4— `packages/stats/core/src/domain/geo.ts` (domain layer) depends on `../database` (import of `packages/stats/core/src/database.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: model packages/stats/core/src/domain/model.ts:1— `packages/stats/core/src/domain/model.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: model packages/stats/core/src/domain/model.ts:4— `packages/stats/core/src/domain/model.ts` (domain layer) depends on `../database` (import of `packages/stats/core/src/database.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: provider packages/stats/core/src/domain/provider.ts:1— `packages/stats/core/src/domain/provider.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: provider packages/stats/core/src/domain/provider.ts:4— `packages/stats/core/src/domain/provider.ts` (domain layer) depends on `../database` (import of `packages/stats/core/src/database.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: retention packages/stats/core/src/domain/retention.ts:1— `packages/stats/core/src/domain/retention.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: retention packages/stats/core/src/domain/retention.ts:3— `packages/stats/core/src/domain/retention.ts` (domain layer) depends on `../database` (import of `packages/stats/core/src/database.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
Domain depends on infrastructure: stat packages/stats/core/src/domain/stat.ts:1— `packages/stats/core/src/domain/stat.ts` (domain layer) depends on `drizzle-orm` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
AC2 · Forms & labels· <input> without a programmatic label · ×6
<input> without a programmatic label packages/app/src/new-session/project/selector.tsx:346— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label packages/app/src/providers/models/select-dialog.tsx:624— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label packages/console/app/src/routes/enterprise/index.tsx:224— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/gui-extensions/src/terminal/tab.tsx:154— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label packages/session-ui/src/components/file-search.tsx:30— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label packages/stats/app/src/routes/stats-shell.tsx:484— 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· Click handler on a non-interactive <div> · ×5
Click handler on a non-interactive <div> packages/app/src/session/screen.tsx:379— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> packages/gui-extensions/src/file/artifact-view.tsx:591— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/session-ui/src/components/line-comment.tsx:112— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
Click handler on a non-interactive <div> packages/session-ui/src/message/attachment-card.tsx:18— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> packages/stats/app/src/routes/stats-shell.tsx:436— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Boundary-crossing change coupling: platform.tsx ↔ REDACTED packages/app/src/runtime/platform/platform.tsx:1— `packages/app/src/runtime/platform/platform.tsx` (context runtime) and `REDACTED` (context desktop) sit in DIFFERENT parts of the tree yet change together 67% of the time (10 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `211cd73f` feat(desktop): update composer dropzone (#42312); `a9afed05` fix(desktop): remove titlebar inset in fullscreen (#38793) (at that commit the file was still `packages/app/src/context/platform.tsx`); `ba6cf386` feat(desktop): add focus debug toggle (#37465) (at that commit the file was still `packages/app/src/context/platform.tsx`) — run `git show` on any of them.
Boundary-crossing change coupling: platform.tsx ↔ index.tsx packages/app/src/runtime/platform/platform.tsx:1— `packages/app/src/runtime/platform/platform.tsx` (context runtime) and `packages/desktop/src/renderer/index.tsx` (context desktop) sit in DIFFERENT parts of the tree yet change together 67% of the time (10 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `a9afed05` fix(desktop): remove titlebar inset in fullscreen (#38793) (at that commit the file was still `packages/app/src/context/platform.tsx`); `ba6cf386` feat(desktop): add focus debug toggle (#37465) (at that commit the file was still `packages/app/src/context/platform.tsx`); `b4e49d5b` feat(app): redesign attachment cards (#35945) (at that commit the file was still `packages/app/src/context/platform.tsx`) — run `git show` on any of them.
Boundary-crossing change coupling: platform.tsx ↔ ipc.ts packages/app/src/runtime/platform/platform.tsx:1— `packages/app/src/runtime/platform/platform.tsx` (context runtime) and `packages/desktop/src/main/ipc.ts` (context desktop) sit in DIFFERENT parts of the tree yet change together 67% of the time (10 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `211cd73f` feat(desktop): update composer dropzone (#42312); `a9afed05` fix(desktop): remove titlebar inset in fullscreen (#38793) (at that commit the file was still `packages/app/src/context/platform.tsx`); `ba6cf386` feat(desktop): add focus debug toggle (#37465) (at that commit the file was still `packages/app/src/context/platform.tsx`) — run `git show` on any of them.
Boundary-crossing change coupling: platform.tsx ↔ types.ts packages/app/src/runtime/platform/platform.tsx:1— `packages/app/src/runtime/platform/platform.tsx` (context runtime) and `packages/desktop/src/preload/types.ts` (context desktop) sit in DIFFERENT parts of the tree yet change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `a9afed05` fix(desktop): remove titlebar inset in fullscreen (#38793) (at that commit the file was still `packages/app/src/context/platform.tsx`); `ba6cf386` feat(desktop): add focus debug toggle (#37465) (at that commit the file was still `packages/app/src/context/platform.tsx`); `b4e49d5b` feat(app): redesign attachment cards (#35945) (at that commit the file was still `packages/app/src/context/platform.tsx`) — run `git show` on any of them.
Boundary-crossing change coupling: stats-proxy.ts ↔ index.tsx packages/console/app/src/lib/stats-proxy.ts:1— `packages/console/app/src/lib/stats-proxy.ts` (context console) and `packages/stats/app/src/routes/index.tsx` (context stats) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `08c483dc` fix(stats): reduce database query load; `05ce6bc2` fix(data): canonicalize locale pages; `f1c31f4e` fix(stats): use data branding assets — run `git show` on any of them.
Dependency-rule violation: @opencode/app (Application) → @opencode/gui-extensions (Web) packages/app/package.json:67— `@opencode/app` is a Application project but references `@opencode/gui-extensions`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one.
Dependency-rule violation: @opencode/app (Application) → @opencode/session-ui (Web) packages/app/package.json:68— `@opencode/app` is a Application project but references `@opencode/session-ui`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one.
Dependency-rule violation: @opencode/app (Application) → @opencode/ui (Web) packages/app/package.json:69— `@opencode/app` is a Application project but references `@opencode/ui`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one.
D10 · Test Quality· No assertions (empty test) · ×3
No assertions (empty test): revalidates after an event overtakes an active session read packages/client/test/solid-data.test.ts:235— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): subagent completion notices navigate to the child session at width %s packages/tui/test/completion-notices.test.tsx:131— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): renders actions with a current selection packages/tui/test/cli/tui/dialog-select.test.tsx:308— Test method has an empty body — it asserts nothing and exercises no code.
AC1 · Text alternatives· <img> without a text alternative · ×2
<img> without a text alternative packages/ui/src/data-display/avatar/avatar.tsx:59— 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 packages/ui/src/data-display/project-avatar/project-avatar.tsx:101— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AC2 · Forms & labels· <label> that labels no control · ×2
<label> that labels no control packages/app/src/providers/credentials/dialog.tsx:192— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control packages/app/src/providers/credentials/dialog.tsx:236— 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· <textarea> without a programmatic label · ×2
<textarea> without a programmatic label packages/session-ui/src/components/line-comment.tsx:309— 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 packages/ui/src/data-display/line-comment/line-comment.tsx:224— 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· Click handler on a non-interactive <img> · ×2
Click handler on a non-interactive <img> packages/app/src/composer/editor/editor.tsx:695— 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 <img> packages/gui-extensions/src/file/artifact-view.tsx:422— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×2
Click handler on a non-interactive <span> packages/app/src/home/projects/view.tsx:396— 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 <span> packages/session-ui/src/components/basic-tool.tsx:251— 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}.
S1 · Web-Security Posture· Password hashing without a KDF · ×2
Password hashing without a KDF packages/app/src/servers/connect/dialog.tsx:386— `password === original.http.password` checks a password against the stored one in plaintext, so the store holds the password itself and whoever reads it holds every account.
Password hashing without a KDF packages/cli/src/services/service-registration.ts:38— `found.password === info.password` checks a password against the stored one in plaintext, so the store holds the password itself and whoever reads it holds every account.
AC2 · Forms & labels· Custom control with no accessible name on <span> · ×1
Custom control with no accessible name on <span> packages/app/src/shell/titlebar/tab-nav.tsx:318— This <span> 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.
AC2 · Forms & labels· Custom control with no accessible name on <video> · ×1
Custom control with no accessible name on <video> packages/gui-extensions/src/file/artifact-view.tsx:600— This <video> 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.
AC2 · Forms & labels· <button> with no accessible text · ×1
<button> with no accessible text packages/gui-extensions/src/updater/whats-new.tsx:279— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC2 · Forms & labels· Custom control with no accessible name on <div> · ×1
Custom control with no accessible name on <div> packages/session-ui/src/components/message-nav.tsx:51— This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC4 · Keyboard semantics· Click handler on a non-interactive <video> · ×1
Click handler on a non-interactive <video> packages/gui-extensions/src/file/artifact-view.tsx:600— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Double-click handler on a non-interactive <span> · ×1
Double-click handler on a non-interactive <span> packages/gui-extensions/src/terminal/tab.tsx:143— This <span> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Focusable <div> isn't keyboard-operable packages/session-ui/src/components/file.tsx:759— This <div> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its only behaviour is bound to pointerdown, pointer gestures a keyboard cannot produce, and there is no key handler. The tab stop leads nowhere. Bind the same behaviour to a key handler, or provide an equivalent control elsewhere. Give it a role as well, so assistive tech can announce what it is.
AC4 · Keyboard semantics· Hover-only interaction on <circle> · ×1
Hover-only interaction on <circle> packages/stats/app/src/routes/compare-radar.tsx:111— This <circle> 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.
AC4 · Keyboard semantics· Click handler on a <span> nested inside <button> · ×1
Click handler on a <span> nested inside <button> packages/stats/app/src/routes/index.tsx:1173— This <span> carries its own click handler, but it sits inside a <button> that performs a different action. A keyboard user reaches the <button> and activating it runs the <button>'s handler, never this one, so this action has no keyboard path at all. Role and tabindex cannot supply one: HTML forbids a <button> from containing interactive content or any descendant with a tabindex, so the browser will not put this element in the tab order however it is marked up. Move it out of the <button> and make it a sibling <button>, so each action has its own control.
AC5 · ARIA correctness· aria-expanded on a <span> with no role to carry it · ×1
aria-expanded on a <span> with no role to carry it packages/app/src/home/projects/view.tsx:396— A plain <span> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <span> a role that supports aria-expanded.
Unlisted import '@pierre/diffs' packages/app/src/custom-elements.d.ts:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@/home' packages/storybook/.storybook/mocks/gui-extensions/ssh.tsx:5— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@/providers' packages/storybook/.storybook/mocks/app/hooks/use-providers.ts:2— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@/runtime' packages/storybook/.storybook/extension.tsx:3— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@/servers' packages/storybook/.storybook/mocks/gui-extensions/ssh.tsx:12— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@/settings' packages/storybook/.storybook/mocks/gui-extensions/pairing.tsx:8— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
FunctionTooLong: index.Prompt packages/tui/src/component/prompt/index.tsx:185— FunctionTooLong — Prompt runs 1369 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1269 over it, 13.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: index.PrivacyPolicy packages/console/app/src/routes/legal/privacy-policy/index.tsx:10— FunctionTooLong — PrivacyPolicy runs 1334 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1234 over it, 13.34× 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: data.createData packages/client/src/solid/data.ts:230— FunctionTooLong — createData runs 1323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1223 over it, 13.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: index.Session packages/tui/src/routes/session/index.tsx:148— FunctionTooLong — Session runs 1166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1066 over it, 11.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: stream-v2.transport.createSessionTransport packages/tui/src/mini/stream-v2.transport.ts:480— FunctionTooLong — createSessionTransport runs 1128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1028 over it, 11.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: dialog.ProviderConnection packages/app/src/providers/connect/dialog.tsx:406— FunctionTooLong — ProviderConnection 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: form.FormPrompt packages/tui/src/routes/session/form.tsx:59— FunctionTooLong — FormPrompt runs 896 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 796 over it, 8.96× 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: footer.prompt.createPromptState packages/tui/src/mini/footer.prompt.tsx:339— FunctionTooLong — createPromptState runs 855 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 755 over it, 8.55× 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.Home packages/console/app/src/routes/index.tsx:31— FunctionTooLong — Home runs 780 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 680 over it, 7.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: stream-v2.subagent.createSubagentTracker packages/tui/src/mini/stream-v2.subagent.ts:203— FunctionTooLong — createSubagentTracker runs 745 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 645 over it, 7.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: app.App packages/tui/src/app.tsx:489— FunctionTooLong — App runs 725 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 625 over it, 7.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: footer.view.RunFooterView packages/tui/src/mini/footer.view.tsx:129— FunctionTooLong — RunFooterView runs 721 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 621 over it, 7.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: diff-viewer.DiffViewerContent packages/tui/src/feature-plugins/system/diff-viewer.tsx:306— FunctionTooLong — DiffViewerContent runs 717 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 617 over it, 7.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: runtime.runInteractiveRuntime packages/tui/src/mini/runtime.ts:193— FunctionTooLong — runInteractiveRuntime runs 686 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 586 over it, 6.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: session-timeline-row.createSessionTimelineRowRenderer packages/session-ui/src/timeline/session-timeline-row.tsx:63— FunctionTooLong — createSessionTimelineRowRenderer runs 683 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 583 over it, 6.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: session-tabs.VerticalSessionTabs packages/tui/src/component/session-tabs.tsx:542— FunctionTooLong — VerticalSessionTabs runs 665 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 565 over it, 6.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: autocomplete.Autocomplete packages/tui/src/component/prompt/autocomplete.tsx:59— FunctionTooLong — Autocomplete runs 655 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 555 over it, 6.55× 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: virtualizer.createTimelineVirtualizer packages/app/src/session/timeline/virtualizer.tsx:93— FunctionTooLong — createTimelineVirtualizer runs 566 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 466 over it, 5.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: noninteractive.runNonInteractivePrompt packages/cli/src/run/noninteractive.ts:76— FunctionTooLong — runNonInteractivePrompt runs 564 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 464 over it, 5.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: session.makeSessionGroup packages/protocol/src/groups/session.ts:111— FunctionTooLong — makeSessionGroup runs 558 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 458 over it, 5.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: titlebar.Titlebar packages/app/src/shell/titlebar/titlebar.tsx:57— FunctionTooLong — Titlebar runs 543 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 443 over it, 5.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: bus.configured packages/core/src/bus.ts:187— FunctionTooLong — configured runs 542 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 442 over it, 5.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: dialog-select.DialogSelect packages/tui/src/ui/dialog-select.tsx:138— FunctionTooLong — DialogSelect runs 537 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 437 over it, 5.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: index.layer packages/core/src/mcp/index.ts:172— FunctionTooLong — layer runs 536 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 436 over it, 5.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: footer.form.RunFormBody packages/tui/src/mini/footer.form.tsx:39— FunctionTooLong — RunFormBody runs 523 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 423 over it, 5.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: packages/tui/src/routes/session/index.tsx packages/tui/src/routes/session/index.tsx:148— packages/tui/src/routes/session/index.tsx changed 172 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 260 in index.Session at line 148. 87 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/routes/session/index.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: packages/tui/src/component/prompt/index.tsx packages/tui/src/component/prompt/index.tsx:185— packages/tui/src/component/prompt/index.tsx changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 275 in index.Prompt at line 185. 29 of those changes were fix/bug commits, and the other 45 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/component/prompt/index.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: packages/client/src/solid/data.ts packages/client/src/solid/data.ts:230— packages/client/src/solid/data.ts changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 307 in data.createData at line 230. 25 of those changes were fix/bug commits, and the other 34 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/client/src/solid/data.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/tui/src/app.tsx packages/tui/src/app.tsx:489— packages/tui/src/app.tsx changed 107 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in app.App at line 489. 39 of those changes were fix/bug commits, and the other 68 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/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: packages/tui/src/component/session-tabs.tsx packages/tui/src/component/session-tabs.tsx:542— packages/tui/src/component/session-tabs.tsx changed 60 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in session-tabs.VerticalSessionTabs at line 542. 27 of those changes were fix/bug commits, and the other 33 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/component/session-tabs.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: packages/app/src/shell/titlebar/titlebar.tsx packages/app/src/shell/titlebar/titlebar.tsx:57— packages/app/src/shell/titlebar/titlebar.tsx changed 63 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in titlebar.Titlebar at line 57. 24 of those changes were fix/bug commits, and the other 39 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/app/src/shell/titlebar/titlebar.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: packages/tui/src/routes/session/form.tsx packages/tui/src/routes/session/form.tsx:59— packages/tui/src/routes/session/form.tsx changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 233 in form.FormPrompt at line 59. 12 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/routes/session/form.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: packages/tui/src/ui/dialog-select.tsx packages/tui/src/ui/dialog-select.tsx:138— packages/tui/src/ui/dialog-select.tsx changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 136 in dialog-select.DialogSelect at line 138. 14 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/ui/dialog-select.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: packages/app/src/session/timeline/message-timeline.tsx packages/app/src/session/timeline/message-timeline.tsx:119— packages/app/src/session/timeline/message-timeline.tsx changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in message-timeline.MessageTimelineView at line 119. 28 of those changes were fix/bug commits, and the other 28 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/app/src/session/timeline/message-timeline.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: packages/tui/src/feature-plugins/system/diff-viewer.tsx packages/tui/src/feature-plugins/system/diff-viewer.tsx:306— packages/tui/src/feature-plugins/system/diff-viewer.tsx changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 121 in diff-viewer.DiffViewerContent at line 306. 11 of those changes were fix/bug commits, and the other 26 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/feature-plugins/system/diff-viewer.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: packages/app/src/session/screen.tsx packages/app/src/session/screen.tsx:58— packages/app/src/session/screen.tsx changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in screen.SessionScreenContent at line 58. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/app/src/session/screen.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: packages/client/src/promise/generated/client.ts packages/client/src/promise/generated/client.ts:313— packages/client/src/promise/generated/client.ts changed 97 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in client.make at line 313. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/client/src/promise/generated/client.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/ai/src/protocols/open-responses.ts packages/ai/src/protocols/open-responses.ts:599— packages/ai/src/protocols/open-responses.ts changed 84 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in open-responses.lowerMessages at line 599. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/ai/src/protocols/open-responses.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/tui/src/mini/stream-v2.transport.ts packages/tui/src/mini/stream-v2.transport.ts:1025— packages/tui/src/mini/stream-v2.transport.ts changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 119 in stream-v2.transport.createSessionTransport.apply at line 1025. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/mini/stream-v2.transport.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/gui-extensions/src/browser/chromium.ts packages/gui-extensions/src/browser/chromium.ts:124— packages/gui-extensions/src/browser/chromium.ts changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 287 in chromium.createBrowserPage at line 124. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/gui-extensions/src/browser/chromium.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/tui/src/component/prompt/autocomplete.tsx packages/tui/src/component/prompt/autocomplete.tsx:59— packages/tui/src/component/prompt/autocomplete.tsx changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 125 in autocomplete.Autocomplete at line 59. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/component/prompt/autocomplete.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: packages/session-ui/src/tools/tool-renderer.tsx packages/session-ui/src/tools/tool-renderer.tsx:460— packages/session-ui/src/tools/tool-renderer.tsx changed 60 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in tool-renderer.CurrentContextToolGroup at line 460. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/session-ui/src/tools/tool-renderer.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: packages/ai/src/protocols/openai-chat.ts packages/ai/src/protocols/openai-chat.ts:1015— packages/ai/src/protocols/openai-chat.ts changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in openai-chat.step at line 1015. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/ai/src/protocols/openai-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.
Hotspot: packages/tui/src/plugin/context.tsx packages/tui/src/plugin/context.tsx:88— packages/tui/src/plugin/context.tsx changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in context.PluginProvider at line 88. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/plugin/context.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: packages/cli/src/services/updater.ts packages/cli/src/services/updater.ts:139— packages/cli/src/services/updater.ts changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in updater.make at line 139. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/cli/src/services/updater.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/tui/src/mini/footer.view.tsx packages/tui/src/mini/footer.view.tsx:129— packages/tui/src/mini/footer.view.tsx changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 181 in footer.view.RunFooterView at line 129. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/mini/footer.view.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: packages/cli/src/run/noninteractive.ts packages/cli/src/run/noninteractive.ts:76— packages/cli/src/run/noninteractive.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 180 in noninteractive.runNonInteractivePrompt at line 76. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/cli/src/run/noninteractive.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/core/src/mcp/index.ts packages/core/src/mcp/index.ts:172— packages/core/src/mcp/index.ts changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in index.layer at line 172. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/core/src/mcp/index.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/tui/src/mini/runtime.ts packages/tui/src/mini/runtime.ts:193— packages/tui/src/mini/runtime.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 161 in runtime.runInteractiveRuntime at line 193. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/mini/runtime.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/gui-extensions/src/terminal/terminal.tsx packages/gui-extensions/src/terminal/terminal.tsx:183— packages/gui-extensions/src/terminal/terminal.tsx changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 119 in terminal.Terminal at line 183. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/gui-extensions/src/terminal/terminal.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.
FileTooLong: session/index.tsx packages/tui/src/routes/session/index.tsx— FileTooLong — 3110 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2610 over it, 6.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: shell/scan.ts packages/core/src/shell/scan.ts— FileTooLong — 1984 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1484 over it, 3.97× 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: tools/tool-renderer.tsx packages/session-ui/src/tools/tool-renderer.tsx— FileTooLong — 1818 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1318 over it, 3.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: interpreter/interpreter.ts packages/codemode/src/interpreter/interpreter.ts— FileTooLong — 1697 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: Frame (379-2357). The bar is 500 significant lines; this is 1197 over it, 3.39× 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: routes/index.tsx packages/stats/app/src/routes/index.tsx— FileTooLong — 1555 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1055 over it, 3.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: component/session-tabs.tsx packages/tui/src/component/session-tabs.tsx— FileTooLong — 1539 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1039 over it, 3.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: prompt/index.tsx packages/tui/src/component/prompt/index.tsx— FileTooLong — 1521 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: Prompt (185-2019). The bar is 500 significant lines; this is 1021 over it, 3.04× 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: solid/data.ts packages/client/src/solid/data.ts— FileTooLong — 1488 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: createData (230-2013). The bar is 500 significant lines; this is 988 over it, 2.98× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: mini/stream-v2.transport.ts packages/tui/src/mini/stream-v2.transport.ts— FileTooLong — 1475 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: createSessionTransport (480-1916). The bar is 500 significant lines; this is 975 over it, 2.95× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED packages/httpapi-codegen/src/index.ts— FileTooLong — 1465 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 965 over it, 2.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: privacy-policy/index.tsx packages/console/app/src/routes/legal/privacy-policy/index.tsx— FileTooLong — 1342 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: PrivacyPolicy (10-1515). The bar is 500 significant lines; this is 842 over it, 2.68× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: connect/dialog.tsx packages/app/src/providers/connect/dialog.tsx— FileTooLong — 1274 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: ProviderConnection (406-1617). The bar is 500 significant lines; this is 774 over it, 2.55× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: [lab]/[model].tsx packages/stats/app/src/routes/[lab]/[model].tsx— FileTooLong — 1229 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 729 over it, 2.46× 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: protocols/anthropic-messages.ts packages/ai/src/protocols/anthropic-messages.ts— FileTooLong — 1193 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 693 over it, 2.39× 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: state/routing.ts packages/merman/src/state/routing.ts— FileTooLong — 1185 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 685 over it, 2.37× 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 packages/tui/src/app.tsx— FileTooLong — 1160 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: App (489-1472). The bar is 500 significant lines; this is 660 over it, 2.32× 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: responses/openai-responses-language-model.ts packages/core/src/github-copilot/responses/openai-responses-language-model.ts— FileTooLong — 1154 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: OpenAIResponsesLanguageModel (115-1272). The bar is 500 significant lines; this is 654 over it, 2.31× 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: browser/chromium.ts packages/gui-extensions/src/browser/chromium.ts— FileTooLong — 1149 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 649 over it, 2.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: flowchart/routing.ts packages/merman/src/flowchart/routing.ts— FileTooLong — 1128 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 628 over it, 2.26× 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: mini/footer.prompt.tsx packages/tui/src/mini/footer.prompt.tsx— FileTooLong — 1126 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: createPromptState (339-1549). The bar is 500 significant lines; this is 626 over it, 2.25× 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: system/diff-viewer.tsx packages/tui/src/feature-plugins/system/diff-viewer.tsx— FileTooLong — 1108 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: DiffViewerContent (306-1190). The bar is 500 significant lines; this is 608 over it, 2.22× 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: protocols/open-responses.ts packages/ai/src/protocols/open-responses.ts— FileTooLong — 1080 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 580 over it, 2.16× 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: database/v1-migration.bun.ts packages/core/src/database/v1-migration.bun.ts— FileTooLong — 1006 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 506 over it, 2.01× 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: component/dialog-integration.tsx packages/tui/src/component/dialog-integration.tsx— FileTooLong — 999 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 499 over it, 2.00× 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 — 994 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: layer (190-1309). The bar is 500 significant lines; this is 494 over it, 1.99× 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.
TodoComment packages/ai/src/protocols/anthropic-messages.ts:1001— // TODO: Move per-model capability heuristics (`supportsEffortUpdates`, `supportsNativeSystemUpdates`, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/app/src/home/sessions/controller.tsx:369— // TODO: Restore archiving when the V2 client exposes a session archive API. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/app/src/providers/credentials/dialog.tsx:94— // TODO: Restore disabled-provider validation when V2 exposes config reads. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/app/src/providers/credentials/dialog.tsx:110— // TODO: Restore custom providers when V2 exposes config and arbitrary credential APIs. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/app/src/runtime/server/sync.tsx:36— // TODO: Restore LSP status when the V2 client exposes an LSP API. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/app/src/runtime/server/sync.tsx:291— // TODO: Restore config updates when the V2 client exposes a config API. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/app/src/runtime/server/global-sync/bootstrap.ts:55— // TODO: Restore config loading when the V2 client exposes a config API. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/client/src/effect/index.ts:1— // TODO: Keep additional network capabilities inside Schema and Protocol as the client grows; /effect must never import — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/workspace.ts:358— // TODO(workspace-plan): add the boot janitor and ~23h safety snapshot rotation in a later PR. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/workspace.ts:359— // TODO(workspace-plan): make cold wake interruptible with a re-pin loop against janitor races. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/workspace.ts:360— // TODO(workspace-plan): consider extracting a keyed shared-attempt helper (join/cancel, drop-on-settle) beside — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/session.ts:323— // TODO: Restore recorded sessions onto replacement synchronized workspaces in a future API slice. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/file-mutation.ts:129— // TODO: Publish watcher/file-edit events after watcher integration exists. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/tool/plugin/write.ts:42— // TODO: Publish watcher/file-edit events after watcher integration exists. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/tool/plugin/edit.ts:203— // TODO: Publish watcher/file-edit events after watcher integration exists. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/file-mutation.ts:130— // TODO: Add snapshots / undo after snapshot design exists. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/file-mutation.ts:131— // TODO: Notify LSP and collect diagnostics after LSP runtime exists. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/file-mutation.ts:132— // TODO: Design multi-file transactions / rollback if patch needs atomic edits. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/file-mutation.ts:134— // TODO: Define crash recovery and idempotency for side effects between Tool.Called and durable settlement. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/codemode/catalog.ts:95— // TODO: Bound namespace discovery once large namespace inventories and descriptions can no longer stay inline. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:385— // TODO we lost type safety on Chunk, most likely due to the error schema. MUST FIX — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/github-copilot/responses/openai-responses-language-model.ts:1594— // TODO AI SDK 6: use optional here instead of nullish — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/session/usage.ts:21— // TODO(#35765): Use Copilot's reported billed amount once billing has a dedicated typed runtime contract.
TodoComment packages/core/src/session/model-request.ts:287— // TODO: Persist cache lineage so nested forks reuse the root session's cache key. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment packages/core/src/session/compaction.ts:669— // TODO: Read the previous summary from the hooked request once it no longer merges summary and recent into one — 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.
Boundary violation [package:undeclared-workspace-dep] packages/ai/script/publish.ts:2— packages/ai/script/publish.ts:2 imports @opencode/script, a package this repository publishes, but this package's own package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies.
Boundary violation [package:test-cross-package-internals] packages/app/e2e/performance/markdown/lifetime.bench.ts:6— packages/app/e2e/performance/markdown/lifetime.bench.ts:6 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/performance/markdown-lifetime/answer) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/e2e/performance/patch-groups/fixture.tsx:7— packages/app/e2e/performance/patch-groups/fixture.tsx:7 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/src/storybook/current-session-story) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/e2e/performance/patch-groups/fixture.tsx:8— packages/app/e2e/performance/patch-groups/fixture.tsx:8 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/src/storybook/current-session-fixtures) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/e2e/performance/patch-groups/fixture.tsx:9— packages/app/e2e/performance/patch-groups/fixture.tsx:9 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/src/tools/tool-renderer) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/e2e/performance/patch-groups/fixture.tsx:10— packages/app/e2e/performance/patch-groups/fixture.tsx:10 reaches past another workspace package's public entry into its internals with a relative path (../../../../session-ui/src/components/apply-patch-file) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/e2e/performance/terminals/probe.ts:2— packages/app/e2e/performance/terminals/probe.ts:2 reaches past another workspace package's public entry into its internals with a relative path (../../../../gui-extensions/src/terminal/serialize) — 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] packages/app/src/shell/titlebar/titlebar.tsx:37— packages/app/src/shell/titlebar/titlebar.tsx:37 reaches into another package with a relative path (../../../../desktop/icons/dev/64x64.png) — import the package by name instead.
Boundary violation [package:relative-cross-package] packages/app/src/shell/titlebar/titlebar.tsx:38— packages/app/src/shell/titlebar/titlebar.tsx:38 reaches into another package with a relative path (../../../../desktop/icons/beta/64x64.png) — import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/test-browser/extension-migrations.test.ts:9— packages/app/test-browser/extension-migrations.test.ts:9 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/context/index) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/test-browser/extension-migrations.test.ts:10— packages/app/test-browser/extension-migrations.test.ts:10 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/context/renderer) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/test-browser/extension-migrations.test.ts:11— packages/app/test-browser/extension-migrations.test.ts:11 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/details/index) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/test-browser/extension-migrations.test.ts:12— packages/app/test-browser/extension-migrations.test.ts:12 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/review/index) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
Boundary violation [package:test-cross-package-internals] packages/app/test-browser/extension-migrations.test.ts:13— packages/app/test-browser/extension-migrations.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../gui-extensions/src/updater/index) — 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] packages/cli/dev/entry.ts:13— packages/cli/dev/entry.ts:13 reaches into another package with a relative path (../../tui/src/index) — import the package by name instead.
Boundary violation [package:relative-cross-package] packages/cli/dev/error-overlay.tsx:5— packages/cli/dev/error-overlay.tsx:5 reaches into another package with a relative path (../../tui/src/context/theme) — import the package by name instead.
Boundary violation [package:relative-cross-package] packages/cli/dev/error-overlay.tsx:6— packages/cli/dev/error-overlay.tsx:6 reaches into another package with a relative path (../../tui/src/ui/dialog) — import the package by name instead.
Boundary violation [package:relative-cross-package] packages/cli/dev/error-overlay.tsx:7— packages/cli/dev/error-overlay.tsx:7 reaches into another package with a relative path (../../tui/src/context/keymap) — import the package by name instead.
Boundary violation [package:relative-cross-package] packages/cli/dev/host.d.ts:4— packages/cli/dev/host.d.ts:4 reaches into another package with a relative path (../../tui/src/context/route) — import the package by name instead.
Boundary violation [package:third-party-deep-import] packages/cli/dev/refresh.ts:3— packages/cli/dev/refresh.ts:3 imports solid-refresh/dist/solid-refresh.mjs, 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:third-party-deep-import] packages/cli/dev/refresh.ts:13— packages/cli/dev/refresh.ts:13 imports solid-refresh/dist/solid-refresh.mjs, 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] packages/cli/dev/route.tsx:4— packages/cli/dev/route.tsx:4 reaches into another package with a relative path (../../tui/src/context/route) — import the package by name instead.
Boundary violation [package:relative-cross-package] packages/cli/dev/route.tsx:6— packages/cli/dev/route.tsx:6 reaches into another package with a relative path (../../tui/src/context/route) — import the package by name instead.
Boundary violation [package:third-party-deep-import] packages/cli/dev/tui.ts:56— packages/cli/dev/tui.ts:56 imports solid-js/dist/dev.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] packages/cli/script/build-node.ts:17— packages/cli/script/build-node.ts:17 reaches into another package with a relative path (../../../script/native-arch) — import the package by name instead.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×37
No test reaches this file packages/stats/app/src/routes/index.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/console/app/src/routes/legal/privacy-policy/index.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/stats/app/src/routes/[lab]/[model].tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/core/src/database/v1-migration.bun.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/stats/app/src/component/model-compare-detail.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/stats/app/src/routes/[lab]/index.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/stats/core/src/honeycomb-backfill.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/console/app/src/routes/index.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/desktop/src/main/extension/host.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/src/components/share/part.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/core/script/snapshot-parity.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/ai/script/setup-recording-env.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/stats/app/src/lib/agent-formats.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/src/components/Share.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/stats/app/src/routes/compare/index.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/stats/app/src/routes/stats-shell.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/console/app/src/routes/legal/terms-of-service/index.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 script/oxlint/anti-slop/shared/dictionary-types.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/console/app/src/routes/download/index.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 script/oxlint/anti-slop/rules/no-known-value-widening.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 script/github/close-prs.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/console/app/src/routes/enterprise/index.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 script/oxlint/anti-slop/rules/no-widen-then-assert.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/console/app/src/routes/go/index.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/console/app/src/component/icon.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.
Repeated repair: packages/stats/core/src/domain/model-normalization.ts packages/stats/core/src/domain/model-normalization.ts:59— packages/stats/core/src/domain/model-normalization.ts changed 24 times in last 90 days and 19 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 model-normalization.statProvider at line 59), 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(stats): merge Cat Jam usage into Reflection Beam (#56025)”; “fix(stats): normalize deepseek v4.1 flash codename (#55330)”; “fix(stats): attribute exo usage to an unknown provider (#53621)”; “fix(stats): attribute usage from catalog identity (#51833)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/stats/core/src/domain/model-normalization.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/stats/core/src/domain/inference.ts packages/stats/core/src/domain/inference.ts:387— packages/stats/core/src/domain/inference.ts changed 18 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is inference.toRetentionAggregate at line 387), 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(stats): include Go Plus usage (#58075)”; “fix(stats): hide models listed in a secret (#52834)”; “fix(stats): attribute usage from catalog identity (#51833)”; “fix(stats): paginate sync aggregates (#50198)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/stats/core/src/domain/inference.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/core/src/plugin/models-dev.ts packages/core/src/plugin/models-dev.ts:86— packages/core/src/plugin/models-dev.ts changed 21 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is models-dev.snapshots 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(core): hide newer Bedrock bare IDs that require inference profiles (#54486)”; “fix(core): exclude non-text models from catalog and default selection (#53295)”; “fix(core): re-read models.dev catalog after subscribing to Refreshed (#50012)”; “refactor(core): refactor model resolving logic, fix missing variant logic (#48943)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/core/src/plugin/models-dev.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/desktop/electron-builder.config.ts packages/desktop/electron-builder.config.ts:139— packages/desktop/electron-builder.config.ts changed 23 times in last 90 days and 12 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 afterPack at line 139), 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): stop AppImage executable name ending in .desktop (#58263)”; “fix(desktop): stop RPM build-id links conflicting with other Electron apps (#58093)”; “fix(ci): fail releases that bundle native code for the wrong CPU (#54982)”; “fix(desktop): bundle arm64 binaries for windows arm (#54689)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/desktop/electron-builder.config.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/app/src/new-session/composer-adapter.ts packages/app/src/new-session/composer-adapter.ts:21— packages/app/src/new-session/composer-adapter.ts changed 18 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is composer-adapter.createNewSessionComposerAdapter at line 21), 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(app): show a submitted prompt in the frame the composer clears (#54047)”; “fix(app): commit a staged revert before switching the selection (#53445)”; “fix(app): create local sessions in project root (#49668)”; “fix(app): align desktop agent and model switching (#47286)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/app/src/new-session/composer-adapter.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/desktop/electron.vite.config.ts packages/desktop/electron.vite.config.ts:6— packages/desktop/electron.vite.config.ts changed 18 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is resolveChannel at line 6), 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): bundle arm64 binaries for windows arm (#54689)”; “fix(desktop): restore fast cold dev startup (#54060)”; “fix(desktop): emit preload as .cjs so it loads under --no-sandbox (#47691)”; “fix(desktop): keep command palette responsive and scoped (#47164)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/desktop/electron.vite.config.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/stats/app/src/routes/model-catalog.ts packages/stats/app/src/routes/model-catalog.ts:373— packages/stats/app/src/routes/model-catalog.ts changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is model-catalog.readCatalogCosts at line 373), 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(stats): add missing lab logos to the top models leaderboard (#57314)”; “fix(stats): show public specs for stealth models (#53381)”; “fix(stats): fix data page canonicals, 404s, and sitemap coverage (#52525)”; “fix(stats): use capability fallbacks in comparison radar (#51161)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/stats/app/src/routes/model-catalog.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/tui/src/plugin/discovery.ts packages/tui/src/plugin/discovery.ts:24— packages/tui/src/plugin/discovery.ts changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is discovery.discoverPluginTargets at line 24), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tui): deduplicate plugin targets (#49112)”; “fix(core): reload local plugin helpers without restarting”; “fix(tui): reload local plugin dependency graphs (#47388)”; “fix(tui): stabilize plugin reload generations (#43447)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/plugin/discovery.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/tui/src/context/storage.tsx packages/tui/src/context/storage.tsx:48— packages/tui/src/context/storage.tsx changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is storage.createStorage at line 48), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tui): degrade gracefully when fs.watch fails (#51536)”; “fix(tui): handle storage watcher errors after startup (#51243)”; “fix(tui): don't crash when fs.watch throws (e.g. ENOSPC) (#51210)”; “fix(tui): cache system theme palette”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/context/storage.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: packages/tui/src/context/local.tsx packages/tui/src/context/local.tsx:326— packages/tui/src/context/local.tsx changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is reconcileSessionSelection at line 326), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tui): retain unavailable saved session model selection (#53822)”; “fix(tui): sync model preferences across clients (#49611)”; “fix(tui): restore agent and model selection parity (#47260)”; “fix(tui): keep model variant across new session (#41591)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/context/local.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: packages/ai/src/protocols/utils/tool-schema.ts packages/ai/src/protocols/utils/tool-schema.ts:22— packages/ai/src/protocols/utils/tool-schema.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 13 (its worst body is tool-schema.moonshotNode at line 22), 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(ai): declare tool schema roots as objects (#51153)”; “fix(ai): apply Gemini and Kimi schema handling by model name (#51017)”; “fix(ai): add types to untyped enums in Moonshot tool schemas (#50961)”; “fix(ai): preserve OpenAI tool schemas (#44546)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/ai/src/protocols/utils/tool-schema.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/console/app/src/routes/index.tsx packages/console/app/src/routes/index.tsx:31— packages/console/app/src/routes/index.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 4 (its worst body is index.Home at line 31), 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(console): fix marketing copy, stale stats and redirected links (#56589)”; “fix(console): give marketing pages complete social preview tags (#56565)”; “fix(console): give each marketing page a single meta description (#56533)”; “fix(console): link Zen and Go docs to V2 console pages (#55773)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/console/app/src/routes/index.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: packages/ai/src/protocols/utils/bedrock-media.ts packages/ai/src/protocols/utils/bedrock-media.ts:95— packages/ai/src/protocols/utils/bedrock-media.ts changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is bedrock-media.lower 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(ai): normalize Bedrock document labels (#48756)”; “fix(ai): validate Bedrock media data (#46333)”; “fix(ai): pass media through protocol lowering (#42921)”; “fix: make workspace imports NodeNext compatible”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/ai/src/protocols/utils/bedrock-media.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/stats/core/src/stat-sync.ts packages/stats/core/src/stat-sync.ts:41— packages/stats/core/src/stat-sync.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 10 (its worst body is stat-sync.syncStats at line 41), 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(stats): hide models listed in a secret (#52834)”; “fix(stats): attribute usage from catalog identity (#51833)”; “fix(stats): paginate sync aggregates (#50198)”; “fix(stats): prevent full retention sync timeouts”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/stats/core/src/stat-sync.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/console/app/src/component/header.tsx packages/console/app/src/component/header.tsx:38— packages/console/app/src/component/header.tsx changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is header.Header at line 38), 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(console): make the mobile menu and copy buttons keyboard accessible (#56591)”; “fix(console): link header GitHub item to the repository root (#56529)”; “fix(console): link Go and Zen login directly to Console (#54425)”; “fix(console): link dev Go navigation to Console (#53430)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/console/app/src/component/header.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/cli/script/app-assets.ts packages/cli/script/app-assets.ts:8— packages/cli/script/app-assets.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 2 (its worst body is app-assets.buildAppArchive at line 8), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): compress the embedded web UI at brotli's best quality (#53644)”; “fix(cli): embed the web UI as raw bytes instead of base64 strings (#53643)”; “fix(cli): load web assets on demand”; “fix(desktop): skip web ui build in dev (#41881)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/cli/script/app-assets.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/app/src/runtime/server/request-queue.ts packages/app/src/runtime/server/request-queue.ts:120— packages/app/src/runtime/server/request-queue.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 5 (its worst body is request-queue.createRequestQueue.fetch at line 120), 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(app): reduce cold and warm session load work (#48223)”; “fix(app): give worktree creation a setup-length request deadline (#47694)”; “fix(app): keep slow git reads from filling the request queue (#47564)”; “fix(app): time out requests the server never answers (#47572)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/app/src/runtime/server/request-queue.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/stats/core/src/domain/geo.ts packages/stats/core/src/domain/geo.ts:272— packages/stats/core/src/domain/geo.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 1 (its worst body is geo.rowsFromAggregates at line 272), 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(stats): hide models listed in a secret (#52834)”; “fix(stats): attribute usage from catalog identity (#51833)”; “fix(stats): attribute Hy4 preview traffic to Tencent (#51050)”; “fix(stats): attribute Hy4 preview traffic to Tencent (#50935)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/stats/core/src/domain/geo.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/stats/core/src/domain/model.ts packages/stats/core/src/domain/model.ts:256— packages/stats/core/src/domain/model.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 1 (its worst body is model.modelDailyScope at line 256), 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(stats): hide models listed in a secret (#52834)”; “fix(stats): attribute usage from catalog identity (#51833)”; “fix(stats): attribute Hy4 preview traffic to Tencent (#51050)”; “fix(stats): attribute Hy4 preview traffic to Tencent (#50935)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/stats/core/src/domain/model.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: packages/ai/src/protocols/alibaba-chat.ts packages/ai/src/protocols/alibaba-chat.ts:66— packages/ai/src/protocols/alibaba-chat.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 5 (its worst body is (anonymous) at line 66), 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(ai): only send store on chat completions for OpenAI and Azure (#57239)”; “fix(ai): enable Alibaba chat prompt caching (#52612)”; “fix(ai): fit thinking budgets to the output limit (#51157)”; “fix(ai): keep valid Responses provider options when a sibling is malformed (#49769)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/ai/src/protocols/alibaba-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: packages/util/src/observability/logging.ts packages/util/src/observability/logging.ts:33— packages/util/src/observability/logging.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 6 (its worst body is logging.flatten 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(util): bound opencode.log by trimming its head in place (#47676)”; “fix(cli): restore print-logs flag for `--standalone` runs (#44112)”; “fix(util): defer module-scope randomness and import.meta path derivation (#41765)”; “fix(util): no filesystem side effects at global module load (#41619)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/util/src/observability/logging.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/stats/core/src/r2-sql.ts packages/stats/core/src/r2-sql.ts:58— packages/stats/core/src/r2-sql.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 11 (its worst body is r2-sql.queryR2SqlPages at line 58), 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(stats): retry failed syncs instead of waiting an hour (#57516)”; “fix(stats): retry transient query failures (#50205)”; “fix(stats): paginate sync aggregates (#50198)”; “fix(stats): prevent full retention sync timeouts”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/stats/core/src/r2-sql.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/ui/src/context/marked-parser.tsx packages/ui/src/context/marked-parser.tsx:7— packages/ui/src/context/marked-parser.tsx changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is marked-parser.createMarkdownParser at line 7), 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(ui): render dollar math next to punctuation without matching prices (#53860)”; “fix(ui): render dollar math with marked-katex-extension (#53513)”; “fix(app): reduce session-switch latency (#46044)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/ui/src/context/marked-parser.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: packages/tui/src/component/patch-diff.tsx packages/tui/src/component/patch-diff.tsx:38— packages/tui/src/component/patch-diff.tsx changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is patch-diff.PatchDiff at line 38), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tui): tidy docked diff panel spacing (#55467)”; “chore(tui): revert OpenTUI 0.6 upgrade (#55300)”; “fix(tui): virtualize large added-file diffs (#51122)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/tui/src/component/patch-diff.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: packages/console/app/src/routes/zen/index.tsx packages/console/app/src/routes/zen/index.tsx:25— packages/console/app/src/routes/zen/index.tsx 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 2 (its worst body is index.Home at line 25), 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(console): give marketing pages complete social preview tags (#56565)”; “fix(console): give each marketing page a single meta description (#56533)”; “fix(console): link Zen and Go docs to V2 console pages (#55773)”. 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-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 00:53:53 -05:00' --until='2026-10-23 00:53:53 -05:00' --full-history --no-merges -- packages/console/app/src/routes/zen/index.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.
Swallowed exception (empty catch) REDACTED: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) REDACTED:549— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/ai/src/protocols/utils/partial-json.ts:45— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/ai/src/protocols/utils/partial-json.ts:51— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/ai/src/protocols/utils/partial-json.ts:253— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/app/src/home/sessions/controller.tsx:144— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/app/src/home/sessions/controller.tsx:198— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/app/src/runtime/persistence/storage.ts:297— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/app/src/runtime/platform/pwa.ts:31— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/app/src/runtime/platform/pwa.ts:43— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/app/src/runtime/server/health.ts:49— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/app/src/shell/notifications/coordinator.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) packages/cli/script/postinstall.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) packages/cli/src/run/noninteractive.ts:182— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/run/noninteractive.ts:184— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/run/noninteractive.ts:682— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/run/noninteractive.ts:727— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/run/noninteractive.ts:730— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/run/noninteractive.ts:736— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/run/noninteractive.ts:784— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/run/noninteractive.ts:785— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/services/update-preflight.tsx:145— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/services/update-preflight.tsx:149— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/ui/timeline.tsx:96— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/ui/timeline.tsx:105— `.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.
No assertions: cycles from $name packages/app/src/providers/models/variant.test.ts:26— 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 Unicode likely subtags to map %p to %p packages/app/src/runtime/i18n/desktop-native.test.ts:52— 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: serializes concurrent embedded initialization for one database path packages/core/test/database-migration.test.ts:128— 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: layer node type contracts compile packages/core/test/effect/layer-node/layer-node-types.test.ts:228— 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: decorates a provided HTTP client packages/http-recorder/test/http.test.ts:19— 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: allows an unused replay layer when the cassette is missing packages/http-recorder/test/http.test.ts:140— 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 compact horizontal flowcharts with shorter routes packages/merman/src/flowchart/flowchart.test.ts:309— 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 compact vertical flowcharts with a readable arrow stem packages/merman/src/flowchart/flowchart.test.ts:325— 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: routes compact vertical sibling subtrees from their true parents packages/merman/src/flowchart/flowchart.test.ts:344— 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: routes vertical sibling subtrees from their true parents packages/merman/src/flowchart/flowchart.test.ts:377— 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 arrowheads for horizontal cycles packages/merman/src/flowchart/flowchart.test.ts:445— 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: folds oversized horizontal activity pipelines into a readable vertical layout packages/merman/src/flowchart/flowchart.test.ts:947— 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: folds oversized horizontal feedback pipelines without losing labeled routes packages/merman/src/flowchart/flowchart.test.ts:1000— 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: detects graph headers and renders a terminal flowchart packages/merman/src/flowchart/flowchart.test.ts:1772— 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 a terminal sequence diagram packages/merman/src/sequence/diagram.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: renders a compact terminal sequence diagram without participant boxes packages/merman/src/sequence/diagram.test.ts:66— 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: keeps structured sequence steps visible in compact mode packages/merman/src/sequence/diagram.test.ts:98— 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 notes and long cross-participant messages in order packages/merman/src/sequence/diagram.test.ts:164— 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 a horizontal state diagram packages/merman/src/state/diagram.test.ts:184— 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 self transitions as loops in vertical diagrams packages/merman/src/state/diagram.test.ts:598— 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: a plugin draws Markdown with a syntax style that the renderer owns and reads a declared layout style packages/tui/test/plugin-native-resources.test.tsx:6— 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: boots on the simulation renderer with the terminal title enabled packages/tui/test/app-lifecycle.test.tsx:223— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — 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: cancels pending endpoint resolution on cleanup packages/tui/test/cli/tui/use-event.test.tsx:273— 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: refreshes agents after agent updates packages/tui/test/cli/tui/data.test.tsx:2109— 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: reconciles active session permissions when the event stream reconnects packages/tui/test/cli/tui/data.test.tsx:2386— 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.
Sync-over-async blocking packages/ai/src/providers/google-vertex-shared.ts:27— `existsSync` in `_tryGetApplicationCredentialsFromWellKnownFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/app/e2e/performance/devex/desktop-startup.ts:89— `spawnSync` in `desktopBenchmarkContext` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/app/e2e/performance/devex/desktop-startup.ts:92— `spawnSync` in `desktopBenchmarkContext` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/app/e2e/performance/devex/desktop-startup.ts:95— `spawnSync` in `desktopBenchmarkContext` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/database/database.ts:89— `existsSync` in `restrictToOwner` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/database/database.ts:89— `closeSync` in `restrictToOwner` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/core/src/database/database.ts:89— `openSync` in `restrictToOwner` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:354— `rmSync` in `launch` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:450— `writeFileSync` in `join` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:476— `existsSync` in `callback to waitFor` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:476— `statSync` in `callback to waitFor` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:533— `writeFileSync` in `metric` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:751— `writeFileSync` in `windowRaiser` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:896— `existsSync` in `identity` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:896— `readFileSync` in `identity` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:896— `statSync` in `identity` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:906— `existsSync` in `warmService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:907— `readFileSync` in `warmService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:923— `existsSync` in `stopService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:924— `readFileSync` in `stopService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/desktop/scripts/bench-startup.ts:932— `rmSync` in `stopService` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/gui-extensions/src/browser/profiling.ts:53— `gunzipSync` in `json` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/gui-extensions/src/browser/profiling.ts:167— `gzipSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/gui-extensions/src/browser/profiling.ts:282— `gzipSync` in `heap` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/plugin/src/source.bun.ts:32— `readFileSync` in `anonymous function` 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.
+ 1 more in this group — see findings.md.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×25
Focus outline removed in CSS without a :focus replacement services/www/src/docs/styles/global.css:1144— `.search-bar input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/overlays/dialog/dialog.css:152— `[data-component="dialog-v2"] [data-slot="dialog-container"] [data-slot="dialog-content"] [data-slot="dialog-body"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/overlays/dialog/dialog.css:156— `[data-component="dialog-v2"] [data-slot="dialog-container"] [data-slot="dialog-content"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/tabs/tabs-current.css:53— `[data-component="tabs-v2"] [data-slot="tabs-v2-trigger"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/tabs/tabs-current.css:63— `[data-component="tabs-v2"] [data-slot="tabs-v2-trigger"]:is(:focus, :focus-visible)` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/tabs/tabs.css:73— `[data-component="tabs"] [data-slot="tabs-trigger-wrapper"] [data-slot="tabs-trigger"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/tabs/tabs.css:67— `[data-component="tabs"] [data-slot="tabs-trigger-wrapper"] [data-slot="tabs-trigger"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/tabs/tabs.css:101— `[data-component="tabs"] [data-slot="tabs-trigger-wrapper"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/tabs/tabs.css:139— `[data-component="tabs"] [data-slot="tabs-content"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/menu/menu.css:30— `[data-component="menu-v2-content"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/menu/menu.css:20— `[data-component="menu-v2-content"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/navigation/menu/menu.css:62— `[data-component="menu-v2-item"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/forms/textarea/textarea.css:55— `[data-component="textarea-v2"] [data-slot="textarea-v2-textarea"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/forms/text-input/text-input.css:95— `[data-component="text-input-v2"] [data-slot="text-input-v2-input"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/forms/switch/switch.css:230— `[data-component="switch"][data-appearance="standard"]:not([data-readonly]) [data-slot="switch-input"]:focus-visible ~ [data-slot="switch-control"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/forms/select/select.css:130— `[data-component="select-v2"] [data-slot="select-v2-value-text"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/forms/select/select.css:194— `[data-component="select-v2"][data-appearance="inline"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/forms/select/select.css:206— `[data-component="select-v2"][data-appearance="inline"]:where([data-expanded]):not([data-disabled], [data-invalid])` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/forms/select/select.css:245— `[data-component="menu-v2-content"][data-slot="select-v2-content"] [data-slot="select-v2-listbox"]:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/forms/select/select.css:241— `[data-component="menu-v2-content"][data-slot="select-v2-content"] [data-slot="select-v2-listbox"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/data-display/accordion/accordion.css:59— `[data-component="accordion"] [data-slot="accordion-item"] [data-slot="accordion-header"] [data-slot="accordion-trigger"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/components/context-menu.css:16— `[data-component="context-menu-content"]:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/components/context-menu.css:44— `[data-component="context-menu-content"] [data-slot="context-menu-item"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/components/context-menu.css:71— `[data-component="context-menu-content"] [data-slot="context-menu-sub-trigger"][data-expanded]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/components/image-preview.css:35— `[data-component="image-preview"] [data-slot="image-preview-container"] [data-slot="image-preview-content"]:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
X2 · Cancellation propagation· Async function without AbortSignal · ×25
Async function without AbortSignal: getAccessToken REDACTED:367— `getAccessToken` 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: getUserPrompt REDACTED:400— `getUserPrompt` 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: subscribeSessionEvents REDACTED:480— `subscribeSessionEvents` 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: revokeAppToken REDACTED:1045— `revokeAppToken` 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: encode packages/app/src/runtime/persistence/drafts.ts:232— `encode` 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: blobDataUrl packages/app/src/runtime/persistence/drafts.ts:553— `blobDataUrl` 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: compileExecutable packages/cli/script/build.ts:228— `compileExecutable` 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: resolveTargetNode packages/cli/script/build-node.ts:178— `resolveTargetNode` 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: execute packages/client/src/promise/generated/client.ts:345— `execute` 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: fetchSvgContent packages/console/app/src/component/header.tsx:27— `fetchSvgContent` 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: login packages/console/app/src/lib/salesforce.ts:3— `login` 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: createLead packages/console/app/src/lib/salesforce.ts:51— `createLead` 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: loadChangelog packages/console/app/src/lib/changelog.ts:41— `loadChangelog` 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: targets packages/desktop/scripts/bench-startup.ts:627— `targets` 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: warmService packages/desktop/scripts/bench-startup.ts:889— `warmService` 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: fetchCatalogPayload packages/stats/app/src/routes/model-catalog.ts:352— `fetchCatalogPayload` 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: fetchLabCatalogPayload packages/stats/app/src/routes/model-catalog.ts:358— `fetchLabCatalogPayload` 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: waitUntilConnected packages/tui/src/mini/stream-v2.transport.ts:524— `waitUntilConnected` awaits `wait(…)` 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: `wait(url, { signal })`.
Async function without AbortSignal: loadThemeFromUrl packages/ui/src/theme/loader.ts:82— `loadThemeFromUrl` 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: publish script/update-artifact.ts:14— `publish` 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: credentials script/update-artifact.ts:95— `credentials` 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: fetchNpmDownloads REDACTED:52— `fetchNpmDownloads` 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: fetchReleases REDACTED:70— `fetchReleases` 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: ensureCleanupLabel script/github/close-prs.ts:274— `ensureCleanupLabel` 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 script/github/close-issues.ts:42— `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 })`.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:88— Token (context gui-extensions) is exposed in ai's public surface via Started.token — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:98— Token (context gui-extensions) is exposed in ai's public surface via PollContext.token — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:117— Token (context gui-extensions) is exposed in ai's public surface via Queued.token — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:118— Token (context gui-extensions) is exposed in ai's public surface via Queued.start — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:126— Token (context gui-extensions) is exposed in ai's public surface via Queued.status — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:133— Token (context gui-extensions) is exposed in ai's public surface via Queued.result — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:140— Token (context gui-extensions) is exposed in ai's public surface via Queued.cancel — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:151— Token (context gui-extensions) is exposed in ai's public surface via media-protocol.queued — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media-protocol.ts:279— Token (context gui-extensions) is exposed in ai's public surface via media-protocol.identity.decodeStarted — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media.ts:106— Token (context gui-extensions) is exposed in ai's public surface via QueuedInput.protocol — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/route/media.ts:172— Token (context gui-extensions) is exposed in ai's public surface via media.queued — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/media-model.ts:77— Token (context gui-extensions) is exposed in ai's public surface via media-model.composeRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/image.ts:36— Token (context gui-extensions) is exposed in ai's public surface via ImageModel.fromRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/image.ts:40— Token (context gui-extensions) is exposed in ai's public surface via ImageModel.fromRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/speech.ts:36— Token (context gui-extensions) is exposed in ai's public surface via SpeechModel.fromRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/speech.ts:40— Token (context gui-extensions) is exposed in ai's public surface via SpeechModel.fromRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/transcription.ts:32— Token (context gui-extensions) is exposed in ai's public surface via TranscriptionModel.fromRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/transcription.ts:36— Token (context gui-extensions) is exposed in ai's public surface via TranscriptionModel.fromRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/video.ts:36— Token (context gui-extensions) is exposed in ai's public surface via VideoModel.fromRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/video.ts:40— Token (context gui-extensions) is exposed in ai's public surface via VideoModel.fromRoute — couples the contexts.
Cross-context type Token (gui-extensions → ai) packages/ai/src/protocols/utils/fal-queue.ts:44— Token (context gui-extensions) is exposed in ai's public surface via fal-queue.protocol — couples the contexts.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×16
Recursive walk over a caller-supplied document has no depth cap packages/app/src/composer/editor/dom.ts:14— `getTextLength` is exported and takes `node: Node` from its caller, and it calls itself at line 14 (`getTextLength`) with a piece of `node` — and nowhere in `getTextLength` 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 `getTextLength` 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/app/src/shell/errors/description.ts:28— `errorStatus` is exported, takes a document from its caller (line 14) and hands it to `visit`, which calls itself at line 28 (`visit`) with a piece of `value` — and nowhere in `visit` 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 `visit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/cli/src/commands/handlers/debug/redact.ts:5— `redactConfig` is exported and takes `value: unknown` from its caller, and it calls itself at line 5 (`redactConfig`) with a piece of `value` (and at line 17) — and nowhere in `redactConfig` 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 `redactConfig` 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/codemode/src/data.ts:113— `fromJson` is exported and takes `value: Json | undefined` from its caller, and it calls itself at line 113 (`fromJson`) with a piece of `value` (and at line 116) — and nowhere in `fromJson` 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 `fromJson` 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/codemode/src/interpreter/errors.ts:51— `normalizeError` is exported and takes `error: unknown` from its caller, and it calls itself at line 51 (`normalizeError`) with a piece of `error` — and nowhere in `normalizeError` 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 `normalizeError` 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/core/src/database/drizzle/internal/drizzle-utils.ts:49— `orderSelectedFields` is exported and takes `fields: Record<string, unknown>` from its caller, and it calls itself at line 49 (`orderSelectedFields`) with a piece of `fields` — and nowhere in `orderSelectedFields` 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 `orderSelectedFields` 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/core/src/instructions/index.ts:244— `hash` is exported, takes a document from its caller (line 194) and hands it to `canonical`, which calls itself at line 244 (`canonical`) with a piece of `value` (and at line 248) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/core/src/session/to-session-error.ts:74— `toSessionError` is exported and takes `cause: unknown` from its caller, and it calls itself at line 74 (`toSessionError`) with a piece of `cause` — and nowhere in `toSessionError` 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 `toSessionError` 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/desktop/src/shared/ipc-transport.ts:15— `omitUndefined` is exported and takes `value: unknown` from its caller, and it calls itself at line 15 (`omitUndefined`) with a piece of `value` (and at line 20) — and nowhere in `omitUndefined` 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 `omitUndefined` 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/http-recorder/src/redaction/secrets.ts:27— `secretFindings` is exported, takes a document from its caller (line 36) and hands it to `stringEntries`, which calls itself at line 27 (`stringEntries`) with a piece of `value` (and at line 29) — and nowhere in `stringEntries` 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 `stringEntries` 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/http-recorder/src/replay/comparison.ts:10— `canonicalizeJson` is exported and takes `value: unknown` from its caller, and it calls itself at line 10 (`canonicalizeJson`) with a piece of `value` (and at line 15) — and nowhere in `canonicalizeJson` 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 `canonicalizeJson` 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/protocol/script/openapi-stabilize.ts:17— `stabilizeOpenApi` is exported, takes a document from its caller (line 3) and hands it to `canonical`, which calls itself at line 17 (`canonical`) with a piece of `node` (and at line 28, line 34) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/protocol/script/openapi-stabilize.ts:47— `stabilizeOpenApi` is exported, takes a document from its caller (line 3) and hands it to `rewrite`, which calls itself at line 47 (`rewrite`) with a piece of `node` (and at line 52) — and nowhere in `rewrite` 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 `rewrite` 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/stats/core/src/domain/stat.ts:268— `isMissingUniqueUsersColumn` is exported, takes a document from its caller (line 151) and hands it to `errorText`, which calls itself at line 268 (`errorText`) with a piece of `cause` (and at line 271) — and nowhere in `errorText` 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 `errorText` 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/stats/core/src/domain/retention.ts:104— `isMissingRetentionTable` is exported, takes a document from its caller (line 98) and hands it to `errorText`, which calls itself at line 104 (`errorText`) with a piece of `cause` (and at line 107) — and nowhere in `errorText` 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 `errorText` 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/tui/src/util/error.ts:7— `cliErrorMessage` is exported and takes `input: unknown` from its caller, and it calls itself at line 7 (`cliErrorMessage`) with a piece of `input` — and nowhere in `cliErrorMessage` 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 `cliErrorMessage` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Focus outline removed inline packages/app/src/composer/editor/editor.tsx:228— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/composer/editor/editor.tsx:1014— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/home/sessions/view.tsx:332— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/new-session/project/selector.tsx:346— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/new-session/workspace/selector.tsx:245— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/providers/connect/dialog.tsx:1403— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/providers/models/select-dialog.tsx:624— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/settings/workspaces/project-row.tsx:130— <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/shell/titlebar/tab-nav.tsx:318— <span> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/app/src/workspaces/submenu.tsx:65— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:997— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/gui-extensions/src/terminal/tab.tsx:154— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/session-ui/src/components/file-search.tsx:30— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline packages/session-ui/src/components/file.tsx:759— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/grouping/session.ts:94— SessionMessageInfo (context client) is exposed in tui's public surface via session.messagePath — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/grouping/session.ts:100— SessionMessageInfo (context client) is exposed in tui's public surface via session.instructionPaths — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/util/session.ts:46— SessionMessageInfo (context client) is exposed in tui's public surface via session.contextUsage — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/util/todo.ts:33— SessionMessageInfo (context client) is exposed in tui's public surface via todo.sessionTodos — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/rows.ts:343— SessionMessageInfo (context client) is exposed in tui's public surface via rows.reduceSessionRows — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/rows.ts:430— SessionMessageInfo (context client) is exposed in tui's public surface via rows.turnDuration — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/rows.ts:442— SessionMessageInfo (context client) is exposed in tui's public surface via rows.turnTokensPerSecond — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/rows.ts:465— SessionMessageInfo (context client) is exposed in tui's public surface via rows.legacyTurns — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/rows.ts:494— SessionMessageInfo (context client) is exposed in tui's public surface via rows.messageBoundaryIDs — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/message-navigation.ts:18— SessionMessageInfo (context client) is exposed in tui's public surface via message-navigation.findMessageBoundary — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/routes/session/activity-summary.ts:22— SessionMessageInfo (context client) is exposed in tui's public surface via activity-summary.summarizeActivity — couples the contexts.
Cross-context type SessionMessageInfo (client → tui) packages/tui/src/mini/session.shared.ts:9— SessionMessageInfo (context client) is exposed in tui's public surface via SessionMessages.SessionMessages — couples the contexts.
Change coupling: api.ts ↔ handlers.ts packages/protocol/src/api.ts:1— `packages/protocol/src/api.ts` and `packages/server/src/handlers.ts` change together 69% of the time (11 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 11 shared commits counted here, the most recent 3 are `d4a6223d` feat(server): add experimental voice session endpoint (#55951); `004b6473` feat(server): add persistent PTY daemon API (#44969); `a02b0a47` fix(core): make workspace destroy idempotent (#44769) — run `git show` on any of them.
Change coupling: devtools-bar.tsx ↔ index.tsx packages/tui/src/component/devtools-bar.tsx:1— `packages/tui/src/component/devtools-bar.tsx` and `packages/tui/src/routes/session/index.tsx` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `474c3588` fix(tui): use unicode ellipses in interface text (#45143); `cb863b8e` fix(tui): dismiss the active interaction with ctrl-c (#45111); `d3eecf7b` feat(tui): compact turn token usage with expandable steps (#41922) — run `git show` on any of them.
Change coupling: message.ts ↔ session.ts packages/server/src/handlers/message.ts:1— `packages/server/src/handlers/message.ts` and `packages/server/src/handlers/session.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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `97d3cd0b` refactor: simplify server client helpers (#43976); `ff499c36` refactor(api): remove watermark sync surface; `bc2e270f` feat(server): durable log reads, changes feed, and watermarked snapsh… — run `git show` on any of them.
Change coupling: opencode.ts ↔ routes.ts packages/sdk/src/opencode.ts:1— `packages/sdk/src/opencode.ts` and `packages/server/src/routes.ts` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `4d0eb97d` feat(sdk): configure session-selected instances (#46496); `bc2251d6` feat(sdk): configure external workspace providers (#42142) (at that commit the file was still `packages/sdk-next/src/opencode.ts`); `9c383581` refactor: centralize client identity (#38148) (at that commit the file was still `packages/sdk-next/src/opencode.ts`) — run `git show` on any of them.
Change coupling: index.tsx ↔ sidebar.tsx packages/tui/src/routes/session/index.tsx:1— `packages/tui/src/routes/session/index.tsx` and `packages/tui/src/routes/session/sidebar.tsx` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `552d2b9c` refactor(tui): drop never-passed component props (#53001); `0bb6cf37` fix(tui): animate automatic session renames (#45957); `b00d8d65` feat(tui): hierarchical slot tree for plugin UI placement (#41189) — run `git show` on any of them.
Change coupling: client.ts ↔ handlers.ts packages/protocol/src/client.ts:1— `packages/protocol/src/client.ts` and `packages/server/src/handlers.ts` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `d4a6223d` feat(server): add experimental voice session endpoint (#55951); `004b6473` feat(server): add persistent PTY daemon API (#44969); `a02b0a47` fix(core): make workspace destroy idempotent (#44769) — run `git show` on any of them.
Change coupling: session.ts ↔ run-coordinator.ts packages/core/src/session.ts:1— `packages/core/src/session.ts` and `packages/core/src/session/run-coordinator.ts` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `34bd7c22` feat(session): report interrupt result (#44766); `e5da5bfa` refactor(session): simplify effect workflows (#43956); `b6966177` refactor(core): simplify interrupt continuation (#42810) — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED packages/desktop/src/main/index.ts:1— `packages/desktop/src/main/index.ts` and `REDACTED` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `5fdfcc7a` perf(desktop): hand the window its persisted stores before the first …; `616aba7b` refactor(desktop): establish typed ipc contract (#43150); `dffecb64` fix(desktop): gate first launch onboarding (#34930) — run `git show` on any of them.
Change coupling: index.tsx ↔ footer.tsx packages/tui/src/component/prompt/index.tsx:1— `packages/tui/src/component/prompt/index.tsx` and `packages/tui/src/feature-plugins/sidebar/footer.tsx` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `a7288d23` feat(tui): add working directory actions (#42624); `b00d8d65` feat(tui): hierarchical slot tree for plugin UI placement (#41189); `0b1ec457` fix(tui): show branch beside directory (#40500) — run `git show` on any of them.
Change coupling: index.tsx ↔ footer.tsx packages/tui/src/component/prompt/index.tsx:1— `packages/tui/src/component/prompt/index.tsx` and `packages/tui/src/feature-plugins/prompt/footer.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `c596a8f1` fix(tui): simplify narrow interrupt footer (#46533); `b00d8d65` feat(tui): hierarchical slot tree for plugin UI placement (#41189); `5d729521` refactor(tui): remove redundant code (#40081) — run `git show` on any of them.
Change coupling: go-models.ts ↔ index.tsx packages/console/app/src/component/go-models.ts:1— `packages/console/app/src/component/go-models.ts` and `packages/console/app/src/routes/go/index.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `7b99646c` docs(go): remove retired Go models (#55761); `3a69bae8` docs(go): remove DeepSeek V4 Flash and V4 Flash Vision Exp (#55332); `65c47af9` feat(console): show Haiku 5.5 across Go pages — run `git show` on any of them.
Change coupling: index.tsx ↔ index.tsx packages/stats/app/src/routes/[lab]/index.tsx:1— `packages/stats/app/src/routes/[lab]/index.tsx` and `packages/stats/app/src/routes/compare/index.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `aa481b8f` fix(stats): fix data page canonicals, 404s, and sitemap coverage (#52…; `b379d71d` fix(stats): update github stars; `0c91e6a6` fix(stats): refine comparison rendering — run `git show` on any of them.
Cross-context type FormField (client → tui) REDACTED:11— FormField (context client) is exposed in tui's public surface via form.isFormAnswerField — couples the contexts.
Cross-context type FormField (client → tui) REDACTED:15— FormField (context client) is exposed in tui's public surface via form.formLabel — couples the contexts.
Cross-context type FormField (client → tui) REDACTED:19— FormField (context client) is exposed in tui's public surface via form.formInitialValues — couples the contexts.
Cross-context type FormField (client → tui) REDACTED:36— FormField (context client) is exposed in tui's public surface via form.formTextual — couples the contexts.
Cross-context type FormField (client → tui) REDACTED:41— FormField (context client) is exposed in tui's public surface via form.formCustom — couples the contexts.
Cross-context type FormField (client → tui) REDACTED:47— FormField (context client) is exposed in tui's public surface via form.formRows — couples the contexts.
Cross-context type FormField (client → tui) REDACTED:63— FormField (context client) is exposed in tui's public surface via form.formSelected — couples the contexts.
Cross-context type FormField (client → tui) packages/tui/src/mini/form.shared.ts:84— FormField (context client) is exposed in tui's public surface via form.shared.formPlaceholder — couples the contexts.
Cross-context type FormField (client → tui) packages/tui/src/mini/form.shared.ts:116— FormField (context client) is exposed in tui's public surface via form.shared.formInput — couples the contexts.
Cross-context type FormField (client → tui) packages/tui/src/mini/form.shared.ts:121— FormField (context client) is exposed in tui's public surface via form.shared.formSetDraft — couples the contexts.
IC1 · Incompleteness & stubs· Both branches are identical · ×9
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:289— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:290— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:292— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:293— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:295— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:296— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:298— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:299— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
Both branches are identical — the condition decides nothing packages/ui/src/theme/resolve.ts:363— 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.
Off the main sequence: @opencode/console-resource — @opencode/console-resource: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: @opencode/theme — @opencode/theme: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: @opencode/schema — @opencode/schema: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 12 project(s), so it's rigid to change.
Off the main sequence: @opencode/codemode — @opencode/codemode: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: @opencode/util — @opencode/util: abstractness 0.11, instability 0.00, distance 0.89 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
Off the main sequence: @opencode/ui — @opencode/ui: abstractness 0.13, instability 0.00, distance 0.87 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: @opencode/stats-core — @opencode/stats-core: abstractness 0.15, instability 0.00, distance 0.85 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: @opencode/protocol — @opencode/protocol: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
MethodTooLong: OpenAIResponsesLanguageModel.doStream packages/core/src/github-copilot/responses/openai-responses-language-model.ts:678— MethodTooLong — doStream runs 423 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 323 over it, 4.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenAIResponsesLanguageModel.doGenerate packages/core/src/github-copilot/responses/openai-responses-language-model.ts:311— MethodTooLong — doGenerate runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.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.
MethodTooLong: OpenAICompatibleChatLanguageModel.doStream packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:305— MethodTooLong — doStream runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RunFooter.constructor packages/tui/src/mini/footer.ts:240— MethodTooLong — constructor runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× 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: TitleShimmerRenderable.renderSelf packages/tui/src/component/title-shimmer.tsx:112— MethodTooLong — renderSelf runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OpenAIResponsesLanguageModel.getArgs packages/core/src/github-copilot/responses/openai-responses-language-model.ts:136— MethodTooLong — getArgs runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× 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: Parser.parseCommand packages/latex/src/parser.ts:201— MethodTooLong — parseCommand runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×6
Heading level jumps from h1 to h3 packages/console/app/src/routes/changelog/index.tsx:152— 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 packages/console/app/src/routes/enterprise/index.tsx:338— 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 packages/console/app/src/routes/go/index.tsx:173— 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 packages/console/app/src/routes/index.tsx:183— 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 packages/console/app/src/routes/zen/index.tsx:150— 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 packages/web/src/components/Lander.astro:96— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Cross-context type FormValue (client → tui) REDACTED:63— FormValue (context client) is exposed in tui's public surface via form.formSelected — couples the contexts.
Cross-context type FormValue (client → tui) REDACTED:72— FormValue (context client) is exposed in tui's public surface via form.formValidateValue — couples the contexts.
Cross-context type FormValue (client → tui) REDACTED:112— FormValue (context client) is exposed in tui's public surface via form.formDisplayValue — couples the contexts.
Cross-context type FormValue (client → tui) REDACTED:120— FormValue (context client) is exposed in tui's public surface via form.formToggleMultiselect — couples the contexts.
Cross-context type FormValue (client → tui) REDACTED:126— FormValue (context client) is exposed in tui's public surface via form.formSetMultiselectCustom — couples the contexts.
Cross-context type FormValue (client → tui) packages/tui/src/mini/form.shared.ts:228— FormValue (context client) is exposed in tui's public surface via form.shared.formDisplay — couples the contexts.
Cross-context type Json (app → core) packages/core/src/instructions/index.ts:45— Json (context app) is exposed in core's public surface via Definition.codec — couples the contexts.
Cross-context type Json (app → core) packages/core/src/instructions/index.ts:65— Json (context app) is exposed in core's public surface via Admission.blobs — couples the contexts.
Cross-context type Json (app → core) packages/core/src/instructions/index.ts:161— Json (context app) is exposed in core's public surface via index.renderInitial — couples the contexts.
Cross-context type Json (app → core) packages/core/src/instructions/index.ts:171— Json (context app) is exposed in core's public surface via index.renderUpdate — couples the contexts.
Cross-context type Json (app → core) packages/core/src/instructions/index.ts:194— Json (context app) is exposed in core's public surface via index.hash — couples the contexts.
Cross-context type Json (app → core) packages/core/src/provider.ts:231— Json (context app) is exposed in core's public surface via provider.mergeOverlay — couples the contexts.
Cross-context type ConnectionInfo (client → plugin) packages/plugin/src/effect/integration.ts:105— ConnectionInfo (context client) is exposed in plugin's public surface via IntegrationDomain.connection — couples the contexts.
Cross-context type ConnectionInfo (client → plugin) packages/plugin/src/effect/provider.ts:12— ConnectionInfo (context client) is exposed in plugin's public surface via ProviderRecord.sourceConnection — couples the contexts.
Cross-context type ConnectionInfo (client → plugin) packages/plugin/src/effect/provider.ts:19— ConnectionInfo (context client) is exposed in plugin's public surface via ProviderEditor.add — couples the contexts.
Cross-context type ConnectionInfo (client → plugin) packages/plugin/src/promise/integration.ts:97— ConnectionInfo (context client) is exposed in plugin's public surface via IntegrationDomain.connection — couples the contexts.
Cross-context type ConnectionInfo (client → plugin) packages/plugin/src/promise/provider.ts:12— ConnectionInfo (context client) is exposed in plugin's public surface via ProviderRecord.sourceConnection — couples the contexts.
Cross-context type ConnectionInfo (client → plugin) packages/plugin/src/promise/provider.ts:19— ConnectionInfo (context client) is exposed in plugin's public surface via ProviderEditor.add — couples the contexts.
Hollow method — returns a constant without doing the work packages/tui/src/mini/tool.ts:725— `scrollWriteStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/tui/src/mini/tool.ts:729— `scrollEditStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/tui/src/mini/tool.ts:733— `scrollPatchStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/tui/src/mini/tool.ts:781— `scrollTaskStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/tui/src/mini/tool.ts:817— `scrollTodoStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work packages/tui/src/mini/tool.ts:821— `scrollQuestionStart` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×6
Untrusted text written into markup unescaped packages/gui-extensions/src/file/drag.ts:14— `(icon as SVGElement).outerHTML+(text as HTMLSpanElement).outerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped packages/session-ui/src/components/markdown-solid.tsx:68— `html` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped packages/session-ui/src/components/markdown.tsx:279— `svg` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped packages/session-ui/src/components/markdown.tsx:917— `block.html` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped packages/tui/src/component/prompt/index.tsx:170— `ranges.join("\n")` 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 services/changelog/src/markdown.ts:96— `escape(href)` 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.
D23 · Boundary Type-Coupling· Cross-context type Region (ai → app) · ×5
Cross-context type Region (ai → app) packages/app/src/runtime/extension/panels.tsx:256— Region (context ai) is exposed in app's public surface via panels.RegionContent — couples the contexts.
Cross-context type Region (ai → app) packages/app/src/runtime/extension/host-apis.tsx:851— Region (context ai) is exposed in app's public surface via host-apis.createExtensionAttachment.region — couples the contexts.
Cross-context type Region (ai → app) packages/app/src/runtime/extension/mobile.tsx:58— Region (context ai) is exposed in app's public surface via mobile.MobileViewTabs — couples the contexts.
Cross-context type Region (ai → app) packages/app/src/runtime/extension/side-region.tsx:38— Region (context ai) is exposed in app's public surface via side-region.SideRegion — couples the contexts.
Cross-context type Region (ai → app) packages/app/src/session/composer/region.tsx:37— Region (context ai) is exposed in app's public surface via region.createActiveSessionRegion — couples the contexts.
Cross-context type IconName (ui → gui-extensions) packages/gui-extensions/src/sdk/host-apis.ts:477— IconName (context ui) is exposed in gui-extensions's public surface via ComposerNote.icon — couples the contexts.
Cross-context type IconName (ui → gui-extensions) packages/gui-extensions/src/sdk/registries.ts:81— IconName (context ui) is exposed in gui-extensions's public surface via SessionPanelMenuItem.icon — couples the contexts.
Cross-context type IconName (ui → gui-extensions) packages/gui-extensions/src/sdk/registries.ts:212— IconName (context ui) is exposed in gui-extensions's public surface via MobileView.icon — couples the contexts.
Cross-context type IconName (ui → gui-extensions) packages/gui-extensions/src/sdk/registries.ts:343— IconName (context ui) is exposed in gui-extensions's public surface via SettingsPage.icon — couples the contexts.
Cross-context type IconName (ui → gui-extensions) packages/gui-extensions/src/sdk/registries.ts:536— IconName (context ui) is exposed in gui-extensions's public surface via TitlebarItem.icon — couples the contexts.
Cross-context type SessionMessageInfo (client → app) packages/app/src/session/session-domain.ts:3— SessionMessageInfo (context client) is exposed in app's public surface via session-domain.selectSessionUserMessages — couples the contexts.
Cross-context type SessionMessageInfo (client → app) packages/app/src/session/timeline/model.ts:80— SessionMessageInfo (context client) is exposed in app's public surface via model.enrichLeadingTurn — couples the contexts.
Cross-context type SessionMessageInfo (client → app) packages/app/src/session/requests/background.ts:8— SessionMessageInfo (context client) is exposed in app's public surface via background.createSessionBackground — couples the contexts.
Cross-context type SessionMessageInfo (client → app) packages/app/src/session/timeline/controller-projection.ts:6— SessionMessageInfo (context client) is exposed in app's public surface via controller-projection.applyTimelineMessageHandoff — couples the contexts.
Cross-context type SessionMessageInfo (client → app) packages/app/src/session/timeline/controller-projection.ts:65— SessionMessageInfo (context client) is exposed in app's public surface via controller-projection.visibleTimelineMessages — couples the contexts.
D23 · Boundary Type-Coupling· Cross-context type Tag (util → desktop) · ×4
Cross-context type Tag (util → desktop) packages/desktop/src/renderer/ipc-client.ts:78— Tag (context util) is exposed in desktop's public surface via ipc-client.invoke — couples the contexts.
Cross-context type Tag (util → desktop) packages/desktop/src/renderer/ipc-client.ts:83— Tag (context util) is exposed in desktop's public surface via ipc-client.send — couples the contexts.
Cross-context type Tag (util → desktop) packages/desktop/src/renderer/ipc-client.ts:88— Tag (context util) is exposed in desktop's public surface via ipc-client.cancellable — couples the contexts.
Cross-context type Tag (util → desktop) packages/desktop/src/renderer/ipc-client.ts:97— Tag (context util) is exposed in desktop's public surface via ipc-client.listen — couples the contexts.
ClassTooLong: Frame packages/codemode/src/interpreter/interpreter.ts:379— ClassTooLong — 1398 significant lines (blank, comment-only and punctuation-only lines excluded), 85 methods. The bar is 400 significant lines; this is 998 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: OpenAIResponsesLanguageModel packages/core/src/github-copilot/responses/openai-responses-language-model.ts:115— ClassTooLong — 818 significant lines (blank, comment-only and punctuation-only lines excluded), 4 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: RunFooter packages/tui/src/mini/footer.ts:164— ClassTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 306 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OpenAICompatibleChatLanguageModel packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:53— ClassTooLong — 435 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 35 over it, 1.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.
Fake-async — async method never awaits packages/cli/src/run/run.ts:226— `renderTool` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits packages/cli/src/run/run.ts:242— `renderToolError` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits packages/session-ui/src/components/markdown.worker.ts:65— `runProject` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits packages/session-ui/src/components/markdown.worker.ts:80— `highlight` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Weak hash algorithm packages/core/script/snapshot-parity.ts:626— 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 packages/core/script/snapshot-parity.ts:694— 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 packages/core/src/mcp/index.ts:208— 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 packages/util/src/hash.ts:5— 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.
Swallowed exception (caught, then discarded) REDACTED:70— `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) packages/app/src/runtime/i18n/language.tsx:216— `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) packages/app/src/runtime/persistence/base64.ts:8— `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) packages/cli/script/postinstall.mjs:66— `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.
AC2 · Forms & labels· <TextInput> field component without a label · ×3
<TextInput> field component without a label packages/app/src/providers/connect/dialog.tsx:313— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<TextInput> field component without a label packages/app/src/shell/commands/dialog.tsx:147— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<TextInput> field component without a label packages/app/src/workspaces/selection/dialog.tsx:336— This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×3
Modal dialog does not manage focus packages/stats/app/src/component/model-compare-detail.tsx:543— 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 packages/stats/app/src/routes/compare/index.tsx:332— 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 packages/stats/app/src/routes/stats-shell.tsx:435— 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.
chromium.createBrowserPage::execute (cyclomatic 84) packages/gui-extensions/src/browser/chromium.ts:687— chromium.createBrowserPage::execute 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: 3 other methods here (chromium.createBrowserPage, chromium.createBrowserPage::inspect, chromium.createBrowserPage::snapshot::walk) 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.
chromium.createBrowserPage::snapshot::walk (cyclomatic 23) packages/gui-extensions/src/browser/chromium.ts:1467— chromium.createBrowserPage::snapshot::walk 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 (chromium.createBrowserPage, chromium.createBrowserPage::execute, chromium.createBrowserPage::inspect) 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.
chromium.createBrowserPage::inspect (cyclomatic 20) packages/gui-extensions/src/browser/chromium.ts:1095— chromium.createBrowserPage::inspect 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: 3 other methods here (chromium.createBrowserPage, chromium.createBrowserPage::execute, chromium.createBrowserPage::snapshot::walk) 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.
D10 · Test Quality· Fixed-sleep synchronisation · ×3
Fixed-sleep synchronisation: accepts a surviving contender after a failure without recruiting replacements packages/client/test/service.test.ts:387— This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(450)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: accepts a surviving contender after a failure without recruiting replacements packages/client/test/promise-service.test.ts:161— This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(450)` — 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: teardown during a pending start resolves only after the started process exited packages/gui-extensions/src/wsl/servers.test.ts:7— This test starts work it did not wait for (`controller`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(1)` — 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.
Deprecated: @ai-sdk/vercel packages/core/package.json:104— @ai-sdk/vercel 2.0.39, declared in packages/core/package.json, is marked deprecated by its publisher: "The v0 Model API has been removed, and @ai-sdk/vercel no longer works. Use the v0 API instead: https://v0.app/docs/api". Replace it with the package or version that message names, or record why this one must stay.
Deprecated: @opentelemetry/sdk-trace-base packages/util/package.json:54— @opentelemetry/sdk-trace-base 2.8.0, declared in packages/util/package.json, is marked deprecated by its publisher: "Use @opentelemetry/sdk-trace package". Replace it with the package or version that message names, or record why this one must stay.
Deprecated: @opentelemetry/sdk-trace-node packages/util/package.json:55— @opentelemetry/sdk-trace-node 2.8.0, declared in packages/util/package.json, is marked deprecated by its publisher: "Use @opentelemetry/sdk-trace package". Replace it with the package or version that message names, or record why this one must stay.
chromium.createBrowserPage::execute (cognitive 87) packages/gui-extensions/src/browser/chromium.ts:687— chromium.createBrowserPage::execute has cognitive complexity 87 (threshold 15). Drivers by points: if/else 22 (48 pts), ternaries 9 (20 pts), loops 4 (10 pts), boolean chains 8, match/switch 1 (nesting depth added 43). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 3 other methods here (chromium.createBrowserPage, chromium.createBrowserPage::inspect, chromium.createBrowserPage::snapshot::walk) 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.
chromium.createBrowserPage::inspect (cognitive 29) packages/gui-extensions/src/browser/chromium.ts:1095— chromium.createBrowserPage::inspect has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 12 (22 pts), if/else 4, 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. This shape REPEATS in the file: 3 other methods here (chromium.createBrowserPage, chromium.createBrowserPage::execute, chromium.createBrowserPage::snapshot::walk) 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.
chromium.createBrowserPage::snapshot::walk (cognitive 25) packages/gui-extensions/src/browser/chromium.ts:1467— chromium.createBrowserPage::snapshot::walk has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 7, if/else 5 (7 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (chromium.createBrowserPage, chromium.createBrowserPage::execute, chromium.createBrowserPage::inspect) 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 SessionStatus (client → session-ui) packages/session-ui/src/timeline/projection.ts:130— SessionStatus (context client) is exposed in session-ui's public surface via projection.createReactiveTimelineProjection — couples the contexts.
Cross-context type SessionStatus (client → session-ui) packages/session-ui/src/components/session-retry.tsx:10— SessionStatus (context client) is exposed in session-ui's public surface via session-retry.SessionRetry — couples the contexts.
Cross-context type SessionStatus (client → session-ui) packages/session-ui/src/timeline/session-timeline-row.tsx:63— SessionStatus (context client) is exposed in session-ui's public surface via session-timeline-row.createSessionTimelineRowRenderer — couples the contexts.
D23 · Boundary Type-Coupling· Cross-context type Any (app → gui-extensions) · ×3
Cross-context type Any (app → gui-extensions) packages/gui-extensions/src/sdk/host-apis.ts:703— Any (context app) is exposed in gui-extensions's public surface via Layout.side — couples the contexts.
Cross-context type Any (app → gui-extensions) packages/gui-extensions/src/sdk/host-apis.ts:726— Any (context app) is exposed in gui-extensions's public surface via Layout.dock — couples the contexts.
Cross-context type Any (app → gui-extensions) packages/gui-extensions/src/sdk/host-apis.ts:741— Any (context app) is exposed in gui-extensions's public surface via Layout.scroll — couples the contexts.
Cross-context type Policy (cli → gui-extensions) packages/gui-extensions/src/browser/policy.ts:47— Policy (context cli) is exposed in gui-extensions's public surface via policy.allowedDestination — couples the contexts.
Cross-context type Policy (cli → gui-extensions) packages/gui-extensions/src/browser/policy.ts:51— Policy (context cli) is exposed in gui-extensions's public surface via policy.normalizeURL — couples the contexts.
Cross-context type Policy (cli → gui-extensions) packages/gui-extensions/src/browser/policy.ts:74— Policy (context cli) is exposed in gui-extensions's public surface via policy.refusal — couples the contexts.
Cross-context type PermissionReply (client → tui) packages/tui/src/mini/demo.ts:1025— PermissionReply (context client) is exposed in tui's public surface via demo.createRunDemo.permission — couples the contexts.
Cross-context type PermissionReply (client → tui) packages/tui/src/mini/permission.shared.ts:169— PermissionReply (context client) is exposed in tui's public surface via permission.shared.permissionReject — couples the contexts.
Cross-context type PermissionReply (client → tui) packages/tui/src/mini/footer.permission.tsx:143— PermissionReply (context client) is exposed in tui's public surface via footer.permission.RunPermissionBody — couples the contexts.
R4 · Test Coverage· This test file cannot be loaded · ×3
This test file cannot be loaded packages/app/e2e/performance/composer-history/vite.config.ts:7— packages/app/e2e/performance/composer-history/vite.config.ts:7 imports '../../../public', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded packages/app/e2e/performance/patch-groups/vite.config.ts:10— packages/app/e2e/performance/patch-groups/vite.config.ts:10 imports '../../../public', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded packages/desktop/scripts/picker.test.ts:25— packages/desktop/scripts/picker.test.ts:25 imports './fixtures/picker', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
AC1 · Text alternatives· <canvas> without a text alternative · ×2
<canvas> without a text alternative packages/app/src/providers/connect/go-upsell-hero.tsx:10— 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 packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:1028— 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.
AC1 · Text alternatives· <video> without a captions track · ×2
<video> without a captions track packages/console/app/src/routes/changelog/index.tsx:57— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track packages/gui-extensions/src/file/artifact-view.tsx:600— 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).
noninteractive.runNonInteractivePrompt::consume (cyclomatic 89) packages/cli/src/run/noninteractive.ts:209— noninteractive.runNonInteractivePrompt::consume has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent 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 (noninteractive.runNonInteractivePrompt, noninteractive.runNonInteractivePrompt::reconcile) 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.
noninteractive.runNonInteractivePrompt::reconcile (cyclomatic 24) packages/cli/src/run/noninteractive.ts:566— noninteractive.runNonInteractivePrompt::reconcile has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (noninteractive.runNonInteractivePrompt, noninteractive.runNonInteractivePrompt::consume) 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.
line-comment.LineCommentEditor (cyclomatic 37) packages/session-ui/src/components/line-comment.tsx:175— line-comment.LineCommentEditor has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 2 of the 37 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 326, currentMention, selectMention, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
line-comment.LineCommentEditor (cyclomatic 37) packages/ui/src/data-display/line-comment/line-comment.tsx:92— line-comment.LineCommentEditor has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 2 of the 37 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 240, currentMention, selectMention, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
spreadsheet.SpreadsheetGrid::paint (cyclomatic 27) packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:353— spreadsheet.SpreadsheetGrid::paint 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 (spreadsheet.SpreadsheetGrid::key) 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.
spreadsheet.SpreadsheetGrid::key (cyclomatic 21) packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:900— spreadsheet.SpreadsheetGrid::key has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (spreadsheet.SpreadsheetGrid::paint) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Skipped test: direct footer recreates the frame across command panel transitions packages/tui/test/mini/footer.view.test.tsx:1588— Skipped — switched off by test.skip
Skipped test: direct footer dispatches leader variant binding only when leader is registered packages/tui/test/mini/footer.view.test.tsx:1612— Skipped — switched off by test.skip
noninteractive.runNonInteractivePrompt::consume (cognitive 157) packages/cli/src/run/noninteractive.ts:209— noninteractive.runNonInteractivePrompt::consume has cognitive complexity 157 (threshold 15). Drivers by points: if/else 49 (123 pts), boolean chains 25, ternaries 3 (8 pts), loops 1 (nesting depth added 79). To reduce it, split the body into named stages: move each independent 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 (noninteractive.runNonInteractivePrompt, noninteractive.runNonInteractivePrompt::reconcile) 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.
noninteractive.runNonInteractivePrompt::reconcile (cognitive 48) packages/cli/src/run/noninteractive.ts:566— noninteractive.runNonInteractivePrompt::reconcile has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (37 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (3 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. This shape REPEATS in the file: 2 other methods here (noninteractive.runNonInteractivePrompt, noninteractive.runNonInteractivePrompt::consume) 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.
extensions.extensionGlobals::fromHost (cognitive 63) packages/codemode/src/interpreter/extensions.ts:76— extensions.extensionGlobals::fromHost has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (41 pts), loops 4 (12 pts), ternaries 2 (7 pts), boolean chains 3 (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. This shape REPEATS in the file: one other method here (extensions.extensionGlobals::toHost) 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.
extensions.extensionGlobals::toHost (cognitive 19) packages/codemode/src/interpreter/extensions.ts:42— extensions.extensionGlobals::toHost has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 pts), boolean chains 2, 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. This shape REPEATS in the file: one other method here (extensions.extensionGlobals::fromHost) 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.
line-comment.LineCommentEditor (cognitive 37) packages/session-ui/src/components/line-comment.tsx:175— line-comment.LineCommentEditor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 8, ternaries 3 (nesting depth added 5). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 326, currentMention, selectMention, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
line-comment.LineCommentEditor (cognitive 37) packages/ui/src/data-display/line-comment/line-comment.tsx:92— line-comment.LineCommentEditor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 9, ternaries 3 (nesting depth added 5). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 240, currentMention, selectMention, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
partial-json._parseJSON::parseAny (cognitive 22) packages/ai/src/protocols/utils/partial-json.ts:115— partial-json._parseJSON::parseAny has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 10. 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. This shape REPEATS in the file: one other method here (partial-json._parseJSON::parseNum) 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.
partial-json._parseJSON::parseNum (cognitive 22) packages/ai/src/protocols/utils/partial-json.ts:244— partial-json._parseJSON::parseNum has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 4 (9 pts), boolean chains 2, loops 1 (nesting depth added 9). 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. This shape REPEATS in the file: one other method here (partial-json._parseJSON::parseAny) 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.
Cross-context type StoreFrom (gui-extensions → app) packages/app/src/runtime/extension/stores.ts:29— StoreFrom (context gui-extensions) is exposed in app's public surface via stores.globalStoreTarget — couples the contexts.
Cross-context type StoreFrom (gui-extensions → app) packages/app/src/runtime/extension/stores.ts:37— StoreFrom (context gui-extensions) is exposed in app's public surface via stores.storeImports — couples the contexts.
Cross-context type SessionMessageInfo (client → session-ui) packages/session-ui/src/timeline/detail.ts:111— SessionMessageInfo (context client) is exposed in session-ui's public surface via detail.timelineNoticeRequired — couples the contexts.
Cross-context type SessionMessageInfo (client → session-ui) packages/session-ui/src/timeline/projection.ts:130— SessionMessageInfo (context client) is exposed in session-ui's public surface via projection.createReactiveTimelineProjection — couples the contexts.
D23 · Boundary Type-Coupling· Cross-context type Any (app → cli) · ×2
Cross-context type Any (app → cli) packages/cli/src/framework/spec.ts:18— Any (context app) is exposed in cli's public surface via Node.aliases — couples the contexts.
Cross-context type Any (app → cli) packages/cli/src/framework/runtime.ts:84— Any (context app) is exposed in cli's public surface via runtime.run — couples the contexts.
Cross-context type ConnectMethod (app → cli) packages/cli/src/commands/handlers/auth/shared.ts:54— ConnectMethod (context app) is exposed in cli's public surface via shared.resolveMethod — couples the contexts.
Cross-context type ConnectMethod (app → cli) packages/cli/src/commands/handlers/auth/login.ts:170— ConnectMethod (context app) is exposed in cli's public surface via login.oauthLogin — couples the contexts.
Cross-context type Json (app → codemode) packages/codemode/src/interpreter/interpreter.ts:364— Json (context app) is exposed in codemode's public surface via Interpreter.tool — couples the contexts.
Cross-context type Json (app → codemode) packages/codemode/src/data.ts:108— Json (context app) is exposed in codemode's public surface via data.fromJson — couples the contexts.
D23 · Boundary Type-Coupling· Cross-context type Field (schema → core) · ×2
Cross-context type Field (schema → core) REDACTED:235— Field (context schema) is exposed in core's public surface via form.validateAnswer — couples the contexts.
Cross-context type Field (schema → core) REDACTED:276— Field (context schema) is exposed in core's public surface via form.validateFields — couples the contexts.
TooManyMethods: Frame packages/codemode/src/interpreter/interpreter.ts:379— TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RunFooter packages/tui/src/mini/footer.ts:164— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×2
Change-coupling hub: types.ts → REDACTED, ipc.ts, REDACTED, index.tsx packages/desktop/src/preload/types.ts— `packages/desktop/src/preload/types.ts` changes together with 4 other files — `packages/desktop/src/main/index.ts`, `packages/desktop/src/main/ipc.ts`, `REDACTED`, `packages/desktop/src/renderer/index.tsx` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 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 4.
Change-coupling hub: [model].tsx → model-compare-detail.tsx, index.tsx, index.tsx packages/stats/app/src/routes/[lab]/[model].tsx— `packages/stats/app/src/routes/[lab]/[model].tsx` changes together with 3 other files — `packages/stats/app/src/component/model-compare-detail.tsx`, `packages/stats/app/src/routes/[lab]/index.tsx`, `packages/stats/app/src/routes/compare/index.tsx` — 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.
Duplication concentrated across 6 sibling directories (8 clone groups) packages/app/src/settings/appearance/appearance.tsx:35— 8 duplicated blocks under packages/app/src/settings/ have copies in at least two of the sibling directories appearance, experimental, general, notifications, providers, workspaces — 6 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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 6 sibling directories (8 clone groups) packages/cli/src/commands/handlers/auth/export.ts:21— 8 duplicated blocks under packages/cli/src/commands/handlers/ have copies in at least two of the sibling directories auth, debug, mcp, plugin, service, session — 7 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 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.
Duplicated block (52 lines × 2 locations) packages/ai/src/providers/google-vertex-chat.ts:34— packages/ai/src/providers/google-vertex-chat.ts:34 · packages/ai/src/providers/google-vertex-responses.ts:35 — 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 (52 lines × 2 locations) packages/ai/src/providers/google-vertex-messages.ts:64— packages/ai/src/providers/google-vertex-messages.ts:64 · packages/ai/src/providers/google-vertex-mistral.ts:50 — 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.
Dead file (~170 LoC) packages/console/app/src/component/limits-graph.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~170 LoC) packages/stats/app/src/routes/compare-cards.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 6 in-repo import(s) from 6 other file(s) do name it (packages/stats/app/src/component/model-compare-detail.tsx, packages/stats/app/src/routes/[lab]/[model].tsx, packages/stats/app/src/routes/[lab]/index.tsx and 3 more) — 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
AC2 · Forms & labels· <TextField> field component without a label · ×1
<TextField> field component without a label packages/ui/src/components/list.tsx:314— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure· More than one main landmark · ×1
More than one main landmark services/www/src/docs/layouts/DocsLayout.astro:26— A document must expose only one main landmark. Multiple visible <main> (or role="main") elements confuse the landmark map and the "skip to content" target. Keep one; remove or hide the rest.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark services/www/src/pages/index.astro:7— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×1
Animation without a prefers-reduced-motion guard packages/ui/src/components/spinner.tsx:35— <rect> moves — its inline style sets `animation: square.corner` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — your oxlint config does not list the `jsx-a11y` plugin (its a11y rules are off until it does) and there's no axe/pa11y/Lighthouse in tests or CI. Start by enabling that plugin to catch issues at author time. What was searched, so you can tell an absence from a miss: the 390 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.
C1 · Data Protection· No data-protection/encryption · ×1
No data-protection/encryption packages/core/src/account/sql.ts:7— No encryption usage (node:crypto createCipheriv, Web Crypto subtle.encrypt, crypto-js AES, tweetnacl/libsodium secretbox, a column-encryption layer such as typeorm-encrypted, prisma-field-encryption or mongoose-field-encryption, or MongoDB client-side field-level encryption) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
scan.scanPowerShellList (cyclomatic 375) packages/core/src/shell/scan.ts:1740— scan.scanPowerShellList has cyclomatic complexity 375 (threshold 15). Of this number, 348 points are the body's own statements and 27 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.Session (cyclomatic 260) packages/tui/src/routes/session/index.tsx:148— index.Session has cyclomatic complexity 260 (threshold 15). Most of this is not in the body itself: 15 of the 260 points are its own statements and the rest belongs to 87 function items inside it that branch (a function literal at line 644, saveScrollAnchor, a function literal at line 620, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
resolve.resolveThemeVariant (cyclomatic 189) packages/ui/src/theme/resolve.ts:4— resolve.resolveThemeVariant has cyclomatic complexity 189 (threshold 15). Of this number, 176 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
footer.view.RunFooterView (cyclomatic 181) packages/tui/src/mini/footer.view.tsx:129— footer.view.RunFooterView has cyclomatic complexity 181 (threshold 15). Most of this is not in the body itself: 7 of the 181 points are its own statements and the rest belongs to 63 function items inside it that branch (a function literal at line 400, a function literal at line 479, a function literal at line 734, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
footer.form.RunFormBody (cyclomatic 168) packages/tui/src/mini/footer.form.tsx:39— footer.form.RunFormBody has cyclomatic complexity 168 (threshold 15). Of this number, 49 points are the body's own statements and 119 belong to 30 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.
runtime.runInteractiveRuntime (cyclomatic 161) packages/tui/src/mini/runtime.ts:193— runtime.runInteractiveRuntime has cyclomatic complexity 161 (threshold 15). Most of this is not in the body itself: 9 of the 161 points are its own statements and the rest belongs to 50 function items inside it that branch (a function literal at line 463, rememberLocal, loadCurrentModel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
panel.SessionBrowserPane (cyclomatic 154) packages/gui-extensions/src/browser/panel.tsx:67— panel.SessionBrowserPane has cyclomatic complexity 154 (threshold 15). Of this number, 33 points are the body's own statements and 121 belong to 58 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-markdown.convertHTMLToMarkdown (cyclomatic 141) packages/core/src/tool/html-markdown.ts:53— html-markdown.convertHTMLToMarkdown 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. This shape REPEATS in the file: one other method here (html-markdown.convertHTMLToMarkdown::finishCode) 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.
session-tabs.VerticalSessionTabs (cyclomatic 139) packages/tui/src/component/session-tabs.tsx:542— session-tabs.VerticalSessionTabs has cyclomatic complexity 139 (threshold 15). Of this number, 25 points are the body's own statements and 114 belong to 40 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.
dialog-select.DialogSelect (cyclomatic 136) packages/tui/src/ui/dialog-select.tsx:138— dialog-select.DialogSelect has cyclomatic complexity 136 (threshold 15). Most of this is not in the body itself: 10 of the 136 points are its own statements and the rest belongs to 42 function items inside it that branch (a function literal at line 292, scrollToSelection, a function literal at line 357, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog.ProviderConnection (cyclomatic 130) packages/app/src/providers/connect/dialog.tsx:406— dialog.ProviderConnection has cyclomatic complexity 130 (threshold 15). Most of this is not in the body itself: 13 of the 130 points are its own statements and the rest belongs to 52 function items inside it that branch (goBack, a function literal at line 485, prepareConsoleCatalog, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
autocomplete.Autocomplete (cyclomatic 125) packages/tui/src/component/prompt/autocomplete.tsx:59— autocomplete.Autocomplete has cyclomatic complexity 125 (threshold 15). Most of this is not in the body itself: 2 of the 125 points are its own statements and the rest belongs to 40 function items inside it that branch (a function literal at line 762, a function literal at line 520, a function literal at line 888, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
diff-viewer.DiffViewerContent (cyclomatic 121) packages/tui/src/feature-plugins/system/diff-viewer.tsx:306— diff-viewer.DiffViewerContent has cyclomatic complexity 121 (threshold 15). Of this number, 29 points are the body's own statements and 92 belong to 43 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.
terminal.Terminal (cyclomatic 119) packages/gui-extensions/src/terminal/terminal.tsx:183— terminal.Terminal has cyclomatic complexity 119 (threshold 15). Most of this is not in the body itself: 12 of the 119 points are its own statements and the rest belongs to 32 function items inside it that branch (a function literal at line 428, a function literal at line 676, getTerminalColors, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stream-v2.transport.createSessionTransport.apply (cyclomatic 119) packages/tui/src/mini/stream-v2.transport.ts:1025— stream-v2.transport.createSessionTransport.apply has cyclomatic complexity 119 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
data.createData::handleEvent (cyclomatic 118) packages/client/src/solid/data.ts:632— data.createData::handleEvent has cyclomatic complexity 118 (threshold 15). To reduce it, separate the cases: extract each independent 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 (data.createData) 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.
app.App (cyclomatic 116) packages/tui/src/app.tsx:489— app.App has cyclomatic complexity 116 (threshold 15). Most of this is not in the body itself: 7 of the 116 points are its own statements and the rest belongs to 43 function items inside it that branch (a function literal at line 727, a function literal at line 748, a function literal at line 634, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-tabs.HorizontalSessionTabs (cyclomatic 111) packages/tui/src/component/session-tabs.tsx:1286— session-tabs.HorizontalSessionTabs has cyclomatic complexity 111 (threshold 15). Most of this is not in the body itself: 4 of the 111 points are its own statements and the rest belongs to 37 function items inside it that branch (a function literal at line 1404, a function literal at line 1561, holdCloseCell, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
titlebar.Titlebar (cyclomatic 100) packages/app/src/shell/titlebar/titlebar.tsx:57— titlebar.Titlebar has cyclomatic complexity 100 (threshold 15). Most of this is not in the body itself: 11 of the 100 points are its own statements and the rest belongs to 38 function items inside it that branch (a function literal at line 278, a function literal at line 326, a function literal at line 181, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
scan.scanBash (cyclomatic 95) packages/core/src/shell/scan.ts:430— scan.scanBash 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.
bus.configured (cyclomatic 94) packages/core/src/bus.ts:187— bus.configured has cyclomatic complexity 94 (threshold 15). Most of this is not in the body itself: 1 of the 94 points is its own statement and the rest belongs to 25 function literals inside it that branch (lines 325, 217, 587, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
screen.SessionScreenContent (cyclomatic 86) packages/app/src/session/screen.tsx:58— screen.SessionScreenContent has cyclomatic complexity 86 (threshold 15). Of this number, 29 points are the body's own statements and 57 belong to 22 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.
dialog-open.DialogOpen (cyclomatic 86) packages/tui/src/component/dialog-open.tsx:38— dialog-open.DialogOpen has cyclomatic complexity 86 (threshold 15). Of this number, 27 points are the body's own statements and 59 belong to 31 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.
scan.scanBashKeyword (cyclomatic 85) packages/core/src/shell/scan.ts:858— scan.scanBashKeyword has cyclomatic complexity 85 (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.
message-timeline.MessageTimelineView (cyclomatic 84) packages/app/src/session/timeline/message-timeline.tsx:119— message-timeline.MessageTimelineView has cyclomatic complexity 84 (threshold 15). Most of this is not in the body itself: 4 of the 84 points are its own statements and the rest belongs to 21 function items inside it that branch (a function literal at line 186, a function literal at line 339, a function literal at line 370, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
step.make.attempt (cyclomatic 83) packages/core/src/session/runner/step.ts:73— step.make.attempt has cyclomatic complexity 83 (threshold 15). Most of this is not in the body itself: 1 of the 83 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 142, a function literal at line 109, executeTool). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-workspaces.DialogWorkspaces (cyclomatic 81) packages/tui/src/component/dialog-workspaces.tsx:39— dialog-workspaces.DialogWorkspaces has cyclomatic complexity 81 (threshold 15). Most of this is not in the body itself: 13 of the 81 points are its own statements and the rest belongs to 24 function items inside it that branch (remove, a function literal at line 167, a function literal at line 132, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
v1-migration.bun.transformSession (cyclomatic 80) packages/core/src/database/v1-migration.bun.ts:227— v1-migration.bun.transformSession has cyclomatic complexity 80 (threshold 15). Most of this is not in the body itself: 6 of the 80 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 279, 244, 387, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
updater.make (cyclomatic 79) packages/cli/src/services/updater.ts:139— updater.make has cyclomatic complexity 79 (threshold 15). Most of this is not in the body itself: 2 of the 79 points are its own statements and the rest belongs to 26 function items inside it that branch (a function literal at line 425, a function literal at line 275, a function literal at line 199, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
bar.DebugBar (cyclomatic 76) packages/gui-extensions/src/debug/bar.tsx:194— bar.DebugBar has cyclomatic complexity 76 (threshold 15). Most of this is not in the body itself: 9 of the 76 points are its own statements and the rest belongs to 32 function items inside it that branch (a function literal at line 303, a function literal at line 482, metrics, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
pane.createBrowserPane (cyclomatic 75) packages/gui-extensions/src/browser/pane.ts:44— pane.createBrowserPane has cyclomatic complexity 75 (threshold 15). Most of this is not in the body itself: 15 of the 75 points are its own statements and the rest belongs to 28 function items inside it that branch (execute, a function literal at line 295, a function literal at line 209, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
footer.permission.RunPermissionBody (cyclomatic 74) packages/tui/src/mini/footer.permission.tsx:143— footer.permission.RunPermissionBody has cyclomatic complexity 74 (threshold 15). Of this number, 42 points are the body's own statements and 32 belong to 11 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.
virtualizer.createTimelineVirtualizer (cyclomatic 73) packages/app/src/session/timeline/virtualizer.tsx:93— virtualizer.createTimelineVirtualizer has cyclomatic complexity 73 (threshold 15). Most of this is not in the body itself: 10 of the 73 points are its own statements and the rest belongs to 21 function literals inside it that branch (lines 247, 318, 213, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
renderer.setup (cyclomatic 71) packages/gui-extensions/src/file/renderer.tsx:61— renderer.setup has cyclomatic complexity 71 (threshold 15). Of this number, 16 points are the body's own statements and 55 belong to 23 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.
layout.separateTopLevelItems (cyclomatic 71) packages/merman/src/flowchart/layout.ts:837— layout.separateTopLevelItems has cyclomatic complexity 71 (threshold 15). Of this number, 53 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.
session-review.SessionReview (cyclomatic 71) packages/session-ui/src/components/session-review.tsx:148— session-review.SessionReview has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 3 of the 71 points are its own statements and the rest belongs to 30 function items inside it that branch (a function literal at line 420, a function literal at line 316, syncVisible, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-frame.SessionFrame (cyclomatic 70) packages/tui/src/component/session-frame.tsx:29— session-frame.SessionFrame has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 14 of the 70 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 94, a function literal at line 308, a function literal at line 112, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.layer (cyclomatic 70) packages/core/src/mcp/index.ts:172— index.layer has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 1 of the 70 points is its own statement and the rest belongs to 41 function literals inside it that branch (lines 660, 261, 561, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scan.scanBashUnit (cyclomatic 70) packages/core/src/shell/scan.ts:1030— scan.scanBashUnit has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
bench-startup.launch (cyclomatic 70) packages/desktop/scripts/bench-startup.ts:349— bench-startup.launch has cyclomatic complexity 70 (threshold 15). Of this number, 67 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
model-transport.makeLayer (cyclomatic 69) packages/core/src/session/model-transport.ts:127— model-transport.makeLayer has cyclomatic complexity 69 (threshold 15). Most of this is not in the body itself: 1 of the 69 points is its own statement and the rest belongs to 17 function literals inside it that branch (lines 295, 445, 141, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scan.scanBashCommandStart (cyclomatic 69) packages/core/src/shell/scan.ts:743— scan.scanBashCommandStart 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.
OpenAIResponsesLanguageModel.doStream (cyclomatic 69) packages/core/src/github-copilot/responses/openai-responses-language-model.ts:678— OpenAIResponsesLanguageModel.doStream 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.
job.make (cyclomatic 68) packages/core/src/job.ts:179— job.make has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 1 of the 68 points is its own statement and the rest belongs to 24 function literals inside it that branch (lines 215, 391, 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.
azure.make (cyclomatic 68) packages/core/src/plugin/provider/azure.ts:56— azure.make has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 1 of the 68 points is its own statement and the rest belongs to 20 function literals inside it that branch (lines 280, 379, 348, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
rows.createSessionRows (cyclomatic 66) packages/tui/src/routes/session/rows.ts:47— rows.createSessionRows 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 30 function items inside it that branch (a function literal at line 190, a function literal at line 203, a function literal at line 163, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Parser.parseCommand (cyclomatic 66) packages/latex/src/parser.ts:201— Parser.parseCommand has cyclomatic complexity 66 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
file-media.FileMedia (cyclomatic 63) packages/session-ui/src/components/file-media.tsx:34— file-media.FileMedia has cyclomatic complexity 63 (threshold 15). Most of this is not in the body itself: 2 of the 63 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 91, a function literal at line 67, a function literal at line 169, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-tabs.SessionTabsStory (cyclomatic 63) packages/tui/src/feature-plugins/system/storybook/session-tabs.tsx:66— session-tabs.SessionTabsStory has cyclomatic complexity 63 (threshold 15). Most of this is not in the body itself: 9 of the 63 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 330, transcript, finishRun, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cross-spawn-spawner.makeCrossSpawnSpawner (cyclomatic 63) packages/util/src/cross-spawn-spawner.ts:100— cross-spawn-spawner.makeCrossSpawnSpawner 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 31 function items inside it that branch (a function literal at line 169, a function literal at line 438, a function literal at line 419, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
search.SettingsSearch (cyclomatic 62) packages/app/src/settings/search.tsx:19— search.SettingsSearch has cyclomatic complexity 62 (threshold 15). Most of this is not in the body itself: 4 of the 62 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 169, a function literal at line 273, group, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tab-nav.TabNavItem (cyclomatic 61) packages/app/src/shell/titlebar/tab-nav.tsx:24— tab-nav.TabNavItem has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 3 of the 61 points are its own statements and the rest belongs to 29 function items inside it that branch (closeRename, previewBlocked, openRename, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog.DirectoryPickerDialog (cyclomatic 59) packages/app/src/workspaces/selection/dialog.tsx:46— dialog.DirectoryPickerDialog has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 4 of the 59 points are its own statements and the rest belongs to 20 function items inside it that branch (load, a function literal at line 99, a function literal at line 89, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
index.Prompt::submitInner (cyclomatic 58) packages/tui/src/component/prompt/index.tsx:1114— index.Prompt::submitInner 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.
drawing.diagramLineGlyph (cyclomatic 58) packages/merman/src/core/drawing.ts:116— drawing.diagramLineGlyph 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.
stream-v2.subagent.createSubagentTracker.reduce (cyclomatic 58) packages/tui/src/mini/stream-v2.subagent.ts:658— stream-v2.subagent.createSubagentTracker.reduce 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.
TitleShimmerRenderable.renderSelf (cyclomatic 57) packages/tui/src/component/title-shimmer.tsx:112— TitleShimmerRenderable.renderSelf has cyclomatic complexity 57 (threshold 15). Of this number, 29 points are the body's own statements and 28 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.
basic-tool.BasicTool (cyclomatic 56) packages/session-ui/src/components/basic-tool.tsx:111— basic-tool.BasicTool has cyclomatic complexity 56 (threshold 15). Of this number, 24 points are the body's own statements and 32 belong to 16 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.
scroll-view.ScrollView (cyclomatic 56) packages/ui/src/components/scroll-view.tsx:131— scroll-view.ScrollView has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 2 of the 56 points are its own statements and the rest belongs to 19 function items inside it that branch (onKeyDown, updateThumb, onThumbPointerDown::onPointerMove, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
openai-chat.step (cyclomatic 55) packages/ai/src/protocols/openai-chat.ts:1015— openai-chat.step has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 1 of the 55 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1016, 1057). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scan.scanBashOperatorOrSeparator (cyclomatic 55) packages/core/src/shell/scan.ts:630— scan.scanBashOperatorOrSeparator has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
routing.avoidNodeObstacles (cyclomatic 55) packages/merman/src/flowchart/routing.ts:875— routing.avoidNodeObstacles has cyclomatic complexity 55 (threshold 15). Of this number, 16 points are the body's own statements and 39 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.
Share.Share (cyclomatic 55) packages/web/src/components/Share.tsx:41— Share.Share has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 8 of the 55 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 354, a function literal at line 121, checkScrollNeed, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-session-list.DialogSessionList (cyclomatic 54) packages/tui/src/component/dialog-session-list.tsx:27— dialog-session-list.DialogSessionList has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 9 of the 54 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 153, a function literal at line 111, 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.
markdown.Markdown (cyclomatic 53) packages/session-ui/src/components/markdown.tsx:560— markdown.Markdown has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 3 of the 53 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 719, a function literal at line 656, a function literal at line 797, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-renderer.CurrentContextToolGroup (cyclomatic 53) packages/session-ui/src/tools/tool-renderer.tsx:460— tool-renderer.CurrentContextToolGroup has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 4 of the 53 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 528, a function literal at line 495, a function literal at line 689, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
model.createComposerModel (cyclomatic 52) packages/app/src/composer/model.ts:40— model.createComposerModel has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 13 of the 52 points are its own statements and the rest belongs to 24 function items inside it that branch (a function literal at line 111, a function literal at line 414, placeholder, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
footer.menu.RunFooterMenu (cyclomatic 52) packages/tui/src/mini/footer.menu.tsx:78— footer.menu.RunFooterMenu has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 7 of the 52 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 201, a function literal at line 227, a function literal at line 106, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stream-v2.transport.createSessionTransport.renderMessage (cyclomatic 51) packages/tui/src/mini/stream-v2.transport.ts:770— stream-v2.transport.createSessionTransport.renderMessage 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.
scan.scanBashParameter (cyclomatic 50) packages/core/src/shell/scan.ts:1368— scan.scanBashParameter has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OpenAICompatibleChatLanguageModel.doStream (cyclomatic 50) packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:305— OpenAICompatibleChatLanguageModel.doStream has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dialog.DialogSsh (cyclomatic 50) packages/gui-extensions/src/ssh/dialog.tsx:15— dialog.DialogSsh has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 14 of the 50 points are its own statements and the rest belongs to 17 function items inside it that branch (respond, a function literal at line 259, a function literal at line 51, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
use-session-commands.useSessionCommands (cyclomatic 49) packages/app/src/session/commands/use-session-commands.tsx:51— use-session-commands.useSessionCommands has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 1 of the 49 points is its own statement and the rest belongs to 19 function items inside it that branch (sideFocused, selectAdjacentSideTab, toggleAutoAccept, …). 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.
workspaces.SettingsWorkspaces (cyclomatic 49) packages/app/src/settings/workspaces/workspaces.tsx:52— workspaces.SettingsWorkspaces has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 4 of the 49 points are its own statements and the rest belongs to 22 function items inside it that branch (sessionCount, a function literal at line 281, remove, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
notification.createServerNotificationState (cyclomatic 49) packages/app/src/shell/notifications/notification.tsx:56— notification.createServerNotificationState has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 1 of the 49 points is its own statement and the rest belongs to 14 function items inside it that branch (unread, a function literal at line 220, a function literal at line 244, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
migrate.migrateV1 (cyclomatic 49) packages/cli/src/config/migrate.ts:160— migrate.migrateV1 has cyclomatic complexity 49 (threshold 15). Of this number, 46 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.
routing.placeStateTransitionLabels (cyclomatic 49) packages/merman/src/state/routing.ts:1221— routing.placeStateTransitionLabels has cyclomatic complexity 49 (threshold 15). Of this number, 29 points are the body's own statements and 20 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session-running-menu.SessionRunningMenu (cyclomatic 48) packages/app/src/session/header/session-running-menu.tsx:29— session-running-menu.SessionRunningMenu has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 13 of the 48 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 77, open, a function literal at line 230, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
permission.permissionPresentation (cyclomatic 48) packages/tui/src/util/permission.ts:23— permission.permissionPresentation 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.
index.ShellDisplay (cyclomatic 48) packages/tui/src/routes/session/index.tsx:2993— index.ShellDisplay has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 8 of the 48 points are its own statements and the rest belongs to 14 function items inside it that branch (loadBackgroundOutput, a function literal at line 3079, a function literal at line 3066, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
gemini.step (cyclomatic 47) packages/ai/src/protocols/gemini.ts:634— gemini.step 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.
go-upsell-hero-art.draw (cyclomatic 47) packages/app/src/providers/connect/go-upsell-hero-art.ts:303— go-upsell-hero-art.draw 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.
form.formValidateValue (cyclomatic 47) REDACTED:72— form.formValidateValue 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.
context.PluginProvider::reconcile (cyclomatic 47) packages/tui/src/plugin/context.tsx:281— context.PluginProvider::reconcile 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.
dialog-go-upsell.DialogGoUpsellConnect (cyclomatic 47) packages/tui/src/component/dialog-go-upsell.tsx:210— dialog-go-upsell.DialogGoUpsellConnect has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 5 of the 47 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 283, sync, a function literal at line 355, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
editor.ComposerEditor (cyclomatic 46) packages/app/src/composer/editor/editor.tsx:94— editor.ComposerEditor has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 15 of the 46 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 257, a function literal at line 279, updateCursor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
devtools-bar.DevToolsBar (cyclomatic 46) packages/tui/src/component/devtools-bar.tsx:29— devtools-bar.DevToolsBar has cyclomatic complexity 46 (threshold 15). Of this number, 18 points are the body's own statements and 28 belong to 11 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.
convert-to-openai-responses-input.convertToOpenAIResponsesInput (cyclomatic 46) packages/core/src/github-copilot/responses/convert-to-openai-responses-input.ts:15— convert-to-openai-responses-input.convertToOpenAIResponsesInput has cyclomatic complexity 46 (threshold 15). Of this number, 35 points are the body's own statements and 11 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.
panel.TerminalPanel (cyclomatic 46) packages/gui-extensions/src/terminal/panel.tsx:38— panel.TerminalPanel has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 2 of the 46 points are its own statements and the rest belongs to 21 function items inside it that branch (a function literal at line 149, a function literal at line 88, a function literal at line 96, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
form.validateField (cyclomatic 45) REDACTED:311— form.validateField 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.
scan.finishBashCommand (cyclomatic 45) packages/core/src/shell/scan.ts:344— scan.finishBashCommand 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.
footer.prompt.createPromptState (cyclomatic 45) packages/tui/src/mini/footer.prompt.tsx:339— footer.prompt.createPromptState 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 15 function literals inside it that branch (lines 1293, 461, 1254, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.DiffViewer (cyclomatic 44) packages/session-ui/src/components/file.tsx:1042— file.DiffViewer has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 11 function items inside it that branch (a function literal at line 1213, a function literal at line 1103, a function literal at line 1081, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
plugins.PluginsDialog (cyclomatic 44) packages/tui/src/feature-plugins/system/plugins.tsx:26— plugins.PluginsDialog 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 18 function items inside it that branch (a function literal at line 90, toggle, a function literal at line 206, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
group-view.GroupContent (cyclomatic 44) packages/tui/src/routes/session/group-view.tsx:63— group-view.GroupContent has cyclomatic complexity 44 (threshold 15). Of this number, 17 points are the body's own statements and 27 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.
client.connect (cyclomatic 44) packages/core/src/mcp/client.ts:152— client.connect has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 7 of the 44 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 260, failure, a function literal at line 299, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
controller.createHomeSessionsController (cyclomatic 43) packages/app/src/home/sessions/controller.tsx:44— controller.createHomeSessionsController 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 17 function items inside it that branch (rename, exportSession, 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.
scan.scanBashConditional (cyclomatic 43) packages/core/src/shell/scan.ts:1451— scan.scanBashConditional has cyclomatic complexity 43 (threshold 15). Of this number, 36 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
provider-error.classifyProviderFailure (cyclomatic 42) packages/ai/src/provider-error.ts:239— provider-error.classifyProviderFailure has cyclomatic complexity 42 (threshold 15). Of this number, 40 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
open-responses.lowerMessages (cyclomatic 42) packages/ai/src/protocols/open-responses.ts:599— open-responses.lowerMessages has cyclomatic complexity 42 (threshold 15). Of this number, 35 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
providers.SettingsProviders (cyclomatic 42) packages/app/src/settings/providers/providers.tsx:44— providers.SettingsProviders has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to 19 function items inside it that branch (source, a function literal at line 130, type, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
iterator.iteratorGlobals (cyclomatic 42) packages/codemode/src/stdlib/iterator.ts:25— iterator.iteratorGlobals has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to 20 function items inside it that branch (a function literal at line 181, a function literal at line 208, 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.
routing.avoidLabelOverlap (cyclomatic 42) packages/merman/src/flowchart/routing.ts:1148— routing.avoidLabelOverlap has cyclomatic complexity 42 (threshold 15). Of this number, 29 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
footer.subagent.RunFooterSubagentBody (cyclomatic 42) packages/tui/src/mini/footer.subagent.tsx:47— footer.subagent.RunFooterSubagentBody has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 8 of the 42 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 115, a function literal at line 166, a function literal at line 77, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-timeline-row.createSessionTimelineRowRenderer.renderAssistant (cyclomatic 41) packages/session-ui/src/timeline/session-timeline-row.tsx:172— session-timeline-row.createSessionTimelineRowRenderer.renderAssistant has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 7 of the 41 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 181, a function literal at line 317, a function literal at line 303, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
storage.persisted (cyclomatic 41) packages/app/src/runtime/persistence/storage.ts:586— storage.persisted has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 10 of the 41 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 632, a function literal at line 689, a function literal at line 708, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
server-process.processEffect (cyclomatic 41) REDACTED:47— server-process.processEffect 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 literals inside it that branch (lines 67, 166, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tool-schema.renderSchema (cyclomatic 41) packages/codemode/src/tool-schema.ts:136— tool-schema.renderSchema has cyclomatic complexity 41 (threshold 15). Of this number, 40 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
view.SessionFileView (cyclomatic 40) packages/gui-extensions/src/file/view.tsx:192— view.SessionFileView has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 3 of the 40 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 432, a function literal at line 374, a function literal at line 395, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
parser.parseMermaidGitGraphDiagram (cyclomatic 40) packages/merman/src/gitgraph/parser.ts:12— parser.parseMermaidGitGraphDiagram has cyclomatic complexity 40 (threshold 15). 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, separate the cases: extract each independent 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-diff.ContentDiff (cyclomatic 40) packages/web/src/components/share/content-diff.tsx:17— content-diff.ContentDiff 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 4 function literals inside it that branch (lines 18, 112, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
view.HomeSessionRow (cyclomatic 39) packages/app/src/home/sessions/view.tsx:494— view.HomeSessionRow has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 5 of the 39 points are its own statements and the rest belongs to 21 function items inside it that branch (saveEditor, a function literal at line 619, a function literal at line 684, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
selector.PromptWorkspaceSelector (cyclomatic 39) packages/app/src/new-session/workspace/selector.tsx:11— selector.PromptWorkspaceSelector has cyclomatic complexity 39 (threshold 15). Of this number, 23 points are the body's own statements and 16 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.
dialog-model.DialogConnectedModels (cyclomatic 39) packages/tui/src/component/dialog-model.tsx:54— dialog-model.DialogConnectedModels has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 5 of the 39 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 129, a function literal at line 87, a function literal at line 150, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.layoutLocalSubgraphDirections (cyclomatic 39) packages/merman/src/flowchart/layout.ts:624— layout.layoutLocalSubgraphDirections has cyclomatic complexity 39 (threshold 15). Of this number, 29 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
routing.addVerticalElbowTransition (cyclomatic 39) packages/merman/src/state/routing.ts:832— routing.addVerticalElbowTransition 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.
layout.createHorizontalLayout (cyclomatic 39) packages/merman/src/state/layout.ts:667— layout.createHorizontalLayout has cyclomatic complexity 39 (threshold 15). Of this number, 29 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
anthropic-messages.lowerMessages (cyclomatic 38) packages/ai/src/protocols/anthropic-messages.ts:871— anthropic-messages.lowerMessages has cyclomatic complexity 38 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
controller.createNewSessionWorkspaceController (cyclomatic 38) packages/app/src/new-session/workspace/controller.ts:51— controller.createNewSessionWorkspaceController 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 18 function items inside it that branch (a function literal at line 150, a function literal at line 255, a function literal at line 106, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
normalize.normalize (cyclomatic 38) packages/core/src/config/normalize.ts:57— normalize.normalize has cyclomatic complexity 38 (threshold 15). Of this number, 35 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
scan.bashWordEvaluation (cyclomatic 38) packages/core/src/shell/scan.ts:285— scan.bashWordEvaluation 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.
tree.FileTree (cyclomatic 38) packages/gui-extensions/src/file/tree.tsx:156— tree.FileTree has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 2 of the 38 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 299, 189, 233, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
open-responses.onOutputItemDone (cyclomatic 37) packages/ai/src/protocols/open-responses.ts:1181— open-responses.onOutputItemDone 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.
StringSerializeHandler._diffStyle (cyclomatic 37) packages/gui-extensions/src/terminal/serialize.ts:316— StringSerializeHandler._diffStyle 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.
diff-viewer-file-tree.DiffViewerFileTree (cyclomatic 37) packages/tui/src/feature-plugins/system/diff-viewer-file-tree.tsx:30— diff-viewer-file-tree.DiffViewerFileTree has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 6 of the 37 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 129, 156, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
data.createData (cyclomatic 37) packages/client/src/solid/data.ts:230— data.createData 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. This shape REPEATS in the file: one other method here (data.createData::handleEvent) 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.
string.stringGlobal (cyclomatic 37) packages/codemode/src/stdlib/string.ts:95— string.stringGlobal has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 16 function items inside it that branch (a function literal at line 197, a function literal at line 255, self, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
message-updater.update (cyclomatic 37) packages/core/src/session/message-updater.ts:33— message-updater.update has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 19 function literals inside it that branch (lines 364, 346, 218, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
open-responses.step (cyclomatic 36) packages/ai/src/protocols/open-responses.ts:1399— open-responses.step 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.
session-timeline-row.createSessionTimelineRowRenderer.Notice (cyclomatic 36) packages/session-ui/src/timeline/session-timeline-row.tsx:492— session-timeline-row.createSessionTimelineRowRenderer.Notice has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 13 function items inside it that branch (navigate, a function literal at line 600, a function literal at line 516, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-question-dock.SessionQuestionDock::nav (cyclomatic 36) packages/app/src/session/requests/session-question-dock.tsx:379— session-question-dock.SessionQuestionDock::nav 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. This shape REPEATS in the file: one other method here (session-question-dock.SessionQuestionDock) 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.
array.arrayGlobal (cyclomatic 36) packages/codemode/src/stdlib/array.ts:105— array.arrayGlobal has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 15 function items inside it that branch (mutable, construct, a function literal at line 262, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
publish-llm-event.createLLMEventPublisher.publish (cyclomatic 36) packages/core/src/session/runner/publish-llm-event.ts:436— publish-llm-event.createLLMEventPublisher.publish 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.
command.parseTarget (cyclomatic 36) packages/gui-extensions/src/ssh/command.ts:46— command.parseTarget 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.compile (cyclomatic 36) packages/httpapi-codegen/src/index.ts:101— index.compile has cyclomatic complexity 36 (threshold 15). Of this number, 34 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
part.Part (cyclomatic 36) packages/web/src/components/share/part.tsx:43— part.Part has cyclomatic complexity 36 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
array.callbackMethods (cyclomatic 35) packages/codemode/src/stdlib/array.ts:399— array.callbackMethods has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 517, 537, 440, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
routing.createStateTransitionRoutePlans (cyclomatic 35) packages/merman/src/state/routing.ts:374— routing.createStateTransitionRoutePlans has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 423, allocateSideRail, a function literal at line 405). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stream-v2.transport.createSessionTransport.performResizeReplay (cyclomatic 35) packages/tui/src/mini/stream-v2.transport.ts:1663— stream-v2.transport.createSessionTransport.performResizeReplay 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.
entry.isPromptEqual (cyclomatic 34) packages/app/src/composer/history/entry.ts:82— entry.isPromptEqual 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.
session-elicitation-dock.SessionElicitationDock (cyclomatic 34) packages/app/src/session/requests/session-elicitation-dock.tsx:27— session-elicitation-dock.SessionElicitationDock 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 11 function items inside it that branch (a function literal at line 161, a function literal at line 87, a function literal at line 112, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
controller.createTimelineController (cyclomatic 34) packages/app/src/session/timeline/controller.tsx:59— controller.createTimelineController 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 16 function items inside it that branch (rename, a function literal at line 100, navigateAfterRemoval, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
host.make (cyclomatic 34) packages/core/src/plugin/host.ts:47— host.make 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 23 function items inside it that branch (a function literal at line 574, locationRef, a function literal at line 121, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
scan.scanBashArrayOrPattern (cyclomatic 34) packages/core/src/shell/scan.ts:1541— scan.scanBashArrayOrPattern 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.
tool-input-repair.repair (cyclomatic 34) packages/core/src/plugin/tool-input-repair.ts:38— tool-input-repair.repair 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.
layout.layoutRankedNodes (cyclomatic 34) packages/merman/src/flowchart/layout.ts:362— layout.layoutRankedNodes has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 449, a function literal at line 400, verticalNodeGap, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
placement.createSequencePlacementPlan (cyclomatic 34) packages/merman/src/sequence/placement.ts:465— placement.createSequencePlacementPlan 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.
footer.command.RunSettingsBody (cyclomatic 34) packages/tui/src/mini/footer.command.tsx:695— footer.command.RunSettingsBody has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 5 of the 34 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 704, change, a function literal at line 772). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
footer.prompt.createPromptState.submitPrompt (cyclomatic 34) packages/tui/src/mini/footer.prompt.tsx:1353— footer.prompt.createPromptState.submitPrompt 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.
anthropic-messages.lowerMedia (cyclomatic 33) packages/ai/src/protocols/anthropic-messages.ts:674— anthropic-messages.lowerMedia 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.
bedrock-converse.lowerMessages (cyclomatic 33) packages/ai/src/protocols/bedrock-converse.ts:326— bedrock-converse.lowerMessages has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gemini.lowerMessages (cyclomatic 33) packages/ai/src/protocols/gemini.ts:322— gemini.lowerMessages has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent 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-timeline-row.createSessionTimelineRowRenderer.render (cyclomatic 33) packages/session-ui/src/timeline/session-timeline-row.tsx:764— session-timeline-row.createSessionTimelineRowRenderer.render has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 12 of the 33 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 1013, a function literal at line 934, 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.
interaction.createComposerEditor.onKeyDown (cyclomatic 33) packages/app/src/composer/editor/interaction.ts:234— interaction.createComposerEditor.onKeyDown 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.
domain.createDirectorySearch (cyclomatic 33) packages/app/src/workspaces/selection/domain.ts:401— domain.createDirectorySearch has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 455, scoped, directories, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TabPulseRenderable.renderSelf (cyclomatic 33) packages/tui/src/component/tab-pulse.tsx:639— TabPulseRenderable.renderSelf 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.
error-component.ErrorComponent (cyclomatic 33) packages/tui/src/component/error-component.tsx:10— error-component.ErrorComponent has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 6 of the 33 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 69, 144, 146). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
subagents-tab.SubagentsTab (cyclomatic 33) packages/tui/src/routes/session/composer/subagents-tab.tsx:26— subagents-tab.SubagentsTab 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 9 function items inside it that branch (a function literal at line 73, a function literal at line 206, scrollToIndex, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
config.layer (cyclomatic 33) packages/core/src/config.ts:94— config.layer has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 16 function literals inside it that branch (lines 220, 110, 151, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
to-session-error.toSessionError (cyclomatic 33) packages/core/src/session/to-session-error.ts:31— to-session-error.toSessionError 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.
shell.layer (cyclomatic 33) packages/core/src/shell.ts:127— shell.layer has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 13 function literals inside it that branch (lines 244, 397, 167, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
openai-responses-prepare-tools.prepareResponsesTools (cyclomatic 33) packages/core/src/github-copilot/responses/openai-responses-prepare-tools.ts:36— openai-responses-prepare-tools.prepareResponsesTools has cyclomatic complexity 33 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
routing.pathIntersectsBounds (cyclomatic 33) packages/merman/src/flowchart/routing.ts:667— routing.pathIntersectsBounds 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.
anthropic-messages.step (cyclomatic 32) packages/ai/src/protocols/anthropic-messages.ts:1527— anthropic-messages.step 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.
cohere-chat.fromRequest (cyclomatic 32) packages/ai/src/protocols/cohere-chat.ts:146— cohere-chat.fromRequest 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.
selection.createComposerModelSelection (cyclomatic 32) packages/app/src/composer/selection.ts:41— selection.createComposerModelSelection 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 10 function items inside it that branch (a function literal at line 120, a function literal at line 53, a function literal at line 55, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
diff-viewer.DiffViewer (cyclomatic 32) packages/tui/src/feature-plugins/system/diff-viewer.tsx:91— diff-viewer.DiffViewer has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 146, sourceDetail, 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.
builtins.make (cyclomatic 32) packages/core/src/formatter/builtins.ts:16— builtins.make has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 159, 180, 79, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scan.bashHeredocDelimiter (cyclomatic 32) packages/core/src/shell/scan.ts:1624— scan.bashHeredocDelimiter 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.
artifact-view.ImageStage (cyclomatic 32) packages/gui-extensions/src/file/artifact-view.tsx:318— artifact-view.ImageStage has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 463, a function literal at line 403, a function literal at line 448, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
actions.execute (cyclomatic 32) packages/simulation/src/frontend/actions.ts:218— actions.execute has cyclomatic complexity 32 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
stream-v2.subagent.createSubagentTracker.hydrate (cyclomatic 32) packages/tui/src/mini/stream-v2.subagent.ts:1025— stream-v2.subagent.createSubagentTracker.hydrate 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.
panels.DockRegion (cyclomatic 31) packages/app/src/runtime/extension/panels.tsx:387— panels.DockRegion has cyclomatic complexity 31 (threshold 15). Of this number, 17 points are the body's own statements and 14 belong to 7 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.
file.TextViewer (cyclomatic 31) packages/session-ui/src/components/file.tsx:798— file.TextViewer has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 12 function items inside it that branch (applySelection, a function literal at line 912, text, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
projection.toolGroupType (cyclomatic 31) packages/session-ui/src/timeline/projection.ts:961— projection.toolGroupType 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.
footer.PromptFooter (cyclomatic 31) packages/tui/src/feature-plugins/prompt/footer.tsx:14— footer.PromptFooter has cyclomatic complexity 31 (threshold 15). Of this number, 17 points are the body's own statements and 14 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.
collections.setOperation (cyclomatic 31) packages/codemode/src/stdlib/collections.ts:259— collections.setOperation has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 265, 267). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
data.walk (cyclomatic 31) packages/codemode/src/data.ts:44— data.walk has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 52, 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.
extensions.extensionGlobals::fromHost (cyclomatic 31) packages/codemode/src/interpreter/extensions.ts:76— extensions.extensionGlobals::fromHost 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.
v1-migration.bun.run (cyclomatic 31) packages/core/src/database/v1-migration.bun.ts:541— v1-migration.bun.run has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 545, 641, 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.
page.PairingPage (cyclomatic 31) packages/gui-extensions/src/pairing/page.tsx:31— page.PairingPage has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 14 of the 31 points are its own statements and the rest belongs to 9 function items inside it that branch (setup, a function literal at line 65, tunnel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
parser.parseMermaidGanttDiagram (cyclomatic 31) packages/merman/src/gantt/parser.ts:15— parser.parseMermaidGanttDiagram 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.
partial-json._parseJSON::parseAny (cyclomatic 30) packages/ai/src/protocols/utils/partial-json.ts:115— partial-json._parseJSON::parseAny has cyclomatic complexity 30 (threshold 15). 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.
screen.ConnectServerScreen (cyclomatic 30) packages/app/src/servers/connect/screen.tsx:20— screen.ConnectServerScreen has cyclomatic complexity 30 (threshold 15). 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 78, target, connect, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
migrate.run (cyclomatic 30) packages/cli/src/config/migrate.ts:17— migrate.run has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body's own statements and 13 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.
convert-to-openai-compatible-chat-messages.convertToOpenAICompatibleChatMessages (cyclomatic 30) packages/core/src/github-copilot/chat/convert-to-openai-compatible-chat-messages.ts:13— convert-to-openai-compatible-chat-messages.convertToOpenAICompatibleChatMessages has cyclomatic complexity 30 (threshold 15). Of this number, 25 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.
index.renderGroup (cyclomatic 30) packages/httpapi-codegen/src/index.ts:1759— index.renderGroup has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 1762, renderSuccess, a function literal at line 1793, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
agent-formats.modelMarkdown (cyclomatic 30) packages/stats/app/src/lib/agent-formats.ts:268— agent-formats.modelMarkdown 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
patch.parseUpdate (cyclomatic 30) packages/util/src/patch.ts:168— patch.parseUpdate 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.
bedrock-converse.step (cyclomatic 29) packages/ai/src/protocols/bedrock-converse.ts:618— bedrock-converse.step has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 619, 678, 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.
openai-chat.lowerAssistantMessage (cyclomatic 29) packages/ai/src/protocols/openai-chat.ts:436— openai-chat.lowerAssistantMessage has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 470, 481, 489). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
openai-chat.lowerMessages (cyclomatic 29) packages/ai/src/protocols/openai-chat.ts:552— openai-chat.lowerMessages has cyclomatic complexity 29 (threshold 15). Of this number, 21 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
scroll.createHomeScrollController (cyclomatic 29) packages/app/src/home/scroll.ts:11— scroll.createHomeScrollController has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 11 function items inside it that branch (containWheel, updatePositionCache, bindResizeObserver, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
error.formatErrorChain (cyclomatic 29) packages/app/src/shell/errors/error.tsx:174— error.formatErrorChain 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.
dialog-mcp.DialogMcp (cyclomatic 29) packages/tui/src/component/dialog-mcp.tsx:36— dialog-mcp.DialogMcp has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 5 of the 29 points are its own statements and the rest belongs to 8 function items inside it that branch (toggle, select, statusColor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
one-cell-spinner.OneCellSpinnerStory (cyclomatic 29) packages/tui/src/feature-plugins/system/storybook/one-cell-spinner.tsx:13— one-cell-spinner.OneCellSpinnerStory has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 164, a function literal at line 140, revealSelected, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
form.validateText (cyclomatic 29) REDACTED:166— form.validateText 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.
parse.scanPortable (cyclomatic 29) packages/core/src/shell/parse.ts:209— parse.scanPortable has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body's own statements and 10 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.
routing.avoidFlowchartFrameBorders (cyclomatic 29) packages/merman/src/flowchart/routing.ts:1337— routing.avoidFlowchartFrameBorders has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
parser.parseMermaidFlowchartDiagram (cyclomatic 29) packages/merman/src/flowchart/parser.ts:281— parser.parseMermaidFlowchartDiagram has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
parser.parseMermaidStateDiagram (cyclomatic 29) packages/merman/src/state/parser.ts:81— parser.parseMermaidStateDiagram 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.
session-review-v2.SessionReviewV2 (cyclomatic 29) packages/session-ui/src/v2/components/session-review-v2.tsx:155— session-review-v2.SessionReviewV2 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 10 function items inside it that branch (a function literal at line 203, fileIndex, toolbarStart, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
footer.command.createSearchablePanelController (cyclomatic 29) packages/tui/src/mini/footer.command.tsx:143— footer.command.createSearchablePanelController has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 186, 171). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
segmented-control.SegmentedControl (cyclomatic 29) packages/ui/src/navigation/segmented-control/segmented-control.tsx:88— segmented-control.SegmentedControl has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 10 function items inside it that branch (syncIndicator, a function literal at line 154, 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.
message-content.CurrentUserMessageDisplay (cyclomatic 28) packages/session-ui/src/message/message-content.tsx:260— message-content.CurrentUserMessageDisplay has cyclomatic complexity 28 (threshold 15). Of this number, 15 points are the body's own statements and 13 belong to 8 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
submit.createComposerSubmit.submit (cyclomatic 28) packages/app/src/composer/submit.ts:57— submit.createComposerSubmit.submit has cyclomatic complexity 28 (threshold 15). Of this number, 23 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.
sync.createServerSyncContextInner (cyclomatic 28) packages/app/src/runtime/server/sync.tsx:50— sync.createServerSyncContextInner has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 242, a function literal at line 326, a function literal at line 180, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
GoUpsellArtRenderable.renderSelf (cyclomatic 28) packages/tui/src/component/go-upsell-art.ts:222— GoUpsellArtRenderable.renderSelf has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 251). 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.
form.answerField (cyclomatic 28) REDACTED:68— form.answerField has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
noninteractive.runNonInteractivePrompt (cyclomatic 28) packages/cli/src/run/noninteractive.ts:76— noninteractive.runNonInteractivePrompt 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: 2 other methods here (noninteractive.runNonInteractivePrompt::consume, noninteractive.runNonInteractivePrompt::reconcile) 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.
Frame.applyBinaryOperator (cyclomatic 28) packages/codemode/src/interpreter/interpreter.ts:1436— Frame.applyBinaryOperator has cyclomatic complexity 28 (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.
oauth.authorize (cyclomatic 28) packages/core/src/mcp/oauth.ts:332— oauth.authorize 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 8 function literals inside it that branch (lines 338, 361, 399, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
to-llm-message.assistant (cyclomatic 28) packages/core/src/session/runner/to-llm-message.ts:155— to-llm-message.assistant 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 5 function literals inside it that branch (lines 162, 203, 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.
index.renderImportedEffectFiles (cyclomatic 28) packages/httpapi-codegen/src/index.ts:641— index.renderImportedEffectFiles has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 654, 677, 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.
gemini-json-schema.normalizeNode (cyclomatic 27) packages/ai/src/protocols/utils/gemini-json-schema.ts:19— gemini-json-schema.normalizeNode has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 24, 29). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
interaction.createSessionTimelineInteraction (cyclomatic 27) packages/app/src/session/timeline/interaction.ts:11— interaction.createSessionTimelineInteraction has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 291, 320, 335, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
usage-exceeded-dialogs.useUsageExceededDialogs (cyclomatic 27) packages/app/src/session/usage-exceeded-dialogs.tsx:82— usage-exceeded-dialogs.useUsageExceededDialogs has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 179, a function literal at line 155, showFreeLimitDialog, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
search-index.settingsSearchIndex (cyclomatic 27) packages/app/src/settings/search-index.ts:20— search-index.settingsSearchIndex has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 10 function items inside it that branch (add, a function literal at line 89, 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.
error.cliErrorMessage (cyclomatic 27) packages/tui/src/util/error.ts:5— error.cliErrorMessage has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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.makeMemoryDriver (cyclomatic 27) packages/core/src/environment/memory.ts:16— memory.makeMemoryDriver has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 118, 70, 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.
local.createLocalProviderPlugin (cyclomatic 27) packages/core/src/plugin/provider/local.ts:25— local.createLocalProviderPlugin has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 41, 79, 97, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
model.createReviewModel (cyclomatic 27) packages/gui-extensions/src/review/model.ts:46— model.createReviewModel has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 520, 222, 512, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
drawing.noteConnectorGlyph (cyclomatic 27) packages/merman/src/state/drawing.ts:119— drawing.noteConnectorGlyph 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.
parser.parseMermaidSequenceDiagram (cyclomatic 27) packages/merman/src/sequence/parser.ts:124— parser.parseMermaidSequenceDiagram 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.
footer.prompt.createPromptState.select (cyclomatic 27) packages/tui/src/mini/footer.prompt.tsx:1030— footer.prompt.createPromptState.select 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.
subagent-eviction.default (cyclomatic 27) script/drive/subagent-eviction.ts:25— subagent-eviction.default has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 26, 41, 106, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
no-widen-then-assert.knownValueEvidence (cyclomatic 27) script/oxlint/anti-slop/rules/no-widen-then-assert.ts:200— no-widen-then-assert.knownValueEvidence 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
use-session-hash-scroll.useSessionHashScroll (cyclomatic 26) packages/app/src/session/use-session-hash-scroll.ts:6— use-session-hash-scroll.useSessionHashScroll 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 4 function literals inside it that branch (lines 169, 208, 159, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
keybinds.createKeybindSettingsController (cyclomatic 26) packages/app/src/settings/keybinds/keybinds.tsx:236— keybinds.createKeybindSettingsController has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (handle, effective, a function literal at line 274, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog.DialogFooter (cyclomatic 26) packages/tui/src/ui/dialog.tsx:209— dialog.DialogFooter has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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-tabs.TabIndicator (cyclomatic 26) packages/tui/src/component/session-tabs.tsx:131— session-tabs.TabIndicator 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 8 function items inside it that branch (label, color, a function literal at line 156, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-update.DialogUpdate (cyclomatic 26) packages/tui/src/component/dialog-update.tsx:10— dialog-update.DialogUpdate has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 133, 35, 45, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
apps.resolveWindowsAppPath (cyclomatic 26) packages/desktop/src/main/files/apps.ts:39— apps.resolveWindowsAppPath has cyclomatic complexity 26 (threshold 15). Of this number, 19 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
chromium.createBrowserPage (cyclomatic 26) packages/gui-extensions/src/browser/chromium.ts:124— chromium.createBrowserPage has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (chromium.createBrowserPage::execute, chromium.createBrowserPage::inspect, chromium.createBrowserPage::snapshot::walk) 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.
footer.width.footerStatuslinePolicy (cyclomatic 26) packages/tui/src/mini/footer.width.ts:27— footer.width.footerStatuslinePolicy has cyclomatic complexity 26 (threshold 15). Of this number, 19 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
stream-v2.transport.createSessionTransport.renderTool (cyclomatic 26) packages/tui/src/mini/stream-v2.transport.ts:720— stream-v2.transport.createSessionTransport.renderTool 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.
machine.keyDown (cyclomatic 25) packages/app/src/composer/suggestions/machine.ts:223— machine.keyDown 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.
tooltip.ModelTooltip (cyclomatic 25) packages/app/src/providers/models/tooltip.tsx:36— tooltip.ModelTooltip has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (sourceName, inputLabel, inputs, …). 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.
auto-approve.createPermissionAutoApprover (cyclomatic 25) packages/app/src/session/requests/auto-approve.ts:15— auto-approve.createPermissionAutoApprover 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 13 function items inside it that branch (a function literal at line 46, a function literal at line 61, approve, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
shell.RootSettings (cyclomatic 25) packages/app/src/settings/shell.tsx:226— shell.RootSettings has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 271, a function literal at line 329, a function literal at line 286, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tab-strip.SessionTabEntry (cyclomatic 25) packages/app/src/shell/titlebar/tab-strip.tsx:84— tab-strip.SessionTabEntry has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 8 function items inside it that branch (rename, a function literal at line 155, a function literal at line 127, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
service-config.set (cyclomatic 25) packages/cli/src/services/service-config.ts:245— service-config.set has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Frame.evaluateForOfStatement (cyclomatic 25) packages/codemode/src/interpreter/interpreter.ts:716— Frame.evaluateForOfStatement has cyclomatic complexity 25 (threshold 15). 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 literals inside it that branch (lines 726, 751, 738, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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: Frame.evaluateExpression (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
language.match (cyclomatic 25) packages/console/app/src/lib/language.ts:233— language.match 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.
aisdk-native.bedrockRequest (cyclomatic 25) packages/core/src/aisdk-native.ts:219— aisdk-native.bedrockRequest 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.
index.makeLayer (cyclomatic 25) packages/core/src/persistent-pty/index.ts:119— index.makeLayer 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 15 function literals inside it that branch (lines 265, 142, 293, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scan.powerShellHereString (cyclomatic 25) packages/core/src/shell/scan.ts:2340— scan.powerShellHereString 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.
tool-input-repair.repairObject (cyclomatic 25) packages/core/src/plugin/tool-input-repair.ts:88— tool-input-repair.repairObject 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 one function literal inside it that branches (line 102). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
spreadsheet.OfficeSpreadsheet (cyclomatic 25) packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:71— spreadsheet.OfficeSpreadsheet 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 10 function items inside it that branch (show, roam, a function literal at line 169, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
openapi-stabilize.stabilizeOpenApi (cyclomatic 25) packages/protocol/script/openapi-stabilize.ts:3— openapi-stabilize.stabilizeOpenApi 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 6 function items inside it that branch (canonical, rewrite, a function literal at line 50, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
persistent-pty.PersistentPtyHandler (cyclomatic 25) packages/server/src/handlers/persistent-pty.ts:17— persistent-pty.PersistentPtyHandler 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 literals inside it that branch (lines 188, 110, 129, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
session-diff.completePatch (cyclomatic 24) packages/session-ui/src/components/session-diff.ts:91— session-diff.completePatch 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.
region.createActiveSessionRegion::handleKeyDown (cyclomatic 24) packages/app/src/session/composer/region.tsx:136— region.createActiveSessionRegion::handleKeyDown 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.
search-results.rankSettings (cyclomatic 24) packages/app/src/settings/search-results.ts:24— search-results.rankSettings has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 30, 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.
attention.createTuiAttention.notify (cyclomatic 24) packages/tui/src/attention.ts:129— attention.createTuiAttention.notify has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
form.FormPrompt (cyclomatic 24) packages/tui/src/routes/session/form.tsx:59— form.FormPrompt 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: one other method here (form.FormPrompt::commitInput) 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.
web.structuredCloneGlobal (cyclomatic 24) packages/codemode/src/stdlib/web.ts:44— web.structuredCloneGlobal 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 49, 45). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Frame.delegateYield (cyclomatic 24) packages/codemode/src/interpreter/interpreter.ts:1984— Frame.delegateYield has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 1986). 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: Frame.evaluateExpression (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
runtime.buildRequest (cyclomatic 24) packages/codemode/src/openapi/runtime.ts:54— runtime.buildRequest 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 3 function literals inside it that branch (lines 58, 63, 105). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
OpenAIResponsesLanguageModel.getArgs (cyclomatic 24) packages/core/src/github-copilot/responses/openai-responses-language-model.ts:136— OpenAIResponsesLanguageModel.getArgs has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
menu-actions.runDesktopMenuAction (cyclomatic 24) packages/desktop/src/main/native/menu-actions.ts:11— menu-actions.runDesktopMenuAction has cyclomatic complexity 24 (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.
tab.SessionContextTab (cyclomatic 24) packages/gui-extensions/src/context/tab.tsx:82— tab.SessionContextTab 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 15 function items inside it that branch (exportSession, restoreScroll, a function literal at line 113, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tree-v2.FileTreeV2 (cyclomatic 24) packages/gui-extensions/src/file/tree-v2.tsx:132— tree-v2.FileTreeV2 has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 219, a function literal at line 174, a function literal at line 207, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
mobile.SessionReviewTab (cyclomatic 24) packages/gui-extensions/src/review/mobile.tsx:36— mobile.SessionReviewTab 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 items inside it that branch (doRestore, handleScroll, queueRestore, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
server-panel.McpMenu (cyclomatic 24) packages/gui-extensions/src/details/server-panel.tsx:173— server-panel.McpMenu 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 9 function literals inside it that branch (lines 179, 298, 272, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
recorder.makeReplayWebSocketConstructor (cyclomatic 24) packages/http-recorder/src/websocket/recorder.ts:475— recorder.makeReplayWebSocketConstructor 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 9 function literals inside it that branch (lines 505, 517, 498, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
layout.outsideNotePlacement (cyclomatic 24) packages/merman/src/state/layout.ts:973— layout.outsideNotePlacement 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.
footer.prompt.createPromptState.paste (cyclomatic 24) packages/tui/src/mini/footer.prompt.tsx:857— footer.prompt.createPromptState.paste has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 859, 863, 886, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
patch.parse (cyclomatic 24) packages/util/src/patch.ts:49— patch.parse 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.
dictionary-types.unsafeDirectValue (cyclomatic 24) script/oxlint/anti-slop/shared/dictionary-types.ts:176— dictionary-types.unsafeDirectValue 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.
virtualizer.createTimelineVirtualizer.View (cyclomatic 23) packages/app/src/session/timeline/virtualizer.tsx:778— virtualizer.createTimelineVirtualizer.View has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 810, VirtualRow, a function literal at line 822, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-renderer.toolErrorSubtitle (cyclomatic 23) packages/session-ui/src/tools/tool-renderer.tsx:1430— tool-renderer.toolErrorSubtitle 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
dom.setCursorPosition (cyclomatic 23) packages/app/src/composer/editor/dom.ts:34— dom.setCursorPosition 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.
selector.PromptProjectSelector (cyclomatic 23) packages/app/src/new-session/project/selector.tsx:221— selector.PromptProjectSelector 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 10 function items inside it that branch (a function literal at line 355, selectActive, setTriggerRef::ready, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
side-region.SideRegion (cyclomatic 23) packages/app/src/runtime/extension/side-region.tsx:38— side-region.SideRegion has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 149, 82, 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.
session-identity-header.SessionIdentityHeader (cyclomatic 23) packages/app/src/session/session-identity-header.tsx:309— session-identity-header.SessionIdentityHeader has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 317, 330, 364, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
shell.SettingsScreen (cyclomatic 23) packages/app/src/settings/shell.tsx:95— shell.SettingsScreen 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 8 function items inside it that branch (a function literal at line 192, a function literal at line 124, a function literal at line 159, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
rows.reduceSessionRows (cyclomatic 23) packages/tui/src/routes/session/rows.ts:343— rows.reduceSessionRows has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 377, a function literal at line 394, flushTurn, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
OpenAIResponsesLanguageModel.doGenerate (cyclomatic 23) packages/core/src/github-copilot/responses/openai-responses-language-model.ts:311— OpenAIResponsesLanguageModel.doGenerate has cyclomatic complexity 23 (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.
transfer.sanitizeMessage (cyclomatic 23) packages/core/src/session/transfer.ts:208— transfer.sanitizeMessage has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
embeds.createEmbeds.apply (cyclomatic 23) packages/desktop/src/main/extension/embeds.ts:34— embeds.createEmbeds.apply has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
connection.createConnection.wake (cyclomatic 23) packages/gui-extensions/src/browser/connection.ts:131— connection.createConnection.wake has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 148, 200). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.renderPromiseClient (cyclomatic 23) packages/httpapi-codegen/src/index.ts:906— index.renderPromiseClient 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 5 function literals inside it that branch (lines 914, 923, 908, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.sameRuntimeEncoding (cyclomatic 23) packages/httpapi-codegen/src/index.ts:1382— index.sameRuntimeEncoding 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.
index.assertPortable::visitCurrent (cyclomatic 23) packages/httpapi-codegen/src/index.ts:1576— index.assertPortable::visitCurrent 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.
routing.routeFlowchartEdges (cyclomatic 23) packages/merman/src/flowchart/routing.ts:1245— routing.routeFlowchartEdges 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 7 function items inside it that branch (a function literal at line 1321, containers, groupedLabelEdge, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
drawing.drawSequenceDiagramGrid (cyclomatic 23) packages/merman/src/sequence/drawing.ts:199— drawing.drawSequenceDiagramGrid 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.
index.TopModelsChart (cyclomatic 23) packages/stats/app/src/routes/index.tsx:447— index.TopModelsChart has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 510, 484, 606, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tool.toolEntryBody (cyclomatic 23) packages/tui/src/mini/tool.ts:1313— tool.toolEntryBody 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.
RunScrollbackStream.append (cyclomatic 23) packages/tui/src/mini/scrollback.surface.ts:446— RunScrollbackStream.append 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.
stream-v2.transport.createSessionTransport.connect (cyclomatic 23) packages/tui/src/mini/stream-v2.transport.ts:1496— stream-v2.transport.createSessionTransport.connect 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 3 function literals inside it that branch (lines 1499, 1511, 1520). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
dictionary-types.dictionaryValueTypes (cyclomatic 23) script/oxlint/anti-slop/shared/dictionary-types.ts:232— dictionary-types.dictionaryValueTypes has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tool-renderer.CurrentFileToolGroup (cyclomatic 22) packages/session-ui/src/tools/tool-renderer.tsx:943— tool-renderer.CurrentFileToolGroup 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 6 function literals inside it that branch (lines 950, 1012, 949, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
search.createHomeSessionSearchController (cyclomatic 22) packages/app/src/home/sessions/search.ts:16— search.createHomeSessionSearchController 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 13 function items inside it that branch (a function literal at line 41, a function literal at line 65, a function literal at line 80, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
select-dialog.ModelSelectorPopoverView (cyclomatic 22) packages/app/src/providers/models/select-dialog.tsx:495— select-dialog.ModelSelectorPopoverView 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 10 function items inside it that branch (a function literal at line 634, initialActive, selectActive, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tab-strip.TitlebarTabStrip (cyclomatic 22) packages/app/src/shell/titlebar/tab-strip.tsx:270— tab-strip.TitlebarTabStrip 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 9 function items inside it that branch (a function literal at line 379, a function literal at line 391, a function literal at line 418, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
form.FormPrompt::commitInput (cyclomatic 22) packages/tui/src/routes/session/form.tsx:381— form.FormPrompt::commitInput 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 (form.FormPrompt) 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.
client-mcp.ClientMcp (cyclomatic 22) packages/tui/src/context/client-mcp.tsx:12— client-mcp.ClientMcp has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function items inside it that branch (terminalFor, sync, writeTerminal, …). 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.
dialog-go-upsell.DialogGoUpsell (cyclomatic 22) packages/tui/src/component/dialog-go-upsell.tsx:39— dialog-go-upsell.DialogGoUpsell has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 9 function items inside it that branch (button, bodyMaxHeight, compact, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
translate.fold (cyclomatic 22) packages/cli/src/acp/translate.ts:93— translate.fold 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.
inventory.inspect (cyclomatic 22) packages/cli/src/commands/handlers/plugin/inventory.ts:18— inventory.inspect has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 30, 49, 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.
runtime.serializeQuery (cyclomatic 22) packages/codemode/src/openapi/runtime.ts:250— runtime.serializeQuery 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.
enterprise.handleEnterpriseRequest (cyclomatic 22) REDACTED:95— enterprise.handleEnterpriseRequest 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.
instructions.update (cyclomatic 22) packages/core/src/codemode/instructions.ts:32— instructions.update 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.
read-filesystem.read (cyclomatic 22) packages/core/src/tool/read-filesystem.ts:116— read-filesystem.read has cyclomatic complexity 22 (threshold 15). Of this number, 19 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.
diff.turn (cyclomatic 22) packages/core/src/session/diff.ts:38— diff.turn has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
model.createModel.attach (cyclomatic 22) packages/gui-extensions/src/browser/model.ts:168— model.createModel.attach 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 9 function literals inside it that branch (lines 226, 202, 213, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
renderer.setup (cyclomatic 22) packages/gui-extensions/src/review/renderer.tsx:36— renderer.setup 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 9 function items inside it that branch (a function literal at line 74, a function literal at line 98, modelFor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
[model].ModelTrendSection (cyclomatic 22) packages/stats/app/src/routes/[lab]/[model].tsx:625— [model].ModelTrendSection has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 794, 671, 661, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
demo.emitFmt (cyclomatic 22) packages/tui/src/mini/demo.ts:830— demo.emitFmt 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.
entry.body.entryBody (cyclomatic 22) packages/tui/src/mini/entry.body.ts:191— entry.body.entryBody 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.
footer.command.PanelShell (cyclomatic 22) packages/tui/src/mini/footer.command.tsx:273— footer.command.PanelShell has cyclomatic complexity 22 (threshold 15). Of this number, 14 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.
RunFooter.event (cyclomatic 22) packages/tui/src/mini/footer.ts:438— RunFooter.event 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.
anthropic-messages.onContentBlockStart (cyclomatic 21) packages/ai/src/protocols/anthropic-messages.ts:1223— anthropic-messages.onContentBlockStart 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.
tool-error-card.ToolErrorCard (cyclomatic 21) packages/session-ui/src/components/tool-error-card.tsx:22— tool-error-card.ToolErrorCard has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 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 64, copyButton, measure, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
prompt.extractPromptFromMessage (cyclomatic 21) packages/app/src/composer/prompt.ts:68— prompt.extractPromptFromMessage 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
view.HomeProjectsPanel (cyclomatic 21) packages/app/src/home/projects/view.tsx:162— view.HomeProjectsPanel 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 5 function literals inside it that branch (lines 255, 167, 181, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
controller.createProviderConnectionController.select (cyclomatic 21) packages/app/src/providers/connect/controller.ts:347— controller.createProviderConnectionController.select has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mcp.useMcpToggle (cyclomatic 21) packages/app/src/providers/connect/mcp.ts:16— mcp.useMcpToggle has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 29, location, a function literal at line 51, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
search-reveal.revealSettingsSearch (cyclomatic 21) packages/app/src/settings/search-reveal.ts:4— search-reveal.revealSettingsSearch 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 6 function items inside it that branch (reveal, restore, finish, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-config.DialogConfig (cyclomatic 21) packages/tui/src/component/dialog-config.tsx:378— dialog-config.DialogConfig 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 8 function items inside it that branch (display, a function literal at line 410, change, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-export-options.LegacyDialogExportOptions (cyclomatic 21) packages/tui/src/ui/dialog-export-options.tsx:128— dialog-export-options.LegacyDialogExportOptions has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (activate, markColor, a function literal at line 226, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.ApplyPatch (cyclomatic 21) packages/tui/src/routes/session/index.tsx:3507— index.ApplyPatch has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 3528, 3539, 3586, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
default.default (cyclomatic 21) packages/cli/src/commands/handlers/default.ts:19— default.default 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 7 function literals inside it that branch (lines 20, 39, 77, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
content.contentBlockToParts (cyclomatic 21) packages/cli/src/acp/content.ts:16— content.contentBlockToParts 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.
integration-picker.selectIntegration (cyclomatic 21) packages/cli/src/ui/integration-picker.ts:13— integration-picker.selectIntegration has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 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.
stats.renderStats (cyclomatic 21) packages/cli/src/commands/handlers/stats.ts:95— stats.renderStats 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.
promises.invokePromiseMethod (cyclomatic 21) packages/codemode/src/interpreter/promises.ts:335— promises.invokePromiseMethod has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 363, 391, 355, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
migrate.migrateModel (cyclomatic 21) packages/core/src/v1/config/migrate.ts:180— migrate.migrateModel 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.
scan.scanBashSpan (cyclomatic 21) packages/core/src/shell/scan.ts:1201— scan.scanBashSpan 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.
restart.layer (cyclomatic 21) packages/core/src/session/execution/restart.ts:65— restart.layer 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 8 function literals inside it that branch (lines 138, 101, 77, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
diagnostics.createDiagnostics (cyclomatic 21) packages/gui-extensions/src/browser/diagnostics.ts:27— diagnostics.createDiagnostics 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 11 function literals inside it that branch (lines 62, 193, 73, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
artifact-view.ArtifactView (cyclomatic 21) packages/gui-extensions/src/file/artifact-view.tsx:67— artifact-view.ArtifactView has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 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 109, a function literal at line 89, a function literal at line 103, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
browser.SessionFileBrowserTab (cyclomatic 21) packages/gui-extensions/src/file/browser.tsx:26— browser.SessionFileBrowserTab has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 68, onFilterKeyDown, a function literal at line 62, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.layoutMatrix (cyclomatic 21) packages/latex/src/layout.ts:242— layout.layoutMatrix has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
layout.cellWidth (cyclomatic 21) packages/latex/src/layout.ts:631— layout.cellWidth 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.
markdown.createLatexCodeBlockRenderer (cyclomatic 21) packages/latex/src/markdown.ts:27— markdown.createLatexCodeBlockRenderer has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 32, 56, 55, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
layout.expandCompositeBoundsForInternalRouting (cyclomatic 21) packages/merman/src/state/layout.ts:408— layout.expandCompositeBoundsForInternalRouting has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 423, 443, 448, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
drawing.createStateDiagramDrawingWithDirection (cyclomatic 21) packages/merman/src/state/drawing.ts:240— drawing.createStateDiagramDrawingWithDirection has cyclomatic complexity 21 (threshold 15). Of this number, 17 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.
message-nav.MessageDiffBars (cyclomatic 21) packages/session-ui/src/components/message-nav.tsx:111— message-nav.MessageDiffBars 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 115). 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.MarketShare (cyclomatic 21) packages/stats/app/src/routes/index.tsx:1093— index.MarketShare 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 6 function literals inside it that branch (lines 1130, 1158, 1172, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scrollback.writer.RunEntryContent (cyclomatic 21) packages/tui/src/mini/scrollback.writer.tsx:83— scrollback.writer.RunEntryContent 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 16 function items inside it that branch (todoColor, a function literal at line 200, a function literal at line 96, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
text-reveal.TextReveal (cyclomatic 21) packages/ui/src/components/text-reveal.tsx:26— text-reveal.TextReveal 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 (a function literal at line 75, widen, a function literal at line 108, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tooltip.Tooltip (cyclomatic 21) packages/ui/src/overlays/tooltip/tooltip.tsx:18— tooltip.Tooltip 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 9 function items inside it that branch (drop, a function literal at line 111, a function literal at line 154, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
anthropic-messages.onContentBlockDelta (cyclomatic 20) packages/ai/src/protocols/anthropic-messages.ts:1316— anthropic-messages.onContentBlockDelta 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.
open-responses-continuation.driver.observe (cyclomatic 20) packages/ai/src/protocols/open-responses-continuation.ts:166— open-responses-continuation.driver.observe 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 2 function literals inside it that branch (lines 167, 210). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
embeds.EmbedView::measure (cyclomatic 20) packages/app/src/runtime/extension/embeds.tsx:149— embeds.EmbedView::measure 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.
observe-element-offset.observeElementOffsetReconnectAware (cyclomatic 20) packages/app/src/session/timeline/observe-element-offset.ts:3— observe-element-offset.observeElementOffsetReconnectAware has cyclomatic complexity 20 (threshold 15). 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 items inside it that branch (a function literal at line 65, startCheck::check, 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.
virtualizer.createTimelineVirtualizer.settleColdBottom (cyclomatic 20) packages/app/src/session/timeline/virtualizer.tsx:568— virtualizer.createTimelineVirtualizer.settleColdBottom has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 571, 583). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
form.validateCustomProvider (cyclomatic 20) packages/app/src/providers/credentials/form.ts:52— form.validateCustomProvider 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.
websearch.replyWebSearch (cyclomatic 20) packages/app/src/session/requests/websearch.ts:104— websearch.replyWebSearch 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 2 function literals inside it that branch (lines 133, 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.
background.createSessionBackground.history.assistant (cyclomatic 20) packages/app/src/session/requests/background.ts:21— background.createSessionBackground.history.assistant 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 one function literal inside it that branches (line 36). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
route.parseSettingsView (cyclomatic 20) packages/app/src/settings/route.ts:87— route.parseSettingsView 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.
dialog-execute.DialogExecute (cyclomatic 20) packages/tui/src/routes/session/dialog-execute.tsx:28— dialog-execute.DialogExecute has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 68, a function literal at line 59, a function literal at line 49, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
timeline.createTimelineHost (cyclomatic 20) packages/cli/src/ui/timeline.tsx:110— timeline.createTimelineHost has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (write, a function literal at line 191, a function literal at line 195, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
pty-handoff.read (cyclomatic 20) packages/client/src/pty-handoff.ts:90— pty-handoff.read has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
interpreter.collectVarNames (cyclomatic 20) packages/codemode/src/interpreter/interpreter.ts:228— interpreter.collectVarNames has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: Frame.evaluateExpression (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
20260805200742_import_legacy_credentials.importLegacyCredentials (cyclomatic 20) packages/core/src/database/migration/20260805200742_import_legacy_credentials.ts:46— 20260805200742_import_legacy_credentials.importLegacyCredentials has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 47). 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.normalizeMcp (cyclomatic 20) packages/core/src/config/normalize.ts:249— normalize.normalizeMcp has cyclomatic complexity 20 (threshold 15). Of this number, 13 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.
workspace.layer (cyclomatic 20) packages/core/src/workspace.ts:81— workspace.layer 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 11 function literals inside it that branch (lines 197, 225, 151, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
to-llm-message.toLLMMessage (cyclomatic 20) packages/core/src/session/runner/to-llm-message.ts:240— to-llm-message.toLLMMessage 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.
models-dev.layer (cyclomatic 20) packages/core/src/models-dev.ts:309— models-dev.layer 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 5 function literals inside it that branch (lines 312, 386, 411, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
html-markdown.convertHTMLToMarkdown::finishCode (cyclomatic 20) packages/core/src/tool/html-markdown.ts:206— html-markdown.convertHTMLToMarkdown::finishCode 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 (html-markdown.convertHTMLToMarkdown) 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.
tool-input-repair.repairArray (cyclomatic 20) packages/core/src/plugin/tool-input-repair.ts:133— tool-input-repair.repairArray has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
desktop-app.DesktopApp (cyclomatic 20) packages/desktop/src/renderer/desktop-app.tsx:34— desktop-app.DesktopApp has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 8 function items inside it that branch (readyToReveal, a function literal at line 69, a function literal at line 89, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
model.addServerPrimaryButton (cyclomatic 20) packages/gui-extensions/src/wsl/model.ts:201— model.addServerPrimaryButton 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.
routing.addBottomLaneTransition (cyclomatic 20) packages/merman/src/state/routing.ts:698— routing.addBottomLaneTransition 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.
routing.addSideParallelTransition (cyclomatic 20) packages/merman/src/state/routing.ts:780— routing.addSideParallelTransition 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.
layout.separateExternalBoundsFromComposites (cyclomatic 20) packages/merman/src/state/layout.ts:518— layout.separateExternalBoundsFromComposites 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.
drawing.drawTimelineDiagramGrid (cyclomatic 20) packages/merman/src/timeline/drawing.ts:19— drawing.drawTimelineDiagramGrid 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, 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.
source.bun.prepareSource.visit (cyclomatic 20) packages/plugin/src/source.bun.ts:15— source.bun.prepareSource.visit has cyclomatic complexity 20 (threshold 15). Of this number, 16 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.
tool-status-title.ToolStatusTitle (cyclomatic 20) packages/session-ui/src/components/tool-status-title.tsx:25— tool-status-title.ToolStatusTitle 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 6 function items inside it that branch (a function literal at line 35, a function literal at line 77, finish, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
index.LabUsageSection (cyclomatic 20) packages/stats/app/src/routes/[lab]/index.tsx:327— index.LabUsageSection has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 443, 343, 350, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RunScrollbackStream.flushActive (cyclomatic 20) packages/tui/src/mini/scrollback.surface.ts:258— RunScrollbackStream.flushActive 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.
create-auto-scroll.createAutoScroll (cyclomatic 20) packages/ui/src/hooks/create-auto-scroll.tsx:13— create-auto-scroll.createAutoScroll has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 194, 224, 240, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
dictionary-types.classifyWideningTarget (cyclomatic 20) script/oxlint/anti-slop/shared/dictionary-types.ts:320— dictionary-types.classifyWideningTarget 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.
dictionary-types.classifyAliasBroadTarget (cyclomatic 20) script/oxlint/anti-slop/shared/dictionary-types.ts:422— dictionary-types.classifyAliasBroadTarget 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.subscribeSessionEvents (cyclomatic 19) REDACTED:480— index.subscribeSessionEvents has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 501). 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.
media-type.detectMediaType (cyclomatic 19) packages/ai/src/utils/media-type.ts:10— media-type.detectMediaType 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.
venice-chat.step (cyclomatic 19) packages/ai/src/protocols/venice-chat.ts:225— venice-chat.step has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
editor.parseComposerEditor (cyclomatic 19) packages/app/src/composer/editor/editor.tsx:460— editor.parseComposerEditor has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (mention, visit, a function literal at line 549, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
child-store.createChildStoreManager.ensureChild (cyclomatic 19) packages/app/src/runtime/server/global-sync/child-store.ts:174— child-store.createChildStoreManager.ensureChild 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 7 function literals inside it that branch (lines 202, 207, 290, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
select-dialog.ModelList (cyclomatic 19) packages/app/src/providers/models/select-dialog.tsx:73— select-dialog.ModelList has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 199, moveActive, a function literal at line 91, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
storage.quota (cyclomatic 19) packages/app/src/runtime/persistence/storage.ts:117— storage.quota 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.
health.createServerHealth (cyclomatic 19) packages/app/src/runtime/server/health.ts:171— health.createServerHealth 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 179, 230, 189, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-row.SettingsProjectRow (cyclomatic 19) packages/app/src/settings/workspaces/project-row.tsx:15— project-row.SettingsProjectRow has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (saveEditor, a function literal at line 108, closeEditor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
structure.resolveSlots (cyclomatic 19) packages/tui/src/plugin/structure.ts:60— structure.resolveSlots has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
file-path.truncateFilePath (cyclomatic 19) packages/tui/src/ui/file-path.tsx:31— file-path.truncateFilePath 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.
local-attachment.parsePastedFilepaths (cyclomatic 19) packages/tui/src/component/prompt/local-attachment.ts:107— local-attachment.parsePastedFilepaths 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.
dialog-shell-output.DialogShellOutput (cyclomatic 19) packages/tui/src/component/dialog-shell-output.tsx:13— dialog-shell-output.DialogShellOutput has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 39, status, 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.
web-ui.serveUI (cyclomatic 19) REDACTED:33— web-ui.serveUI 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.
client.make::sse (cyclomatic 19) packages/client/src/promise/generated/client.ts:376— client.make::sse 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.
connection.createClientConnection.runStream (cyclomatic 19) packages/client/src/solid/connection.ts:147— connection.createClientConnection.runStream 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.
discovery.discover (cyclomatic 19) packages/core/src/config/discovery.ts:59— discovery.discover has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
stdio.make (cyclomatic 19) packages/core/src/mcp/stdio.ts:45— stdio.make 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 11 function literals inside it that branch (lines 118, 67, 171, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
read-filesystem.textPage (cyclomatic 19) packages/core/src/tool/read-filesystem.ts:291— read-filesystem.textPage 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.
compaction.flattenMessage (cyclomatic 19) packages/core/src/session/compaction.ts:1011— compaction.flattenMessage 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 1015). 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.
variant.nvidiaChat (cyclomatic 19) packages/core/src/variant.ts:155— variant.nvidiaChat 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.
stats.get (cyclomatic 19) packages/core/src/session/stats.ts:80— stats.get 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 5 function literals inside it that branch (lines 150, 254, 190, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
renderer.setup (cyclomatic 19) packages/gui-extensions/src/browser/renderer.tsx:11— renderer.setup has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 10 function items inside it that branch (create::text, a function literal at line 56, a function literal at line 111, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tab.SortableTerminalTab (cyclomatic 19) packages/gui-extensions/src/terminal/tab.tsx:13— tab.SortableTerminalTab 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 9 function items inside it that branch (edit, focus, save, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.layoutScripts (cyclomatic 19) packages/latex/src/layout.ts:182— layout.layoutScripts 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.
routing.routeHorizontalSubgraphExitFanIn (cyclomatic 19) packages/merman/src/flowchart/routing.ts:572— routing.routeHorizontalSubgraphExitFanIn 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.
placement.resolveParticipantCenters (cyclomatic 19) packages/merman/src/sequence/placement.ts:376— placement.resolveParticipantCenters 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.
session-review-file-preview-v2.SessionReviewFilePreviewV2 (cyclomatic 19) packages/session-ui/src/v2/components/session-review-file-preview-v2.tsx:104— session-review-file-preview-v2.SessionReviewFilePreviewV2 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 11 function items inside it that branch (a function literal at line 208, diffViewer, a function literal at line 175, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stream-v2.subagent.createSubagentTracker.main (cyclomatic 19) packages/tui/src/mini/stream-v2.subagent.ts:966— stream-v2.subagent.createSubagentTracker.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.
runtime.queue.runPromptQueue::submit (cyclomatic 19) packages/tui/src/mini/runtime.queue.ts:243— runtime.queue.runPromptQueue::submit 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.
array-method.isKnownArrayExpression (cyclomatic 19) script/oxlint/anti-slop/shared/array-method.ts:60— array-method.isKnownArrayExpression 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.
google-interactions.lowerMessages (cyclomatic 18) packages/ai/src/protocols/google-interactions.ts:237— google-interactions.lowerMessages has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mistral-chat.appendTools (cyclomatic 18) packages/ai/src/protocols/mistral-chat.ts:589— mistral-chat.appendTools 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.
responses-checkpoint.make (cyclomatic 18) packages/ai/src/protocols/utils/responses-checkpoint.ts:50— responses-checkpoint.make 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 66, 51). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
host-apis.createExtensionAttachment.open (cyclomatic 18) packages/app/src/runtime/extension/host-apis.tsx:641— host-apis.createExtensionAttachment.open 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 3 function literals inside it that branch (lines 664, 662, 663). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tool-renderer.ToolDisplay (cyclomatic 18) packages/session-ui/src/tools/tool-renderer.tsx:1343— tool-renderer.ToolDisplay has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1405, a function literal at line 1378, hideQuestion, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-timeline-row.createSessionTimelineRowRenderer.notice (cyclomatic 18) packages/session-ui/src/timeline/session-timeline-row.tsx:405— session-timeline-row.createSessionTimelineRowRenderer.notice 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.
attachments.attachmentMime (cyclomatic 18) packages/app/src/composer/attachments/attachments.ts:299— attachments.attachmentMime 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
drafts.createDraftStore.encode (cyclomatic 18) packages/app/src/runtime/persistence/drafts.ts:232— drafts.createDraftStore.encode 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.
namespace.createNamespaceStorage (cyclomatic 18) packages/app/src/runtime/persistence/namespace.ts:30— namespace.createNamespaceStorage 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 6 function items inside it that branch (a function literal at line 58, load, acknowledge, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-question-dock.SessionQuestionDock (cyclomatic 18) packages/app/src/session/requests/session-question-dock.tsx:81— session-question-dock.SessionQuestionDock has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (session-question-dock.SessionQuestionDock::nav) 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.
search-keydown.handleDocumentSearchKeydown (cyclomatic 18) packages/app/src/shell/commands/search-keydown.ts:3— search-keydown.handleDocumentSearchKeydown 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.
route.initialRoute (cyclomatic 18) packages/tui/src/context/route.tsx:48— route.initialRoute 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.
dialog-integration.manageConnections (cyclomatic 18) packages/tui/src/component/dialog-integration.tsx:172— dialog-integration.manageConnections 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 9 function literals inside it that branch (lines 214, 179, 226, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
watch.createSourceWatcher.arm (cyclomatic 18) packages/tui/src/plugin/watch.ts:31— watch.createSourceWatcher.arm has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 35, 48, 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.
permission.PermissionPrompt (cyclomatic 18) packages/tui/src/routes/session/permission.tsx:113— permission.PermissionPrompt 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 9 function literals inside it that branch (lines 122, 183, 243, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
home.Home (cyclomatic 18) packages/tui/src/routes/home.tsx:25— home.Home 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 (a function literal at line 69, bind, a function literal at line 61, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
RetryProviderRenderable.onScreen (cyclomatic 18) packages/tui/src/component/retry-provider.tsx:52— RetryProviderRenderable.onScreen 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.
index.SessionNoticeMessageV2 (cyclomatic 18) packages/tui/src/routes/session/index.tsx:2098— index.SessionNoticeMessageV2 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 11 function items inside it that branch (color, text, status, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
update-preflight.UpdateFooter (cyclomatic 18) packages/cli/src/services/update-preflight.tsx:314— update-preflight.UpdateFooter has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 394, a function literal at line 353, a function literal at line 364, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stats.handler (cyclomatic 18) packages/cli/src/commands/handlers/stats.ts:12— stats.handler has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
opencode-pty.resolveOpencodePty (cyclomatic 18) packages/cli/script/opencode-pty.ts:21— opencode-pty.resolveOpencodePty 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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-node.resolveTargetNode (cyclomatic 18) packages/cli/script/build-node.ts:178— build-node.resolveTargetNode 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.
service.ensure (cyclomatic 18) packages/client/src/promise/service.ts:28— service.ensure has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent 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-schema.docTags (cyclomatic 18) packages/codemode/src/tool-schema.ts:71— tool-schema.docTags 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.i18n (cyclomatic 18) packages/console/app/src/i18n/index.ts:26— index.i18n 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.
daemon.subscribePromise (cyclomatic 18) packages/core/src/persistent-pty/daemon.ts:552— daemon.subscribePromise has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 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.toElicitationField (cyclomatic 18) packages/core/src/mcp/index.ts:943— index.toElicitationField has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
scan.finishBashWord (cyclomatic 18) packages/core/src/shell/scan.ts:249— scan.finishBashWord 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.
scan.bashHeredoc (cyclomatic 18) packages/core/src/shell/scan.ts:1690— scan.bashHeredoc 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.
chatgpt.signIn (cyclomatic 18) packages/core/src/plugin/provider/chatgpt.ts:93— chatgpt.signIn has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 113, 166, 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.
github-copilot.oauth (cyclomatic 18) packages/core/src/plugin/provider/github-copilot.ts:48— github-copilot.oauth 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 101, 119, 77). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
github-copilot.requestMetadata (cyclomatic 18) packages/core/src/plugin/provider/github-copilot.ts:522— github-copilot.requestMetadata has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
migration-status.MigrationStatus (cyclomatic 18) packages/desktop/src/renderer/migration-status.tsx:10— migration-status.MigrationStatus 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 6 function items inside it that branch (format, a function literal at line 88, a function literal at line 101, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
analysis.parseHeap (cyclomatic 18) packages/gui-extensions/src/browser/analysis.ts:120— analysis.parseHeap 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.
artifact-view.ArtifactVideo (cyclomatic 18) packages/gui-extensions/src/file/artifact-view.tsx:497— artifact-view.ArtifactVideo 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 10 function items inside it that branch (measure, a function literal at line 546, a function literal at line 596, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
server-panel.ServiceConfigLink (cyclomatic 18) packages/gui-extensions/src/details/server-panel.tsx:548— server-panel.ServiceConfigLink 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 6 function items inside it that branch (a function literal at line 566, activate, label, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
controller.createSshController.start (cyclomatic 18) packages/gui-extensions/src/ssh/controller.ts:221— controller.createSshController.start has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 247, 240, 276). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.renderPromiseTypes (cyclomatic 18) packages/httpapi-codegen/src/index.ts:799— index.renderPromiseTypes 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 6 function items inside it that branch (a function literal at line 851, a function literal at line 842, typeOf, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.rankNodes (cyclomatic 18) packages/merman/src/flowchart/layout.ts:129— layout.rankNodes 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, separate the cases: extract each independent 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.parseMermaidTimelineDiagram (cyclomatic 18) packages/merman/src/timeline/parser.ts:14— parser.parseMermaidTimelineDiagram 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.
viewer.mount (cyclomatic 18) packages/session-ui/performance/highlighting/viewer.tsx:90— viewer.mount 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 2 function items inside it that branch (check, a function literal at line 137). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
model-compare-detail.ModelCompareDetailPage (cyclomatic 18) packages/stats/app/src/component/model-compare-detail.tsx:123— model-compare-detail.ModelCompareDetailPage 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 9 function items inside it that branch (a function literal at line 183, navigateToModels, syncComparisonScroll, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
v1-migrate.referenceHues (cyclomatic 18) packages/theme/src/tui/v1-migrate.ts:227— v1-migrate.referenceHues has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (resolve, replace, a function literal at line 253, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
footer.prompt.createPromptState.syncParts (cyclomatic 18) packages/tui/src/mini/footer.prompt.tsx:610— footer.prompt.createPromptState.syncParts 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.
select.Select (cyclomatic 18) packages/ui/src/forms/select/select.tsx:78— select.Select 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 8 function items inside it that branch (move, a function literal at line 210, a function literal at line 162, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layer-node.compile (cyclomatic 18) packages/util/src/effect/layer-node.ts:242— layer-node.compile has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 271, resolve, a function literal at line 303, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.selectArtifacts (cyclomatic 18) REDACTED:196— index.selectArtifacts has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 208, 210). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
bedrock-converse.fromRequest (cyclomatic 17) packages/ai/src/protocols/bedrock-converse.ts:497— bedrock-converse.fromRequest has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
host-apis.createHostApis (cyclomatic 17) packages/app/src/runtime/extension/host-apis.tsx:79— host-apis.createHostApis 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 8 function literals inside it that branch (lines 219, 167, 156, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
commented-lines.markCommentedDiffLines (cyclomatic 17) packages/session-ui/src/pierre/commented-lines.ts:26— commented-lines.markCommentedDiffLines has cyclomatic complexity 17 (threshold 15). 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, separate the cases: extract each independent 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.updateBlock (cyclomatic 17) packages/session-ui/src/components/markdown.tsx:875— markdown.updateBlock 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.
shell-output.followShellOutput (cyclomatic 17) packages/session-ui/src/tools/shell-output.ts:25— shell-output.followShellOutput 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 items inside it that branch (read, a function literal at line 55). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
attachments.createComposerAttachments.handlePaste (cyclomatic 17) packages/app/src/composer/attachments/attachments.ts:151— attachments.createComposerAttachments.handlePaste has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
machine.transitionComposer (cyclomatic 17) packages/app/src/composer/suggestions/machine.ts:61— machine.transitionComposer 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.
view.HomeServerRow (cyclomatic 17) packages/app/src/home/projects/view.tsx:343— view.HomeServerRow has cyclomatic complexity 17 (threshold 15). Of this number, 14 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.
dialog.createFormController.request (cyclomatic 17) packages/app/src/servers/connect/dialog.tsx:367— dialog.createFormController.request 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 368). 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.
windows-menu.WindowsAppMenu (cyclomatic 17) packages/app/src/shell/titlebar/windows-menu.tsx:34— windows-menu.WindowsAppMenu 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 10 function items inside it that branch (runEntry, runAction, 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.
path.unquoteGitPath (cyclomatic 17) packages/app/src/workspaces/files/path.ts:22— path.unquoteGitPath 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.supportsAvx2 (cyclomatic 17) packages/cli/bin/opencode.cjs:44— opencode.supportsAvx2 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.
dialog-prompt.DialogPrompt (cyclomatic 17) packages/tui/src/ui/dialog-prompt.tsx:34— dialog-prompt.DialogPrompt has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 115, a function literal at line 107, a function literal at line 94, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-select.DialogSelectRow::row (cyclomatic 17) packages/tui/src/ui/dialog-select.tsx:912— dialog-select.DialogSelectRow::row 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.
session-tabs.TabContextMenu (cyclomatic 17) packages/tui/src/component/session-tabs.tsx:370— session-tabs.TabContextMenu 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 9 function items inside it that branch (a function literal at line 383, a function literal at line 475, a function literal at line 393, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
permission.SessionQuestion (cyclomatic 17) packages/tui/src/routes/session/permission.tsx:407— permission.SessionQuestion 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 5 function items inside it that branch (a function literal at line 440, content, dismiss, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
theme.resolveRunTheme (cyclomatic 17) packages/tui/src/mini/theme.ts:266— theme.resolveRunTheme has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
context.resolvePlugin (cyclomatic 17) packages/tui/src/plugin/context.tsx:652— context.resolvePlugin 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.
index.InlineTool (cyclomatic 17) packages/tui/src/routes/session/index.tsx:2799— index.InlineTool has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 2832, 2823, 2855, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
terminal-pane.TerminalPane::processStream (cyclomatic 17) packages/tui/src/component/terminal-pane.tsx:97— terminal-pane.TerminalPane::processStream 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.supportsAvx2 (cyclomatic 17) packages/cli/script/postinstall.mjs:32— postinstall.supportsAvx2 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.
recent-text.messageToText (cyclomatic 17) packages/core/src/session/recent-text.ts:15— recent-text.messageToText has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent 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.normalizeCompaction (cyclomatic 17) packages/core/src/config/normalize.ts:342— normalize.normalizeCompaction 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.
normalize.normalizeExperimental (cyclomatic 17) packages/core/src/config/normalize.ts:448— normalize.normalizeExperimental 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.
source.scan (cyclomatic 17) packages/core/src/config/plugin/source.ts:122— source.scan has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 160, 137, 149). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
variant.anthropicMessages (cyclomatic 17) packages/core/src/variant.ts:325— variant.anthropicMessages has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
snapshot-parity.run (cyclomatic 17) packages/core/script/snapshot-parity.ts:559— snapshot-parity.run has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 615, a function literal at line 605, a function literal at line 611, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
renderer.setup (cyclomatic 17) packages/gui-extensions/src/ssh/renderer.tsx:12— renderer.setup 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 13 function items inside it that branch (a function literal at line 63, a function literal at line 147, client, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
model.addServerDistroStatus (cyclomatic 17) packages/gui-extensions/src/wsl/model.ts:147— model.addServerDistroStatus 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.
index.codegenAsts (cyclomatic 17) packages/httpapi-codegen/src/index.ts:1159— index.codegenAsts 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 items inside it that branch (normalize, recur). 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.
index.normalizeTransport (cyclomatic 17) packages/httpapi-codegen/src/index.ts:1300— index.normalizeTransport 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.
routing.routeParallelEdges (cyclomatic 17) packages/merman/src/flowchart/routing.ts:524— routing.routeParallelEdges 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.
layout.rankGraphComponents (cyclomatic 17) packages/merman/src/flowchart/layout.ts:780— layout.rankGraphComponents 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, 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.
routing.createFeedbackAllocations (cyclomatic 17) packages/merman/src/state/routing.ts:140— routing.createFeedbackAllocations 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 branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
markdown.createMermaidCodeBlockRenderer (cyclomatic 17) packages/merman/src/markdown.ts:268— markdown.createMermaidCodeBlockRenderer 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 273). 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.
logging.layer (cyclomatic 17) packages/sdk/src/logging.ts:36— logging.layer 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 37). 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.
footer.command.RunCommandMenuBody (cyclomatic 17) packages/tui/src/mini/footer.command.tsx:391— footer.command.RunCommandMenuBody 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 items inside it that branch (pick, a function literal at line 416). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
popover.Popover (cyclomatic 17) packages/ui/src/components/popover.tsx:23— popover.Popover 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 8 function items inside it that branch (a function literal at line 70, onOpenChange, a function literal at line 94, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-history.normalizeToolHistory (cyclomatic 16) packages/ai/src/tool-history.ts:6— tool-history.normalizeToolHistory has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
open-responses-channel.driver.observeEvent (cyclomatic 16) packages/ai/src/protocols/open-responses-channel.ts:56— open-responses-channel.driver.observeEvent 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.
host.createHost.activate (cyclomatic 16) packages/app/src/runtime/extension/host.tsx:391— host.createHost.activate has cyclomatic complexity 16 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
file-selection.readShadowLineSelection (cyclomatic 16) packages/session-ui/src/pierre/file-selection.ts:60— file-selection.readShadowLineSelection 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.
message-content.AssistantTextContent (cyclomatic 16) packages/session-ui/src/message/message-content.tsx:671— message-content.AssistantTextContent 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 4 function items inside it that branch (a function literal at line 690, a function literal at line 716, interrupted, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
apply-patch-file.changedFileDiff (cyclomatic 16) packages/session-ui/src/components/apply-patch-file.ts:17— apply-patch-file.changedFileDiff 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.
dialog.DialogConnectProvider (cyclomatic 16) packages/app/src/providers/connect/dialog.tsx:87— dialog.DialogConnectProvider 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 5 function items inside it that branch (a function literal at line 172, Content, a function literal at line 145, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog.DialogServer (cyclomatic 16) packages/app/src/servers/connect/dialog.tsx:46— dialog.DialogServer has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 62, a function literal at line 73, 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.
location-missing.SessionLocationMissing (cyclomatic 16) packages/app/src/session/composer/location-missing.tsx:17— location-missing.SessionLocationMissing 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 8 function items inside it that branch (a function literal at line 73, a function literal at line 84, a function literal at line 46, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-resolution.createSessionResolution (cyclomatic 16) packages/app/src/session/session-resolution.ts:37— session-resolution.createSessionResolution has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 85, 55, 42, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
controller-projection.visibleTimelineMessages (cyclomatic 16) packages/app/src/session/timeline/controller-projection.ts:65— controller-projection.visibleTimelineMessages has cyclomatic complexity 16 (threshold 15). Of this number, 9 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.
models.SettingsModels (cyclomatic 16) packages/app/src/settings/models/models.tsx:30— models.SettingsModels has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 49, a function literal at line 104, a function literal at line 122, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
error.formatInitError (cyclomatic 16) packages/app/src/shell/errors/error.tsx:71— error.formatInitError 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.
dialog-integration.StringChoiceField (cyclomatic 16) packages/tui/src/component/dialog-integration.tsx:938— dialog-integration.StringChoiceField 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 9 function items inside it that branch (a function literal at line 1079, select, a function literal at line 955, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
activity-summary.activitySummary (cyclomatic 16) packages/tui/src/routes/session/activity-summary.ts:61— activity-summary.activitySummary has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 63, 74, 91). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
auth.authenticate (cyclomatic 16) packages/cli/src/commands/handlers/mcp/auth.ts:21— auth.authenticate 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.
run.execute (cyclomatic 16) packages/cli/src/run/run.ts:84— run.execute has cyclomatic complexity 16 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
shared-events.make.subscribe (cyclomatic 16) packages/client/src/shared-events.ts:61— shared-events.make.subscribe has cyclomatic complexity 16 (threshold 15). Of this number, 9 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.
service.ensure (cyclomatic 16) packages/client/src/effect/service.ts:49— service.ensure 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 71, 55, 60). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Frame.destructureArrayPattern (cyclomatic 16) packages/codemode/src/interpreter/interpreter.ts:1245— Frame.destructureArrayPattern has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 1251). 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: Frame.evaluateExpression (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
Frame.applyOperator (cyclomatic 16) packages/codemode/src/interpreter/interpreter.ts:1412— Frame.applyOperator has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: Frame.evaluateExpression (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
Frame.invokeFunction (cyclomatic 16) packages/codemode/src/interpreter/interpreter.ts:1758— Frame.invokeFunction has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 1760, 1784, 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. This is NOT this file's highest cyclomatic complexity: Frame.evaluateExpression (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
Frame.createGenerator::request (cyclomatic 16) packages/codemode/src/interpreter/interpreter.ts:1829— Frame.createGenerator::request 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: Frame.evaluateExpression (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
errors.normalizeError (cyclomatic 16) packages/codemode/src/interpreter/errors.ts:26— errors.normalizeError 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.
runtime.invoke (cyclomatic 16) packages/codemode/src/openapi/runtime.ts:11— runtime.invoke has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 12). 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.fromSpec (cyclomatic 16) packages/codemode/src/openapi/index.ts:38— index.fromSpec 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.
drizzle-utils.mapResultRow (cyclomatic 16) packages/core/src/database/drizzle/internal/drizzle-utils.ts:84— drizzle-utils.mapResultRow has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 92, 129, 109). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
read.toModelContent (cyclomatic 16) packages/core/src/tool/plugin/read.ts:169— read.toModelContent 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.
variant.zaiChat (cyclomatic 16) packages/core/src/variant.ts:301— variant.zaiChat 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.
models.build (cyclomatic 16) packages/core/src/github-copilot/models.ts:129— models.build 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.
supervisor.resolve (cyclomatic 16) packages/core/src/plugin/supervisor.ts:19— supervisor.resolve 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.
assets.extensionAsset (cyclomatic 16) packages/desktop/src/main/extension/assets.ts:31— assets.extensionAsset 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.
list.SessionFileList (cyclomatic 16) packages/gui-extensions/src/file/list.tsx:45— list.SessionFileList 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 7 function literals inside it that branch (lines 158, 82, 101, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
resolve-link.normalizeRelativeSegments (cyclomatic 16) packages/gui-extensions/src/file/resolve-link.ts:92— resolve-link.normalizeRelativeSegments has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
panel.ReviewPanel (cyclomatic 16) packages/gui-extensions/src/review/panel.tsx:116— panel.ReviewPanel has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 140, a function literal at line 175, a function literal at line 158, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
worker-rpc.serveWorker (cyclomatic 16) packages/gui-extensions/src/microsoft-office/worker-rpc.ts:143— worker-rpc.serveWorker has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 216, run, 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.
presentation.worker.createDeck.paint (cyclomatic 16) packages/gui-extensions/src/microsoft-office/presentation.worker.ts:159— presentation.worker.createDeck.paint has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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.assertPromiseEndpoint (cyclomatic 16) packages/httpapi-codegen/src/index.ts:575— index.assertPromiseEndpoint 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.
layout.layoutFlowchartWithDirection (cyclomatic 16) packages/merman/src/flowchart/layout.ts:1063— layout.layoutFlowchartWithDirection 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.
search.findStateManhattanPath (cyclomatic 16) packages/merman/src/state/search.ts:50— search.findStateManhattanPath 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.
pty.PtyHandler (cyclomatic 16) packages/server/src/handlers/pty.ts:23— pty.PtyHandler has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 123, 105, 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.
catalog-identity.catalogIdentity (cyclomatic 16) packages/stats/core/src/domain/catalog-identity.ts:27— catalog-identity.catalogIdentity has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 37, 34, 63). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
v1-migrate.resolveV1 (cyclomatic 16) packages/theme/src/tui/v1-migrate.ts:340— v1-migrate.resolveV1 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 2 function items inside it that branch (resolveColor, 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.
stream-v2.subagent.createSubagentTracker.resolvePermissionTools (cyclomatic 16) packages/tui/src/mini/stream-v2.subagent.ts:453— stream-v2.subagent.createSubagentTracker.resolvePermissionTools has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
form.shared.formUnsupported (cyclomatic 16) packages/tui/src/mini/form.shared.ts:50— form.shared.formUnsupported 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.
list.List::handleKey (cyclomatic 16) packages/ui/src/components/list.tsx:190— list.List::handleKey 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.
segmented-control.SegmentedControlItem (cyclomatic 16) packages/ui/src/navigation/segmented-control/segmented-control.tsx:283— segmented-control.SegmentedControlItem has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (onKeyDown, onClick, a function literal at line 300, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
no-reduce-accumulator-copy.enclosingReducer (cyclomatic 16) script/oxlint/anti-slop/rules/no-reduce-accumulator-copy.ts:11— no-reduce-accumulator-copy.enclosingReducer 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.
no-widen-then-assert.isBroadRecordType (cyclomatic 16) script/oxlint/anti-slop/rules/no-widen-then-assert.ts:52— no-widen-then-assert.isBroadRecordType 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.
D12 · Dependency Hygiene· One package at two majors across the workspace · ×1
One package at two majors across the workspace: astro — `astro` is maintained at 2 different major versions inside this one repository — major 5 in packages/web/package.json; major 7 in packages/posts/package.json, services/www/package.json. Every major carries its own breaking changes, advisories and upgrade path, so the cost of keeping current is paid more than once; and where the packages are installed together, the resolver cannot dedupe them, so both copies ship.
scan.scanPowerShellList (cognitive 439) packages/core/src/shell/scan.ts:1740— scan.scanPowerShellList has cognitive complexity 439 (threshold 15). Drivers by points: if/else 91 (212 pts), boolean chains 150, ternaries 21 (73 pts), loops 2 (4 pts) (nesting depth added 175). Of this number, 421 points are the body's own statements and 18 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
index.Session (cognitive 229) packages/tui/src/routes/session/index.tsx:148— index.Session has cognitive complexity 229 (threshold 15). Drivers by points: if/else 107 (113 pts), boolean chains 74, ternaries 31 (37 pts), loops 3, error handling 2 (nesting depth added 12). Most of this is not in the body itself: 12 of the 229 points are its own statements and the rest belongs to 87 function items inside it that branch (a function literal at line 644, saveScrollAnchor, a function literal at line 1341, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
html-markdown.convertHTMLToMarkdown (cognitive 218) packages/core/src/tool/html-markdown.ts:53— html-markdown.convertHTMLToMarkdown has cognitive complexity 218 (threshold 15). Drivers by points: if/else 129 (207 pts), boolean chains 48, ternaries 12 (21 pts), loops 9 (18 pts) (nesting depth added 96). To reduce it, split the body into named stages: move each independent 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 (html-markdown.convertHTMLToMarkdown::finishCode) 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.
stream-v2.transport.createSessionTransport.apply (cognitive 184) packages/tui/src/mini/stream-v2.transport.ts:1025— stream-v2.transport.createSessionTransport.apply has cognitive complexity 184 (threshold 15). Drivers by points: if/else 84 (134 pts), ternaries 13 (31 pts), boolean chains 16, loops 1 (3 pts) (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
footer.form.RunFormBody (cognitive 178) packages/tui/src/mini/footer.form.tsx:39— footer.form.RunFormBody has cognitive complexity 178 (threshold 15). Drivers by points: ternaries 61 (87 pts), if/else 46 (50 pts), boolean chains 38, error handling 3 (nesting depth added 30). Of this number, 61 points are the body's own statements and 117 belong to 30 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.
footer.view.RunFooterView (cognitive 163) packages/tui/src/mini/footer.view.tsx:129— footer.view.RunFooterView has cognitive complexity 163 (threshold 15). Drivers by points: ternaries 47 (61 pts), if/else 50 (52 pts), boolean chains 50 (nesting depth added 16). Most of this is not in the body itself: 6 of the 163 points are its own statements and the rest belongs to 63 function items inside it that branch (a function literal at line 400, a function literal at line 479, a function literal at line 734, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
runtime.runInteractiveRuntime (cognitive 148) packages/tui/src/mini/runtime.ts:193— runtime.runInteractiveRuntime has cognitive complexity 148 (threshold 15). Drivers by points: if/else 81 (93 pts), boolean chains 36, ternaries 12, error handling 4 (5 pts), loops 2 (nesting depth added 13). Most of this is not in the body itself: 11 of the 148 points are its own statements and the rest belongs to 50 function items inside it that branch (a function literal at line 463, a function literal at line 710, a function literal at line 1019, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
panel.SessionBrowserPane (cognitive 146) packages/gui-extensions/src/browser/panel.tsx:67— panel.SessionBrowserPane has cognitive complexity 146 (threshold 15). Drivers by points: boolean chains 55, if/else 46 (47 pts), ternaries 40 (44 pts) (nesting depth added 5). Of this number, 30 points are the body's own statements and 116 belong to 58 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.
autocomplete.Autocomplete (cognitive 139) packages/tui/src/component/prompt/autocomplete.tsx:59— autocomplete.Autocomplete has cognitive complexity 139 (threshold 15). Drivers by points: if/else 62 (74 pts), ternaries 33 (43 pts), boolean chains 21, loops 1 (nesting depth added 22). Most of this is not in the body itself: 1 of the 139 points is its own statement and the rest belongs to 40 function items inside it that branch (a function literal at line 192, a function literal at line 325, a function literal at line 762, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
open-responses.lowerMessages (cognitive 135) packages/ai/src/protocols/open-responses.ts:599— open-responses.lowerMessages has cognitive complexity 135 (threshold 15). Drivers by points: if/else 24 (92 pts), ternaries 8 (32 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 95). Of this number, 118 points are the body's own statements and 17 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
scan.scanBash (cognitive 135) packages/core/src/shell/scan.ts:430— scan.scanBash has cognitive complexity 135 (threshold 15). Drivers by points: if/else 37 (88 pts), boolean chains 32, ternaries 5 (14 pts), loops 1 (nesting depth added 60). To reduce it, split the body into named stages: move each independent 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-tabs.VerticalSessionTabs (cognitive 133) packages/tui/src/component/session-tabs.tsx:542— session-tabs.VerticalSessionTabs has cognitive complexity 133 (threshold 15). Drivers by points: ternaries 49 (54 pts), if/else 41 (42 pts), boolean chains 37 (nesting depth added 6). Of this number, 23 points are the body's own statements and 110 belong to 40 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.
StringSerializeHandler._diffStyle (cognitive 127) packages/gui-extensions/src/terminal/serialize.ts:316— StringSerializeHandler._diffStyle has cognitive complexity 127 (threshold 15). Drivers by points: if/else 25 (72 pts), ternaries 10 (52 pts), boolean chains 3 (nesting depth added 89). 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.
dialog.ProviderConnection (cognitive 125) packages/app/src/providers/connect/dialog.tsx:406— dialog.ProviderConnection has cognitive complexity 125 (threshold 15). Drivers by points: if/else 41 (45 pts), boolean chains 42, ternaries 35 (37 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 12 of the 125 points are its own statements and the rest belongs to 52 function items inside it that branch (a function literal at line 485, methodDetails, goBack, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
convert-to-openai-responses-input.convertToOpenAIResponsesInput (cognitive 122) packages/core/src/github-copilot/responses/convert-to-openai-responses-input.ts:15— convert-to-openai-responses-input.convertToOpenAIResponsesInput has cognitive complexity 122 (threshold 15). Drivers by points: if/else 17 (65 pts), ternaries 6 (31 pts), match/switch 5 (16 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 88). Of this number, 85 points are the body's own statements and 37 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.
layout.separateTopLevelItems (cognitive 122) packages/merman/src/flowchart/layout.ts:837— layout.separateTopLevelItems has cognitive complexity 122 (threshold 15). Drivers by points: ternaries 16 (47 pts), if/else 20 (41 pts), loops 17 (26 pts), boolean chains 8 (nesting depth added 61). Of this number, 104 points are the body's own statements and 18 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.
anthropic-messages.lowerMessages (cognitive 119) packages/ai/src/protocols/anthropic-messages.ts:871— anthropic-messages.lowerMessages has cognitive complexity 119 (threshold 15). Drivers by points: if/else 28 (96 pts), loops 5 (10 pts), ternaries 2 (8 pts), boolean chains 5 (nesting depth added 79). Of this number, 115 points are the body's own statements and 4 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.
bus.configured (cognitive 118) packages/core/src/bus.ts:187— bus.configured has cognitive complexity 118 (threshold 15). Drivers by points: if/else 48 (72 pts), ternaries 17 (24 pts), boolean chains 15, loops 6 (7 pts) (nesting depth added 32). None of this is in the body itself: all 118 points belong to 25 function literals inside it that branch (lines 217, 325, 587, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-viewer.DiffViewerContent (cognitive 112) packages/tui/src/feature-plugins/system/diff-viewer.tsx:306— diff-viewer.DiffViewerContent has cognitive complexity 112 (threshold 15). Drivers by points: if/else 44 (46 pts), ternaries 40 (43 pts), boolean chains 23 (nesting depth added 5). Of this number, 26 points are the body's own statements and 86 belong to 43 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.
app.App (cognitive 112) packages/tui/src/app.tsx:489— app.App has cognitive complexity 112 (threshold 15). Drivers by points: if/else 54 (60 pts), ternaries 23 (26 pts), boolean chains 25, loops 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 112 points are its own statements and the rest belongs to 43 function items inside it that branch (a function literal at line 634, a function literal at line 748, a function literal at line 556, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
terminal.Terminal (cognitive 112) packages/gui-extensions/src/terminal/terminal.tsx:183— terminal.Terminal has cognitive complexity 112 (threshold 15). Drivers by points: if/else 70 (80 pts), boolean chains 16, ternaries 12 (13 pts), error handling 1 (2 pts), loops 1 (nesting depth added 12). Most of this is not in the body itself: 7 of the 112 points are its own statements and the rest belongs to 32 function items inside it that branch (a function literal at line 428, a function literal at line 676, scheduleSize, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-tabs.HorizontalSessionTabs (cognitive 111) packages/tui/src/component/session-tabs.tsx:1286— session-tabs.HorizontalSessionTabs has cognitive complexity 111 (threshold 15). Drivers by points: if/else 41 (43 pts), ternaries 31 (37 pts), boolean chains 30, loops 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 111 points are its own statements and the rest belongs to 37 function items inside it that branch (a function literal at line 1404, a function literal at line 1652, a function literal at line 1561, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
titlebar.Titlebar (cognitive 110) packages/app/src/shell/titlebar/titlebar.tsx:57— titlebar.Titlebar has cognitive complexity 110 (threshold 15). Drivers by points: if/else 39 (51 pts), ternaries 25 (33 pts), boolean chains 25, match/switch 1 (nesting depth added 20). Most of this is not in the body itself: 14 of the 110 points are its own statements and the rest belongs to 38 function items inside it that branch (a function literal at line 278, a function literal at line 245, a function literal at line 326, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
OpenAIResponsesLanguageModel.doStream (cognitive 107) packages/core/src/github-copilot/responses/openai-responses-language-model.ts:678— OpenAIResponsesLanguageModel.doStream has cognitive complexity 107 (threshold 15). Drivers by points: if/else 54 (85 pts), loops 4 (10 pts), ternaries 4 (7 pts), boolean chains 5 (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.
OpenAICompatibleChatLanguageModel.doStream (cognitive 98) packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:305— OpenAICompatibleChatLanguageModel.doStream has cognitive complexity 98 (threshold 15). Drivers by points: if/else 32 (65 pts), ternaries 10 (26 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 50). 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.
bedrock-converse.lowerMessages (cognitive 96) packages/ai/src/protocols/bedrock-converse.ts:326— bedrock-converse.lowerMessages has cognitive complexity 96 (threshold 15). Drivers by points: if/else 25 (74 pts), ternaries 4 (11 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 61). Of this number, 94 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
routing.placeStateTransitionLabels (cognitive 96) packages/merman/src/state/routing.ts:1221— routing.placeStateTransitionLabels has cognitive complexity 96 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 8 (26 pts), ternaries 9 (25 pts), boolean chains 16 (nesting depth added 54). Of this number, 80 points are the body's own statements and 16 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
v1-migration.bun.transformSession (cognitive 93) packages/core/src/database/v1-migration.bun.ts:227— v1-migration.bun.transformSession has cognitive complexity 93 (threshold 15). Drivers by points: ternaries 26 (44 pts), if/else 20 (30 pts), boolean chains 19 (nesting depth added 28). Most of this is not in the body itself: 3 of the 93 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 279, 387, 244, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
parser.parseMermaidGitGraphDiagram (cognitive 91) packages/merman/src/gitgraph/parser.ts:12— parser.parseMermaidGitGraphDiagram has cognitive complexity 91 (threshold 15). Drivers by points: if/else 27 (70 pts), ternaries 6 (16 pts), boolean chains 4, loops 1 (nesting depth added 53). Of this number, 90 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.
scan.scanBashCommandStart (cognitive 89) packages/core/src/shell/scan.ts:743— scan.scanBashCommandStart has cognitive complexity 89 (threshold 15). Drivers by points: if/else 35 (65 pts), boolean chains 18, ternaries 4 (6 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.
dialog-open.DialogOpen (cognitive 87) packages/tui/src/component/dialog-open.tsx:38— dialog-open.DialogOpen has cognitive complexity 87 (threshold 15). Drivers by points: ternaries 35 (41 pts), if/else 22 (25 pts), boolean chains 21 (nesting depth added 9). Of this number, 28 points are the body's own statements and 59 belong to 31 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.
data.createData::handleEvent (cognitive 86) packages/client/src/solid/data.ts:632— data.createData::handleEvent has cognitive complexity 86 (threshold 15). Drivers by points: if/else 29 (59 pts), ternaries 6 (14 pts), boolean chains 9, loops 1 (2 pts), match/switch 2 (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. This shape REPEATS in the file: one other method here (data.createData) 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.
scan.scanBashUnit (cognitive 86) packages/core/src/shell/scan.ts:1030— scan.scanBashUnit has cognitive complexity 86 (threshold 15). Drivers by points: if/else 30 (49 pts), boolean chains 25, ternaries 7 (12 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gemini.lowerMessages (cognitive 85) packages/ai/src/protocols/gemini.ts:322— gemini.lowerMessages has cognitive complexity 85 (threshold 15). Drivers by points: if/else 20 (58 pts), loops 5 (12 pts), ternaries 3 (10 pts), boolean chains 5 (nesting depth added 52). Of this number, 84 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.
cross-spawn-spawner.makeCrossSpawnSpawner (cognitive 84) packages/util/src/cross-spawn-spawner.ts:100— cross-spawn-spawner.makeCrossSpawnSpawner has cognitive complexity 84 (threshold 15). Drivers by points: if/else 36 (59 pts), ternaries 7 (8 pts), boolean chains 7, loops 5 (6 pts), match/switch 3 (4 pts) (nesting depth added 26). None of this is in the body itself: all 84 points belong to 31 function items inside it that branch (a function literal at line 169, a function literal at line 419, a function literal at line 438, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
placement.createSequencePlacementPlan (cognitive 83) packages/merman/src/sequence/placement.ts:465— placement.createSequencePlacementPlan has cognitive complexity 83 (threshold 15). Drivers by points: if/else 22 (53 pts), ternaries 9 (24 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
context.PluginProvider::reconcile (cognitive 81) packages/tui/src/plugin/context.tsx:281— context.PluginProvider::reconcile has cognitive complexity 81 (threshold 15). Drivers by points: if/else 20 (45 pts), ternaries 8 (17 pts), loops 6 (10 pts), boolean chains 9 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
step.make.attempt (cognitive 81) packages/core/src/session/runner/step.ts:73— step.make.attempt has cognitive complexity 81 (threshold 15). Drivers by points: if/else 29 (33 pts), boolean chains 25, ternaries 12 (22 pts), loops 1 (nesting depth added 14). None of this is in the body itself: all 81 points belong to 3 function items inside it that branch (a function literal at line 142, a function literal at line 109, executeTool). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
bar.DebugBar (cognitive 81) packages/gui-extensions/src/debug/bar.tsx:194— bar.DebugBar has cognitive complexity 81 (threshold 15). Drivers by points: if/else 40 (48 pts), ternaries 18 (19 pts), boolean chains 8, loops 5, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 8 of the 81 points are its own statements and the rest belongs to 32 function items inside it that branch (a function literal at line 303, a function literal at line 482, a function literal at line 391, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.make (cognitive 80) packages/cli/src/services/updater.ts:139— updater.make has cognitive complexity 80 (threshold 15). Drivers by points: if/else 36, ternaries 24 (29 pts), boolean chains 15 (nesting depth added 5). Most of this is not in the body itself: 1 of the 80 points is its own statement and the rest belongs to 26 function items inside it that branch (a function literal at line 425, a function literal at line 275, retaining, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.layoutLocalSubgraphDirections (cognitive 80) packages/merman/src/flowchart/layout.ts:624— layout.layoutLocalSubgraphDirections has cognitive complexity 80 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 9 (24 pts), ternaries 7 (19 pts), boolean chains 6 (nesting depth added 47). Of this number, 68 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
footer.menu.RunFooterMenu (cognitive 80) packages/tui/src/mini/footer.menu.tsx:78— footer.menu.RunFooterMenu has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 27 (56 pts), if/else 11 (18 pts), boolean chains 6 (nesting depth added 36). Most of this is not in the body itself: 11 of the 80 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 201, a function literal at line 106, a function literal at line 121, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
index.layer (cognitive 79) packages/core/src/mcp/index.ts:172— index.layer has cognitive complexity 79 (threshold 15). Drivers by points: if/else 39 (46 pts), ternaries 14 (17 pts), boolean chains 11, loops 3 (5 pts) (nesting depth added 12). None of this is in the body itself: all 79 points belong to 41 function literals inside it that branch (lines 660, 261, 561, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
bench-startup.launch (cognitive 79) packages/desktop/scripts/bench-startup.ts:349— bench-startup.launch has cognitive complexity 79 (threshold 15). Drivers by points: boolean chains 37, if/else 17 (26 pts), ternaries 12 (13 pts), loops 2 (3 pts) (nesting depth added 11). Of this number, 75 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.
content-diff.ContentDiff (cognitive 79) packages/web/src/components/share/content-diff.tsx:17— content-diff.ContentDiff has cognitive complexity 79 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 8 (24 pts), ternaries 6 (15 pts), boolean chains 12, error handling 1 (nesting depth added 40). None of this is in the body itself: all 79 points belong to 4 function literals inside it that branch (lines 18, 112, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
stream-v2.subagent.createSubagentTracker.reduce (cognitive 78) packages/tui/src/mini/stream-v2.subagent.ts:658— stream-v2.subagent.createSubagentTracker.reduce has cognitive complexity 78 (threshold 15). Drivers by points: if/else 39 (55 pts), ternaries 6 (14 pts), boolean chains 9 (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.
stream-v2.transport.createSessionTransport.renderMessage (cognitive 78) packages/tui/src/mini/stream-v2.transport.ts:770— stream-v2.transport.createSessionTransport.renderMessage has cognitive complexity 78 (threshold 15). Drivers by points: if/else 29 (55 pts), boolean chains 14, ternaries 3 (8 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.
footer.permission.RunPermissionBody (cognitive 77) packages/tui/src/mini/footer.permission.tsx:143— footer.permission.RunPermissionBody has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 44 (49 pts), if/else 16 (17 pts), boolean chains 10, error handling 1 (nesting depth added 6). Of this number, 40 points are the body's own statements and 37 belong to 11 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.
parser.parseMermaidFlowchartDiagram (cognitive 76) packages/merman/src/flowchart/parser.ts:281— parser.parseMermaidFlowchartDiagram has cognitive complexity 76 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 6 (23 pts), ternaries 1 (7 pts), boolean chains 5 (nesting depth added 48). Of this number, 67 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scan.scanBashParameter (cognitive 75) packages/core/src/shell/scan.ts:1368— scan.scanBashParameter has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (41 pts), ternaries 7 (17 pts), boolean chains 16, loops 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.
message-timeline.MessageTimelineView (cognitive 74) packages/app/src/session/timeline/message-timeline.tsx:119— message-timeline.MessageTimelineView has cognitive complexity 74 (threshold 15). Drivers by points: if/else 33 (34 pts), boolean chains 32, ternaries 7 (8 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 74 points are its own statements and the rest belongs to 21 function items inside it that branch (a function literal at line 186, a function literal at line 339, a function literal at line 370, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TitleShimmerRenderable.renderSelf (cognitive 74) packages/tui/src/component/title-shimmer.tsx:112— TitleShimmerRenderable.renderSelf has cognitive complexity 74 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 21, loops 8 (17 pts), ternaries 5 (11 pts) (nesting depth added 24). Of this number, 26 points are the body's own statements and 48 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.
routing.avoidLabelOverlap (cognitive 74) packages/merman/src/flowchart/routing.ts:1148— routing.avoidLabelOverlap has cognitive complexity 74 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 8 (20 pts), boolean chains 10, ternaries 3 (7 pts) (nesting depth added 39). Of this number, 66 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-frame.SessionFrame (cognitive 73) packages/tui/src/component/session-frame.tsx:29— session-frame.SessionFrame has cognitive complexity 73 (threshold 15). Drivers by points: if/else 31 (36 pts), boolean chains 25, ternaries 10 (12 pts) (nesting depth added 7). Most of this is not in the body itself: 12 of the 73 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 94, a function literal at line 308, a function literal at line 112, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
routing.addVerticalElbowTransition (cognitive 73) packages/merman/src/state/routing.ts:832— routing.addVerticalElbowTransition has cognitive complexity 73 (threshold 15). Drivers by points: ternaries 25 (54 pts), if/else 9 (10 pts), loops 2 (5 pts), boolean chains 4 (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.
model-transport.makeLayer (cognitive 71) packages/core/src/session/model-transport.ts:127— model-transport.makeLayer has cognitive complexity 71 (threshold 15). Drivers by points: if/else 32 (36 pts), ternaries 17 (23 pts), boolean chains 12 (nesting depth added 10). None of this is in the body itself: all 71 points belong to 17 function literals inside it that branch (lines 295, 445, 141, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scan.scanBashKeyword (cognitive 71) packages/core/src/shell/scan.ts:858— scan.scanBashKeyword has cognitive complexity 71 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 29, ternaries 2 (4 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.
screen.SessionScreenContent (cognitive 70) packages/app/src/session/screen.tsx:58— screen.SessionScreenContent has cognitive complexity 70 (threshold 15). Drivers by points: boolean chains 39, if/else 19, ternaries 12. Of this number, 21 points are the body's own statements and 49 belong to 22 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.
open-responses.onOutputItemDone (cognitive 69) packages/ai/src/protocols/open-responses.ts:1181— open-responses.onOutputItemDone has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 14 (31 pts), if/else 12 (23 pts), loops 4 (9 pts), boolean chains 6 (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.
azure.make (cognitive 69) packages/core/src/plugin/provider/azure.ts:56— azure.make has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (33 pts), boolean chains 16, ternaries 13 (14 pts), loops 5 (6 pts) (nesting depth added 9). None of this is in the body itself: all 69 points belong to 20 function literals inside it that branch (lines 280, 379, 348, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pane.createBrowserPane (cognitive 69) packages/gui-extensions/src/browser/pane.ts:44— pane.createBrowserPane has cognitive complexity 69 (threshold 15). Drivers by points: if/else 45 (46 pts), boolean chains 15, ternaries 8 (nesting depth added 1). Most of this is not in the body itself: 13 of the 69 points are its own statements and the rest belongs to 28 function items inside it that branch (execute, a function literal at line 295, a function literal at line 209, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
gemini.step (cognitive 68) packages/ai/src/protocols/gemini.ts:634— gemini.step has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (44 pts), ternaries 5 (14 pts), boolean chains 9, loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
go-upsell-hero-art.draw (cognitive 68) packages/app/src/providers/connect/go-upsell-hero-art.ts:303— go-upsell-hero-art.draw has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 11 (23 pts), ternaries 6 (12 pts), boolean chains 7 (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.
index.Prompt::submitInner (cognitive 68) packages/tui/src/component/prompt/index.tsx:1114— index.Prompt::submitInner has cognitive complexity 68 (threshold 15). Drivers by points: if/else 29 (39 pts), boolean chains 17, ternaries 7 (12 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.
job.make (cognitive 68) packages/core/src/job.ts:179— job.make has cognitive complexity 68 (threshold 15). Drivers by points: if/else 36 (40 pts), boolean chains 13, ternaries 11 (12 pts), loops 3 (nesting depth added 5). None of this is in the body itself: all 68 points belong to 24 function literals inside it that branch (lines 391, 215, 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.
routing.avoidFlowchartFrameBorders (cognitive 68) packages/merman/src/flowchart/routing.ts:1337— routing.avoidFlowchartFrameBorders has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 9 (44 pts), if/else 4 (13 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 47). Of this number, 67 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.
session-review.SessionReview (cognitive 68) packages/session-ui/src/components/session-review.tsx:148— session-review.SessionReview has cognitive complexity 68 (threshold 15). Drivers by points: if/else 29 (33 pts), boolean chains 21, ternaries 12, loops 2 (nesting depth added 4). Most of this is not in the body itself: 2 of the 68 points are its own statements and the rest belongs to 30 function items inside it that branch (syncVisible, a function literal at line 316, a function literal at line 420, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
form.validateField (cognitive 67) REDACTED:311— form.validateField has cognitive complexity 67 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 17, error handling 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scan.scanBashConditional (cognitive 67) packages/core/src/shell/scan.ts:1451— scan.scanBashConditional has cognitive complexity 67 (threshold 15). Drivers by points: if/else 21 (50 pts), boolean chains 14, ternaries 1 (2 pts), loops 1 (nesting depth added 30). Of this number, 61 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.
rows.createSessionRows (cognitive 66) packages/tui/src/routes/session/rows.ts:47— rows.createSessionRows has cognitive complexity 66 (threshold 15). Drivers by points: if/else 28, boolean chains 26, ternaries 10 (12 pts) (nesting depth added 2). None of this is in the body itself: all 66 points belong to 30 function items inside it that branch (a function literal at line 190, a function literal at line 163, a function literal at line 203, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Parser.parseCommand (cognitive 66) packages/latex/src/parser.ts:201— Parser.parseCommand has cognitive complexity 66 (threshold 15). Drivers by points: if/else 37 (42 pts), ternaries 6 (13 pts), boolean chains 11 (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
form.formValidateValue (cognitive 65) REDACTED:72— form.formValidateValue has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 18, ternaries 3 (6 pts), error handling 1 (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.
scan.scanBashOperatorOrSeparator (cognitive 65) packages/core/src/shell/scan.ts:630— scan.scanBashOperatorOrSeparator has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (42 pts), boolean chains 21, ternaries 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stream-v2.transport.createSessionTransport.performResizeReplay (cognitive 65) packages/tui/src/mini/stream-v2.transport.ts:1663— stream-v2.transport.createSessionTransport.performResizeReplay has cognitive complexity 65 (threshold 15). Drivers by points: if/else 17 (41 pts), ternaries 3 (14 pts), boolean chains 6, loops 2 (3 pts), error handling 1 (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.
renderer.setup (cognitive 64) packages/gui-extensions/src/file/renderer.tsx:61— renderer.setup has cognitive complexity 64 (threshold 15). Drivers by points: if/else 35 (36 pts), boolean chains 21, ternaries 7 (nesting depth added 1). Most of this is not in the body itself: 14 of the 64 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 596, resolve, a function literal at line 512, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
anthropic-messages.lowerMedia (cognitive 63) packages/ai/src/protocols/anthropic-messages.ts:674— anthropic-messages.lowerMedia has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 23 (51 pts), if/else 8 (11 pts), boolean chains 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.
session-tabs.SessionTabsStory (cognitive 63) packages/tui/src/feature-plugins/system/storybook/session-tabs.tsx:66— session-tabs.SessionTabsStory has cognitive complexity 63 (threshold 15). Drivers by points: if/else 28, ternaries 20 (23 pts), boolean chains 12 (nesting depth added 3). Most of this is not in the body itself: 9 of the 63 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 330, transcript, finishRun, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
collections.setOperation (cognitive 63) packages/codemode/src/stdlib/collections.ts:259— collections.setOperation has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (41 pts), loops 11 (22 pts) (nesting depth added 32). None of this is in the body itself: all 63 points belong to 2 function literals inside it that branch (lines 265, 267). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
file-media.FileMedia (cognitive 62) packages/session-ui/src/components/file-media.tsx:34— file-media.FileMedia has cognitive complexity 62 (threshold 15). Drivers by points: if/else 40, boolean chains 20, ternaries 2. Most of this is not in the body itself: 1 of the 62 points is its own statement and the rest belongs to 20 function items inside it that branch (a function literal at line 91, a function literal at line 67, a function literal at line 169, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
search.SettingsSearch (cognitive 61) packages/app/src/settings/search.tsx:19— search.SettingsSearch has cognitive complexity 61 (threshold 15). Drivers by points: boolean chains 22, ternaries 14 (21 pts), if/else 18 (nesting depth added 7). Most of this is not in the body itself: 3 of the 61 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 169, a function literal at line 273, category, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
parser.parseMermaidGanttDiagram (cognitive 61) packages/merman/src/gantt/parser.ts:15— parser.parseMermaidGanttDiagram has cognitive complexity 61 (threshold 15). Drivers by points: if/else 21 (48 pts), ternaries 4 (7 pts), boolean chains 3, loops 2 (3 pts) (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.
apps.resolveWindowsAppPath (cognitive 60) packages/desktop/src/main/files/apps.ts:39— apps.resolveWindowsAppPath has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 5 (11 pts), boolean chains 3 (nesting depth added 35). Of this number, 46 points are the body's own statements and 14 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.
migrate.migrateV1 (cognitive 59) packages/cli/src/config/migrate.ts:160— migrate.migrateV1 has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 32 (51 pts), boolean chains 6, if/else 1 (2 pts) (nesting depth added 20). Of this number, 56 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.
convert-to-openai-compatible-chat-messages.convertToOpenAICompatibleChatMessages (cognitive 59) packages/core/src/github-copilot/chat/convert-to-openai-compatible-chat-messages.ts:13— convert-to-openai-compatible-chat-messages.convertToOpenAICompatibleChatMessages has cognitive complexity 59 (threshold 15). Drivers by points: if/else 6 (21 pts), ternaries 4 (16 pts), match/switch 4 (13 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 40). Of this number, 41 points are the body's own statements and 18 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
drawing.diagramLineGlyph (cognitive 59) packages/merman/src/core/drawing.ts:116— drawing.diagramLineGlyph has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 20, ternaries 4 (8 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.
cohere-chat.fromRequest (cognitive 58) packages/ai/src/protocols/cohere-chat.ts:146— cohere-chat.fromRequest has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (31 pts), ternaries 9 (15 pts), boolean chains 6, loops 3 (6 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.
permission.permissionPresentation (cognitive 58) packages/tui/src/util/permission.ts:23— permission.permissionPresentation has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 17 (35 pts), boolean chains 13, if/else 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.
parser.parseMermaidSequenceDiagram (cognitive 58) packages/merman/src/sequence/parser.ts:124— parser.parseMermaidSequenceDiagram has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (47 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 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.
migrate.run (cognitive 57) packages/cli/src/config/migrate.ts:17— migrate.run has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 11 (26 pts), boolean chains 5 (nesting depth added 29). Of this number, 29 points are the body's own statements and 28 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.
iterator.iteratorGlobals (cognitive 56) packages/codemode/src/stdlib/iterator.ts:25— iterator.iteratorGlobals has cognitive complexity 56 (threshold 15). Drivers by points: if/else 27 (44 pts), loops 9, boolean chains 2, ternaries 1 (nesting depth added 17). None of this is in the body itself: all 56 points belong to 20 function items inside it that branch (a function literal at line 181, a function literal at line 208, 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.
index.compile (cognitive 55) packages/httpapi-codegen/src/index.ts:101— index.compile has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 10 (13 pts), loops 6 (11 pts), boolean chains 3 (nesting depth added 22). Of this number, 53 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.
parser.parseMermaidStateDiagram (cognitive 55) packages/merman/src/state/parser.ts:81— parser.parseMermaidStateDiagram has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (36 pts), ternaries 5 (15 pts), boolean chains 3, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resolve.resolveThemeVariant (cognitive 55) packages/ui/src/theme/resolve.ts:4— resolve.resolveThemeVariant has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 28 (33 pts), if/else 11 (14 pts), boolean chains 7, loops 1 (nesting depth added 8). Of this number, 40 points are the body's own statements and 15 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
markdown.Markdown (cognitive 54) packages/session-ui/src/components/markdown.tsx:560— markdown.Markdown has cognitive complexity 54 (threshold 15). Drivers by points: if/else 33 (37 pts), boolean chains 9, ternaries 7, loops 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 54 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 719, a function literal at line 656, a function literal at line 797, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-session-list.DialogSessionList (cognitive 54) packages/tui/src/component/dialog-session-list.tsx:27— dialog-session-list.DialogSessionList has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 24 (27 pts), boolean chains 14, if/else 12, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 54 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 153, a function literal at line 111, 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.
scan.finishBashCommand (cognitive 54) packages/core/src/shell/scan.ts:344— scan.finishBashCommand has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 19, loops 2 (6 pts), ternaries 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tab-nav.TabNavItem (cognitive 53) packages/app/src/shell/titlebar/tab-nav.tsx:24— tab-nav.TabNavItem has cognitive complexity 53 (threshold 15). Drivers by points: if/else 35, boolean chains 13, ternaries 5. Most of this is not in the body itself: 2 of the 53 points are its own statements and the rest belongs to 29 function items inside it that branch (closeRename, tab, 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.
dialog-go-upsell.DialogGoUpsellConnect (cognitive 53) packages/tui/src/component/dialog-go-upsell.tsx:210— dialog-go-upsell.DialogGoUpsellConnect has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 12, ternaries 8 (9 pts), error handling 3, loops 1 (nesting depth added 7). Most of this is not in the body itself: 5 of the 53 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 283, sync, a function literal at line 325, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
scan.bashHeredocDelimiter (cognitive 53) packages/core/src/shell/scan.ts:1624— scan.bashHeredocDelimiter has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 12, ternaries 1 (3 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.
scroll-view.ScrollView (cognitive 53) packages/ui/src/components/scroll-view.tsx:131— scroll-view.ScrollView has cognitive complexity 53 (threshold 15). Drivers by points: if/else 25, ternaries 12 (16 pts), boolean chains 11, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 1 of the 53 points is its own statement and the rest belongs to 19 function items inside it that branch (updateThumb, onThumbPointerDown::onPointerMove, 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.
session-timeline-row.createSessionTimelineRowRenderer.renderAssistant (cognitive 52) packages/session-ui/src/timeline/session-timeline-row.tsx:172— session-timeline-row.createSessionTimelineRowRenderer.renderAssistant has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 11 (16 pts), boolean chains 7 (nesting depth added 18). Most of this is not in the body itself: 8 of the 52 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 181, a function literal at line 317, a function literal at line 303, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
array.callbackMethods (cognitive 52) packages/codemode/src/stdlib/array.ts:399— array.callbackMethods has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 13 (15 pts), boolean chains 2, ternaries 1 (nesting depth added 18). None of this is in the body itself: all 52 points belong to 12 function literals inside it that branch (lines 517, 537, 440, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
routing.avoidNodeObstacles (cognitive 52) packages/merman/src/flowchart/routing.ts:875— routing.avoidNodeObstacles has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 25 (32 pts), boolean chains 15, if/else 5 (nesting depth added 7). Most of this is not in the body itself: 15 of the 52 points are its own statements and the rest belongs to 14 function items inside it that branch (routeViaBus, a function literal at line 915, a function literal at line 889, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.subscribeSessionEvents (cognitive 51) REDACTED:480— index.subscribeSessionEvents has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (36 pts), error handling 2 (5 pts), ternaries 1 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 33). Most of this is not in the body itself: 1 of the 51 points is its own statement and the rest belongs to one function literal inside it that branches (line 501). 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.
storage.persisted (cognitive 51) packages/app/src/runtime/persistence/storage.ts:586— storage.persisted has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 23 (32 pts), if/else 12 (14 pts), boolean chains 5 (nesting depth added 11). Most of this is not in the body itself: 9 of the 51 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 632, a function literal at line 689, a function literal at line 708, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
use-session-commands.useSessionCommands (cognitive 51) packages/app/src/session/commands/use-session-commands.tsx:51— use-session-commands.useSessionCommands has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18, ternaries 11 (16 pts), boolean chains 14, error handling 3 (nesting depth added 5). None of this is in the body itself: all 51 points belong to 19 function items inside it that branch (toggleAutoAccept, exportSession, copySessionID, …). 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.
tool-input-repair.repair (cognitive 51) packages/core/src/plugin/tool-input-repair.ts:38— tool-input-repair.repair has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 9 (20 pts), boolean chains 9 (nesting depth added 18). Of this number, 50 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
patch.parseUpdate (cognitive 51) packages/util/src/patch.ts:168— patch.parseUpdate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (37 pts), ternaries 3 (7 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.
virtualizer.createTimelineVirtualizer (cognitive 50) packages/app/src/session/timeline/virtualizer.tsx:93— virtualizer.createTimelineVirtualizer has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (24 pts), boolean chains 19, ternaries 6, loops 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 50 points are its own statements and the rest belongs to 21 function literals inside it that branch (lines 247, 500, 208, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
error.formatErrorChain (cognitive 50) packages/app/src/shell/errors/error.tsx:174— error.formatErrorChain has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 5 (9 pts), boolean chains 8 (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.
dialog.DirectoryPickerDialog (cognitive 50) packages/app/src/workspaces/selection/dialog.tsx:46— dialog.DirectoryPickerDialog has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (25 pts), boolean chains 16, ternaries 7, loops 1 (2 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 50 points are its own statements and the rest belongs to 20 function items inside it that branch (load, a function literal at line 99, complete, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-schema.renderSchema (cognitive 50) packages/codemode/src/tool-schema.ts:136— tool-schema.renderSchema has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 9, ternaries 4 (8 pts) (nesting depth added 14). Of this number, 48 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.
layout.createHorizontalLayout (cognitive 50) packages/merman/src/state/layout.ts:667— layout.createHorizontalLayout has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 8 (12 pts), boolean chains 9, ternaries 4 (8 pts) (nesting depth added 19). Of this number, 44 points are the body's own statements and 6 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.
openai-chat.step (cognitive 49) packages/ai/src/protocols/openai-chat.ts:1015— openai-chat.step has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 22, if/else 13 (18 pts), ternaries 6 (8 pts), loops 1 (nesting depth added 7). None of this is in the body itself: all 49 points belong to 2 function literals inside it that branch (lines 1016, 1057). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
path.unquoteGitPath (cognitive 49) packages/app/src/workspaces/files/path.ts:22— path.unquoteGitPath has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 7 (35 pts), if/else 6 (11 pts), boolean chains 2, loops 1 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
parse.scanPortable (cognitive 49) packages/core/src/shell/parse.ts:209— parse.scanPortable has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 9 (25 pts), if/else 6 (15 pts), boolean chains 8, loops 1 (nesting depth added 25). Of this number, 23 points are the body's own statements and 26 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.
layout.layoutRankedNodes (cognitive 49) packages/merman/src/flowchart/layout.ts:362— layout.layoutRankedNodes has cognitive complexity 49 (threshold 15). Drivers by points: loops 7 (17 pts), boolean chains 13, ternaries 6 (10 pts), if/else 5 (9 pts) (nesting depth added 18). Of this number, 22 points are the body's own statements and 27 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.
Share.Share (cognitive 49) packages/web/src/components/Share.tsx:41— Share.Share has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (32 pts), boolean chains 11, ternaries 5, loops 1 (nesting depth added 7). Most of this is not in the body itself: 7 of the 49 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 354, a function literal at line 255, checkScrollNeed, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
basic-tool.BasicTool (cognitive 48) packages/session-ui/src/components/basic-tool.tsx:111— basic-tool.BasicTool has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 20, if/else 13 (14 pts), ternaries 14 (nesting depth added 1). Of this number, 20 points are the body's own statements and 28 belong to 16 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.
model.createComposerModel (cognitive 48) packages/app/src/composer/model.ts:40— model.createComposerModel has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (22 pts), ternaries 15 (16 pts), boolean chains 10 (nesting depth added 2). Most of this is not in the body itself: 13 of the 48 points are its own statements and the rest belongs to 24 function items inside it that branch (a function literal at line 111, a function literal at line 414, placeholder, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
workspaces.SettingsWorkspaces (cognitive 48) packages/app/src/settings/workspaces/workspaces.tsx:52— workspaces.SettingsWorkspaces has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17, boolean chains 15, ternaries 13 (15 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 48 points are its own statements and the rest belongs to 22 function items inside it that branch (sessionCount, a function literal at line 281, a function literal at line 101, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
devtools-bar.DevToolsBar (cognitive 48) packages/tui/src/component/devtools-bar.tsx:29— devtools-bar.DevToolsBar has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 23 (29 pts), if/else 9 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 11). Of this number, 23 points are the body's own statements and 25 belong to 11 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.
scan.powerShellHereString (cognitive 48) packages/core/src/shell/scan.ts:2340— scan.powerShellHereString has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (34 pts), ternaries 2 (7 pts), boolean chains 6, 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.
routing.createStateTransitionRoutePlans (cognitive 48) packages/merman/src/state/routing.ts:374— routing.createStateTransitionRoutePlans has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 9, ternaries 3 (5 pts) (nesting depth added 15). None of this is in the body itself: all 48 points belong to 3 function items inside it that branch (a function literal at line 423, allocateSideRail, a function literal at line 405). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.separateExternalBoundsFromComposites (cognitive 48) packages/merman/src/state/layout.ts:518— layout.separateExternalBoundsFromComposites has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 5 (12 pts), boolean chains 5 (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.
stream-v2.subagent.createSubagentTracker.hydrate (cognitive 48) packages/tui/src/mini/stream-v2.subagent.ts:1025— stream-v2.subagent.createSubagentTracker.hydrate has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 8 (11 pts), boolean chains 5, ternaries 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.
notification.createServerNotificationState (cognitive 47) packages/app/src/shell/notifications/notification.tsx:56— notification.createServerNotificationState has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (27 pts), boolean chains 14, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 5). None of this is in the body itself: all 47 points belong to 14 function items inside it that branch (migrateLegacy, a function literal at line 220, a function literal at line 244, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
group-view.GroupContent (cognitive 47) packages/tui/src/routes/session/group-view.tsx:63— group-view.GroupContent has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 19 (24 pts), boolean chains 14, if/else 6 (9 pts) (nesting depth added 8). Of this number, 16 points are the body's own statements and 31 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.
tree.FileTree (cognitive 47) packages/gui-extensions/src/file/tree.tsx:156— tree.FileTree has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (28 pts), loops 7 (8 pts), ternaries 5 (6 pts), boolean chains 5 (nesting depth added 10). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 299, 189, 233, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
dialog.DialogSsh (cognitive 47) packages/gui-extensions/src/ssh/dialog.tsx:15— dialog.DialogSsh has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 21, ternaries 11 (15 pts), if/else 11 (nesting depth added 4). Most of this is not in the body itself: 15 of the 47 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 259, respond, 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.
open-responses.step (cognitive 45) packages/ai/src/protocols/open-responses.ts:1399— open-responses.step has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 7 (14 pts), boolean chains 9 (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.
client.connect (cognitive 45) packages/core/src/mcp/client.ts:152— client.connect has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 14 (16 pts), boolean chains 10 (nesting depth added 9). Most of this is not in the body itself: 6 of the 45 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 260, failure, a function literal at line 299, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
v1-migration.bun.run (cognitive 45) packages/core/src/database/v1-migration.bun.ts:541— v1-migration.bun.run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (25 pts), ternaries 7 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 18). None of this is in the body itself: all 45 points belong to 3 function literals inside it that branch (lines 545, 641, 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.
command.parseTarget (cognitive 45) packages/gui-extensions/src/ssh/command.ts:46— command.parseTarget has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 9, loops 2, ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stream-v2.transport.createSessionTransport.connect (cognitive 45) packages/tui/src/mini/stream-v2.transport.ts:1496— stream-v2.transport.createSessionTransport.connect has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 5, loops 3 (5 pts), error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 22). Of this number, 19 points are the body's own statements and 26 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.
anthropic-messages.step (cognitive 44) packages/ai/src/protocols/anthropic-messages.ts:1527— anthropic-messages.step has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 7 (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.
session-running-menu.SessionRunningMenu (cognitive 44) packages/app/src/session/header/session-running-menu.tsx:29— session-running-menu.SessionRunningMenu has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 17, ternaries 14 (16 pts), if/else 11 (nesting depth added 2). Most of this is not in the body itself: 8 of the 44 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 77, open, a function literal at line 230, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-model.DialogConnectedModels (cognitive 44) packages/tui/src/component/dialog-model.tsx:54— dialog-model.DialogConnectedModels has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 17 (24 pts), boolean chains 10, if/else 9 (10 pts) (nesting depth added 8). Most of this is not in the body itself: 6 of the 44 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 129, a function literal at line 87, a function literal at line 150, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Frame.delegateYield (cognitive 44) packages/codemode/src/interpreter/interpreter.ts:1984— Frame.delegateYield has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (28 pts), ternaries 4 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 22). None of this is in the body itself: all 44 points belong to one function literal inside it that branches (line 1986). 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.
openai-responses-prepare-tools.prepareResponsesTools (cognitive 44) packages/core/src/github-copilot/responses/openai-responses-prepare-tools.ts:36— openai-responses-prepare-tools.prepareResponsesTools has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 11 (28 pts), if/else 7 (8 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 21). Of this number, 42 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bedrock-converse.step (cognitive 43) packages/ai/src/protocols/bedrock-converse.ts:618— bedrock-converse.step has cognitive complexity 43 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 15). None of this is in the body itself: all 43 points belong to 8 function literals inside it that branch (lines 619, 678, 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.
session-timeline-row.createSessionTimelineRowRenderer.render (cognitive 43) packages/session-ui/src/timeline/session-timeline-row.tsx:764— session-timeline-row.createSessionTimelineRowRenderer.render has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (34 pts), ternaries 4 (7 pts), boolean chains 2 (nesting depth added 13). Most of this is not in the body itself: 11 of the 43 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 1013, current, a function literal at line 779, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
server-process.processEffect (cognitive 43) REDACTED:47— server-process.processEffect has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 12 (15 pts), boolean chains 10, loops 1 (nesting depth added 7). Most of this is not in the body itself: 2 of the 43 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 67, 166, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
normalize.normalizeExperimental (cognitive 43) packages/core/src/config/normalize.ts:448— normalize.normalizeExperimental has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (41 pts), boolean chains 2 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
scan.scanBashArrayOrPattern (cognitive 43) packages/core/src/shell/scan.ts:1541— scan.scanBashArrayOrPattern has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 4 (10 pts), boolean chains 9, 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.
layout.outsideNotePlacement (cognitive 43) packages/merman/src/state/layout.ts:973— layout.outsideNotePlacement has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 13 (26 pts), if/else 3 (8 pts), loops 4 (6 pts), boolean chains 3 (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.
drawing.drawSequenceDiagramGrid (cognitive 43) packages/merman/src/sequence/drawing.ts:199— drawing.drawSequenceDiagramGrid has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 8 (15 pts), ternaries 2 (5 pts), boolean chains 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.
editor.ComposerEditor (cognitive 42) packages/app/src/composer/editor/editor.tsx:94— editor.ComposerEditor has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 15 (16 pts), boolean chains 9 (nesting depth added 3). Most of this is not in the body itself: 13 of the 42 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 257, a function literal at line 279, updateCursor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
controller.createHomeSessionsController (cognitive 42) packages/app/src/home/sessions/controller.tsx:44— controller.createHomeSessionsController has cognitive complexity 42 (threshold 15). Drivers by points: if/else 23, boolean chains 9, ternaries 8 (9 pts), error handling 1 (nesting depth added 1). None of this is in the body itself: all 42 points belong to 17 function items inside it that branch (exportSession, rename, 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.
GoUpsellArtRenderable.renderSelf (cognitive 42) packages/tui/src/component/go-upsell-art.ts:222— GoUpsellArtRenderable.renderSelf has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 9 (13 pts), loops 4 (7 pts), boolean chains 6 (nesting depth added 17). Most of this is not in the body itself: 8 of the 42 points are its own statements and the rest belongs to one function literal inside it that branches (line 251). 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.
scan.bashWordEvaluation (cognitive 42) packages/core/src/shell/scan.ts:285— scan.bashWordEvaluation has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 6 (12 pts), boolean chains 11 (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.
footer.command.RunSettingsBody (cognitive 42) packages/tui/src/mini/footer.command.tsx:695— footer.command.RunSettingsBody has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 28 (37 pts), if/else 4, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 5 of the 42 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 704, change, a function literal at line 772). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
string.stringGlobal (cognitive 41) packages/codemode/src/stdlib/string.ts:95— string.stringGlobal has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 14 (18 pts), if/else 15 (16 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 5). None of this is in the body itself: all 41 points belong to 16 function items inside it that branch (a function literal at line 197, a function literal at line 255, self, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
footer.prompt.createPromptState (cognitive 41) packages/tui/src/mini/footer.prompt.tsx:339— footer.prompt.createPromptState has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 17, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 41 points belong to 15 function literals inside it that branch (lines 1293, 461, 1254, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
patch.parse (cognitive 41) packages/util/src/patch.ts:49— patch.parse has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 4, loops 2 (4 pts), ternaries 3 (nesting depth added 20). Of this number, 40 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
google-interactions.lowerMessages (cognitive 40) packages/ai/src/protocols/google-interactions.ts:237— google-interactions.lowerMessages has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (24 pts), ternaries 3 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 22). Of this number, 34 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.
data.createData (cognitive 40) packages/client/src/solid/data.ts:230— data.createData has cognitive complexity 40 (threshold 15). Drivers by points: if/else 136 (208 pts), boolean chains 53, ternaries 34 (50 pts), loops 11 (14 pts), match/switch 2 (nesting depth added 91). To reduce it, split the body into named stages: move each independent 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 (data.createData::handleEvent) 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.
tool-renderer.CurrentContextToolGroup (cognitive 39) packages/session-ui/src/tools/tool-renderer.tsx:460— tool-renderer.CurrentContextToolGroup has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 22, if/else 9, ternaries 8. Most of this is not in the body itself: 2 of the 39 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 528, a function literal at line 495, a function literal at line 689, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
domain.createDirectorySearch (cognitive 39) packages/app/src/workspaces/selection/domain.ts:401— domain.createDirectorySearch has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 7, ternaries 3 (5 pts), loops 1 (nesting depth added 8). None of this is in the body itself: all 39 points belong to 5 function items inside it that branch (a function literal at line 455, scoped, directories, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
plugins.PluginsDialog (cognitive 39) packages/tui/src/feature-plugins/system/plugins.tsx:26— plugins.PluginsDialog has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 15 (17 pts), boolean chains 11, if/else 11 (nesting depth added 2). Most of this is not in the body itself: 4 of the 39 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 90, toggle, a function literal at line 206, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
builtins.make (cognitive 39) packages/core/src/formatter/builtins.ts:16— builtins.make has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 6, loops 5, ternaries 5 (nesting depth added 8). None of this is in the body itself: all 39 points belong to 9 function literals inside it that branch (lines 159, 79, 93, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
transfer.sanitizeMessage (cognitive 39) packages/core/src/session/transfer.ts:208— transfer.sanitizeMessage has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 12 (26 pts), if/else 10 (13 pts) (nesting depth added 17). Most of this is not in the body itself: 15 of the 39 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 267, 215, 233, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
footer.subagent.RunFooterSubagentBody (cognitive 39) packages/tui/src/mini/footer.subagent.tsx:47— footer.subagent.RunFooterSubagentBody has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 15 (18 pts), boolean chains 12, if/else 9 (nesting depth added 3). Most of this is not in the body itself: 7 of the 39 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 115, a function literal at line 166, a function literal at line 77, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
entry.isPromptEqual (cognitive 38) packages/app/src/composer/history/entry.ts:82— entry.isPromptEqual has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 8, ternaries 1 (3 pts), loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
view.HomeSessionRow (cognitive 38) packages/app/src/home/sessions/view.tsx:494— view.HomeSessionRow has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 10, ternaries 7 (nesting depth added 1). Most of this is not in the body itself: 3 of the 38 points are its own statements and the rest belongs to 21 function items inside it that branch (saveEditor, a function literal at line 619, a function literal at line 684, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
providers.SettingsProviders (cognitive 38) packages/app/src/settings/providers/providers.tsx:44— providers.SettingsProviders has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22, boolean chains 11, ternaries 4 (5 pts) (nesting depth added 1). None of this is in the body itself: all 38 points belong to 19 function items inside it that branch (source, a function literal at line 130, type, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
subagents-tab.SubagentsTab (cognitive 38) packages/tui/src/routes/session/composer/subagents-tab.tsx:26— subagents-tab.SubagentsTab has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 14 (18 pts), if/else 15 (17 pts), boolean chains 3 (nesting depth added 6). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 73, a function literal at line 206, scrollToIndex, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
form.answerField (cognitive 38) REDACTED:68— form.answerField has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 7, ternaries 2 (nesting depth added 11). Of this number, 34 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.
openai-chat.lowerMessages (cognitive 37) packages/ai/src/protocols/openai-chat.ts:552— openai-chat.lowerMessages has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 8, ternaries 3 (7 pts), loops 1 (nesting depth added 12). Of this number, 30 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dom.setCursorPosition (cognitive 37) packages/app/src/composer/editor/dom.ts:34— dom.setCursorPosition has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 11, ternaries 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
submit.createComposerSubmit.submit (cognitive 37) packages/app/src/composer/submit.ts:57— submit.createComposerSubmit.submit has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 6 (8 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 11). Of this number, 27 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
selector.PromptWorkspaceSelector (cognitive 37) packages/app/src/new-session/workspace/selector.tsx:11— selector.PromptWorkspaceSelector has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 23 (25 pts), if/else 9, boolean chains 3 (nesting depth added 2). Of this number, 21 points are the body's own statements and 16 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.
form.validateText (cognitive 37) REDACTED:166— form.validateText has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 10, error handling 1 (2 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.
array.arrayGlobal (cognitive 37) packages/codemode/src/stdlib/array.ts:105— array.arrayGlobal has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 10 (11 pts), boolean chains 7, loops 4 (nesting depth added 3). None of this is in the body itself: all 37 points belong to 15 function items inside it that branch (mutable, a function literal at line 372, construct, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
20260805200742_import_legacy_credentials.importLegacyCredentials (cognitive 37) packages/core/src/database/migration/20260805200742_import_legacy_credentials.ts:46— 20260805200742_import_legacy_credentials.importLegacyCredentials has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 8 (23 pts), if/else 7 (11 pts), boolean chains 2, loops 1 (nesting depth added 19). None of this is in the body itself: all 37 points belong to one function literal inside it that branches (line 47). 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.normalize (cognitive 37) packages/core/src/config/normalize.ts:57— normalize.normalize has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 12 (16 pts), if/else 13, boolean chains 8 (nesting depth added 4). Of this number, 34 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.
message-updater.update (cognitive 37) packages/core/src/session/message-updater.ts:33— message-updater.update has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 9, ternaries 4 (5 pts) (nesting depth added 5). None of this is in the body itself: all 37 points belong to 19 function literals inside it that branch (lines 364, 346, 218, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
publish-llm-event.createLLMEventPublisher.publish (cognitive 37) packages/core/src/session/runner/publish-llm-event.ts:436— publish-llm-event.createLLMEventPublisher.publish has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (33 pts), ternaries 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 18). 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.
controller.createNewSessionWorkspaceController (cognitive 36) packages/app/src/new-session/workspace/controller.ts:51— controller.createNewSessionWorkspaceController has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17, boolean chains 10, ternaries 9. None of this is in the body itself: all 36 points belong to 18 function items inside it that branch (a function literal at line 150, a function literal at line 255, a function literal at line 106, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
error-component.ErrorComponent (cognitive 36) packages/tui/src/component/error-component.tsx:10— error-component.ErrorComponent has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14, ternaries 9 (14 pts), boolean chains 8 (nesting depth added 5). Most of this is not in the body itself: 6 of the 36 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 69, 146, 144). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
diff-viewer-file-tree.DiffViewerFileTree (cognitive 36) packages/tui/src/feature-plugins/system/diff-viewer-file-tree.tsx:30— diff-viewer-file-tree.DiffViewerFileTree has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 16 (17 pts), if/else 13, boolean chains 6 (nesting depth added 1). Most of this is not in the body itself: 6 of the 36 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 129, 156, 136, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
service.ensure (cognitive 36) packages/client/src/promise/service.ts:28— service.ensure has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 18). Of this number, 33 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.
panel.TerminalPanel (cognitive 36) packages/gui-extensions/src/terminal/panel.tsx:38— panel.TerminalPanel has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17, boolean chains 15, ternaries 4. Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 21 function items inside it that branch (a function literal at line 149, markTerminalConnected, a function literal at line 279, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
index.normalizeTransport (cognitive 36) packages/httpapi-codegen/src/index.ts:1300— index.normalizeTransport has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 10 (30 pts), if/else 6 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
content.contentBlockToParts (cognitive 35) packages/cli/src/acp/content.ts:16— content.contentBlockToParts has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 7 (15 pts), boolean chains 3, match/switch 1 (nesting depth added 18). 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.
Frame.destructureArrayPattern (cognitive 35) packages/codemode/src/interpreter/interpreter.ts:1245— Frame.destructureArrayPattern has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 4 (10 pts), loops 2 (4 pts) (nesting depth added 20). None of this is in the body itself: all 35 points belong to one function literal inside it that branches (line 1251). 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.
runtime.buildRequest (cognitive 35) packages/codemode/src/openapi/runtime.ts:54— runtime.buildRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 3 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 13). None of this is in the body itself: all 35 points belong to 3 function literals inside it that branch (lines 58, 105, 63). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.fromSpec (cognitive 35) packages/codemode/src/openapi/index.ts:38— index.fromSpec has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 3 (6 pts), ternaries 2, boolean chains 1 (nesting depth added 20). Of this number, 26 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.
config.layer (cognitive 35) packages/core/src/config.ts:94— config.layer has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 15 (17 pts), if/else 10 (11 pts), boolean chains 5, loops 2 (nesting depth added 3). None of this is in the body itself: all 35 points belong to 16 function literals inside it that branch (lines 220, 301, 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.
host.make (cognitive 35) packages/core/src/plugin/host.ts:47— host.make has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 16 (17 pts), if/else 9 (10 pts), boolean chains 8 (nesting depth added 2). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 23 function items inside it that branch (locationRef, a function literal at line 574, a function literal at line 121, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
file.DiffViewer (cognitive 34) packages/session-ui/src/components/file.tsx:1042— file.DiffViewer has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15, ternaries 10, boolean chains 9. None of this is in the body itself: all 34 points belong to 11 function items inside it that branch (a function literal at line 1213, a function literal at line 1103, a function literal at line 1081, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-diff.completePatch (cognitive 34) packages/session-ui/src/components/session-diff.ts:91— session-diff.completePatch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 6, error handling 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.
session-elicitation-dock.SessionElicitationDock (cognitive 34) packages/app/src/session/requests/session-elicitation-dock.tsx:27— session-elicitation-dock.SessionElicitationDock has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 13, ternaries 10 (11 pts), if/else 9 (10 pts) (nesting depth added 2). None of this is in the body itself: all 34 points belong to 11 function items inside it that branch (a function literal at line 161, a function literal at line 87, a function literal at line 112, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TabPulseRenderable.renderSelf (cognitive 34) packages/tui/src/component/tab-pulse.tsx:639— TabPulseRenderable.renderSelf has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 16 (26 pts), if/else 4 (5 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.
SpatialIndex.conflicts (cognitive 34) packages/merman/src/core/spatial.ts:198— SpatialIndex.conflicts has cognitive complexity 34 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 3 (13 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 21). 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.
source.bun.prepareSource.visit (cognitive 34) packages/plugin/src/source.bun.ts:15— source.bun.prepareSource.visit has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (10 pts), error handling 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 15). Of this number, 27 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-timeline-row.createSessionTimelineRowRenderer.Notice (cognitive 33) packages/session-ui/src/timeline/session-timeline-row.tsx:492— session-timeline-row.createSessionTimelineRowRenderer.Notice has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 11, if/else 10 (nesting depth added 1). None of this is in the body itself: all 33 points belong to 13 function items inside it that branch (a function literal at line 516, a function literal at line 600, a function literal at line 543, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
prompt.extractPromptFromMessage (cognitive 33) packages/app/src/composer/prompt.ts:68— prompt.extractPromptFromMessage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 5 (11 pts), boolean chains 3, loops 3 (nesting depth added 13). Of this number, 30 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.
session-question-dock.SessionQuestionDock::nav (cognitive 33) packages/app/src/session/requests/session-question-dock.tsx:379— session-question-dock.SessionQuestionDock::nav has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 9, ternaries 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. This shape REPEATS in the file: one other method here (session-question-dock.SessionQuestionDock) 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.
controller.createTimelineController (cognitive 33) packages/app/src/session/timeline/controller.tsx:59— controller.createTimelineController has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14, ternaries 10 (12 pts), boolean chains 6, error handling 1 (nesting depth added 2). None of this is in the body itself: all 33 points belong to 16 function items inside it that branch (rename, exportSession, a function literal at line 100, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
one-cell-spinner.OneCellSpinnerStory (cognitive 33) packages/tui/src/feature-plugins/system/storybook/one-cell-spinner.tsx:13— one-cell-spinner.OneCellSpinnerStory has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 23 (28 pts), if/else 4, boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 33 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 164, a function literal at line 140, a function literal at line 72, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Frame.evaluateForOfStatement (cognitive 33) packages/codemode/src/interpreter/interpreter.ts:716— Frame.evaluateForOfStatement has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 7 (11 pts), boolean chains 3, loops 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 726, 738, 751, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
view.SessionFileView (cognitive 33) packages/gui-extensions/src/file/view.tsx:192— view.SessionFileView has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15, boolean chains 11, ternaries 7. Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 374, a function literal at line 432, a function literal at line 395, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.renderImportedEffectFiles (cognitive 33) packages/httpapi-codegen/src/index.ts:641— index.renderImportedEffectFiles has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 24 (30 pts), boolean chains 2, if/else 1 (nesting depth added 6). Most of this is not in the body itself: 14 of the 33 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 654, 677, 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.
index.renderGroup (cognitive 33) packages/httpapi-codegen/src/index.ts:1759— index.renderGroup has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 24 (28 pts), if/else 4, boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 33 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 1762, renderSuccess, a function literal at line 1793, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
parser.parseMermaidTimelineDiagram (cognitive 33) packages/merman/src/timeline/parser.ts:14— parser.parseMermaidTimelineDiagram has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (28 pts), ternaries 2 (3 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.
markdown.createMermaidCodeBlockRenderer (cognitive 33) packages/merman/src/markdown.ts:268— markdown.createMermaidCodeBlockRenderer has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (22 pts), ternaries 3 (5 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 17). None of this is in the body itself: all 33 points belong to one function literal inside it that branches (line 273). 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.
tool.toolEntryBody (cognitive 33) packages/tui/src/mini/tool.ts:1313— tool.toolEntryBody has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
projection.toolGroupType (cognitive 32) packages/session-ui/src/timeline/projection.ts:961— projection.toolGroupType has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 12 (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.
diff-viewer.DiffViewer (cognitive 32) packages/tui/src/feature-plugins/system/diff-viewer.tsx:91— diff-viewer.DiffViewer has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 12 (14 pts), if/else 12, boolean chains 6 (nesting depth added 2). Most of this is not in the body itself: 2 of the 32 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 146, sourceDetail, 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.
client.make::sse (cognitive 32) packages/client/src/promise/generated/client.ts:376— client.make::sse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 4 (9 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
data.walk (cognitive 32) packages/codemode/src/data.ts:44— data.walk has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 7, ternaries 6 (7 pts), loops 2 (3 pts) (nesting depth added 3). None of this is in the body itself: all 32 points belong to 2 function literals inside it that branch (lines 52, 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.
runtime.serializeQuery (cognitive 32) packages/codemode/src/openapi/runtime.ts:250— runtime.serializeQuery has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, loops 3 (6 pts), ternaries 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.
normalize.normalizeMcp (cognitive 32) packages/core/src/config/normalize.ts:249— normalize.normalizeMcp has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 15). Most of this is not in the body itself: 14 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 269). 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.
read-filesystem.read (cognitive 32) packages/core/src/tool/read-filesystem.ts:116— read-filesystem.read has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6, ternaries 1 (4 pts), loops 1 (nesting depth added 12). Of this number, 27 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
to-llm-message.assistant (cognitive 32) packages/core/src/session/runner/to-llm-message.ts:155— to-llm-message.assistant has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 11, if/else 6 (nesting depth added 7). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 162, 203, 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.
OpenAIResponsesLanguageModel.doGenerate (cognitive 32) packages/core/src/github-copilot/responses/openai-responses-language-model.ts:311— OpenAIResponsesLanguageModel.doGenerate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (11 pts), boolean chains 2, match/switch 1 (2 pts), ternaries 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.
drawing.drawTimelineDiagramGrid (cognitive 32) packages/merman/src/timeline/drawing.ts:19— drawing.drawTimelineDiagramGrid has cognitive complexity 32 (threshold 15). Drivers by points: loops 9 (17 pts), if/else 5 (9 pts), ternaries 4 (6 pts) (nesting depth added 14). Of this number, 29 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, 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.
footer.prompt.createPromptState.submitPrompt (cognitive 32) packages/tui/src/mini/footer.prompt.tsx:1353— footer.prompt.createPromptState.submitPrompt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 6 (9 pts), boolean chains 8 (nesting depth added 6). Of this number, 29 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openai-chat.lowerAssistantMessage (cognitive 31) packages/ai/src/protocols/openai-chat.ts:436— openai-chat.lowerAssistantMessage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 4 (6 pts), boolean chains 5, loops 1 (nesting depth added 6). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 470, 481, 489). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
selection.createComposerModelSelection (cognitive 31) packages/app/src/composer/selection.ts:41— selection.createComposerModelSelection has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 10, boolean chains 9 (nesting depth added 2). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 120, a function literal at line 53, a function literal at line 55, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
screen.ConnectServerScreen (cognitive 31) packages/app/src/servers/connect/screen.tsx:20— screen.ConnectServerScreen has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 10, ternaries 8 (nesting depth added 3). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 78, target, connect, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
search-results.rankSettings (cognitive 31) packages/app/src/settings/search-results.ts:24— search-results.rankSettings has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (21 pts), boolean chains 5, if/else 5 (nesting depth added 11). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 30, 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.
footer.PromptFooter (cognitive 31) packages/tui/src/feature-plugins/prompt/footer.tsx:14— footer.PromptFooter has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 16 (18 pts), boolean chains 8, if/else 5 (nesting depth added 2). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 22, 29, 36, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
provider-error.classifyProviderFailure (cognitive 30) packages/ai/src/provider-error.ts:239— provider-error.classifyProviderFailure has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 21, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
terminal-pane.TerminalPane::processStream (cognitive 30) packages/tui/src/component/terminal-pane.tsx:97— terminal-pane.TerminalPane::processStream has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
promises.invokePromiseMethod (cognitive 30) packages/codemode/src/interpreter/promises.ts:335— promises.invokePromiseMethod has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 10). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 363, 391, 355, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scan.scanBashSpan (cognitive 30) packages/core/src/shell/scan.ts:1201— scan.scanBashSpan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 7, ternaries 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.
analysis.parseHeap.object (cognitive 30) packages/gui-extensions/src/browser/analysis.ts:217— analysis.parseHeap.object has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routing.routeParallelEdges (cognitive 30) packages/merman/src/flowchart/routing.ts:524— routing.routeParallelEdges has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 3 (6 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routing.pathIntersectsBounds (cognitive 30) packages/merman/src/flowchart/routing.ts:667— routing.pathIntersectsBounds has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 12, 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.
entry.body.entryBody (cognitive 30) packages/tui/src/mini/entry.body.ts:191— entry.body.entryBody has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 4 (10 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.
machine.keyDown (cognitive 29) packages/app/src/composer/suggestions/machine.ts:223— machine.keyDown has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (11 pts), ternaries 5 (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.
child-store.createChildStoreManager.ensureChild (cognitive 29) packages/app/src/runtime/server/global-sync/child-store.ts:174— child-store.createChildStoreManager.ensureChild has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 9 of the 29 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 202, 207, 290, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
sync.createServerSyncContextInner (cognitive 29) packages/app/src/runtime/server/sync.tsx:50— sync.createServerSyncContextInner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 5, ternaries 4 (5 pts), loops 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 242, a function literal at line 326, a function literal at line 180, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
usage-exceeded-dialogs.useUsageExceededDialogs (cognitive 29) packages/app/src/session/usage-exceeded-dialogs.tsx:82— usage-exceeded-dialogs.useUsageExceededDialogs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 5, ternaries 1 (nesting depth added 2). 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 155, a function literal at line 179, showFreeLimitDialog, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
migration.applyOnly (cognitive 29) packages/core/src/database/migration.ts:54— migration.applyOnly has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 3 (8 pts), loops 2 (5 pts) (nesting depth added 18). None of this is in the body itself: all 29 points belong to 2 function literals inside it that branch (lines 55, 122). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
routing.routeHorizontalSubgraphExitFanIn (cognitive 29) packages/merman/src/flowchart/routing.ts:572— routing.routeHorizontalSubgraphExitFanIn has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 4 (7 pts), loops 3 (4 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.
runtime-modules.discoverPluginRuntimeSpecifiers (cognitive 29) packages/plugin/src/runtime-modules.ts:25— runtime-modules.discoverPluginRuntimeSpecifiers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 3 (10 pts), ternaries 3 (7 pts), loops 3 (6 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 17). Of this number, 27 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stream-v2.subagent.createSubagentTracker.runDiscovery (cognitive 29) packages/tui/src/mini/stream-v2.subagent.ts:584— stream-v2.subagent.createSubagentTracker.runDiscovery has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (7 pts), boolean chains 4, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunFooter.event (cognitive 29) packages/tui/src/mini/footer.ts:438— RunFooter.event has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (29 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.
close-issues.main (cognitive 29) script/github/close-issues.ts:62— close-issues.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (11 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.
dictionary-types.unsafeDirectValue (cognitive 29) script/oxlint/anti-slop/shared/dictionary-types.ts:176— dictionary-types.unsafeDirectValue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 5 (10 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.
file.TextViewer (cognitive 28) packages/session-ui/src/components/file.tsx:798— file.TextViewer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 4, ternaries 2. None of this is in the body itself: all 28 points belong to 12 function items inside it that branch (applySelection, a function literal at line 912, text, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
use-session-hash-scroll.useSessionHashScroll (cognitive 28) packages/app/src/session/use-session-hash-scroll.ts:6— use-session-hash-scroll.useSessionHashScroll has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 8 (nesting depth added 3). None of this is in the body itself: all 28 points belong to 4 function literals inside it that branch (lines 169, 208, 159, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
background.createSessionBackground.history.assistant (cognitive 28) packages/app/src/session/requests/background.ts:21— background.createSessionBackground.history.assistant has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 5 (7 pts), boolean chains 4 (nesting depth added 9). Of this number, 14 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.
structure.resolveSlots (cognitive 28) packages/tui/src/plugin/structure.ts:60— structure.resolveSlots has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). Of this number, 24 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.
dialog-mcp.DialogMcp (cognitive 28) packages/tui/src/component/dialog-mcp.tsx:36— dialog-mcp.DialogMcp has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15, ternaries 7, boolean chains 6. Most of this is not in the body itself: 4 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (toggle, select, statusColor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
form.FormPrompt::commitInput (cognitive 28) packages/tui/src/routes/session/form.tsx:381— form.FormPrompt::commitInput has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 8, ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (form.FormPrompt) 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.
connection.createClientConnection.runStream (cognitive 28) packages/client/src/solid/connection.ts:147— connection.createClientConnection.runStream has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 14). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
web.structuredCloneGlobal (cognitive 28) packages/codemode/src/stdlib/web.ts:44— web.structuredCloneGlobal has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 3 (5 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 6). None of this is in the body itself: all 28 points belong to 2 function literals inside it that branch (lines 49, 45). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tool-input-repair.repairArray (cognitive 28) packages/core/src/plugin/tool-input-repair.ts:133— tool-input-repair.repairArray has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (21 pts), boolean chains 5, if/else 2 (nesting depth added 10). Of this number, 24 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.
page.PairingPage (cognitive 28) packages/gui-extensions/src/pairing/page.tsx:31— page.PairingPage has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 13, if/else 12, ternaries 3. Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 9 function items inside it that branch (setup, a function literal at line 65, tunnel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
home.getWindow (cognitive 28) packages/stats/core/src/domain/home.ts:919— home.getWindow has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (28 pts) (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.
stream-v2.transport.createSessionTransport.renderTool (cognitive 28) packages/tui/src/mini/stream-v2.transport.ts:720— stream-v2.transport.createSessionTransport.renderTool has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 9, ternaries 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
dictionary-types.dictionaryValueTypes (cognitive 28) script/oxlint/anti-slop/shared/dictionary-types.ts:232— dictionary-types.dictionaryValueTypes has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 10, boolean chains 6 (nesting depth added 6). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gemini-json-schema.normalizeNode (cognitive 27) packages/ai/src/protocols/utils/gemini-json-schema.ts:19— gemini-json-schema.normalizeNode has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 11, ternaries 3 (5 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 24, 29). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
anthropic-messages.onContentBlockStart (cognitive 27) packages/ai/src/protocols/anthropic-messages.ts:1223— anthropic-messages.onContentBlockStart has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 8, if/else 6 (7 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.
keybinds.createKeybindSettingsController (cognitive 27) packages/app/src/settings/keybinds/keybinds.tsx:236— keybinds.createKeybindSettingsController has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 6). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 6 function items inside it that branch (handle, a function literal at line 274, effective, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
opencode.supportsAvx2 (cognitive 27) packages/cli/bin/opencode.cjs:44— opencode.supportsAvx2 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 3 (7 pts), boolean chains 5, 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.
dialog-update.DialogUpdate (cognitive 27) packages/tui/src/component/dialog-update.tsx:10— dialog-update.DialogUpdate has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (16 pts), if/else 7, boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 45, 133, 35, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
postinstall.supportsAvx2 (cognitive 27) packages/cli/script/postinstall.mjs:32— postinstall.supportsAvx2 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 3 (7 pts), boolean chains 5, 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.
oauth.authorize (cognitive 27) packages/core/src/mcp/oauth.ts:332— oauth.authorize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 10 (11 pts), boolean chains 5 (nesting depth added 2). None of this is in the body itself: all 27 points belong to 8 function literals inside it that branch (lines 338, 361, 399, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
artifact-view.ImageStage (cognitive 27) packages/gui-extensions/src/file/artifact-view.tsx:318— artifact-view.ImageStage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12, boolean chains 10, ternaries 5. Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 403, a function literal at line 448, a function literal at line 437, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
openapi-stabilize.stabilizeOpenApi (cognitive 27) packages/protocol/script/openapi-stabilize.ts:3— openapi-stabilize.stabilizeOpenApi has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 6 (10 pts), boolean chains 6, loops 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (canonical, a function literal at line 27, a function literal at line 33, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
anthropic-messages.onContentBlockDelta (cognitive 26) packages/ai/src/protocols/anthropic-messages.ts:1316— anthropic-messages.onContentBlockDelta has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, 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.
message-content.CurrentUserMessageDisplay (cognitive 26) packages/session-ui/src/message/message-content.tsx:260— message-content.CurrentUserMessageDisplay has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13, boolean chains 9, if/else 4. Of this number, 13 points are the body's own statements and 13 belong to 8 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
scroll.createHomeScrollController (cognitive 26) packages/app/src/home/scroll.ts:11— scroll.createHomeScrollController has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 4, ternaries 2 (nesting depth added 1). None of this is in the body itself: all 26 points belong to 11 function items inside it that branch (containWheel, updatePositionCache, bindResizeObserver, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
controller.createProviderConnectionController.select (cognitive 26) packages/app/src/providers/connect/controller.ts:347— controller.createProviderConnectionController.select has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (7 pts), boolean chains 5 (nesting depth added 6). Of this number, 23 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tooltip.ModelTooltip (cognitive 26) packages/app/src/providers/models/tooltip.tsx:36— tooltip.ModelTooltip has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, ternaries 6 (8 pts) (nesting depth added 2). 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 items inside it that branch (sourceName, inputLabel, inputs, …). 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.
attention.createTuiAttention.notify (cognitive 26) packages/tui/src/attention.ts:129— attention.createTuiAttention.notify has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts), ternaries 6, error handling 2 (3 pts) (nesting depth added 3). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.applyCredentials (cognitive 26) packages/codemode/src/openapi/runtime.ts:156— runtime.applyCredentials has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 13). Of this number, 24 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent 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.makeMemoryDriver (cognitive 26) packages/core/src/environment/memory.ts:16— memory.makeMemoryDriver has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, ternaries 5, loops 3 (nesting depth added 1). None of this is in the body itself: all 26 points belong to 9 function literals inside it that branch (lines 118, 70, 106, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
shell.layer (cognitive 26) packages/core/src/shell.ts:127— shell.layer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 5, boolean chains 3, loops 3 (nesting depth added 2). None of this is in the body itself: all 26 points belong to 13 function literals inside it that branch (lines 397, 244, 167, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
supervisor.resolve (cognitive 26) packages/core/src/plugin/supervisor.ts:19— supervisor.resolve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 13). Of this number, 23 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
errors.browserFailure (cognitive 26) packages/gui-extensions/src/browser/errors.ts:22— errors.browserFailure has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (24 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.
spreadsheet.SpreadsheetGrid::paint (cognitive 26) packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:353— spreadsheet.SpreadsheetGrid::paint has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 9, 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.
layout.rankGraphComponents (cognitive 26) packages/merman/src/flowchart/layout.ts:780— layout.rankGraphComponents has cognitive complexity 26 (threshold 15). Drivers by points: loops 9 (13 pts), if/else 4 (11 pts), boolean chains 2 (nesting depth added 11). 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, 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.
routing.addSideParallelTransition (cognitive 26) packages/merman/src/state/routing.ts:780— routing.addSideParallelTransition has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 5 (7 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
layout.expandCompositeBoundsForInternalRouting (cognitive 26) packages/merman/src/state/layout.ts:408— layout.expandCompositeBoundsForInternalRouting has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 8, ternaries 2 (4 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 423, 443, 448, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
drawing.createStateDiagramDrawingWithDirection (cognitive 26) packages/merman/src/state/drawing.ts:240— drawing.createStateDiagramDrawingWithDirection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 6, ternaries 5, boolean chains 2 (nesting depth added 6). 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.
message-nav.MessageDiffBars (cognitive 26) packages/session-ui/src/components/message-nav.tsx:111— message-nav.MessageDiffBars has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 12 (20 pts), boolean chains 4, if/else 2 (nesting depth added 8). None of this is in the body itself: all 26 points belong to one function literal inside it that branches (line 115). 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.
session-review-v2.SessionReviewV2 (cognitive 26) packages/session-ui/src/v2/components/session-review-v2.tsx:155— session-review-v2.SessionReviewV2 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12, boolean chains 8, ternaries 6. Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 203, fileIndex, toolbarStart, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
footer.command.createSearchablePanelController (cognitive 26) packages/tui/src/mini/footer.command.tsx:143— footer.command.createSearchablePanelController has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 10 (nesting depth added 1). None of this is in the body itself: all 26 points belong to 2 function literals inside it that branch (lines 186, 171). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
footer.prompt.createPromptState.select (cognitive 26) packages/tui/src/mini/footer.prompt.tsx:1030— footer.prompt.createPromptState.select has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 7). Of this number, 25 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunScrollbackStream.flushActive (cognitive 26) packages/tui/src/mini/scrollback.surface.ts:258— RunScrollbackStream.flushActive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 5 (9 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
subagent-eviction.default (cognitive 26) script/drive/subagent-eviction.ts:25— subagent-eviction.default has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 4). None of this is in the body itself: all 26 points belong to 4 function literals inside it that branch (lines 26, 41, 106, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
dictionary-types.classifyWideningTarget (cognitive 26) script/oxlint/anti-slop/shared/dictionary-types.ts:320— dictionary-types.classifyWideningTarget has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 11, 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.
panels.DockRegion (cognitive 25) packages/app/src/runtime/extension/panels.tsx:387— panels.DockRegion has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 7, ternaries 4 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 432, 457, 518, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
session-timeline-row.createSessionTimelineRowRenderer.notice (cognitive 25) packages/session-ui/src/timeline/session-timeline-row.tsx:405— session-timeline-row.createSessionTimelineRowRenderer.notice has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 5 (11 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.
search-index.settingsSearchIndex (cognitive 25) packages/app/src/settings/search-index.ts:20— search-index.settingsSearchIndex has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10, ternaries 6 (8 pts), boolean chains 7 (nesting depth added 2). None of this is in the body itself: all 25 points belong to 10 function items inside it that branch (a function literal at line 89, add, 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.
error.cliErrorMessage (cognitive 25) packages/tui/src/util/error.ts:5— error.cliErrorMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 5). 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.
local-attachment.parsePastedFilepaths (cognitive 25) packages/tui/src/component/prompt/local-attachment.ts:107— local-attachment.parsePastedFilepaths has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 10). 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.
form.answerForm (cognitive 25) REDACTED:12— form.answerForm has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 2 (5 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.
stats.renderStats (cognitive 25) packages/cli/src/commands/handlers/stats.ts:95— stats.renderStats has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 12 (19 pts), boolean chains 3, if/else 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
postinstall.packageNames (cognitive 25) packages/cli/script/postinstall.mjs:85— postinstall.packageNames has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 9 (23 pts), boolean chains 2 (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.
index.makeLayer (cognitive 25) packages/core/src/persistent-pty/index.ts:119— index.makeLayer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 3 (nesting depth added 1). None of this is in the body itself: all 25 points belong to 15 function literals inside it that branch (lines 265, 142, 293, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
html-markdown.convertHTMLToMarkdown::finishCode (cognitive 25) packages/core/src/tool/html-markdown.ts:206— html-markdown.convertHTMLToMarkdown::finishCode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 5 (9 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (html-markdown.convertHTMLToMarkdown) 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.
v1-migration.bun.migrateError (cognitive 25) packages/core/src/database/v1-migration.bun.ts:1105— v1-migration.bun.migrateError has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (24 pts), boolean chains 1 (nesting depth added 16). 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.
stats.get (cognitive 25) packages/core/src/session/stats.ts:80— stats.get has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 4 (5 pts), boolean chains 2 (nesting depth added 7). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 150, 254, 190, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
diagnostics.createDiagnostics (cognitive 25) packages/gui-extensions/src/browser/diagnostics.ts:27— diagnostics.createDiagnostics has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 9 (10 pts), boolean chains 2 (nesting depth added 5). None of this is in the body itself: all 25 points belong to 11 function literals inside it that branch (lines 62, 193, 73, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
model.createReviewModel (cognitive 25) packages/gui-extensions/src/review/model.ts:46— model.createReviewModel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 10, ternaries 2 (nesting depth added 1). None of this is in the body itself: all 25 points belong to 10 function literals inside it that branch (lines 520, 222, 582, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.renderPromiseClient (cognitive 25) packages/httpapi-codegen/src/index.ts:906— index.renderPromiseClient has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 15 (18 pts), if/else 3 (4 pts), boolean chains 3 (nesting depth added 4). None of this is in the body itself: all 25 points belong to 5 function literals inside it that branch (lines 914, 923, 908, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
routing.addBottomLaneTransition (cognitive 25) packages/merman/src/state/routing.ts:698— routing.addBottomLaneTransition has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (14 pts), loops 3 (5 pts), if/else 4, boolean chains 2 (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.
tool-history.normalizeToolHistory (cognitive 24) packages/ai/src/tool-history.ts:6— tool-history.normalizeToolHistory has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 9). Of this number, 22 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bedrock-event-stream.consumeFrames (cognitive 24) packages/ai/src/protocols/bedrock-event-stream.ts:44— bedrock-event-stream.consumeFrames has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (9 pts), boolean chains 1, loops 1 (nesting depth added 11). None of this is in the body itself: all 24 points belong to 2 function literals inside it that branch (lines 45, 69). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
health.createServerHealth (cognitive 24) packages/app/src/runtime/server/health.ts:171— health.createServerHealth has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (8 pts), boolean chains 4, loops 2 (nesting depth added 8). None of this is in the body itself: all 24 points belong to 4 function literals inside it that branch (lines 179, 230, 189, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
auto-approve.createPermissionAutoApprover (cognitive 24) packages/app/src/session/requests/auto-approve.ts:15— auto-approve.createPermissionAutoApprover has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8, loops 3 (4 pts), ternaries 1 (nesting depth added 2). None of this is in the body itself: all 24 points belong to 13 function items inside it that branch (a function literal at line 46, remember, a function literal at line 36, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog.DialogFooter (cognitive 24) packages/tui/src/ui/dialog.tsx:209— dialog.DialogFooter has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 18, boolean chains 5, if/else 1. Of this number, 19 points are the body's own statements and 5 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.
rows.reduceSessionRows (cognitive 24) packages/tui/src/routes/session/rows.ts:343— rows.reduceSessionRows has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, ternaries 3 (nesting depth added 3). 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 377, a function literal at line 394, flushTurn, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.ApplyPatch (cognitive 24) packages/tui/src/routes/session/index.tsx:3507— index.ApplyPatch has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 14 (18 pts), if/else 4, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 3539, 3586, 3528, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
service-config.set (cognitive 24) packages/cli/src/services/service-config.ts:245— service-config.set has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, 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.
errors.normalizeError (cognitive 24) packages/codemode/src/interpreter/errors.ts:26— errors.normalizeError has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 5 (11 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.
instructions.update (cognitive 24) packages/core/src/codemode/instructions.ts:32— instructions.update has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (21 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.
variant.sapAICore (cognitive 24) packages/core/src/variant.ts:515— variant.sapAICore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 12). Of this number, 15 points are the body's own statements and 9 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.
migration-status.MigrationStatus (cognitive 24) packages/desktop/src/renderer/migration-status.tsx:10— migration-status.MigrationStatus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 6). 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 88, format, a function literal at line 101, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
chromium.createBrowserPage (cognitive 24) packages/gui-extensions/src/browser/chromium.ts:124— chromium.createBrowserPage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 112 (147 pts), ternaries 55 (89 pts), boolean chains 56, loops 8 (14 pts), error handling 1, 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. This shape REPEATS in the file: 3 other methods here (chromium.createBrowserPage::execute, chromium.createBrowserPage::inspect, chromium.createBrowserPage::snapshot::walk) 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.
spreadsheet.OfficeSpreadsheet (cognitive 24) packages/gui-extensions/src/microsoft-office/spreadsheet.tsx:71— spreadsheet.OfficeSpreadsheet has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, ternaries 6, boolean chains 5. None of this is in the body itself: all 24 points belong to 10 function items inside it that branch (show, roam, a function literal at line 169, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
routing.routeFlowchartEdges (cognitive 24) packages/merman/src/flowchart/routing.ts:1245— routing.routeFlowchartEdges has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, loops 5, ternaries 2 (nesting depth added 4). Of this number, 14 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
layout.rankNodes (cognitive 24) packages/merman/src/flowchart/layout.ts:129— layout.rankNodes has cognitive complexity 24 (threshold 15). Drivers by points: loops 9 (11 pts), if/else 5 (10 pts), ternaries 2, boolean chains 1 (nesting depth added 7). 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.
placement.resolveParticipantCenters (cognitive 24) packages/merman/src/sequence/placement.ts:376— placement.resolveParticipantCenters has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, loops 3, 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.
footer.prompt.createPromptState.syncParts (cognitive 24) packages/tui/src/mini/footer.prompt.tsx:610— footer.prompt.createPromptState.syncParts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (nesting depth added 8). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.queue.runPromptQueue (cognitive 24) packages/tui/src/mini/runtime.queue.ts:46— runtime.queue.runPromptQueue has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, if/else 9. 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 items inside it that branch (submit, drain, finish, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
part.Part (cognitive 24) packages/web/src/components/share/part.tsx:43— part.Part has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 23, ternaries 1. 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.
no-reduce-accumulator-copy.enclosingReducer (cognitive 24) script/oxlint/anti-slop/rules/no-reduce-accumulator-copy.ts:11— no-reduce-accumulator-copy.enclosingReducer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, loops 2 (4 pts), 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.
dictionary-types.classifyAliasBroadTarget (cognitive 24) script/oxlint/anti-slop/shared/dictionary-types.ts:422— dictionary-types.classifyAliasBroadTarget has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11, ternaries 5 (10 pts), boolean chains 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.
commented-lines.markCommentedDiffLines (cognitive 23) packages/session-ui/src/pierre/commented-lines.ts:26— commented-lines.markCommentedDiffLines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 9). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
drafts.createDraftStore.encode (cognitive 23) packages/app/src/runtime/persistence/drafts.ts:232— drafts.createDraftStore.encode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
selector.PromptProjectSelector (cognitive 23) packages/app/src/new-session/project/selector.tsx:221— selector.PromptProjectSelector has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 355, selectActive, setTriggerRef::ready, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
shell.RootSettings (cognitive 23) packages/app/src/settings/shell.tsx:226— shell.RootSettings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9, ternaries 7 (8 pts), boolean chains 6 (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 9 function items inside it that branch (a function literal at line 271, a function literal at line 286, a function literal at line 329, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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-tabs.TabIndicator (cognitive 23) packages/tui/src/component/session-tabs.tsx:131— session-tabs.TabIndicator has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, boolean chains 7, ternaries 5. Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 8 function items inside it that branch (label, color, a function literal at line 156, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
form.FormPrompt (cognitive 23) packages/tui/src/routes/session/form.tsx:59— form.FormPrompt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 101 (123 pts), ternaries 54 (72 pts), boolean chains 58 (nesting depth added 40). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 (form.FormPrompt::commitInput) 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.
translate.fold (cognitive 23) packages/cli/src/acp/translate.ts:93— translate.fold has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 7, ternaries 5 (7 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.
noninteractive.runNonInteractivePrompt (cognitive 23) packages/cli/src/run/noninteractive.ts:76— noninteractive.runNonInteractivePrompt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 97 (205 pts), boolean chains 39, ternaries 18 (30 pts), loops 5 (7 pts), error handling 1 (nesting depth added 122). To reduce it, split the body into named stages: move each independent 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 (noninteractive.runNonInteractivePrompt::consume, noninteractive.runNonInteractivePrompt::reconcile) 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.
compaction.flattenMessage (cognitive 23) packages/core/src/session/compaction.ts:1011— compaction.flattenMessage has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 9 (10 pts), boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 1015). 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.
scan.bashHeredoc (cognitive 23) packages/core/src/shell/scan.ts:1690— scan.bashHeredoc has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resolve-link.normalizeRelativeSegments (cognitive 23) packages/gui-extensions/src/file/resolve-link.ts:92— resolve-link.normalizeRelativeSegments has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 8). Of this number, 15 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.
server-panel.McpMenu (cognitive 23) packages/gui-extensions/src/details/server-panel.tsx:173— server-panel.McpMenu has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 7, ternaries 2 (nesting depth added 1). None of this is in the body itself: all 23 points belong to 9 function literals inside it that branch (lines 179, 298, 272, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
model.addServerPrimaryButton (cognitive 23) packages/gui-extensions/src/wsl/model.ts:201— model.addServerPrimaryButton has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, ternaries 5 (10 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.
layout.layoutAccent (cognitive 23) packages/latex/src/layout.ts:322— layout.layoutAccent has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (17 pts), boolean chains 3, if/else 3 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
drawing.drawSourceConnectors (cognitive 23) packages/merman/src/flowchart/drawing.ts:256— drawing.drawSourceConnectors has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, ternaries 1 (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.
stream-v2.subagent.createSubagentTracker.resolvePermissionTools (cognitive 23) packages/tui/src/mini/stream-v2.subagent.ts:453— stream-v2.subagent.createSubagentTracker.resolvePermissionTools has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts), boolean chains 3, ternaries 1 (nesting depth added 10). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
footer.width.footerStatuslinePolicy (cognitive 23) packages/tui/src/mini/footer.width.ts:27— footer.width.footerStatuslinePolicy has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 14, if/else 5 (6 pts), boolean chains 2, loops 1 (nesting depth added 1). Of this number, 19 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
open-responses-continuation.driver.observe (cognitive 22) packages/ai/src/protocols/open-responses-continuation.ts:166— open-responses-continuation.driver.observe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, ternaries 3 (4 pts) (nesting depth added 4). None of this is in the body itself: all 22 points belong to 2 function literals inside it that branch (lines 167, 210). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
file-find.createFileFind.scan (cognitive 22) packages/session-ui/src/pierre/file-find.ts:267— file-find.createFileFind.scan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (7 pts), ternaries 1 (2 pts) (nesting depth added 11). Of this number, 14 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.
tool-renderer.CurrentFileToolGroup (cognitive 22) packages/session-ui/src/tools/tool-renderer.tsx:943— tool-renderer.CurrentFileToolGroup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 6 (7 pts) (nesting depth added 2). 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 950, 1012, 949, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tool-renderer.toolErrorSubtitle (cognitive 22) packages/session-ui/src/tools/tool-renderer.tsx:1430— tool-renderer.toolErrorSubtitle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 3). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
storage.quota (cognitive 22) packages/app/src/runtime/persistence/storage.ts:117— storage.quota has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, ternaries 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.
search-controller.createTimelineSearchController.matches (cognitive 22) packages/app/src/session/timeline/search-controller.ts:104— search-controller.createTimelineSearchController.matches has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts), boolean chains 2, 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.
tab-strip.TitlebarTabStrip (cognitive 22) packages/app/src/shell/titlebar/tab-strip.tsx:270— tab-strip.TitlebarTabStrip has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 8, boolean chains 3 (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 9 function items inside it that branch (a function literal at line 418, a function literal at line 379, a function literal at line 391, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
file-path.truncateFilePath (cognitive 22) packages/tui/src/ui/file-path.tsx:31— file-path.truncateFilePath has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 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.
default.default (cognitive 22) packages/cli/src/commands/handlers/default.ts:19— default.default has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 5, if/else 5 (nesting depth added 3). None of this is in the body itself: all 22 points belong to 7 function literals inside it that branch (lines 20, 145, 39, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
timeline.createTimelineHost (cognitive 22) packages/cli/src/ui/timeline.tsx:110— timeline.createTimelineHost has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (6 pts), boolean chains 2, error handling 1 (nesting depth added 7). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 7 function items inside it that branch (write, a function literal at line 191, cancel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
language.match (cognitive 22) packages/console/app/src/lib/language.ts:233— language.match has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19 (20 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.
aisdk-native.bedrockRequest (cognitive 22) packages/core/src/aisdk-native.ts:219— aisdk-native.bedrockRequest has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 7 (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.
runtime.inlineLocalReferences (cognitive 22) packages/core/src/tool/runtime.ts:213— runtime.inlineLocalReferences has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, ternaries 1 (2 pts) (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.
migrate.migrateModel (cognitive 22) packages/core/src/v1/config/migrate.ts:180— migrate.migrateModel has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (7 pts), ternaries 5, 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.
OpenAIResponsesLanguageModel.getArgs (cognitive 22) packages/core/src/github-copilot/responses/openai-responses-language-model.ts:136— OpenAIResponsesLanguageModel.getArgs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10, boolean chains 9, ternaries 2 (3 pts) (nesting depth added 1). Of this number, 19 points are the body's own statements and 3 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.
bench-startup.mainLog (cognitive 22) packages/desktop/scripts/bench-startup.ts:699— bench-startup.mainLog has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts), 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.
connection.createConnection.wake (cognitive 22) packages/gui-extensions/src/browser/connection.ts:131— connection.createConnection.wake has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 4, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 148, 200). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tree-v2.FileTreeV2 (cognitive 22) packages/gui-extensions/src/file/tree-v2.tsx:132— tree-v2.FileTreeV2 has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8, boolean chains 7, if/else 7. Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 174, a function literal at line 207, a function literal at line 219, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
routing.createFeedbackAllocations (cognitive 22) packages/merman/src/state/routing.ts:140— routing.createFeedbackAllocations has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 4 (7 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 8). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
placement.getFragmentFrameBoundsByStep (cognitive 22) packages/merman/src/sequence/placement.ts:340— placement.getFragmentFrameBoundsByStep has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 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.
index.TopModelsChart (cognitive 22) packages/stats/app/src/routes/index.tsx:447— index.TopModelsChart has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10, if/else 7, boolean chains 5. Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 510, 484, 606, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
demo.emitFmt (cognitive 22) packages/tui/src/mini/demo.ts:830— demo.emitFmt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 6, 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.
patch.computeReplacements (cognitive 22) packages/util/src/patch.ts:311— patch.computeReplacements has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 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.
mistral-chat.lowerAssistant (cognitive 21) packages/ai/src/protocols/mistral-chat.ts:254— mistral-chat.lowerAssistant has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3, boolean chains 2, loops 1 (nesting depth added 7). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
venice-chat.step (cognitive 21) packages/ai/src/protocols/venice-chat.ts:225— venice-chat.step has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shell-output.followShellOutput (cognitive 21) packages/session-ui/src/tools/shell-output.ts:25— shell-output.followShellOutput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 6). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (read, a function literal at line 55). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
search.createHomeSessionSearchController (cognitive 21) packages/app/src/home/sessions/search.ts:16— search.createHomeSessionSearchController has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 4, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 21 points belong to 13 function items inside it that branch (a function literal at line 65, a function literal at line 41, a function literal at line 80, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
select-dialog.ModelSelectorPopoverView (cognitive 21) packages/app/src/providers/models/select-dialog.tsx:495— select-dialog.ModelSelectorPopoverView has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, ternaries 6, boolean chains 3. None of this is in the body itself: all 21 points belong to 10 function items inside it that branch (a function literal at line 634, initialActive, selectActive, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
region.createActiveSessionRegion::handleKeyDown (cognitive 21) packages/app/src/session/composer/region.tsx:136— region.createActiveSessionRegion::handleKeyDown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
search-reveal.revealSettingsSearch (cognitive 21) packages/app/src/settings/search-reveal.ts:4— search-reveal.revealSettingsSearch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 2). None of this is in the body itself: all 21 points belong to 6 function items inside it that branch (reveal, restore, finish, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
search-keydown.handleDocumentSearchKeydown (cognitive 21) packages/app/src/shell/commands/search-keydown.ts:3— search-keydown.handleDocumentSearchKeydown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tree-store.createFileTreeStore.listDir (cognitive 21) packages/app/src/workspaces/files/tree-store.ts:42— tree-store.createFileTreeStore.listDir has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 8). 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 75, 67, 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.
dialog-select.DialogSelectRow (cognitive 21) packages/tui/src/ui/dialog-select.tsx:883— dialog-select.DialogSelectRow has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 6, if/else 3 (nesting depth added 1). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 3 function items inside it that branch (row, secondary, a function literal at line 901). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-integration.multiselectAnswer (cognitive 21) packages/tui/src/component/dialog-integration.tsx:1141— dialog-integration.multiselectAnswer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 9). Of this number, 15 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.
client-mcp.ClientMcp (cognitive 21) packages/tui/src/context/client-mcp.tsx:12— client-mcp.ClientMcp has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 5, ternaries 4 (5 pts) (nesting depth added 1). None of this is in the body itself: all 21 points belong to 4 function items inside it that branch (terminalFor, sync, writeTerminal, …). 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.
dialog-go-upsell.DialogGoUpsell (cognitive 21) packages/tui/src/component/dialog-go-upsell.tsx:39— dialog-go-upsell.DialogGoUpsell has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 5, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 9 function items inside it that branch (button, bodyMaxHeight, run, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-export-options.LegacyDialogExportOptions (cognitive 21) packages/tui/src/ui/dialog-export-options.tsx:128— dialog-export-options.LegacyDialogExportOptions has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 5, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (activate, markColor, a function literal at line 226, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.ShellDisplay::loadBackgroundOutput (cognitive 21) packages/tui/src/routes/session/index.tsx:3025— index.ShellDisplay::loadBackgroundOutput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 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.
integration-picker.selectIntegration (cognitive 21) packages/cli/src/ui/integration-picker.ts:13— integration-picker.selectIntegration has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 4, if/else 3 (nesting depth added 1). Of this number, 12 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, 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.
service.ensure (cognitive 21) packages/client/src/effect/service.ts:49— service.ensure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2 (nesting depth added 6). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 71, 55, 60). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
url.urlGlobal (cognitive 21) packages/codemode/src/stdlib/url.ts:57— url.urlGlobal has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 3 (6 pts), error handling 3 (5 pts), loops 1 (nesting depth added 8). 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 items inside it that branch (a function literal at line 81, construct, a function literal at line 103). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
runtime.invoke (cognitive 21) packages/codemode/src/openapi/runtime.ts:11— runtime.invoke has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 4, if/else 2, loops 1 (nesting depth added 6). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 12). 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.
to-session-error.toSessionError (cognitive 21) packages/core/src/session/to-session-error.ts:31— to-session-error.toSessionError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 2 (3 pts), boolean chains 2, match/switch 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.
diff.turn (cognitive 21) packages/core/src/session/diff.ts:38— diff.turn has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 7, boolean chains 3 (nesting depth added 1). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: 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.
variant.nvidiaChat (cognitive 21) packages/core/src/variant.ts:155— variant.nvidiaChat has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 6). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
variant.anthropicMessages (cognitive 21) packages/core/src/variant.ts:325— variant.anthropicMessages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 4 (8 pts), boolean chains 4, match/switch 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 3 belong to 2 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
scan.powerShellSubExpression (cognitive 21) packages/core/src/shell/scan.ts:2296— scan.powerShellSubExpression has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 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.
local.createLocalProviderPlugin (cognitive 21) packages/core/src/plugin/provider/local.ts:25— local.createLocalProviderPlugin has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), loops 2, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 21 points belong to 8 function literals inside it that branch (lines 97, 41, 61, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
restart.layer (cognitive 21) packages/core/src/session/execution/restart.ts:65— restart.layer has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 7, boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 21 points belong to 8 function literals inside it that branch (lines 101, 138, 77, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
model.createModel.attach (cognitive 21) packages/gui-extensions/src/browser/model.ts:168— model.createModel.attach has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 4, boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 213, 226, 202, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tab.SessionContextTab (cognitive 21) packages/gui-extensions/src/context/tab.tsx:82— tab.SessionContextTab has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, ternaries 4 (5 pts), boolean chains 1, error handling 1 (nesting depth added 1). None of this is in the body itself: all 21 points belong to 15 function items inside it that branch (exportSession, restoreScroll, a function literal at line 113, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
artifact-view.ArtifactView (cognitive 21) packages/gui-extensions/src/file/artifact-view.tsx:67— artifact-view.ArtifactView has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 7, if/else 2 (nesting depth added 1). Most of this is not in the body itself: 6 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 109, a function literal at line 89, a function literal at line 103, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
mobile.SessionReviewTab (cognitive 21) packages/gui-extensions/src/review/mobile.tsx:36— mobile.SessionReviewTab has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 8, ternaries 1. None of this is in the body itself: all 21 points belong to 6 function items inside it that branch (doRestore, handleScroll, queueRestore, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
search.findStateManhattanPath (cognitive 21) packages/merman/src/state/search.ts:50— search.findStateManhattanPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
layout.placeStateDiagramNotesAroundTransitions (cognitive 21) packages/merman/src/state/layout.ts:867— layout.placeStateDiagramNotesAroundTransitions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 4 (6 pts), loops 2 (3 pts) (nesting depth added 10). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (findPlacement, a function literal at line 876, a function literal at line 897, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
actions.execute (cognitive 21) packages/simulation/src/frontend/actions.ts:218— actions.execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 8). 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.
scrollback.writer.RunEntryContent (cognitive 21) packages/tui/src/mini/scrollback.writer.tsx:83— scrollback.writer.RunEntryContent has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 16 (17 pts), if/else 4 (nesting depth added 1). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 200, todoColor, a function literal at line 96, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
RunScrollbackStream.append (cognitive 21) packages/tui/src/mini/scrollback.surface.ts:446— RunScrollbackStream.append has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 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.
create-auto-scroll.createAutoScroll (cognitive 21) packages/ui/src/hooks/create-auto-scroll.tsx:13— create-auto-scroll.createAutoScroll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 4 (nesting depth added 2). None of this is in the body itself: all 21 points belong to 7 function literals inside it that branch (lines 194, 224, 240, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.fromV1 (cognitive 21) packages/web/src/components/Share.tsx:503— Share.fromV1 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (21 pts) (nesting depth added 11). 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 531, 561, 614). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
raw-changelog.format (cognitive 21) script/raw-changelog.ts:198— raw-changelog.format has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
media-type.detectMediaType (cognitive 20) packages/ai/src/utils/media-type.ts:10— media-type.detectMediaType has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
mistral-chat.lowerMessages (cognitive 20) packages/ai/src/protocols/mistral-chat.ts:329— mistral-chat.lowerMessages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (6 pts), boolean chains 4, loops 1 (nesting depth added 8). Of this number, 15 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.
tool-error-card.ToolErrorCard (cognitive 20) packages/session-ui/src/components/tool-error-card.tsx:22— tool-error-card.ToolErrorCard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 5. Most of this is not in the body itself: 6 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 64, copyButton, measure, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
mcp.useMcpToggle (cognitive 20) packages/app/src/providers/connect/mcp.ts:16— mcp.useMcpToggle has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 6 (nesting depth added 1). None of this is in the body itself: all 20 points belong to 4 function items inside it that branch (a function literal at line 29, location, a function literal at line 51, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
permission.PermissionPrompt (cognitive 20) packages/tui/src/routes/session/permission.tsx:113— permission.PermissionPrompt has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), boolean chains 5 (nesting depth added 4). None of this is in the body itself: all 20 points belong to 9 function literals inside it that branch (lines 122, 243, 168, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
dialog-config.DialogConfig (cognitive 20) packages/tui/src/component/dialog-config.tsx:378— dialog-config.DialogConfig has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9, if/else 7, boolean chains 4. Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 8 function items inside it that branch (display, a function literal at line 410, change, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
activity-summary.activitySummary (cognitive 20) packages/tui/src/routes/session/activity-summary.ts:61— activity-summary.activitySummary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 4). None of this is in the body itself: all 20 points belong to 3 function literals inside it that branch (lines 63, 74, 91). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
inventory.inspect (cognitive 20) packages/cli/src/commands/handlers/plugin/inventory.ts:18— inventory.inspect has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 7, if/else 4 (nesting depth added 1). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 30, 49, 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.
connection.createClientConnection.connect (cognitive 20) packages/client/src/solid/connection.ts:76— connection.createClientConnection.connect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (6 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 6). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
objects.set (cognitive 20) REDACTED:572— objects.set has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Frame.evaluateSwitchStatement (cognitive 20) packages/codemode/src/interpreter/interpreter.ts:594— Frame.evaluateSwitchStatement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 10). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 599). 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.
Frame.declarePattern (cognitive 20) packages/codemode/src/interpreter/interpreter.ts:1131— Frame.declarePattern has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 1139). 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.
workspace.layer (cognitive 20) packages/core/src/workspace.ts:81— workspace.layer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 2, boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 20 points belong to 11 function literals inside it that branch (lines 225, 197, 151, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
stdio.make (cognitive 20) packages/core/src/mcp/stdio.ts:45— stdio.make has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 6 (9 pts), loops 2 (nesting depth added 6). None of this is in the body itself: all 20 points belong to 11 function literals inside it that branch (lines 118, 171, 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.
index.toElicitationField (cognitive 20) packages/core/src/mcp/index.ts:943— index.toElicitationField has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (17 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.
scan.bashAnsiQuote (cognitive 20) packages/core/src/shell/scan.ts:1595— scan.bashAnsiQuote has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (7 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.
embeds.createEmbeds.apply (cognitive 20) packages/desktop/src/main/extension/embeds.ts:34— embeds.createEmbeds.apply 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). Of this number, 17 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.
artifact.parseDelimited (cognitive 20) packages/gui-extensions/src/file/artifact.ts:23— artifact.parseDelimited has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 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.
renderer.setup (cognitive 20) packages/gui-extensions/src/review/renderer.tsx:36— renderer.setup has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 5. Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 74, a function literal at line 98, modelFor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.layoutScripts (cognitive 20) packages/latex/src/layout.ts:182— layout.layoutScripts has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (8 pts), boolean chains 6, if/else 5 (6 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.
layout.layoutMatrix (cognitive 20) packages/latex/src/layout.ts:242— layout.layoutMatrix has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (9 pts), ternaries 4 (5 pts), boolean chains 3, if/else 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 4 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.
geometry.orthogonalPathPoints (cognitive 20) packages/merman/src/core/geometry.ts:267— geometry.orthogonalPathPoints has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 2 (5 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser.hasInternalStatementSeparator (cognitive 20) packages/merman/src/flowchart/parser.ts:243— parser.hasInternalStatementSeparator has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 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.
drawing.noteConnectorGlyph (cognitive 20) packages/merman/src/state/drawing.ts:119— drawing.noteConnectorGlyph has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 10. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
persistent-pty.PersistentPtyHandler (cognitive 20) packages/server/src/handlers/persistent-pty.ts:17— persistent-pty.PersistentPtyHandler has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 6, ternaries 3. None of this is in the body itself: all 20 points belong to 5 function literals inside it that branch (lines 188, 110, 129, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
[model].ModelTrendSection (cognitive 20) packages/stats/app/src/routes/[lab]/[model].tsx:625— [model].ModelTrendSection has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 6. Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 671, 794, 661, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.MarketShare (cognitive 20) packages/stats/app/src/routes/index.tsx:1093— index.MarketShare has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 13, boolean chains 6, if/else 1. Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1130, 1158, 1172, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
footer.command.PanelShell (cognitive 20) packages/tui/src/mini/footer.command.tsx:273— footer.command.PanelShell has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 15 (16 pts), boolean chains 3, if/else 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
text-reveal.TextReveal (cognitive 20) packages/ui/src/components/text-reveal.tsx:26— text-reveal.TextReveal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5, boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 75, widen, a function literal at line 108, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
segmented-control.SegmentedControl (cognitive 20) packages/ui/src/navigation/segmented-control/segmented-control.tsx:88— segmented-control.SegmentedControl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 7, ternaries 3. Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 10 function items inside it that branch (syncIndicator, a function literal at line 151, clearIfAllowed, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tooltip.Tooltip (cognitive 20) packages/ui/src/overlays/tooltip/tooltip.tsx:18— tooltip.Tooltip has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 6, ternaries 1. 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 items inside it that branch (drop, a function literal at line 111, a function literal at line 154, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
no-widen-then-assert.knownValueEvidence (cognitive 20) script/oxlint/anti-slop/rules/no-widen-then-assert.ts:200— no-widen-then-assert.knownValueEvidence has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9 (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.
raw-changelog.commits (cognitive 20) script/raw-changelog.ts:113— raw-changelog.commits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 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.
host-apis.createExtensionAttachment.open (cognitive 19) packages/app/src/runtime/extension/host-apis.tsx:641— host-apis.createExtensionAttachment.open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 664, 662, 663). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
virtualizer.createTimelineVirtualizer.View (cognitive 19) packages/app/src/session/timeline/virtualizer.tsx:778— virtualizer.createTimelineVirtualizer.View has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 6. Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 8 function items inside it that branch (VirtualRow, a function literal at line 810, a function literal at line 822, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
message-content.AssistantTextContent (cognitive 19) packages/session-ui/src/message/message-content.tsx:671— message-content.AssistantTextContent has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 3, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 690, a function literal at line 716, interrupted, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
editor.parseComposerEditor (cognitive 19) packages/app/src/composer/editor/editor.tsx:460— editor.parseComposerEditor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, ternaries 3 (5 pts), boolean chains 2 (nesting depth added 2). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (mention, visit, a function literal at line 549, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
namespace.createNamespaceStorage (cognitive 19) packages/app/src/runtime/persistence/namespace.ts:30— namespace.createNamespaceStorage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 9 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
select-dialog.ModelList (cognitive 19) packages/app/src/providers/models/select-dialog.tsx:73— select-dialog.ModelList has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 4 (5 pts) (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 (a function literal at line 199, moveActive, a function literal at line 91, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
side-region.SideRegion (cognitive 19) packages/app/src/runtime/extension/side-region.tsx:38— side-region.SideRegion has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 2. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 82, 61, 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.
websearch.replyWebSearch (cognitive 19) packages/app/src/session/requests/websearch.ts:104— websearch.replyWebSearch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, ternaries 1 (2 pts) (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 2 function literals inside it that branch (lines 133, 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.
session-identity-header.SessionIdentityHeader (cognitive 19) packages/app/src/session/session-identity-header.tsx:309— session-identity-header.SessionIdentityHeader has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 4. Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 330, 364, 317, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tab-strip.SessionTabEntry (cognitive 19) packages/app/src/shell/titlebar/tab-strip.tsx:84— tab-strip.SessionTabEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 4 (5 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 8 function items inside it that branch (rename, a function literal at line 113, a function literal at line 155, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-execute.DialogExecute (cognitive 19) packages/tui/src/routes/session/dialog-execute.tsx:28— dialog-execute.DialogExecute has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 6, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 68, a function literal at line 59, a function literal at line 49, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
mini.resolveMiniTarget (cognitive 19) packages/cli/src/mini.ts:160— mini.resolveMiniTarget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (8 pts), error handling 2 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-schema.docTags (cognitive 19) packages/codemode/src/tool-schema.ts:71— tool-schema.docTags has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (17 pts), error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
collections.groupBy (cognitive 19) packages/codemode/src/stdlib/collections.ts:41— collections.groupBy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). None of this is in the body itself: all 19 points belong to 2 function literals inside it that branch (lines 49, 42). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Frame.invokeFunction (cognitive 19) packages/codemode/src/interpreter/interpreter.ts:1758— Frame.invokeFunction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (4 pts), ternaries 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 1760, 1784, 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.
Frame.createGenerator::request (cognitive 19) packages/codemode/src/interpreter/interpreter.ts:1829— Frame.createGenerator::request 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.
Frame.evaluateObjectExpression (cognitive 19) packages/codemode/src/interpreter/interpreter.ts:2057— Frame.evaluateObjectExpression has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 8). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 2060). 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.
form.validateAnswer (cognitive 19) REDACTED:235— form.validateAnswer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
read-filesystem.textPage (cognitive 19) packages/core/src/tool/read-filesystem.ts:291— read-filesystem.textPage has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 5 (6 pts), loops 1 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scan.scanBashDollarOrBacktick (cognitive 19) packages/core/src/shell/scan.ts:1264— scan.scanBashDollarOrBacktick has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server-panel.ServiceConfigLink (cognitive 19) packages/gui-extensions/src/details/server-panel.tsx:548— server-panel.ServiceConfigLink has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 5 (6 pts), boolean chains 5 (nesting depth added 2). Most of this is not in the body itself: 6 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 566, activate, label, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
model.addServerDistroStatus (cognitive 19) packages/gui-extensions/src/wsl/model.ts:147— model.addServerDistroStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5 (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.
recorder.makeReplayWebSocketConstructor (cognitive 19) packages/http-recorder/src/websocket/recorder.ts:475— recorder.makeReplayWebSocketConstructor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, loops 1 (nesting depth added 1). None of this is in the body itself: all 19 points belong to 9 function literals inside it that branch (lines 505, 517, 498, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.assertPortable::visitCurrent (cognitive 19) packages/httpapi-codegen/src/index.ts:1576— index.assertPortable::visitCurrent has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Parser.parseRow (cognitive 19) packages/latex/src/parser.ts:147— Parser.parseRow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
markdown.createLatexCodeBlockRenderer (cognitive 19) packages/latex/src/markdown.ts:27— markdown.createLatexCodeBlockRenderer has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 6, if/else 5 (6 pts) (nesting depth added 2). None of this is in the body itself: all 19 points belong to 4 function literals inside it that branch (lines 32, 56, 55, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
layout.layoutFlowchartWithDirection (cognitive 19) packages/merman/src/flowchart/layout.ts:1063— layout.layoutFlowchartWithDirection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (7 pts), boolean chains 3, 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.
routing.createStateTransitionJunctionPlans (cognitive 19) packages/merman/src/state/routing.ts:1488— routing.createStateTransitionJunctionPlans has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 1494). 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.
drawing.drawTask (cognitive 19) packages/merman/src/gantt/drawing.ts:104— drawing.drawTask has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 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.
session-review-file-preview-v2.SessionReviewFilePreviewV2 (cognitive 19) packages/session-ui/src/v2/components/session-review-file-preview-v2.tsx:104— session-review-file-preview-v2.SessionReviewFilePreviewV2 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5, boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 208, diffViewer, a function literal at line 175, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
index.LabUsageSection (cognitive 19) packages/stats/app/src/routes/[lab]/index.tsx:327— index.LabUsageSection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 4. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 443, 343, 350, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
stream-v2.subagent.createSubagentTracker.rebuild (cognitive 19) packages/tui/src/mini/stream-v2.subagent.ts:343— stream-v2.subagent.createSubagentTracker.rebuild has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
footer.prompt.createPromptState.paste (cognitive 19) packages/tui/src/mini/footer.prompt.tsx:857— footer.prompt.createPromptState.paste has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 4 (5 pts) (nesting depth added 1). None of this is in the body itself: all 19 points belong to 5 function literals inside it that branch (lines 859, 863, 886, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
select.Select (cognitive 19) packages/ui/src/forms/select/select.tsx:78— select.Select has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (13 pts), if/else 5, boolean chains 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 8 function items inside it that branch (move, a function literal at line 162, a function literal at line 182, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
part.flattenToolArgs (cognitive 19) packages/web/src/components/share/part.tsx:700— part.flattenToolArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 13 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent 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.repairJSON (cognitive 18) packages/ai/src/protocols/utils/partial-json.ts:62— partial-json.repairJSON has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). 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.
google-interactions.onStart (cognitive 18) packages/ai/src/protocols/google-interactions.ts:393— google-interactions.onStart has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
markdown-stream.project (cognitive 18) REDACTED:112— markdown-stream.project has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (5 pts), boolean chains 4 (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.
interaction.createComposerEditor.onKeyDown (cognitive 18) packages/app/src/composer/editor/interaction.ts:234— interaction.createComposerEditor.onKeyDown has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
form.validateCustomProvider (cognitive 18) packages/app/src/providers/credentials/form.ts:52— form.validateCustomProvider has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 4, if/else 1 (nesting depth added 3). 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.
interaction.createSessionTimelineInteraction (cognitive 18) packages/app/src/session/timeline/interaction.ts:11— interaction.createSessionTimelineInteraction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 4, ternaries 2. None of this is in the body itself: all 18 points belong to 9 function literals inside it that branch (lines 335, 353, 270, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-row.SettingsProjectRow (cognitive 18) packages/app/src/settings/workspaces/project-row.tsx:15— project-row.SettingsProjectRow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 4. 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 items inside it that branch (saveEditor, a function literal at line 108, closeEditor, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
shell.SettingsScreen (cognitive 18) packages/app/src/settings/shell.tsx:95— shell.SettingsScreen has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 2. 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 192, a function literal at line 159, a function literal at line 168, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
error.errorFormat (cognitive 18) packages/tui/src/util/error.ts:93— error.errorFormat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
watch.createSourceWatcher.arm (cognitive 18) packages/tui/src/plugin/watch.ts:31— watch.createSourceWatcher.arm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3, boolean chains 2 (nesting depth added 2). 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 35, 48, 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.
dialog-workspaces.DialogWorkspaces::remove (cognitive 18) packages/tui/src/component/dialog-workspaces.tsx:226— dialog-workspaces.DialogWorkspaces::remove has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
session-tabs.TabContextMenu (cognitive 18) packages/tui/src/component/session-tabs.tsx:370— session-tabs.TabContextMenu has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 4, if/else 4 (nesting depth added 2). None of this is in the body itself: all 18 points belong to 9 function items inside it that branch (a function literal at line 383, a function literal at line 475, a function literal at line 393, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
theme.resolveRunTheme (cognitive 18) packages/tui/src/mini/theme.ts:266— theme.resolveRunTheme has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 5, if/else 4 (nesting depth added 3). Of this number, 15 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.
dialog-shell-output.DialogShellOutput (cognitive 18) packages/tui/src/component/dialog-shell-output.tsx:13— dialog-shell-output.DialogShellOutput has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3, boolean chains 2 (nesting depth added 2). 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 items inside it that branch (a function literal at line 39, status, a function literal at line 65, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.partsToContentChunks (cognitive 18) packages/cli/src/acp/content.ts:69— content.partsToContentChunks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 pts), boolean chains 3 (nesting depth added 4). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 70). 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.
auth.authenticate (cognitive 18) packages/cli/src/commands/handlers/mcp/auth.ts:21— auth.authenticate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stats.handler (cognitive 18) packages/cli/src/commands/handlers/stats.ts:12— stats.handler has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 7, if/else 1 (nesting depth added 4). 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.
web-ui.serveUI (cognitive 18) REDACTED:33— web-ui.serveUI has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 6, if/else 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.
rpc.makeRpc (cognitive 18) packages/client/src/promise/rpc.ts:53— rpc.makeRpc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (4 pts), error handling 2, loops 2, boolean chains 1 (nesting depth added 5). None of this is in the body itself: all 18 points belong to 5 function literals inside it that branch (lines 68, 100, 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.
Frame.assignPattern (cognitive 18) packages/codemode/src/interpreter/interpreter.ts:1190— Frame.assignPattern has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 1192). 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.
interpreter.collectVarNames (cognitive 18) packages/codemode/src/interpreter/interpreter.ts:228— interpreter.collectVarNames has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (7 pts), match/switch 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
enterprise.handleEnterpriseRequest (cognitive 18) REDACTED:95— enterprise.handleEnterpriseRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 5, 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.
SQLiteEffectUpdateBase.createJoin (cognitive 18) packages/core/src/database/drizzle/sqlite-core/effect/update.ts:257— SQLiteEffectUpdateBase.createJoin has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (14 pts), boolean chains 2, if/else 2 (nesting depth added 10). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 260). 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.
discovery.discover (cognitive 18) packages/core/src/config/discovery.ts:59— discovery.discover has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 5, if/else 2 (nesting depth added 1). Of this number, 13 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: 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.scan (cognitive 18) packages/core/src/config/plugin/source.ts:122— source.scan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (6 pts), boolean chains 3 (nesting depth added 2). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 160, 137, 149). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
models-dev.layer (cognitive 18) packages/core/src/models-dev.ts:309— models-dev.layer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 4. None of this is in the body itself: all 18 points belong to 5 function literals inside it that branch (lines 312, 386, 411, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
scan.finishBashWord (cognitive 18) packages/core/src/shell/scan.ts:249— scan.finishBashWord has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 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.
models.build (cognitive 18) packages/core/src/github-copilot/models.ts:129— models.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 4, 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.
github-copilot.oauth (cognitive 18) packages/core/src/plugin/provider/github-copilot.ts:48— github-copilot.oauth has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 5 (6 pts), boolean chains 5 (nesting depth added 3). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 101, 77, 119). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
renderer.setup (cognitive 18) packages/gui-extensions/src/browser/renderer.tsx:11— renderer.setup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 7, ternaries 1. Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 10 function items inside it that branch (create::text, a function literal at line 56, a function literal at line 111, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tab.SortableTerminalTab (cognitive 18) packages/gui-extensions/src/terminal/tab.tsx:13— tab.SortableTerminalTab has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 2. None of this is in the body itself: all 18 points belong to 9 function items inside it that branch (edit, focus, save, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
browser.SessionFileBrowserTab (cognitive 18) packages/gui-extensions/src/file/browser.tsx:26— browser.SessionFileBrowserTab has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 3. 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 68, onFilterKeyDown, a function literal at line 62, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.codegenAsts (cognitive 18) packages/httpapi-codegen/src/index.ts:1159— index.codegenAsts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, ternaries 2 (nesting depth added 4). None of this is in the body itself: all 18 points belong to 2 function items inside it that branch (normalize, recur). 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.
index.sameRuntimeEncoding (cognitive 18) packages/httpapi-codegen/src/index.ts:1382— index.sameRuntimeEncoding has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, 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.
parser.maskNodeLabelOperators (cognitive 18) packages/merman/src/flowchart/parser.ts:213— parser.maskNodeLabelOperators 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.
agent-formats.modelMarkdown (cognitive 18) packages/stats/app/src/lib/agent-formats.ts:268— agent-formats.modelMarkdown has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, if/else 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.
honeycomb-backfill.csvRecords (cognitive 18) packages/stats/core/src/honeycomb-backfill.ts:752— honeycomb-backfill.csvRecords has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 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.
stream-v2.subagent.createSubagentTracker.main (cognitive 18) packages/tui/src/mini/stream-v2.subagent.ts:966— stream-v2.subagent.createSubagentTracker.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 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.
RunFooter.applyHeight (cognitive 18) packages/tui/src/mini/footer.ts:742— RunFooter.applyHeight has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 2, if/else 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.
stats.save (cognitive 18) REDACTED:125— stats.save has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 3 (6 pts), 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.
index.artifactDistribution (cognitive 18) REDACTED:149— index.artifactDistribution has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bedrock-converse.fromRequest (cognitive 17) packages/ai/src/protocols/bedrock-converse.ts:497— bedrock-converse.fromRequest has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 4, if/else 3 (nesting depth added 3). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
mistral-chat.appendTools (cognitive 17) packages/ai/src/protocols/mistral-chat.ts:589— mistral-chat.appendTools has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, 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.
open-responses-channel.driver.observeEvent (cognitive 17) packages/ai/src/protocols/open-responses-channel.ts:56— open-responses-channel.driver.observeEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 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.
observe-element-offset.observeElementOffsetReconnectAware (cognitive 17) packages/app/src/session/timeline/observe-element-offset.ts:3— observe-element-offset.observeElementOffsetReconnectAware has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 1. Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (startCheck::check, a function literal at line 65, 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.
attachments.createComposerAttachments.handlePaste (cognitive 17) packages/app/src/composer/attachments/attachments.ts:151— attachments.createComposerAttachments.handlePaste has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 2 (nesting depth added 1). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
machine.transitionComposer (cognitive 17) packages/app/src/composer/suggestions/machine.ts:61— machine.transitionComposer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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.
interaction.createComposerEditor.dispatch (cognitive 17) packages/app/src/composer/editor/interaction.ts:201— interaction.createComposerEditor.dispatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 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.
view.HomeProjectsPanel (cognitive 17) packages/app/src/home/projects/view.tsx:162— view.HomeProjectsPanel has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 6, if/else 1. Of this number, 9 points are the body's own statements and 8 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.
controller.createProviderConnectionController.poll (cognitive 17) packages/app/src/providers/connect/controller.ts:269— controller.createProviderConnectionController.poll has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 5, 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.
session-question-dock.SessionQuestionDock (cognitive 17) packages/app/src/session/requests/session-question-dock.tsx:81— session-question-dock.SessionQuestionDock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 61 (68 pts), ternaries 31 (32 pts), boolean chains 18 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (session-question-dock.SessionQuestionDock::nav) 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.
model.storedTimelineCategory (cognitive 17) packages/app/src/settings/model.tsx:180— model.storedTimelineCategory has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 1 (nesting depth added 10). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 190). 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.
dialog-integration.manageConnections (cognitive 17) packages/tui/src/component/dialog-integration.tsx:172— dialog-integration.manageConnections has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8, if/else 6, boolean chains 3. None of this is in the body itself: all 17 points belong to 9 function literals inside it that branch (lines 214, 179, 226, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
context.resolvePlugin (cognitive 17) packages/tui/src/plugin/context.tsx:652— context.resolvePlugin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 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.SessionNoticeMessageV2 (cognitive 17) packages/tui/src/routes/session/index.tsx:2098— index.SessionNoticeMessageV2 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 5, boolean chains 3. None of this is in the body itself: all 17 points belong to 11 function items inside it that branch (color, text, status, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stats.renderTools (cognitive 17) packages/cli/src/commands/handlers/stats.ts:242— stats.renderTools has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 3 (nesting depth added 6). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shared-events.make.subscribe (cognitive 17) packages/client/src/shared-events.ts:61— shared-events.make.subscribe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 1 (nesting depth added 1). 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: 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.
Frame.evaluateAssignmentExpression (cognitive 17) packages/codemode/src/interpreter/interpreter.ts:1548— Frame.evaluateAssignmentExpression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 4). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 1554, 1582). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
execute.boundOutput (cognitive 17) packages/codemode/src/interpreter/execute.ts:135— execute.boundOutput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
index.i18n (cognitive 17) packages/console/app/src/i18n/index.ts:26— index.i18n has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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.
state.create.get (cognitive 17) packages/core/src/state.ts:172— state.create.get has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
normalize.normalizeCompaction (cognitive 17) packages/core/src/config/normalize.ts:342— normalize.normalizeCompaction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5, 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.
photon.make (cognitive 17) packages/core/src/image/photon.ts:10— photon.make has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 3 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 33, 59, 22). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.subscribePromise::pump (cognitive 17) packages/core/src/persistent-pty/daemon.ts:587— daemon.subscribePromise::pump has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
to-llm-message.toLLMMessage (cognitive 17) packages/core/src/session/runner/to-llm-message.ts:240— to-llm-message.toLLMMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 4 (8 pts), match/switch 1 (nesting depth added 8). Of this number, 15 points are the body's own statements and 2 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.
read.toModelContent (cognitive 17) packages/core/src/tool/plugin/read.ts:169— read.toModelContent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 4 (5 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
variant.bedrockConverse (cognitive 17) packages/core/src/variant.ts:441— variant.bedrockConverse has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 447, 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.
skill-scan.scan (cognitive 17) packages/core/src/config/plugin/skill-scan.ts:11— skill-scan.scan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 7). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 23, 18, 19, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
chatgpt.signIn (cognitive 17) packages/core/src/plugin/provider/chatgpt.ts:93— chatgpt.signIn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 5 (6 pts), boolean chains 2 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 5 function literals inside it that branch (lines 113, 166, 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.
tool-input-repair.repairObject (cognitive 17) packages/core/src/plugin/tool-input-repair.ts:88— tool-input-repair.repairObject has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 6, if/else 4 (nesting depth added 1). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 102). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
recovery.makeWindowRecovery (cognitive 17) packages/desktop/src/main/windows/recovery.ts:9— recovery.makeWindowRecovery has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 4 function items inside it that branch (wireWindowRecovery::show, wireWindowRecovery::handle, wireWindowRecovery::failed, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
errors.protocolError (cognitive 17) packages/gui-extensions/src/browser/errors.ts:3— errors.protocolError has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 2 (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.
bootstrap.bootstrap (cognitive 17) packages/gui-extensions/src/ssh/bootstrap.ts:76— bootstrap.bootstrap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 3). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recorder.makeReplaySocket (cognitive 17) packages/http-recorder/src/websocket/recorder.ts:249— recorder.makeReplaySocket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). None of this is in the body itself: all 17 points belong to 5 function literals inside it that branch (lines 276, 303, 260, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Parser.parseMatrix (cognitive 17) packages/latex/src/parser.ts:357— Parser.parseMatrix has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routing.routeHorizontalFanOut (cognitive 17) packages/merman/src/flowchart/routing.ts:417— routing.routeHorizontalFanOut has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser.splitNodeGroup (cognitive 17) packages/merman/src/flowchart/parser.ts:130— parser.splitNodeGroup 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.
routing.alternateBodySafeTransitionPlan (cognitive 17) packages/merman/src/state/routing.ts:1090— routing.alternateBodySafeTransitionPlan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (6 pts), ternaries 2 (6 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.
layout.createStateDiagramLayout (cognitive 17) packages/merman/src/state/layout.ts:596— layout.createStateDiagramLayout has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), loops 4 (5 pts), if/else 2 (3 pts), boolean chains 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.
catalog-identity.catalogIdentity (cognitive 17) packages/stats/core/src/domain/catalog-identity.ts:27— catalog-identity.catalogIdentity has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 6, boolean chains 4 (nesting depth added 3). 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 37, 34, 63). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
stream-v2.subagent.createSubagentTracker.hydrateChild (cognitive 17) packages/tui/src/mini/stream-v2.subagent.ts:401— stream-v2.subagent.createSubagentTracker.hydrateChild has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4, boolean chains 2 (nesting depth added 3). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 412, 442). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
footer.command.RunCommandMenuBody (cognitive 17) packages/tui/src/mini/footer.command.tsx:391— footer.command.RunCommandMenuBody has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, ternaries 4 (5 pts) (nesting depth added 1). None of this is in the body itself: all 17 points belong to 2 function items inside it that branch (pick, a function literal at line 416). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
form.shared.formUnsupported (cognitive 17) packages/tui/src/mini/form.shared.ts:50— form.shared.formUnsupported has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, 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.
layer-node.compile (cognitive 17) packages/util/src/effect/layer-node.ts:242— layer-node.compile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, ternaries 4 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 5 function items inside it that branch (a function literal at line 271, resolve, a function literal at line 303, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
mistral-chat.step (cognitive 16) packages/ai/src/protocols/mistral-chat.ts:655— mistral-chat.step has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 4 (6 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
open-responses.onResponseFinish (cognitive 16) packages/ai/src/protocols/open-responses.ts:1317— open-responses.onResponseFinish has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
responses-checkpoint.make (cognitive 16) packages/ai/src/protocols/utils/responses-checkpoint.ts:50— responses-checkpoint.make has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, loops 1. None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 66, 51). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
google-images.decodeResponse (cognitive 16) packages/ai/src/protocols/google-images.ts:127— google-images.decodeResponse has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 2, if/else 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 209, 153, 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.
embeds.EmbedView::measure (cognitive 16) packages/app/src/runtime/extension/embeds.tsx:149— embeds.EmbedView::measure has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
virtualizer.createTimelineVirtualizer.settleColdBottom (cognitive 16) packages/app/src/session/timeline/virtualizer.tsx:568— virtualizer.createTimelineVirtualizer.settleColdBottom has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. 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 571, 583). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
commented-lines.markCommentedFileLines (cognitive 16) packages/session-ui/src/pierre/commented-lines.ts:79— commented-lines.markCommentedFileLines has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 2 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
file-find.installShortcuts (cognitive 16) packages/session-ui/src/pierre/file-find.ts:42— file-find.installShortcuts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 2). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 50). 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.
media.dataUrlFromMediaValue (cognitive 16) packages/session-ui/src/pierre/media.ts:70— media.dataUrlFromMediaValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, 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.
markdown-solid.parseNode (cognitive 16) packages/session-ui/src/components/markdown-solid.tsx:73— markdown-solid.parseNode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 5). Of this number, 8 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.
markdown.updateBlock (cognitive 16) packages/session-ui/src/components/markdown.tsx:875— markdown.updateBlock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 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.
view.HomeServerRow (cognitive 16) packages/app/src/home/projects/view.tsx:343— view.HomeServerRow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 6, if/else 2. Of this number, 13 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.
dialog.DialogConnectProvider (cognitive 16) packages/app/src/providers/connect/dialog.tsx:87— dialog.DialogConnectProvider has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 5 (6 pts), if/else 4 (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 5 function items inside it that branch (a function literal at line 172, Content, a function literal at line 145, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog.createFormController.request (cognitive 16) packages/app/src/servers/connect/dialog.tsx:367— dialog.createFormController.request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 3). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 368). 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.
route.parseSettingsView (cognitive 16) packages/app/src/settings/route.ts:87— route.parseSettingsView 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.
models.SettingsModels (cognitive 16) packages/app/src/settings/models/models.tsx:30— models.SettingsModels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. None of this is in the body itself: all 16 points belong to 4 function items inside it that branch (a function literal at line 49, a function literal at line 104, a function literal at line 122, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
selection.handleSelectionKey (cognitive 16) packages/tui/src/util/selection.ts:65— selection.handleSelectionKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 1 (2 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.
dialog-prompt.DialogPrompt (cognitive 16) packages/tui/src/ui/dialog-prompt.tsx:34— dialog-prompt.DialogPrompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 5, boolean chains 3. Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 115, a function literal at line 107, a function literal at line 94, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
dialog-select.DialogSelect::scrollToSelection (cognitive 16) packages/tui/src/ui/dialog-select.tsx:431— dialog-select.DialogSelect::scrollToSelection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.splitRows (cognitive 16) packages/tui/src/util/diff.ts:56— diff.splitRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-tabs.heldSessionTabLayout (cognitive 16) packages/tui/src/component/session-tabs.tsx:238— session-tabs.heldSessionTabLayout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 1 (2 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.
permission.SessionQuestion (cognitive 16) packages/tui/src/routes/session/permission.tsx:407— permission.SessionQuestion has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 14, if/else 2. None of this is in the body itself: all 16 points belong to 5 function items inside it that branch (a function literal at line 440, content, dismiss, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
rows.rowBoundaryMessageID (cognitive 16) packages/tui/src/routes/session/rows.ts:510— rows.rowBoundaryMessageID 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). To reduce it, split the body into named stages: move each independent 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.formatSessionTranscript (cognitive 16) packages/tui/src/routes/session/index.tsx:3732— index.formatSessionTranscript has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 7 (nesting depth added 4). None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 3743, 3738, 3754). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.run (cognitive 16) packages/tui/src/app.tsx:211— app.run has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 7 (nesting depth added 2). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 317, 262, 313, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-node.resolveTargetNode (cognitive 16) packages/cli/script/build-node.ts:178— build-node.resolveTargetNode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, 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.
pty-handoff.read (cognitive 16) packages/client/src/pty-handoff.ts:90— pty-handoff.read has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7, 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.
Frame.evaluateForStatement (cognitive 16) packages/codemode/src/interpreter/interpreter.ts:664— Frame.evaluateForStatement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 4). None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 670, 692). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Frame.evaluateArrayExpression (cognitive 16) packages/codemode/src/interpreter/interpreter.ts:2100— Frame.evaluateArrayExpression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts) (nesting depth added 9). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 2104). 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.
projector.projectFork (cognitive 16) packages/core/src/session/projector.ts:109— projector.projectFork has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 4). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scan.scanBashBacktick (cognitive 16) packages/core/src/shell/scan.ts:1339— scan.scanBashBacktick has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 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.
OpenAICompatibleChatLanguageModel.doGenerate (cognitive 16) packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:192— OpenAICompatibleChatLanguageModel.doGenerate has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 5, 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.
snapshot-parity.run (cognitive 16) packages/core/script/snapshot-parity.ts:559— snapshot-parity.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 6, boolean chains 3. Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 615, a function literal at line 605, a function literal at line 611, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
v1-migration.bun.legacyToolNotice (cognitive 16) packages/core/src/database/v1-migration.bun.ts:1005— v1-migration.bun.legacyToolNotice has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 2, if/else 2 (nesting depth added 3). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
diagnostics.createDiagnostics.get (cognitive 16) packages/gui-extensions/src/browser/diagnostics.ts:346— diagnostics.createDiagnostics.get has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6, boolean chains 2 (nesting depth added 3). Of this number, 8 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
artifact-view.ArtifactVideo (cognitive 16) packages/gui-extensions/src/file/artifact-view.tsx:497— artifact-view.ArtifactVideo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, ternaries 4. Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 10 function items inside it that branch (measure, a function literal at line 546, a function literal at line 596, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
renderer.setup (cognitive 16) packages/gui-extensions/src/ssh/renderer.tsx:12— renderer.setup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 13 function items inside it that branch (a function literal at line 63, client, byKey, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
worker-rpc.serveWorker (cognitive 16) packages/gui-extensions/src/microsoft-office/worker-rpc.ts:143— worker-rpc.serveWorker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), loops 1 (nesting depth added 7). None of this is in the body itself: all 16 points belong to 4 function items inside it that branch (run, a function literal at line 183, a function literal at line 199, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
sheet-paint.paintHeader (cognitive 16) packages/gui-extensions/src/microsoft-office/sheet-paint.ts:291— sheet-paint.paintHeader has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 3, 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.
index.assertPromiseEndpoint (cognitive 16) packages/httpapi-codegen/src/index.ts:575— index.assertPromiseEndpoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 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.
index.renderPromiseTypes (cognitive 16) packages/httpapi-codegen/src/index.ts:799— index.renderPromiseTypes has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 4, boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 851, a function literal at line 842, typeOf, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
layout.layoutSubgraphs (cognitive 16) packages/merman/src/flowchart/layout.ts:1033— layout.layoutSubgraphs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (5 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.
routing.addTopFeedbackTransition (cognitive 16) packages/merman/src/state/routing.ts:744— routing.addTopFeedbackTransition has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 3, loops 2 (3 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.
routing.renderBodySafeTransitionPlan (cognitive 16) packages/merman/src/state/routing.ts:1144— routing.renderBodySafeTransitionPlan has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 2 (4 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.
model-compare-detail.ModelCompareDetailPage (cognitive 16) packages/stats/app/src/component/model-compare-detail.tsx:123— model-compare-detail.ModelCompareDetailPage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 3. Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 183, navigateToModels, syncComparisonScroll, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
v1-migrate.referenceHues (cognitive 16) packages/theme/src/tui/v1-migrate.ts:227— v1-migrate.referenceHues has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, ternaries 1. Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function items inside it that branch (resolve, a function literal at line 253, replace, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
stream-v2.subagent.toolCommit (cognitive 16) packages/tui/src/mini/stream-v2.subagent.ts:52— stream-v2.subagent.toolCommit has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 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.
stream-v2.subagent.createSubagentTracker.foreign (cognitive 16) packages/tui/src/mini/stream-v2.subagent.ts:1003— stream-v2.subagent.createSubagentTracker.foreign has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
demo.createRunDemo.prompt (cognitive 16) packages/tui/src/mini/demo.ts:960— demo.createRunDemo.prompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stream-v2.transport.createSessionTransport.resolvePermissionSources (cognitive 16) packages/tui/src/mini/stream-v2.transport.ts:935— stream-v2.transport.createSessionTransport.resolvePermissionSources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), ternaries 2, boolean chains 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent 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-icon.chooseIconName (cognitive 16) packages/ui/src/components/file-icon.tsx:575— file-icon.chooseIconName has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
list.List::handleKey (cognitive 16) packages/ui/src/components/list.tsx:190— list.List::handleKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, 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.
popover.Popover (cognitive 16) packages/ui/src/components/popover.tsx:23— popover.Popover has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2. None of this is in the body itself: all 16 points belong to 8 function items inside it that branch (a function literal at line 70, onOpenChange, a function literal at line 94, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
use-filtered-list.useFilteredList.onKeyDown (cognitive 16) packages/ui/src/hooks/use-filtered-list.tsx:101— use-filtered-list.useFilteredList.onKeyDown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
segmented-control.SegmentedControlItem (cognitive 16) packages/ui/src/navigation/segmented-control/segmented-control.tsx:283— segmented-control.SegmentedControlItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, ternaries 3 (4 pts), boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function items inside it that branch (onKeyDown, onClick, a function literal at line 300, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
close-prs.githubRequest (cognitive 16) script/github/close-prs.ts:295— close-prs.githubRequest has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 3, if/else 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency· Redundant authentication helper methods. `auth.bearer` appears to be a convenience wrapper for `auth.bearerHeader` (likely defaulting the header name to 'Authorization'). Having both exposes unnecessary complexity to the user. · ×1
Redundant authentication helper methods. `auth.bearer` appears to be a convenience wrapper for `auth.bearerHeader` (likely defaulting the header name to 'Authorization'). Having both exposes unnecessary complexity to the user. — Remove `auth.bearer` and document that `auth.bearerHeader` is the standard way to add bearer tokens, or remove `auth.bearerHeader` and keep `auth.bearer` if the header name is always fixed. (signatures: packages.ai.src.route.auth.auth.bearer(source: REDACTED | Credential) | packages.ai.src.route.auth.auth.bearerHeader(name: string, source?: REDACTED | Credential))
D22 · Internal API Consistency· Ambiguous naming for similar input types. `parseDataUrl` suggests returning a parsed structure or validation, while `fromDataUrl` suggests creating an `Asset`. If both create Assets, the names are confusingly distinct. If `parse` returns a raw object and `from` returns an Asset, the distinction is valid but `parse` is a poor name for a constructor-like function. · ×1
Ambiguous naming for similar input types. `parseDataUrl` suggests returning a parsed structure or validation, while `fromDataUrl` suggests creating an `Asset`. If both create Assets, the names are confusingly distinct. If `parse` returns a raw object and `from` returns an Asset, the distinction is valid but `parse` is a poor name for a constructor-like function. — If both create `Asset`, rename `parseDataUrl` to `fromDataUrl` (and remove the duplicate) or rename `parseDataUrl` to `parseDataUrlInput` to clarify it returns a raw input object, not an Asset. (signatures: packages.ai.src.media.media.fromDataUrl(dataUrl: string, options?: AssetOptions) | packages.ai.src.media.media.parseDataUrl(value: string, options?: AssetOptions))
D23 · Boundary Type-Coupling· Cross-context type Part (schema → ai) · ×1
Cross-context type Part (schema → ai) packages/ai/src/protocols/utils/gemini-generate-content.ts:18— Part (context schema) is exposed in ai's public surface via gemini-generate-content.chunk — couples the contexts.
Cross-context type Setup (gui-extensions → app) packages/app/component-tests/extension-host.fixture.tsx:182— Setup (context gui-extensions) is exposed in app's public surface via extension-host.fixture.mountExtensionHost.load — couples the contexts.
Cross-context type SessionMessageCompaction (client → session-ui) packages/session-ui/src/message/message-content.tsx:586— SessionMessageCompaction (context client) is exposed in session-ui's public surface via message-content.SessionCompactionMessage — couples the contexts.
Cross-context type ServerState (gui-extensions → app) packages/app/src/runtime/server/registry.tsx:39— ServerState (context gui-extensions) is exposed in app's public surface via registry.createServerProjects — couples the contexts.
Cross-context type ClientConnectionStatus (client → app) packages/app/src/runtime/server/client.tsx:59— ClientConnectionStatus (context client) is exposed in app's public surface via ServerConnectionStatus.ServerConnectionStatus — couples the contexts.
Cross-context type SessionInboxInfo (client → app) packages/app/src/session/timeline/controller-projection.ts:65— SessionInboxInfo (context client) is exposed in app's public surface via controller-projection.visibleTimelineMessages — couples the contexts.
Cross-context type ConfigEntry (client → app) packages/app/src/settings/workspaces/project-lsp.ts:5— ConfigEntry (context client) is exposed in app's public surface via project-lsp.configuredLanguageServers — couples the contexts.
Cross-context type ConnectMethod (app → tui) packages/tui/src/component/dialog-integration.tsx:79— ConnectMethod (context app) is exposed in tui's public surface via dialog-integration.connectMethods — couples the contexts.
Cross-context type PanelPresentation (plugin → tui) packages/tui/src/context/panel.tsx:23— PanelPresentation (context plugin) is exposed in tui's public surface via panel.createPanelState.open — couples the contexts.
Cross-context type REDACTED (ai → core) packages/core/src/integration.ts:178— REDACTED (context ai) is exposed in core's public surface via Interface.connection — couples the contexts.
Cross-context type RealtimeTransportInput (ai → core) packages/core/src/voice.ts:36— RealtimeTransportInput (context ai) is exposed in core's public surface via SessionInput.transport — couples the contexts.
Cross-context type RealtimeTransport (ai → core) packages/core/src/voice.ts:40— RealtimeTransport (context ai) is exposed in core's public surface via Session.transport — couples the contexts.
Cross-context type DesktopMenuAction (app → desktop) packages/desktop/src/main/native/menu-actions.ts:11— DesktopMenuAction (context app) is exposed in desktop's public surface via menu-actions.runDesktopMenuAction — couples the contexts.
Cross-context type DesktopOS (app → desktop) packages/desktop/src/renderer/platform/files.ts:24— DesktopOS (context app) is exposed in desktop's public surface via files.createDesktopFiles — couples the contexts.
Cross-context type SessionMessageInfo (client → gui-extensions) packages/gui-extensions/src/debug/metrics.ts:87— SessionMessageInfo (context client) is exposed in gui-extensions's public surface via metrics.projectedProviderMetrics — couples the contexts.
Cross-context type ArtifactKind (util → gui-extensions) packages/gui-extensions/src/file/contract.ts:66— ArtifactKind (context util) is exposed in gui-extensions's public surface via FileViewer.kinds — couples the contexts.
Cross-context type SessionReviewDiffStyle (session-ui → gui-extensions) packages/gui-extensions/src/review/panel.tsx:72— SessionReviewDiffStyle (context session-ui) is exposed in gui-extensions's public surface via panel.ReviewPanelContent — couples the contexts.
Cross-context type SessionReviewExpandMode (session-ui → gui-extensions) packages/gui-extensions/src/review/panel.tsx:72— SessionReviewExpandMode (context session-ui) is exposed in gui-extensions's public surface via panel.ReviewPanelContent — couples the contexts.
Cross-context type ConfigEntry (client → gui-extensions) packages/gui-extensions/src/details/configured-lsp.ts:4— ConfigEntry (context client) is exposed in gui-extensions's public surface via configured-lsp.configuredLsps — couples the contexts.
Cross-context type Json (app → plugin) packages/plugin/src/storage.ts:5— Json (context app) is exposed in plugin's public surface via StorageEntry.value — couples the contexts.
Cross-context type SessionInboxInfo (client → plugin) packages/plugin/src/tui/context.ts:69— SessionInboxInfo (context client) is exposed in plugin's public surface via Data.session — couples the contexts.
Cross-context type SessionMessageInfo (client → plugin) packages/plugin/src/tui/context.ts:69— SessionMessageInfo (context client) is exposed in plugin's public surface via Data.session — couples the contexts.
Cross-context type DialogSelectAction (tui → plugin) packages/plugin/src/tui/context.ts:391— DialogSelectAction (context tui) is exposed in plugin's public surface via DialogSelectOptions.actions — couples the contexts.
Cross-context type PluralKey (app → ui) packages/ui/src/context/i18n.tsx:8— PluralKey (context app) is exposed in ui's public surface via UiI18nPluralKey.UiI18nPluralKey — couples the contexts.
Cross-context type Implementation (core → util) packages/util/src/effect/layer-node.ts:192— Implementation (context core) is exposed in util's public surface via layer-node.make — couples the contexts.
D23 · Boundary Type-Coupling· Cross-context type Part (schema → web) · ×1
Cross-context type Part (schema → web) packages/web/src/components/share/part.tsx:39— Part (context schema) is exposed in web's public surface via PartProps.part — couples the contexts.
Duplication concentrated across 26 sibling directories (188 clone groups) packages/app/happydom.ts:1— 188 duplicated blocks under packages/ have copies in at least two of the sibling directories ai, app, cli, client, codemode, console (+20 more sibling(s) not listed) — 94 of them are reported below, and 94 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 188 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 188 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 188 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 11 sibling directories (48 clone groups) packages/tui/src/component/session-tabs.tsx:435— 48 duplicated blocks under packages/tui/src/ have copies in at least two of the sibling directories component, config, context, feature-plugins, mini, plugin (+5 more sibling(s) not listed) — 22 of them are reported below, and 26 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 48 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 48 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 48 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 10 sibling directories (39 clone groups) packages/app/src/home/sessions/command-palette.tsx:29— 39 duplicated blocks under packages/app/src/ have copies in at least two of the sibling directories composer, home, new-session, providers, runtime, servers (+4 more sibling(s) not listed) — 23 of them are reported below, and 16 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 39 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 39 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 39 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 12 sibling directories (18 clone groups) packages/core/src/reference/instructions.ts:31— 18 duplicated blocks under packages/core/src/ have copies in at least two of the sibling directories config, filesystem, instructions, mcp, permission, plugin (+6 more sibling(s) not listed) — 12 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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 3 sibling directories (18 clone groups) packages/plugin/src/effect/session.ts:2— 18 duplicated blocks under packages/plugin/src/ have copies in at least two of the sibling directories effect, promise, tui — 9 of them are reported below, and 9 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 3 sibling directories (16 clone groups) packages/stats/app/src/component/model-compare-detail.tsx:525— 16 of the duplicated blocks reported below have copies in at least two of the sibling directories component, lib, routes under packages/stats/app/src/. That concentration is one structural fact, not 16 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 16 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 7 sibling directories (15 clone groups) packages/merman/src/core/drawing.ts:127— 15 duplicated blocks under packages/merman/src/ have copies in at least two of the sibling directories core, flowchart, gantt, gitgraph, sequence, state (+1 more sibling(s) not listed) — 9 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 15 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 15 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 15 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 13 sibling directories (13 clone groups) packages/gui-extensions/src/browser/index.ts:21— 13 duplicated blocks under packages/gui-extensions/src/ have copies in at least two of the sibling directories browser, btw, context, debug, details, file (+7 more sibling(s) not listed) — 9 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 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 6 sibling directories (13 clone groups) packages/session-ui/src/components/line-comment-annotations.tsx:407— 13 duplicated blocks under packages/session-ui/src/ have copies in at least two of the sibling directories components, message, pierre, timeline, tools, v2 — 6 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 7 sibling directories (7 clone groups) packages/console/app/src/routes/go/index.tsx:175— 7 duplicated blocks under packages/console/app/src/routes/ have copies in at least two of the sibling directories brand, changelog, enterprise, go, s, t (+1 more sibling(s) not listed) — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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 6 sibling directories (7 clone groups) packages/ui/src/components/context-menu.tsx:107— 7 duplicated blocks under packages/ui/src/ have copies in at least two of the sibling directories actions, components, data-display, feedback, forms, navigation — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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 2 sibling directories (5 clone groups) packages/stats/app/src/routes/[lab]/[model].tsx:1449— 5 duplicated blocks under packages/stats/app/src/routes/ have copies in at least two of the sibling directories [lab], compare — 2 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (144 matched lines × 2 locations) · ×1
Duplicated block with local edits (144 matched lines × 2 locations) packages/stats/core/src/domain/geo.ts:56— packages/stats/core/src/domain/geo.ts:56 · packages/stats/core/src/domain/model.ts:47 — the two spans are one implementation copied and then locally edited — 1045 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 (101 identical lines × 2 files) packages/plugin/src/effect/session.ts:2— packages/plugin/src/effect/session.ts:2 · packages/plugin/src/promise/session.ts:2 — these 2 files are line-for-line copies of one another — 101 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 (97 matched lines × 2 locations) · ×1
Duplicated block with local edits (97 matched lines × 2 locations) packages/console/app/src/component/go-plan-chart.tsx:16— packages/console/app/src/component/go-plan-chart.tsx:16 · packages/console/app/src/component/limits-graph.tsx:9 — the two spans are one implementation copied and then locally edited — 702 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 (95 matched lines × 2 locations) · ×1
Duplicated block with local edits (95 matched lines × 2 locations) packages/core/src/database/drizzle/sqlite-core/effect/delete.ts:50— packages/core/src/database/drizzle/sqlite-core/effect/delete.ts:50 · packages/core/src/database/drizzle/sqlite-core/effect/update.ts:78 — the two spans are one implementation copied and then locally edited — 510 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 (88 matched lines × 2 locations) · ×1
Duplicated block with local edits (88 matched lines × 2 locations) packages/codemode/src/stdlib/headers.ts:40— packages/codemode/src/stdlib/headers.ts:40 · packages/codemode/src/stdlib/url.ts:186 — the two spans are one implementation copied and then locally edited — 702 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 (88 lines × 2 locations) packages/stats/app/src/component/model-compare-detail.tsx:525— packages/stats/app/src/component/model-compare-detail.tsx:525 · packages/stats/app/src/routes/compare/index.tsx:314 — 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 (80 matched lines × 2 locations) · ×1
Duplicated block with local edits (80 matched lines × 2 locations) packages/ai/src/image.ts:20— packages/ai/src/image.ts:20 · packages/ai/src/video.ts:20 — the two spans are one implementation copied and then locally edited — 634 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (78 matched lines × 2 locations) · ×1
Duplicated block with local edits (78 matched lines × 2 locations) packages/core/src/tool/plugin/glob.ts:26— packages/core/src/tool/plugin/glob.ts:26 · packages/core/src/tool/plugin/grep.ts:36 — the two spans are one implementation copied and then locally edited — 486 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) packages/core/src/plugin/vcs/git.ts:27— packages/core/src/plugin/vcs/git.ts:27 · packages/core/src/plugin/vcs/hg.ts:25 — the two spans are one implementation copied and then locally edited — 541 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 (74 matched lines × 2 locations) · ×1
Duplicated block with local edits (74 matched lines × 2 locations) packages/schema/src/v1/session.ts:103— packages/schema/src/v1/session.ts:103 · packages/schema/src/v1/session.ts:398 — the two spans are one implementation copied and then locally edited — 517 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.
Duplicated block (73 lines × 2 locations) packages/stats/core/src/domain/geo.ts:89— packages/stats/core/src/domain/geo.ts:89 · packages/stats/core/src/domain/provider.ts:61 — 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 (72 matched lines × 2 locations) · ×1
Duplicated block with local edits (72 matched lines × 2 locations) packages/gui-extensions/src/file/list.tsx:70— packages/gui-extensions/src/file/list.tsx:70 · packages/gui-extensions/src/file/tree-v2.tsx:162 — the two spans are one implementation copied and then locally edited — 436 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 (69 identical lines × 2 files) packages/app/happydom.ts:1— packages/app/happydom.ts:1 · packages/gui-extensions/happydom.ts:1 — these 2 files are line-for-line copies of one another — 69 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 (69 matched lines × 2 locations) · ×1
Duplicated block with local edits (69 matched lines × 2 locations) packages/core/src/database/sqlite.bun.ts:16— packages/core/src/database/sqlite.bun.ts:16 · packages/core/src/database/sqlite.node.ts:18 — the two spans are one implementation copied and then locally edited — 591 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 (67 lines × 10 locations) packages/gui-extensions/src/browser/index.ts:21— packages/gui-extensions/src/browser/index.ts:21 · packages/gui-extensions/src/context/index.ts:6 · packages/gui-extensions/src/debug/index.ts:7 · packages/gui-extensions/src/details/index.ts:18 · +6 more site(s) not listed — the 10 copies are spread across 10 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication· Duplicated block with local edits (65 matched lines × 2 locations) · ×1
Duplicated block with local edits (65 matched lines × 2 locations) packages/app/src/settings/appearance/appearance.tsx:35— packages/app/src/settings/appearance/appearance.tsx:35 · packages/app/src/settings/notifications/notifications.tsx:31 — the two spans are one implementation copied and then locally edited — 386 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 (64 matched lines × 2 locations) · ×1
Duplicated block with local edits (64 matched lines × 2 locations) packages/session-ui/src/components/line-comment-annotations.tsx:407— packages/session-ui/src/components/line-comment-annotations.tsx:407 · packages/session-ui/src/v2/components/line-comment-annotations-v2.tsx:125 — 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.
R10 · Code Duplication· Duplicated block with local edits (61 matched lines × 2 locations) · ×1
Duplicated block with local edits (61 matched lines × 2 locations) packages/app/src/settings/shell.tsx:345— packages/app/src/settings/shell.tsx:345 · packages/app/src/settings/shell.tsx:465 — the two spans are one implementation copied and then locally edited — 391 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (60 matched lines × 2 locations) · ×1
Duplicated block with local edits (60 matched lines × 2 locations) packages/core/src/reference/instructions.ts:31— packages/core/src/reference/instructions.ts:31 · packages/core/src/skill/instructions.ts:35 — the two spans are one implementation copied and then locally edited — 455 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 (59 matched lines × 2 locations) · ×1
Duplicated block with local edits (59 matched lines × 2 locations) packages/ai/src/providers/moonshot.ts:35— packages/ai/src/providers/moonshot.ts:35 · packages/ai/src/providers/zai-coding-plan.ts:17 — the two spans are one implementation copied and then locally edited — 423 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 (52 matched lines × 2 locations) · ×1
Duplicated block with local edits (52 matched lines × 2 locations) packages/app/src/providers/connect/dialog.tsx:994— packages/app/src/providers/connect/dialog.tsx:994 · packages/app/src/providers/connect/dialog.tsx:1073 — the two spans are one implementation copied and then locally edited — 336 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 (50 matched lines × 2 locations) · ×1
Duplicated block with local edits (50 matched lines × 2 locations) packages/client/src/effect/service.ts:40— packages/client/src/effect/service.ts:40 · packages/client/src/promise/service.ts:22 — the two spans are one implementation copied and then locally edited — 373 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 (49 matched lines × 2 locations) · ×1
Duplicated block with local edits (49 matched lines × 2 locations) packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:316— packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts:316 · packages/core/src/github-copilot/responses/openai-responses-language-model.ts:679 — the two spans are one implementation copied and then locally edited — 266 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 (48 lines × 2 locations) packages/console/app/src/routes/go/index.tsx:175— packages/console/app/src/routes/go/index.tsx:175 · packages/console/app/src/routes/zen/index.tsx:153 — 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.
Complex function scanPowerShellList (cyclomatic 358, cognitive 475) packages/core/src/shell/scan.ts:1740— scanPowerShellList has cyclomatic complexity 358 and cognitive complexity 475; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 resolveThemeVariant (cyclomatic 180, cognitive 209) packages/ui/src/theme/resolve.ts:4— resolveThemeVariant has cyclomatic complexity 180 and cognitive complexity 209; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function apply (cyclomatic 128, cognitive 190) packages/tui/src/mini/stream-v2.transport.ts:1025— apply has cyclomatic complexity 128 and cognitive complexity 190; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleEvent (cyclomatic 120, cognitive 87) packages/client/src/solid/data.ts:632— handleEvent has cyclomatic complexity 120 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 consume (cyclomatic 102, cognitive 173) packages/cli/src/run/noninteractive.ts:209— consume has cyclomatic complexity 102 and cognitive complexity 173; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 scanBash (cyclomatic 96, cognitive 138) packages/core/src/shell/scan.ts:430— scanBash has cyclomatic complexity 96 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 execute (cyclomatic 94, cognitive 99) packages/gui-extensions/src/browser/chromium.ts:687— execute has cyclomatic complexity 94 and cognitive complexity 99; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 scanBashKeyword (cyclomatic 86, cognitive 78) packages/core/src/shell/scan.ts:858— scanBashKeyword has cyclomatic complexity 86 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 75, cognitive 70) packages/core/src/session/runner/step.ts:142— (anonymous) has cyclomatic complexity 75 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 transform (cyclomatic 73, cognitive 106) packages/core/src/github-copilot/responses/openai-responses-language-model.ts:763— transform has cyclomatic complexity 73 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function onclosetag (cyclomatic 72, cognitive 121) packages/core/src/tool/html-markdown.ts:471— onclosetag has cyclomatic complexity 72 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function onopentag (cyclomatic 72, cognitive 99) packages/core/src/tool/html-markdown.ts:264— onopentag has cyclomatic complexity 72 and cognitive complexity 99; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 72, cognitive 67) packages/ai/src/protocols/openai-chat.ts:1016— (anonymous) has cyclomatic complexity 72 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 scanBashUnit (cyclomatic 71, cognitive 86) packages/core/src/shell/scan.ts:1030— scanBashUnit has cyclomatic complexity 71 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function scanBashCommandStart (cyclomatic 69, cognitive 89) packages/core/src/shell/scan.ts:743— scanBashCommandStart has cyclomatic complexity 69 and cognitive complexity 89; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 parseCommand (cyclomatic 67, cognitive 66) packages/latex/src/parser.ts:201— parseCommand has cyclomatic complexity 67 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 reduce (cyclomatic 65, cognitive 87) packages/tui/src/mini/stream-v2.subagent.ts:658— reduce has cyclomatic complexity 65 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 analyzeVisualObservations (cyclomatic 62, cognitive 121) packages/app/e2e/utils/visual-stability/analyzer.ts:4— analyzeVisualObservations has cyclomatic complexity 62 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function submitInner (cyclomatic 60, cognitive 74) packages/tui/src/component/prompt/index.tsx:1114— submitInner has cyclomatic complexity 60 and cognitive complexity 74; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 diagramLineGlyph (cyclomatic 58, cognitive 59) packages/merman/src/core/drawing.ts:116— diagramLineGlyph has cyclomatic complexity 58 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· packages/client/src/promise/generated/types.ts · ×1
packages/client/src/promise/generated/types.ts: 5405 lines of code packages/client/src/promise/generated/types.ts:1— packages/client/src/promise/generated/types.ts has 5405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/routes/session/index.tsx · ×1
packages/tui/src/routes/session/index.tsx: 3691 lines of code packages/tui/src/routes/session/index.tsx:1— packages/tui/src/routes/session/index.tsx has 3691 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/client/src/promise/generated/client.ts · ×1
packages/client/src/promise/generated/client.ts: 2385 lines of code packages/client/src/promise/generated/client.ts:1— packages/client/src/promise/generated/client.ts has 2385 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/shell/scan.ts · ×1
packages/core/src/shell/scan.ts: 2340 lines of code packages/core/src/shell/scan.ts:1— packages/core/src/shell/scan.ts has 2340 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/codemode/src/interpreter/interpreter.ts · ×1
packages/codemode/src/interpreter/interpreter.ts: 2173 lines of code packages/codemode/src/interpreter/interpreter.ts:1— packages/codemode/src/interpreter/interpreter.ts has 2173 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/session-ui/src/tools/tool-renderer.tsx · ×1
packages/session-ui/src/tools/tool-renderer.tsx: 2127 lines of code packages/session-ui/src/tools/tool-renderer.tsx:1— packages/session-ui/src/tools/tool-renderer.tsx has 2127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/client/src/solid/data.ts · ×1
packages/client/src/solid/data.ts: 1963 lines of code packages/client/src/solid/data.ts:1— packages/client/src/solid/data.ts has 1963 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/component/prompt/index.tsx · ×1
packages/tui/src/component/prompt/index.tsx: 1925 lines of code packages/tui/src/component/prompt/index.tsx:1— packages/tui/src/component/prompt/index.tsx has 1925 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/httpapi-codegen/src/index.ts · ×1
packages/httpapi-codegen/src/index.ts: 1855 lines of code packages/httpapi-codegen/src/index.ts:1— packages/httpapi-codegen/src/index.ts has 1855 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/mini/stream-v2.transport.ts · ×1
packages/tui/src/mini/stream-v2.transport.ts: 1833 lines of code packages/tui/src/mini/stream-v2.transport.ts:1— packages/tui/src/mini/stream-v2.transport.ts has 1833 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/stats/app/src/routes/index.tsx · ×1
packages/stats/app/src/routes/index.tsx: 1781 lines of code packages/stats/app/src/routes/index.tsx:1— packages/stats/app/src/routes/index.tsx has 1781 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/component/session-tabs.tsx · ×1
packages/tui/src/component/session-tabs.tsx: 1763 lines of code packages/tui/src/component/session-tabs.tsx:1— packages/tui/src/component/session-tabs.tsx has 1763 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ai/src/protocols/anthropic-messages.ts · ×1
packages/ai/src/protocols/anthropic-messages.ts: 1554 lines of code packages/ai/src/protocols/anthropic-messages.ts:1— packages/ai/src/protocols/anthropic-messages.ts has 1554 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/gui-extensions/src/browser/chromium.ts · ×1
packages/gui-extensions/src/browser/chromium.ts: 1490 lines of code packages/gui-extensions/src/browser/chromium.ts:1— packages/gui-extensions/src/browser/chromium.ts has 1490 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/github-copilot/responses/openai-responses-language-model.ts · ×1
packages/core/src/github-copilot/responses/openai-responses-language-model.ts: 1489 lines of code packages/core/src/github-copilot/responses/openai-responses-language-model.ts:1— packages/core/src/github-copilot/responses/openai-responses-language-model.ts has 1489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/providers/connect/dialog.tsx · ×1
packages/app/src/providers/connect/dialog.tsx: 1439 lines of code packages/app/src/providers/connect/dialog.tsx:1— packages/app/src/providers/connect/dialog.tsx has 1439 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/merman/src/state/routing.ts · ×1
packages/merman/src/state/routing.ts: 1436 lines of code packages/merman/src/state/routing.ts:1— packages/merman/src/state/routing.ts has 1436 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/tui/src/app.tsx: 1432 lines of code packages/tui/src/app.tsx:1— packages/tui/src/app.tsx has 1432 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/stats/app/src/routes/[lab]/[model].tsx · ×1
packages/stats/app/src/routes/[lab]/[model].tsx: 1411 lines of code packages/stats/app/src/routes/[lab]/[model].tsx:1— packages/stats/app/src/routes/[lab]/[model].tsx has 1411 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/mini/footer.prompt.tsx · ×1
packages/tui/src/mini/footer.prompt.tsx: 1411 lines of code packages/tui/src/mini/footer.prompt.tsx:1— packages/tui/src/mini/footer.prompt.tsx has 1411 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ai/src/protocols/open-responses.ts · ×1
packages/ai/src/protocols/open-responses.ts: 1402 lines of code packages/ai/src/protocols/open-responses.ts:1— packages/ai/src/protocols/open-responses.ts has 1402 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: 1347 lines of code REDACTED:1— REDACTED has 1347 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/console/app/src/routes/legal/privacy-policy/index.tsx · ×1
packages/console/app/src/routes/legal/privacy-policy/index.tsx: 1344 lines of code packages/console/app/src/routes/legal/privacy-policy/index.tsx:1— packages/console/app/src/routes/legal/privacy-policy/index.tsx has 1344 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/merman/src/flowchart/routing.ts · ×1
packages/merman/src/flowchart/routing.ts: 1343 lines of code packages/merman/src/flowchart/routing.ts:1— packages/merman/src/flowchart/routing.ts has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/feature-plugins/system/diff-viewer.tsx · ×1
packages/tui/src/feature-plugins/system/diff-viewer.tsx: 1335 lines of code packages/tui/src/feature-plugins/system/diff-viewer.tsx:1— packages/tui/src/feature-plugins/system/diff-viewer.tsx has 1335 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/component/dialog-integration.tsx · ×1
packages/tui/src/component/dialog-integration.tsx: 1231 lines of code packages/tui/src/component/dialog-integration.tsx:1— packages/tui/src/component/dialog-integration.tsx has 1231 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ai/src/protocols/openai-chat.ts · ×1
packages/ai/src/protocols/openai-chat.ts: 1215 lines of code packages/ai/src/protocols/openai-chat.ts:1— packages/ai/src/protocols/openai-chat.ts has 1215 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/mini/tool.ts · ×1
packages/tui/src/mini/tool.ts: 1215 lines of code packages/tui/src/mini/tool.ts:1— packages/tui/src/mini/tool.ts has 1215 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/database/v1-migration.bun.ts · ×1
packages/core/src/database/v1-migration.bun.ts: 1189 lines of code packages/core/src/database/v1-migration.bun.ts:1— packages/core/src/database/v1-migration.bun.ts has 1189 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/session-ui/src/storybook/current-session-fixtures.ts · ×1
packages/session-ui/src/storybook/current-session-fixtures.ts: 1173 lines of code packages/session-ui/src/storybook/current-session-fixtures.ts:1— packages/session-ui/src/storybook/current-session-fixtures.ts has 1173 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/gui-extensions/src/browser/panel.tsx · ×1
packages/gui-extensions/src/browser/panel.tsx: 1147 lines of code packages/gui-extensions/src/browser/panel.tsx:1— packages/gui-extensions/src/browser/panel.tsx has 1147 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/mini/footer.command.tsx · ×1
packages/tui/src/mini/footer.command.tsx: 1141 lines of code packages/tui/src/mini/footer.command.tsx:1— packages/tui/src/mini/footer.command.tsx has 1141 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/routes/session/form.tsx · ×1
packages/tui/src/routes/session/form.tsx: 1130 lines of code packages/tui/src/routes/session/form.tsx:1— packages/tui/src/routes/session/form.tsx has 1130 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/stats/app/src/component/model-compare-detail.tsx · ×1
packages/stats/app/src/component/model-compare-detail.tsx: 1127 lines of code packages/stats/app/src/component/model-compare-detail.tsx:1— packages/stats/app/src/component/model-compare-detail.tsx has 1127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/tui/src/mini/stream-v2.subagent.ts · ×1
packages/tui/src/mini/stream-v2.subagent.ts: 1100 lines of code packages/tui/src/mini/stream-v2.subagent.ts:1— packages/tui/src/mini/stream-v2.subagent.ts has 1100 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/gui-extensions/src/sdk/host-apis.ts · ×1
packages/gui-extensions/src/sdk/host-apis.ts: 1099 lines of code packages/gui-extensions/src/sdk/host-apis.ts:1— packages/gui-extensions/src/sdk/host-apis.ts has 1099 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/core/src/session/compaction.ts · ×1
packages/core/src/session/compaction.ts: 1087 lines of code packages/core/src/session/compaction.ts:1— packages/core/src/session/compaction.ts has 1087 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/stats/core/src/domain/home.ts · ×1
packages/stats/core/src/domain/home.ts: 1077 lines of code packages/stats/core/src/domain/home.ts:1— packages/stats/core/src/domain/home.ts has 1077 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/app/src/composer/editor/editor.tsx · ×1
packages/app/src/composer/editor/editor.tsx: 1068 lines of code packages/app/src/composer/editor/editor.tsx:1— packages/app/src/composer/editor/editor.tsx has 1068 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/merman/src/flowchart/layout.ts · ×1
packages/merman/src/flowchart/layout.ts: 1067 lines of code packages/merman/src/flowchart/layout.ts:1— packages/merman/src/flowchart/layout.ts has 1067 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling· The declared test suite includes a file that cannot be loaded · ×1
The declared test suite includes a file that cannot be loaded packages/app/e2e/performance/composer-history/vite.config.ts:7— This repository declares test tooling, and the ✓ above records that declaration — but packages/app/e2e/performance/composer-history/vite.config.ts and 2 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
Dead file (~1883 LoC) packages/stats/app/src/routes/index.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~1494 LoC) packages/stats/app/src/routes/[lab]/[model].tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~1196 LoC) packages/stats/app/src/component/model-compare-detail.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/stats/app/src/routes/compare/[firstFamily]/[secondFamily].tsx, packages/stats/app/src/routes/compare/[firstLab]/[firstModel]/[secondLab]/[secondModel].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 (~1028 LoC) packages/stats/app/src/routes/[lab]/index.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~997 LoC) packages/gui-extensions/src/browser/panel.fixture.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~833 LoC) packages/console/app/src/routes/index.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~758 LoC) packages/web/src/components/share/part.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/web/src/components/Share.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 (~646 LoC) packages/web/src/components/Share.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~615 LoC) packages/stats/app/src/routes/compare/index.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~540 LoC) packages/stats/app/src/routes/stats-shell.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 5 in-repo import(s) from 5 other file(s) do name it (packages/stats/app/src/component/model-compare-detail.tsx, packages/stats/app/src/routes/[lab]/[model].tsx, packages/stats/app/src/routes/[lab]/index.tsx and 2 more) — 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 (~385 LoC) packages/core/script/benchmark-snapshot.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~298 LoC) packages/gui-extensions/src/sdk/compose.typecheck.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~255 LoC) packages/web/src/components/icons/index.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 3 in-repo import(s) from 3 other file(s) do name it (packages/web/src/components/Share.tsx, packages/web/src/components/share/copy-button.tsx, packages/web/src/components/share/part.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 (~250 LoC) packages/ai/script/recording-cost-report.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~243 LoC) packages/cli/src/ui/timeline.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~197 LoC) packages/web/src/components/share/content-diff.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/web/src/components/share/part.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 (~194 LoC) packages/core/script/benchmark-snapshot-session.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~187 LoC) packages/cli/dev/tui.ts— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/cli/dev/vite.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 (~182 LoC) packages/console/app/src/lib/stats-proxy.ts— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 4 in-repo import(s) from 4 other file(s) do name it (packages/console/app/src/routes/data/[...path].ts, packages/console/app/src/routes/data/index.ts, packages/console/app/src/routes/stats/[...path].ts and 1 more) — 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 (~174 LoC) packages/console/app/src/routes/changelog/index.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~153 LoC) script/drive/subagent-eviction.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~131 LoC) packages/stats/app/src/routes/sitemap.xml.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~130 LoC) nix/scripts/normalize-bun-binaries.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~117 LoC) packages/web/src/i18n/locales.ts— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/web/src/middleware.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 (~112 LoC) packages/core/script/wellknown-server.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~101 LoC) nix/scripts/canonicalize-node-modules.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~94 LoC) packages/web/src/middleware.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~91 LoC) packages/web/src/components/share/common.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 7 in-repo import(s) from 7 other file(s) do name it (packages/web/src/components/Share.tsx, packages/web/src/components/share/content-bash.tsx, packages/web/src/components/share/content-error.tsx and 4 more) — 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 (~88 LoC) script/drive/shell-output.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~87 LoC) packages/web/src/components/icons/custom.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/web/src/components/Share.tsx, packages/web/src/components/share/part.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 (~83 LoC) packages/stats/app/src/routes/compare-selector.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~74 LoC) packages/web/src/components/share/content-markdown.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/web/src/components/share/part.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 (~70 LoC) packages/stats/app/src/routes/breadcrumb-select.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/stats/app/src/routes/[lab]/[model].tsx, packages/stats/app/src/routes/[lab]/index.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 (~67 LoC) packages/web/src/components/share/content-bash.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/web/src/components/share/part.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 (~66 LoC) packages/core/script/benchmark-snapshot-pack.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~62 LoC) packages/codemode/script/sync-test262.ts— no import path from any entry point (1631 application, 223 tooling, 1548 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 (~58 LoC) packages/console/app/src/component/rolling-number.tsx— no import path from any entry point (1631 application, 223 tooling, 1548 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
Unlisted import '@octokit/webhooks-types' REDACTED:8— Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json.
Unlisted import 'rolldown' REDACTED:61— Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json.
Unused dependency '@actions/artifact' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@typescript/native' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'heap-snapshot-toolkit' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X29 · Per-element action decided by a fixed element· Per-element action decided by a fixed element · ×1
Per-element action decided by a fixed element packages/core/src/shell/scan.ts:2365— This loop runs once per element of `input`, and the statement it guards acts on the element it is on — `input[index]`. The test deciding whether that statement runs does not: `quote === '"'` reads `input[start + 1]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2349, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
README/code drift salesforce/README.md:16— salesforce/README.md names `packages/core/src/crm.ts`, but no file or folder `packages/core/src/crm.ts` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift services/README.md:9— services/README.md links to `./updates`, but `services/updates` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/ai/README.md:1331— packages/ai/README.md names `providers/google-vertex/gemini`, but no file or folder `providers/google-vertex/gemini` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/http-recorder/README.md:13— packages/http-recorder/README.md installs `@effect/vitest` (`bun add -d @opencode/http-recorder @effect/vitest@4.0.0-beta.107 vitest@^4`), but no package.json declares it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/http-recorder/README.md:13— packages/http-recorder/README.md installs `vitest` (`bun add -d @opencode/http-recorder @effect/vitest@4.0.0-beta.107 vitest@^4`), but no package.json declares it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/codemode/test/test262/README.md:8— packages/codemode/test/test262/README.md runs `bun run script/sync-test262.ts ~/development/test262`, but `script/sync-test262.ts` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/codemode/test/test262/README.md:38— packages/codemode/test/test262/README.md runs `bun run script/test262-report.ts [--write] [dir]`, but `script/test262-report.ts` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/agents.mdx:69— packages/web/src/content/docs/agents.mdx documents the environment variable `OPENCODE_EXPERIMENTAL_PLAN_MODE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/agents.mdx:206— packages/web/src/content/docs/agents.mdx names `.opencode/agents/`, but no file or folder `.opencode/agents` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/agents.mdx:369— packages/web/src/content/docs/agents.mdx links to `/docs/config#models`, but `docs/config` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/agents.mdx:569— packages/web/src/content/docs/agents.mdx links to `/docs/permissions`, but `docs/permissions` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:213— packages/web/src/content/docs/cli.mdx links to `/docs/github`, but `docs/github` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:326— packages/web/src/content/docs/cli.mdx links to `/docs/config/`, but `docs/config` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:399— packages/web/src/content/docs/cli.mdx links to `/docs/server`, but `docs/server` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:755— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_TUI_CONFIG`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:759— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_PRUNE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:760— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_TERMINAL_TITLE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:761— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_PERMISSION`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:762— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_DEFAULT_PLUGINS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:763— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_LSP_DOWNLOAD`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:764— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_ENABLE_EXPERIMENTAL_MODELS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:765— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_AUTOCOMPACT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:767— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_CLAUDE_CODE_PROMPT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:770— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_DISABLE_MOUSE`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift packages/web/src/content/docs/cli.mdx:771— packages/web/src/content/docs/cli.mdx documents the environment variable `OPENCODE_FAKE_VCS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Duplicated predicate packages/cli/src/run/noninteractive.ts:805— `!!error && typeof error === "object" && "_tag" in error && error._tag === "FormAlreadySettledError"` appears character-identically in 2 files — packages/cli/src/run/noninteractive.ts, packages/tui/src/mini/runtime.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/app/src/composer/selection.ts:69— `!!provider?.models[model.modelID] && connected().has(model.providerID)` appears character-identically in 2 files — packages/app/src/composer/selection.ts, packages/app/src/providers/models/selection.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 script/oxlint/anti-slop/rules/no-module-mocking.ts:41— `!("property" in callee) || !("object" in callee) || !("computed" in callee)` appears character-identically in 2 files — script/oxlint/anti-slop/rules/no-module-mocking.ts, script/oxlint/anti-slop/shared/reflect-method.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/codemode/src/interpreter/callback.ts:42— `!(value instanceof Obj) || isOpaque(value)` appears character-identically in 2 files — packages/codemode/src/interpreter/callback.ts, packages/codemode/src/interpreter/extensions.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/stats/core/src/honeycomb-backfill.ts:983— `!Number.isInteger(parsed) || parsed <= 0` appears character-identically in 2 files — packages/stats/core/src/honeycomb-backfill.ts, script/github/close-prs.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:365— `!Number.isNaN(date.getTime()) && date.toISOString().slice(0, 10) === value` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/app/src/composer/model.ts:208— `!agent.hidden && agent.mode !== "primary"` appears character-identically in 2 files — packages/app/src/composer/model.ts, packages/tui/src/component/prompt/autocomplete.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 packages/desktop/src/main/service/background-service.ts:37— `!app.isPackaged && process.env.OPENCODE_DESKTOP_ISOLATED_SERVER === "1"` appears character-identically in 2 files — packages/desktop/src/main/service/background-service.ts, packages/desktop/src/main/service/desktop-cli.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/tui/src/mini/stream-v2.subagent.ts:777— `!current || current.part.state.status !== "streaming"` appears character-identically in 2 files — packages/tui/src/mini/stream-v2.subagent.ts, packages/tui/src/mini/stream-v2.transport.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/app/src/session/requests/model.ts:25— `!id || serverSDK.connection.status() !== "connected"` appears character-identically in 2 files — packages/app/src/session/requests/model.ts, packages/app/src/workspaces/location.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 packages/app/src/session/composer/region.tsx:219— `!item || item.type === "shell" || item.type === "idle"` appears character-identically in 2 files — packages/app/src/session/composer/region.tsx, packages/tui/src/routes/session/index.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 packages/tui/src/routes/home.tsx:74— `!local.agent.current() || !local.model.current()` appears character-identically in 2 files — packages/tui/src/routes/home.tsx, packages/tui/src/routes/session/index.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 packages/client/src/rpc-runtime.ts:17— `!method.errors || !Object.hasOwn(method.errors, error.type)` appears character-identically in 2 files — packages/client/src/rpc-runtime.ts, packages/core/src/rpc.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/codemode/src/interpreter/interpreter.ts:153— `!node.computed && property.type === "Identifier"` appears character-identically in 2 files — packages/codemode/src/interpreter/interpreter.ts, script/oxlint/anti-slop/shared/array-method.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/app/src/composer/attachments/attachments.ts:327— `!selection || selection.rangeCount === 0` appears character-identically in 2 files — packages/app/src/composer/attachments/attachments.ts, packages/app/src/composer/editor/dom.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/app/src/composer/editor/editor.tsx:571— `!selection?.rangeCount || !editor.contains(selection.anchorNode)` appears character-identically in 2 files — packages/app/src/composer/editor/editor.tsx, packages/app/src/composer/editor/interaction.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/tui/src/component/fade-in-text.tsx:66— `!this.visible || this.isDestroyed || !Number.isFinite(this.width) || this.width <= 0 || this.height <= 0` appears character-identically in 3 files — packages/tui/src/component/fade-in-text.tsx, packages/tui/src/component/shimmer-text.tsx, packages/tui/src/component/title-shimmer.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 packages/app/src/servers/connect/pairing.ts:44— `!url || (url.protocol !== "http:" && url.protocol !== "https:")` appears character-identically in 2 files — packages/app/src/servers/connect/pairing.ts, packages/util/src/open.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/app/src/runtime/i18n/desktop-native.ts:332— `!value || typeof value !== "object" || Array.isArray(value)` appears character-identically in 4 files — packages/app/src/runtime/i18n/desktop-native.ts, packages/app/src/settings/keybinds/keybinds.tsx, packages/theme/src/tui/v1-migrate.ts, packages/tui/src/util/permission.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/ai/src/providers/google-vertex-chat.ts:40— `"apiKey" in input && input.apiKey !== undefined` appears character-identically in 4 files — packages/ai/src/providers/google-vertex-chat.ts, packages/ai/src/providers/google-vertex-messages.ts, packages/ai/src/providers/google-vertex-mistral.ts, packages/ai/src/providers/google-vertex-responses.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/core/src/plugin/provider/digitalocean.ts:191— `"code" in cause && cause.code === "EADDRINUSE"` appears character-identically in 2 files — packages/core/src/plugin/provider/digitalocean.ts, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:227— `"code" in error && error.code === "EADDRINUSE"` appears character-identically in 2 files — REDACTED, packages/core/src/plugin/provider/openai.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/cli/src/acp/translate.ts:461— `"sessionID" in event.data && typeof event.data.sessionID === "string"` appears character-identically in 2 files — packages/cli/src/acp/translate.ts, packages/tui/src/mini/stream-v2.transport.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/web/src/components/share/content-error.tsx:18— `(!props.expand && overflow.status) || expanded()` appears character-identically in 2 files — packages/web/src/components/share/content-error.tsx, packages/web/src/components/share/content-text.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 packages/session-ui/src/components/line-comment.tsx:353— `(nav || ctrlNav) && mention.flat().length > 0` appears character-identically in 2 files — packages/session-ui/src/components/line-comment.tsx, packages/ui/src/data-display/line-comment/line-comment.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.
P2 · Observability· Console output used as the logging channel · ×20
Console output used as the logging channel packages/tui/src/audio.ts:12— `packages/tui/src/audio.ts` reports through `console.*` at line 12 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/audio.ts:17— `packages/tui/src/audio.ts` reports through `console.*` at line 17 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/audio.ts:31— `packages/tui/src/audio.ts` reports through `console.*` at line 31 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/attention.ts:114— `packages/tui/src/attention.ts` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/attention.ts:123— `packages/tui/src/attention.ts` reports through `console.*` at line 123 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/attention.ts:149— `packages/tui/src/attention.ts` reports through `console.*` at line 149 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/attention.ts:174— `packages/tui/src/attention.ts` reports through `console.*` at line 174 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/app.tsx:548— `packages/tui/src/app.tsx` reports through `console.*` at line 548 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/component/session-frame.tsx:54— `packages/tui/src/component/session-frame.tsx` reports through `console.*` at line 54 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/context/session-terminals.tsx:61— `packages/tui/src/context/session-terminals.tsx` reports through `console.*` at line 61 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/context/session-terminals.tsx:77— `packages/tui/src/context/session-terminals.tsx` reports through `console.*` at line 77 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/context/session-terminals.tsx:83— `packages/tui/src/context/session-terminals.tsx` reports through `console.*` at line 83 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/context/session-tabs.tsx:114— `packages/tui/src/context/session-tabs.tsx` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/feature-plugins/sidebar/todo.tsx:29— `packages/tui/src/feature-plugins/sidebar/todo.tsx` reports through `console.*` at line 29 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/feature-plugins/sidebar/mcp.tsx:33— `packages/tui/src/feature-plugins/sidebar/mcp.tsx` reports through `console.*` at line 33 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/feature-plugins/sidebar/footer.tsx:51— `packages/tui/src/feature-plugins/sidebar/footer.tsx` reports through `console.*` at line 51 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/prompt/directory-recents.ts:28— `packages/tui/src/prompt/directory-recents.ts` reports through `console.*` at line 28 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/prompt/directory-recents.ts:33— `packages/tui/src/prompt/directory-recents.ts` reports through `console.*` at line 33 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/util/watch.ts:17— `packages/tui/src/util/watch.ts` reports through `console.*` at line 17 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/tui/src/util/watch.ts:21— `packages/tui/src/util/watch.ts` reports through `console.*` at line 21 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 packages/ai/script/recording-cost-report.ts:163— `jsonPayloads` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/ai/script/recording-cost-report.ts:188— `modelFromRequest` swallows every exception into `return "unknown"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/tui/src/editor.ts:72— `discoverEditorConnection` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/codemode/src/tool-schema.ts:228— `toTypeScript` swallows every exception into `return "unknown"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/codemode/src/tool-schema.ts:236— `jsonSchemaToTypeScript` swallows every exception into `return "unknown"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/codemode/src/tool-schema.ts:271— `inputProperties` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/desktop/src/main/service/desktop-cli.ts:105— `bundledVersion` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/desktop/src/main/service/sidecar-probe.ts:30— `bundledVersion` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/desktop/src/renderer/window/route-storage.ts:6— `getLastActiveUrl` swallows every exception into `return "/"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/plugin/src/source.ts:56— `digest` swallows every exception into `return "missing"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/plugin/src/source.bun.ts:33— `prepareSource.visit` 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.
Disabled test packages/ai/test/lib/effect.ts:30— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/ai/test/lib/effect.ts:39— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/ai/test/recorded-runner.ts:67— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/ai/test/recorded-runner.ts:72— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/ai/test/recorded-runner.ts:75— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/core/test/lib/effect.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.
Disabled test packages/core/test/lib/effect.ts:66— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/tui/test/mini/footer.view.test.tsx:1588— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/tui/test/mini/footer.view.test.tsx:1612— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 39 significant file(s) lose their only recent owner: packages/core/src/shell/scan.ts, packages/merman/src/flowchart/routing.ts, packages/merman/src/state/layout.ts, packages/tui/src/component/tab-pulse.tsx, packages/merman/src/sequence/placement.ts, packages/core/src/tool/html-markdown.ts, packages/schema/src/v1/session.ts, packages/core/src/workspace.ts (+31 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 38 significant file(s) lose their only recent owner: packages/ai/src/protocols/mistral-chat.ts, packages/codemode/src/interpreter/promises.ts, REDACTED, packages/codemode/src/stdlib/array.ts, packages/codemode/src/stdlib/string.ts, script/github/close-prs.ts, packages/core/src/oauth/page.ts, packages/codemode/src/stdlib/iterator.ts (+30 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 26 significant file(s) lose their only recent owner: packages/desktop/scripts/bench-startup.ts, packages/gui-extensions/src/browser/pane.ts, packages/session-ui/src/tools/tool-group.stories.tsx, packages/session-ui/performance/highlighting/viewer.tsx, packages/app/src/runtime/persistence/namespace.ts, packages/app/src/runtime/server/request-queue.ts, packages/app/src/composer/request.ts, packages/session-ui/src/components/markdown-cache.tsx (+18 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: packages/ai/src/route/media.ts, packages/cli/src/commands/handlers/stats.ts, packages/ai/src/protocols/google-video.ts, packages/ai/src/protocols/xai-video.ts, packages/ai/src/protocols/runway-video.ts, packages/cli/src/acp/content.ts, packages/cli/src/acp/config-option.ts, packages/cli/src/acp/error.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: packages/theme/src/tui/resolve.ts, packages/tui/src/routes/session/grouping/session.ts, packages/tui/src/routes/session/grouping/tree.ts, packages/tui/src/feature-plugins/system/diff-viewer-file-menu.tsx, packages/schema/src/persistent-pty.ts, packages/cli/dev/refresh.ts. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 4 significant file(s) lose their only recent owner: packages/stats/app/src/routes/compare-radar.tsx, packages/stats/core/src/database/schema.ts, packages/stats/core/src/r2-sql.ts, packages/stats/app/src/routes/compare-cards.tsx. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 3 significant file(s) lose their only recent owner: packages/cli/script/publish-homebrew.ts, packages/core/script/wellknown-server.ts, packages/containers/script/build.ts. Pair on, review, or document these before any departure.
Outdated (npm): @actions/github github/package.json:15— @actions/github is pinned at 6.0.1; registry.npmjs.org publishes 9.1.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @opentelemetry/sdk-logs packages/util/package.json:52— @opentelemetry/sdk-logs is pinned at 0.219.0; registry.npmjs.org publishes 3.0.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): htmlparser2 packages/core/package.json:127— htmlparser2 is pinned at 8.0.2; registry.npmjs.org publishes 12.0.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
IC1 · Incompleteness & stubs· Empty method body · ×3
Empty method body packages/app/src/session/story-model.tsx:64— `cycle` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body packages/app/src/session/story-model.tsx:65— `set` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body packages/app/src/session/story-model.tsx:67— `setVisibility` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Orphaned file packages/web/src/components/share/content-diff.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 packages/console/resource/resource.node.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.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×2
Diagnostic log message is built whether or not it is wanted packages/core/src/config/plugin/skill.ts:140— `logDebug` at line 140 is called with an argument built by `skills.map((skill) => skill.id)` (line 144), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because logDebug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted packages/core/src/config/plugin/instruction.ts:194— `logDebug` at line 194 is called with an argument built by `files.map((item) => item.path)` (line 197), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because logDebug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Fat interface: Interface (34 required operations) packages/core/src/session.ts:123— `Interface` declares 34 required operations: `list`, `create`, `fork`, `get`, `environment`, `view`, `remove`, `messages`, `message`, `context`, `diff`, `inbox`, `cancelInbox`, `steerInbox`, `queueInbox`, `log`, `switchAgent`, `switchModel`, `rename`, `archive`, `unarchive`, `setMetadata`, `setPermissions`, `prompt`, `generate`, `command`, `shell`, `skill`, `compact`, `wait`, `background`, `resume`, `interrupt`, `synthetic`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
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.
C4 · Data Retention· Partial data-retention evidence · ×1
Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a cron task that deletes rows past their retention — purgeExpired… / deleteOld…).
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 5 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 (138 single-owned of 1537 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 1537 of the 3153 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 (1 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: packages/tui/src/mini/footer.width.ts, packages/tui/src/mini/runtime.boot.ts, packages/cli/src/commands/handlers/auth/account.ts, packages/cli/src/cpu-profile.ts, packages/ui/src/theme/v2/resolve.ts, packages/app/src/shell/notifications/coordinator.ts, packages/app/src/settings/search-empty.tsx.
D20 · ADR Quality· ADR has no Consequences section · ×1
ADR has no Consequences section specs/v2/event-stream-architecture.md:1— specs/v2/event-stream-architecture.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 12 of 42 project(s) overshoot their size bounds, lowering Project Cohesion to 4.4/10. The most over is `packages/app` (111218 LoC, 389 module-visible types across 60 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.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 2 of 1537 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 1537 of the 3153 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: packages/web/src/components/share/content-diff.tsx, packages/console/resource/resource.node.ts. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
DM9 · Scattered domain decisions· Rule about [left, top] decided in 2 places · ×1
Rule about [left, top] decided in 2 places — packages.merman.src.core.geometry.DiagramBounds's [left, top] are judged in packages.merman.src.flowchart.layout, packages.merman.src.flowchart.routing — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [x, y] decided in 6 places · ×1
Rule about [x, y] decided in 6 places — packages.merman.src.core.geometry.DiagramPoint's [x, y] are judged in packages.merman.src.core.geometry, packages.merman.src.core.spatial, packages.merman.src.flowchart.routing, packages.merman.src.state.layout, packages.merman.src.state.search, packages.merman.src.test.layout-audit.harness — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [fromX, toX, y] decided in 3 places · ×1
Rule about [fromX, toX, y] decided in 3 places — packages.merman.src.core.spatial.SpatialSpan's [fromX, toX, y] are judged in packages.merman.src.core.spatial, packages.merman.src.core.spatial.SpatialIndex, packages.merman.src.state.routing — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [id, parentId] decided in 2 places · ×1
Rule about [id, parentId] decided in 2 places — packages.merman.src.flowchart.types.FlowchartSubgraph's [id, parentId] are judged in packages.merman.src.flowchart.layout, packages.merman.src.flowchart.routing — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [height, width] decided in 2 places · ×1
Rule about [height, width] decided in 2 places — packages.merman.src.state.layout.StateDiagramBoxBounds's [height, width] are judged in packages.merman.src.state.routing, packages.merman.src.test.layout-audit.harness — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [left, top] decided in 3 places · ×1
Rule about [left, top] decided in 3 places — packages.merman.src.state.layout.StateDiagramBoxBounds's [left, top] are judged in packages.merman.src.state.layout, packages.merman.src.state.routing, packages.merman.src.test.layout-audit.harness — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [from, to] decided in 4 places · ×1
Rule about [from, to] decided in 4 places — packages.merman.src.state.types.StateDiagramTransition's [from, to] are judged in packages.merman.src.state.layout, packages.merman.src.state.routing, packages.merman.src.state.visible-model, packages.merman.src.test.layout-audit.harness — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
M2 · Architecture documentation· ADRs not easily discoverable · ×1
ADRs not easily discoverable — 2 ADR-shaped document(s) detected by content — `specs/v2/event-stream-architecture.md`, `specs/v2/provider-policy.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
Logging is not universal — Only 3/11 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `packages/console/app`, `packages/core`, `packages/desktop`, `packages/function`, `packages/gui-extensions` and 3 more.
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 91659 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.
R8 · Dependency Hygiene· Type-only dependency '@cloudflare/workers-types' in production deps · ×1
Type-only dependency '@cloudflare/workers-types' in production deps packages/console/resource/resource.node.ts:1— Every import is type-only — move it to devDependencies.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 36/61 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 — 39/40 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 — ~1.5 `!` null assertions per 1k TypeScript source lines — 792 assertion(s) across the 542324 source line(s) of the 3484 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: packages/merman/src/flowchart/layout.ts (67), packages/merman/src/sequence/placement.ts (38), packages/merman/src/flowchart/routing.ts (33). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Hand-rolled JSON/XML parsing via regex packages/desktop/src/renderer/startup/locale-value.ts:2— 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.
Outdated (npm): @actions/core — @actions/core is pinned at 1.11.1; registry.npmjs.org publishes 3.0.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @agentclientprotocol/sdk — @agentclientprotocol/sdk is pinned at 1.6.0; registry.npmjs.org publishes 2.0.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @ai-sdk/cohere — @ai-sdk/cohere is pinned at 3.0.27; registry.npmjs.org publishes 4.0.68 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @ai-sdk/perplexity — @ai-sdk/perplexity is pinned at 3.0.26; registry.npmjs.org publishes 5.0.19 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @ai-sdk/provider — @ai-sdk/provider is pinned at 3.0.8; registry.npmjs.org publishes 4.0.33 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @ai-sdk/provider-utils — @ai-sdk/provider-utils is pinned at 4.0.23; registry.npmjs.org publishes 5.0.67 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @ai-sdk/vercel — @ai-sdk/vercel is pinned at 2.0.39; registry.npmjs.org publishes 3.0.30 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @astrojs/cloudflare — @astrojs/cloudflare is pinned at 14.1.4; registry.npmjs.org publishes 14.4.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @astrojs/markdown-remark — @astrojs/markdown-remark is pinned at 6.3.1; registry.npmjs.org publishes 7.3.4 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @astrojs/mdx — @astrojs/mdx is pinned at 7.0.5; registry.npmjs.org publishes 8.1.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @astrojs/solid-js — @astrojs/solid-js is pinned at 5.1.0; registry.npmjs.org publishes 7.1.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @aws-sdk/client-s3 — @aws-sdk/client-s3 is pinned at 3.933.0; registry.npmjs.org publishes 3.1156.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @aws-sdk/credential-providers — @aws-sdk/credential-providers is pinned at 3.1057.0; registry.npmjs.org publishes 3.1156.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @clack/core — @clack/core is pinned at 1.0.0-alpha.1; registry.npmjs.org publishes 1.5.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @clack/prompts — @clack/prompts is pinned at 1.0.0-alpha.1; registry.npmjs.org publishes 1.8.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @cloudflare/vite-plugin — @cloudflare/vite-plugin is pinned at 1.52.1; registry.npmjs.org publishes 1.64.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @cloudflare/workers-types — @cloudflare/workers-types is pinned at 4.20251008.0; registry.npmjs.org publishes 5.20261023.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @dnd-kit/abstract — @dnd-kit/abstract is pinned at 0.5.0; registry.npmjs.org publishes 0.5.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @dnd-kit/dom — @dnd-kit/dom is pinned at 0.5.0; registry.npmjs.org publishes 0.5.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @dnd-kit/helpers — @dnd-kit/helpers is pinned at 0.5.0; registry.npmjs.org publishes 0.5.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @dnd-kit/solid — @dnd-kit/solid is pinned at 0.5.0; registry.npmjs.org publishes 0.5.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @effect/opentelemetry — @effect/opentelemetry is pinned at 4.0.1; registry.npmjs.org publishes 4.0.6 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @effect/platform-node — @effect/platform-node is pinned at 4.0.1; registry.npmjs.org publishes 4.0.6 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @effect/platform-node-shared — @effect/platform-node-shared is pinned at 4.0.1; registry.npmjs.org publishes 4.0.6 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Outdated (npm): @ff-labs/fff-bun — @ff-labs/fff-bun is pinned at 0.10.5; registry.npmjs.org publishes 0.11.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
Skipped (documented): (unnamed test) packages/client/test/service.test.ts:230— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/client/test/service.test.ts:246— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/client/test/promise-service.test.ts:309— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/client/test/promise-service.test.ts:325— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/npm.test.ts:314— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/powershell-runtime.test.ts:542— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/parity-regressions.test.ts:82— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/compound-parity.test.ts:108— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/bash-syntax.test.ts:94— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/bash-syntax.test.ts:112— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/bash-syntax.test.ts:244— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/bash-safety.test.ts:24— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/bash-safety.test.ts:212— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/bash-safety.test.ts:237— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/core/test/shell-scan/arithmetic.test.ts:119— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/desktop/scripts/windows-installer.test.ts:6— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/gui-extensions/src/wsl/runtime.test.ts:34— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/tui/test/session-wheel-focus.test.tsx:9— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/tui/test/editor.test.ts:33— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/tui/test/client-mcp.test.tsx:39— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/tui/test/client-mcp.test.tsx:67— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/tui/test/client-mcp.test.tsx:95— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/tui/test/app-lifecycle.test.tsx:1390— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/tui/test/mini/scrollback.surface.test.ts:746— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) packages/tui/test/mini/footer.view.test.tsx:259— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
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 298 file(s) — `packages/ai/src/experimental/evaluation-client.ts`, `packages/ai/src/experimental/evaluation.ts`, `packages/ai/src/image.ts`, `packages/ai/src/llm.ts`, `packages/ai/src/promise.ts`, … (+293 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a167a7-3ba8-75e5-bfe5-524a41306d33 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 192 · Warnings: 2682 · Recommendations: 157 · Info: 133 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 23-10-2026 @ 07:26 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.