Public report of HKUDS/nanobot, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 01:43 UTC · Survey ID cd_2465618aa03845d0afcd2fa18e0dd04f
HKUDS/nanobot
Measured 14 November 2026, 01:36 UTC, at code version 5e9810c
CAI scoreAt riskUp 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 222,783 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 3.4 person-years · Weakest lens: Production Readiness, 39
Findings by how serious they are
75 critical1948 serious114 minor
14 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 01:36 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
78of 78 dimensions measured by tools.
2124of 2137 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
78dimensions across 7 lenses, read from 222,783 lines of product code in 3 projects.
HKUDS/nanobot is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 54 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Production Readiness, at 39, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the test that passed on some runs and failed on others, worth about 5 points. Adding automated security scanning would lift Production Readiness itself, worth about 6 points. Raising Production Readiness to 62 would lift the score to about 64.
Forty-six pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Sixteen known security holes in the packages the code depends on can be used by attackers, and two places in the code run text as code, which an attacker could use. Pinning each tool to an exact version, updating the vulnerable packages and replacing text run as code with direct calls would close these risks. Fixing the weaknesses the scanner points to would fix the two security weaknesses in the code, and the pipeline step that installs packages without pinning their versions needs the packages it installs pinned to exact versions. The three controls that only work with a mouse need to work with the keyboard, or to become a real button.
The product code is 222,783 lines, about €500,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 39 to 62, the lowest score rated Strong, the score would rise from 54 to about 64.
Code composition: what the lines of code are
Product code 44%Tests 56%
New since the last survey: 423 findings
These 423 critical or serious findings weren't in the previous survey, on 25 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
We compare 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: 492 findings
These 492 critical or serious findings were in the previous survey, on 25 October 2026, and are gone from this one. The first 100 are listed here.
God Classes · FunctionTooLong: thread-event-projection.projectThreadEvent webui/src/lib/thread-event-projection.ts
God Classes · FunctionTooLong: ThreadComposer.GoalStateStrip webui/src/components/thread/ThreadComposer.tsx
God Classes · FunctionTooLong: App.PairingCodePopup webui/src/App.tsx
God Classes · FunctionTooLong: AppearanceSettingsView.AppearanceSettingsView webui/src/components/settings/overview/AppearanceSettingsView.tsx
God Classes · FunctionTooLong: ComposerUsagePopover.UsagePanel webui/src/components/thread/ComposerUsagePopover.tsx
God Classes · FileTooLong: cli/commands.py nanobot/cli/commands.py
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) nanobot/agent/tools/web.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) nanobot/webui/skills_marketplace.py
Rebuild cost: about €500,000 · Estimate
Cost to rebuild
€160,000 to €830,000, for 2,743 to 8,701 hours of work, about 3.4 person-years for 2 to 7 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 54. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 222,783 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Flaky test finding(s) in Test Reliability.
Raises the score by about 5 points · Low effort · Test Reliability
2
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €500,000 to build again, about 3.4 person-years of work. Its weakest lens is Production Readiness, at 39 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Flaky test finding(s) in Test Reliability. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 1 Test Reliability findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 513,638 lines over the last 90 days, which is about 2,083,087 lines a year. At that pace, the extra work comes to an estimated 281.3 to 1687.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
546 modules, with 803 dependencies between them. 3 loops run through 7 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 506 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.
nanobot.bus.queue uses nanobot.bus.events, so a change to nanobot.bus.events can break nanobot.bus.queue, while a change to nanobot.bus.queue can't break nanobot.bus.events.
Position
Below the diagonal: nanobot.bus.queue uses a module listed above it, which is the healthy direction.
nanobot.bus.queue uses nanobot.events, so a change to nanobot.events can break nanobot.bus.queue, while a change to nanobot.bus.queue can't break nanobot.events.
Position
Below the diagonal: nanobot.bus.queue uses a module listed above it, which is the healthy direction.
nanobot.config.schema uses nanobot.config_base, so a change to nanobot.config_base can break nanobot.config.schema, while a change to nanobot.config.schema can't break nanobot.config_base.
Position
Below the diagonal: nanobot.config.schema uses a module listed above it, which is the healthy direction.
nanobot.providers.base uses nanobot.events, so a change to nanobot.events can break nanobot.providers.base, while a change to nanobot.providers.base can't break nanobot.events.
Position
Below the diagonal: nanobot.providers.base uses a module listed above it, which is the healthy direction.
tui.src.app.app uses tui.src.client.types, so a change to tui.src.client.types can break tui.src.app.app, while a change to tui.src.app.app can't break tui.src.client.types.
Position
Below the diagonal: tui.src.app.app uses a module listed above it, which is the healthy direction.
tui.src.app.layout uses tui.src.client.types, so a change to tui.src.client.types can break tui.src.app.layout, while a change to tui.src.app.layout can't break tui.src.client.types.
Position
Below the diagonal: tui.src.app.layout uses a module listed above it, which is the healthy direction.
tui.src.client.nanobot-client uses tui.src.client.types, so a change to tui.src.client.types can break tui.src.client.nanobot-client, while a change to tui.src.client.nanobot-client can't break tui.src.client.types.
Position
Below the diagonal: tui.src.client.nanobot-client uses a module listed above it, which is the healthy direction.
webui.src.lib.types uses tui.src.client.types, so a change to tui.src.client.types can break webui.src.lib.types, while a change to webui.src.lib.types can't break tui.src.client.types.
Position
Below the diagonal: webui.src.lib.types uses a module listed above it, which is the healthy direction.
nanobot.agent.hook uses nanobot.events, so a change to nanobot.events can break nanobot.agent.hook, while a change to nanobot.agent.hook can't break nanobot.events.
Position
Below the diagonal: nanobot.agent.hook uses a module listed above it, which is the healthy direction.
nanobot.agent.hook uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.agent.hook, while a change to nanobot.agent.hook can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.agent.hook uses a module listed above it, which is the healthy direction.
nanobot.agent.tools.context uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot.agent.tools.context, while a change to nanobot.agent.tools.context can't break nanobot.config.schema.
Position
Below the diagonal: nanobot.agent.tools.context uses a module listed above it, which is the healthy direction.
nanobot.providers uses nanobot.events, so a change to nanobot.events can break nanobot.providers, while a change to nanobot.providers can't break nanobot.events.
Position
Below the diagonal: nanobot.providers uses a module listed above it, which is the healthy direction.
nanobot.providers uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot.providers, while a change to nanobot.providers can't break nanobot.config.schema.
Position
Below the diagonal: nanobot.providers uses a module listed above it, which is the healthy direction.
nanobot.providers uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.providers, while a change to nanobot.providers can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.providers uses a module listed above it, which is the healthy direction.
nanobot.utils.llm_runtime uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.utils.llm_runtime, while a change to nanobot.utils.llm_runtime can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.utils.llm_runtime uses a module listed above it, which is the healthy direction.
nanobot.webui.ws_http uses nanobot.bus.queue, so a change to nanobot.bus.queue can break nanobot.webui.ws_http, while a change to nanobot.webui.ws_http can't break nanobot.bus.queue.
Position
Below the diagonal: nanobot.webui.ws_http uses a module listed above it, which is the healthy direction.
tui.src.app uses tui.src.client.types, so a change to tui.src.client.types can break tui.src.app, while a change to tui.src.app can't break tui.src.client.types.
Position
Below the diagonal: tui.src.app uses a module listed above it, which is the healthy direction.
tui.src.app uses tui.src.app.layout, so a change to tui.src.app.layout can break tui.src.app, while a change to tui.src.app can't break tui.src.app.layout.
Position
Below the diagonal: tui.src.app uses a module listed above it, which is the healthy direction.
webui.src.components uses webui.src.lib.types, so a change to webui.src.lib.types can break webui.src.components, while a change to webui.src.components can't break webui.src.lib.types.
Position
Below the diagonal: webui.src.components uses a module listed above it, which is the healthy direction.
webui.src.components.settings.system uses tui.src.client.nanobot-client, so a change to tui.src.client.nanobot-client can break webui.src.components.settings.system, while a change to webui.src.components.settings.system can't break tui.src.client.nanobot-client.
Position
Below the diagonal: webui.src.components.settings.system uses a module listed above it, which is the healthy direction.
webui.src.components.settings.system uses webui.src.lib.types, so a change to webui.src.lib.types can break webui.src.components.settings.system, while a change to webui.src.components.settings.system can't break webui.src.lib.types.
Position
Below the diagonal: webui.src.components.settings.system uses a module listed above it, which is the healthy direction.
webui.src.components.thread uses tui.src.client.types, so a change to tui.src.client.types can break webui.src.components.thread, while a change to webui.src.components.thread can't break tui.src.client.types.
Position
Below the diagonal: webui.src.components.thread uses a module listed above it, which is the healthy direction.
webui.src.components.thread uses tui.src.client.nanobot-client, so a change to tui.src.client.nanobot-client can break webui.src.components.thread, while a change to webui.src.components.thread can't break tui.src.client.nanobot-client.
Position
Below the diagonal: webui.src.components.thread uses a module listed above it, which is the healthy direction.
webui.src.components.thread uses webui.src.lib.types, so a change to webui.src.lib.types can break webui.src.components.thread, while a change to webui.src.components.thread can't break webui.src.lib.types.
Position
Below the diagonal: webui.src.components.thread uses a module listed above it, which is the healthy direction.
webui.src.components.thread.activity uses tui.src.client.types, so a change to tui.src.client.types can break webui.src.components.thread.activity, while a change to webui.src.components.thread.activity can't break tui.src.client.types.
Position
Below the diagonal: webui.src.components.thread.activity uses a module listed above it, which is the healthy direction.
webui.src.components.thread.activity uses webui.src.lib.types, so a change to webui.src.lib.types can break webui.src.components.thread.activity, while a change to webui.src.components.thread.activity can't break webui.src.lib.types.
Position
Below the diagonal: webui.src.components.thread.activity uses a module listed above it, which is the healthy direction.
webui.src.hooks uses tui.src.client.types, so a change to tui.src.client.types can break webui.src.hooks, while a change to webui.src.hooks can't break tui.src.client.types.
Position
Below the diagonal: webui.src.hooks uses a module listed above it, which is the healthy direction.
webui.src.hooks uses tui.src.client.nanobot-client, so a change to tui.src.client.nanobot-client can break webui.src.hooks, while a change to webui.src.hooks can't break tui.src.client.nanobot-client.
Position
Below the diagonal: webui.src.hooks uses a module listed above it, which is the healthy direction.
webui.src.hooks uses webui.src.lib.types, so a change to webui.src.lib.types can break webui.src.hooks, while a change to webui.src.hooks can't break webui.src.lib.types.
Position
Below the diagonal: webui.src.hooks uses a module listed above it, which is the healthy direction.
webui.src.lib uses tui.src.client.types, so a change to tui.src.client.types can break webui.src.lib, while a change to webui.src.lib can't break tui.src.client.types.
Position
Below the diagonal: webui.src.lib uses a module listed above it, which is the healthy direction.
webui.src.lib uses tui.src.client.nanobot-client, so a change to tui.src.client.nanobot-client can break webui.src.lib, while a change to webui.src.lib can't break tui.src.client.nanobot-client.
Position
Below the diagonal: webui.src.lib uses a module listed above it, which is the healthy direction.
73 pairs of types, where a type in webui.src.lib uses a type in webui.src.lib.types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
webui.src.lib uses webui.src.lib.types, so a change to webui.src.lib.types can break webui.src.lib, while a change to webui.src.lib can't break webui.src.lib.types.
Position
Below the diagonal: webui.src.lib uses a module listed above it, which is the healthy direction.
nanobot uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot, while a change to nanobot can't break nanobot.config.schema.
Position
Below the diagonal: nanobot uses a module listed above it, which is the healthy direction.
nanobot uses nanobot.agent.tools.context, so a change to nanobot.agent.tools.context can break nanobot, while a change to nanobot can't break nanobot.agent.tools.context.
Position
Below the diagonal: nanobot uses a module listed above it, which is the healthy direction.
nanobot.agent.tools.base uses nanobot.agent.tools.context, so a change to nanobot.agent.tools.context can break nanobot.agent.tools.base, while a change to nanobot.agent.tools.base can't break nanobot.agent.tools.context.
Position
Below the diagonal: nanobot.agent.tools.base uses a module listed above it, which is the healthy direction.
nanobot.agent.turn_delivery uses nanobot.bus.events, so a change to nanobot.bus.events can break nanobot.agent.turn_delivery, while a change to nanobot.agent.turn_delivery can't break nanobot.bus.events.
Position
Below the diagonal: nanobot.agent.turn_delivery uses a module listed above it, which is the healthy direction.
nanobot.agent.turn_delivery uses nanobot.events, so a change to nanobot.events can break nanobot.agent.turn_delivery, while a change to nanobot.agent.turn_delivery can't break nanobot.events.
Position
Below the diagonal: nanobot.agent.turn_delivery uses a module listed above it, which is the healthy direction.
nanobot.agent.turn_delivery uses nanobot.bus.queue, so a change to nanobot.bus.queue can break nanobot.agent.turn_delivery, while a change to nanobot.agent.turn_delivery can't break nanobot.bus.queue.
Position
Below the diagonal: nanobot.agent.turn_delivery uses a module listed above it, which is the healthy direction.
nanobot.agent.turn_delivery uses nanobot.utils.llm_runtime, so a change to nanobot.utils.llm_runtime can break nanobot.agent.turn_delivery, while a change to nanobot.agent.turn_delivery can't break nanobot.utils.llm_runtime.
Position
Below the diagonal: nanobot.agent.turn_delivery uses a module listed above it, which is the healthy direction.
nanobot.session uses nanobot.bus.events, so a change to nanobot.bus.events can break nanobot.session, while a change to nanobot.session can't break nanobot.bus.events.
Position
Below the diagonal: nanobot.session uses a module listed above it, which is the healthy direction.
nanobot.session uses nanobot.session.manager, so a change to nanobot.session.manager can break nanobot.session, while a change to nanobot.session can't break nanobot.session.manager.
Position
Below the diagonal: nanobot.session uses a module listed above it, which is the healthy direction.
nanobot.session uses nanobot.bus.queue, so a change to nanobot.bus.queue can break nanobot.session, while a change to nanobot.session can't break nanobot.bus.queue.
Position
Below the diagonal: nanobot.session uses a module listed above it, which is the healthy direction.
nanobot.session uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.session, while a change to nanobot.session can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.session uses a module listed above it, which is the healthy direction.
nanobot.session uses nanobot.agent.tools.context, so a change to nanobot.agent.tools.context can break nanobot.session, while a change to nanobot.session can't break nanobot.agent.tools.context.
Position
Below the diagonal: nanobot.session uses a module listed above it, which is the healthy direction.
nanobot.utils uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.utils, while a change to nanobot.utils can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.utils uses a module listed above it, which is the healthy direction.
nanobot.utils uses nanobot.agent.hook, so a change to nanobot.agent.hook can break nanobot.utils, while a change to nanobot.utils can't break nanobot.agent.hook.
Position
Below the diagonal: nanobot.utils uses a module listed above it, which is the healthy direction.
nanobot.utils uses nanobot.utils.llm_runtime, so a change to nanobot.utils.llm_runtime can break nanobot.utils, while a change to nanobot.utils can't break nanobot.utils.llm_runtime.
Position
Below the diagonal: nanobot.utils uses a module listed above it, which is the healthy direction.
nanobot.webui.gateway_services uses nanobot.webui.ws_http, so a change to nanobot.webui.ws_http can break nanobot.webui.gateway_services, while a change to nanobot.webui.gateway_services can't break nanobot.webui.ws_http.
Position
Below the diagonal: nanobot.webui.gateway_services uses a module listed above it, which is the healthy direction.
nanobot.agent uses nanobot.bus.events, so a change to nanobot.bus.events can break nanobot.agent, while a change to nanobot.agent can't break nanobot.bus.events.
Position
Below the diagonal: nanobot.agent uses a module listed above it, which is the healthy direction.
nanobot.agent uses nanobot.bus.queue, so a change to nanobot.bus.queue can break nanobot.agent, while a change to nanobot.agent can't break nanobot.bus.queue.
Position
Below the diagonal: nanobot.agent uses a module listed above it, which is the healthy direction.
nanobot.agent uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot.agent, while a change to nanobot.agent can't break nanobot.config.schema.
Position
Below the diagonal: nanobot.agent uses a module listed above it, which is the healthy direction.
nanobot.agent uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.agent, while a change to nanobot.agent can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.agent uses a module listed above it, which is the healthy direction.
nanobot.agent uses nanobot.agent.hook, so a change to nanobot.agent.hook can break nanobot.agent, while a change to nanobot.agent can't break nanobot.agent.hook.
Position
Below the diagonal: nanobot.agent uses a module listed above it, which is the healthy direction.
nanobot.agent uses nanobot.agent.turn_delivery, so a change to nanobot.agent.turn_delivery can break nanobot.agent, while a change to nanobot.agent can't break nanobot.agent.turn_delivery.
Position
Below the diagonal: nanobot.agent uses a module listed above it, which is the healthy direction.
nanobot.agent.tools.registry uses nanobot.agent.tools.base, so a change to nanobot.agent.tools.base can break nanobot.agent.tools.registry, while a change to nanobot.agent.tools.registry can't break nanobot.agent.tools.base.
Position
Below the diagonal: nanobot.agent.tools.registry uses a module listed above it, which is the healthy direction.
nanobot.webui uses nanobot.session.manager, so a change to nanobot.session.manager can break nanobot.webui, while a change to nanobot.webui can't break nanobot.session.manager.
Position
Below the diagonal: nanobot.webui uses a module listed above it, which is the healthy direction.
nanobot.webui uses nanobot.bus.queue, so a change to nanobot.bus.queue can break nanobot.webui, while a change to nanobot.webui can't break nanobot.bus.queue.
Position
Below the diagonal: nanobot.webui uses a module listed above it, which is the healthy direction.
nanobot.webui uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot.webui, while a change to nanobot.webui can't break nanobot.config.schema.
Position
Below the diagonal: nanobot.webui uses a module listed above it, which is the healthy direction.
nanobot.webui uses nanobot.agent.hook, so a change to nanobot.agent.hook can break nanobot.webui, while a change to nanobot.webui can't break nanobot.agent.hook.
Position
Below the diagonal: nanobot.webui uses a module listed above it, which is the healthy direction.
nanobot.webui uses nanobot.webui.gateway_services, so a change to nanobot.webui.gateway_services can break nanobot.webui, while a change to nanobot.webui can't break nanobot.webui.gateway_services.
Position
Below the diagonal: nanobot.webui uses a module listed above it, which is the healthy direction.
nanobot.agent.memory uses nanobot.events, so a change to nanobot.events can break nanobot.agent.memory, while a change to nanobot.agent.memory can't break nanobot.events.
Position
Below the diagonal: nanobot.agent.memory uses a module listed above it, which is the healthy direction.
nanobot.agent.memory uses nanobot.session.manager, so a change to nanobot.session.manager can break nanobot.agent.memory, while a change to nanobot.agent.memory can't break nanobot.session.manager.
Position
Below the diagonal: nanobot.agent.memory uses a module listed above it, which is the healthy direction.
nanobot.agent.memory uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.agent.memory, while a change to nanobot.agent.memory can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.agent.memory uses a module listed above it, which is the healthy direction.
nanobot.agent.memory uses nanobot.utils.llm_runtime, so a change to nanobot.utils.llm_runtime can break nanobot.agent.memory, while a change to nanobot.agent.memory can't break nanobot.utils.llm_runtime.
Position
Below the diagonal: nanobot.agent.memory uses a module listed above it, which is the healthy direction.
nanobot.agent.memory uses nanobot.agent.tools.registry, so a change to nanobot.agent.tools.registry can break nanobot.agent.memory, while a change to nanobot.agent.memory can't break nanobot.agent.tools.registry.
Position
Below the diagonal: nanobot.agent.memory uses a module listed above it, which is the healthy direction.
nanobot.agent.runner uses nanobot.events, so a change to nanobot.events can break nanobot.agent.runner, while a change to nanobot.agent.runner can't break nanobot.events.
Position
Below the diagonal: nanobot.agent.runner uses a module listed above it, which is the healthy direction.
nanobot.agent.runner uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.agent.runner, while a change to nanobot.agent.runner can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.agent.runner uses a module listed above it, which is the healthy direction.
nanobot.agent.runner uses nanobot.agent.hook, so a change to nanobot.agent.hook can break nanobot.agent.runner, while a change to nanobot.agent.runner can't break nanobot.agent.hook.
Position
Below the diagonal: nanobot.agent.runner uses a module listed above it, which is the healthy direction.
nanobot.agent.runner uses nanobot.utils.llm_runtime, so a change to nanobot.utils.llm_runtime can break nanobot.agent.runner, while a change to nanobot.agent.runner can't break nanobot.utils.llm_runtime.
Position
Below the diagonal: nanobot.agent.runner uses a module listed above it, which is the healthy direction.
nanobot.agent.runner uses nanobot.agent.tools.registry, so a change to nanobot.agent.tools.registry can break nanobot.agent.runner, while a change to nanobot.agent.runner can't break nanobot.agent.tools.registry.
Position
Below the diagonal: nanobot.agent.runner uses a module listed above it, which is the healthy direction.
nanobot.agent.tools uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot.agent.tools, while a change to nanobot.agent.tools can't break nanobot.config.schema.
Position
Below the diagonal: nanobot.agent.tools uses a module listed above it, which is the healthy direction.
nanobot.agent.tools uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.agent.tools, while a change to nanobot.agent.tools can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.agent.tools uses a module listed above it, which is the healthy direction.
nanobot.agent.tools uses nanobot.agent.hook, so a change to nanobot.agent.hook can break nanobot.agent.tools, while a change to nanobot.agent.tools can't break nanobot.agent.hook.
Position
Below the diagonal: nanobot.agent.tools uses a module listed above it, which is the healthy direction.
nanobot.agent.tools uses nanobot.agent.tools.context, so a change to nanobot.agent.tools.context can break nanobot.agent.tools, while a change to nanobot.agent.tools can't break nanobot.agent.tools.context.
Position
Below the diagonal: nanobot.agent.tools uses a module listed above it, which is the healthy direction.
nanobot.agent.tools uses nanobot.agent.tools.registry, so a change to nanobot.agent.tools.registry can break nanobot.agent.tools, while a change to nanobot.agent.tools can't break nanobot.agent.tools.registry.
Position
Below the diagonal: nanobot.agent.tools uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.bus.events, so a change to nanobot.bus.events can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.bus.events.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.events, so a change to nanobot.events can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.events.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.session.manager, so a change to nanobot.session.manager can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.session.manager.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.bus.queue, so a change to nanobot.bus.queue can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.bus.queue.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.config.schema.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.agent.tools.context, so a change to nanobot.agent.tools.context can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.agent.tools.context.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.utils.llm_runtime, so a change to nanobot.utils.llm_runtime can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.utils.llm_runtime.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.agent.turn_delivery, so a change to nanobot.agent.turn_delivery can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.agent.turn_delivery.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.agent.tools.registry, so a change to nanobot.agent.tools.registry can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.agent.tools.registry.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.loop uses nanobot.agent.runner, so a change to nanobot.agent.runner can break nanobot.agent.loop, while a change to nanobot.agent.loop can't break nanobot.agent.runner.
Position
Below the diagonal: nanobot.agent.loop uses a module listed above it, which is the healthy direction.
nanobot.agent.subagent uses nanobot.bus.events, so a change to nanobot.bus.events can break nanobot.agent.subagent, while a change to nanobot.agent.subagent can't break nanobot.bus.events.
Position
Below the diagonal: nanobot.agent.subagent uses a module listed above it, which is the healthy direction.
nanobot.agent.subagent uses nanobot.session.manager, so a change to nanobot.session.manager can break nanobot.agent.subagent, while a change to nanobot.agent.subagent can't break nanobot.session.manager.
Position
Below the diagonal: nanobot.agent.subagent uses a module listed above it, which is the healthy direction.
nanobot.agent.subagent uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot.agent.subagent, while a change to nanobot.agent.subagent can't break nanobot.config.schema.
Position
Below the diagonal: nanobot.agent.subagent uses a module listed above it, which is the healthy direction.
nanobot.agent.subagent uses nanobot.providers.base, so a change to nanobot.providers.base can break nanobot.agent.subagent, while a change to nanobot.agent.subagent can't break nanobot.providers.base.
Position
Below the diagonal: nanobot.agent.subagent uses a module listed above it, which is the healthy direction.
nanobot.agent.subagent uses nanobot.agent.hook, so a change to nanobot.agent.hook can break nanobot.agent.subagent, while a change to nanobot.agent.subagent can't break nanobot.agent.hook.
Position
Below the diagonal: nanobot.agent.subagent uses a module listed above it, which is the healthy direction.
nanobot.agent.subagent uses nanobot.utils.llm_runtime, so a change to nanobot.utils.llm_runtime can break nanobot.agent.subagent, while a change to nanobot.agent.subagent can't break nanobot.utils.llm_runtime.
Position
Below the diagonal: nanobot.agent.subagent uses a module listed above it, which is the healthy direction.
nanobot.agent.subagent uses nanobot.agent.tools.registry, so a change to nanobot.agent.tools.registry can break nanobot.agent.subagent, while a change to nanobot.agent.subagent can't break nanobot.agent.tools.registry.
Position
Below the diagonal: nanobot.agent.subagent uses a module listed above it, which is the healthy direction.
nanobot.agent.subagent uses nanobot.agent.memory, so a change to nanobot.agent.memory can break nanobot.agent.subagent, while a change to nanobot.agent.subagent can't break nanobot.agent.memory.
Position
Below the diagonal: nanobot.agent.subagent uses a module listed above it, which is the healthy direction.
nanobot.cli uses nanobot.bus.events, so a change to nanobot.bus.events can break nanobot.cli, while a change to nanobot.cli can't break nanobot.bus.events.
Position
Below the diagonal: nanobot.cli uses a module listed above it, which is the healthy direction.
nanobot.cli uses nanobot.session.manager, so a change to nanobot.session.manager can break nanobot.cli, while a change to nanobot.cli can't break nanobot.session.manager.
Position
Below the diagonal: nanobot.cli uses a module listed above it, which is the healthy direction.
nanobot.cli uses nanobot.bus.queue, so a change to nanobot.bus.queue can break nanobot.cli, while a change to nanobot.cli can't break nanobot.bus.queue.
Position
Below the diagonal: nanobot.cli uses a module listed above it, which is the healthy direction.
nanobot.cli uses nanobot.config.schema, so a change to nanobot.config.schema can break nanobot.cli, while a change to nanobot.cli can't break nanobot.config.schema.
Position
Below the diagonal: nanobot.cli uses a module listed above it, which is the healthy direction.
nanobot.cli uses nanobot.agent.loop, so a change to nanobot.agent.loop can break nanobot.cli, while a change to nanobot.cli can't break nanobot.agent.loop.
Position
Below the diagonal: nanobot.cli uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 67% · 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
A05:2025 — Injection
68
High / Critical
A03:2025 — Software Supply Chain Failures
28
High / Critical
A02:2025 — Security Misconfiguration
3
Medium
A01:2025 — Broken Access Control
1
Medium
Roadmap
Top priorities: Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing; Resolve the 1 Flaky test finding(s) in Test Reliability; Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Flaky test finding(s) in Test Reliability.
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
No persistence guard on critical data stores — use Docker named volumes (or your orchestrator's persistent-volume equivalent) so the data store can't be wiped by a container recreate (or, in cloud, set purge-protection / soft-delete / prevent_destroy).
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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.
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 — 75
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 — 1948
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 — 114
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 14
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 78 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 78 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, 2124 of 2137 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .ts, .tsx, .py, and our analyzer cannot run the .py test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 94.2% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 3,381 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 574 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 6 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Tracing effort is measured over resolved call sites, and all 1003 sampled here came from .py files. This repository's .tsx, .ts source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
D32 Data Compliance (PII/GDPR) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. `nanobot/channels/dingtalk/webui/index.ts`, `nanobot/channels/discord/webui/index.ts`, `nanobot/channels/email/webui/index.ts`, `nanobot/channels/feishu/webui/index.tsx`, `nanobot/channels/linear/webui/index.tsx`, … (+23 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.
AC1 Text alternatives — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 10 script file(s) building 36 markup element(s) as HTML strings, carrying 6 role/aria/tabindex attribute(s) (e.g. webui/src/dev/gallery/conversation.tsx, webui/src/dev/gallery/foundations.tsx, webui/src/dev/gallery/shared-views.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 289 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 10 script file(s) building 36 markup element(s) as HTML strings, carrying 6 role/aria/tabindex attribute(s) (e.g. webui/src/dev/gallery/conversation.tsx, webui/src/dev/gallery/foundations.tsx, webui/src/dev/gallery/shared-views.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 289 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC3 Page structure — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 10 script file(s) building 36 markup element(s) as HTML strings, carrying 6 role/aria/tabindex attribute(s) (e.g. webui/src/dev/gallery/conversation.tsx, webui/src/dev/gallery/foundations.tsx, webui/src/dev/gallery/shared-views.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 289 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC4 Keyboard semantics — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 10 script file(s) building 36 markup element(s) as HTML strings, carrying 6 role/aria/tabindex attribute(s) (e.g. webui/src/dev/gallery/conversation.tsx, webui/src/dev/gallery/foundations.tsx, webui/src/dev/gallery/shared-views.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 289 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC5 ARIA correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 10 script file(s) building 36 markup element(s) as HTML strings, carrying 6 role/aria/tabindex attribute(s) (e.g. webui/src/dev/gallery/conversation.tsx, webui/src/dev/gallery/foundations.tsx, webui/src/dev/gallery/shared-views.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 289 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 10 script file(s) building 36 markup element(s) as HTML strings, carrying 6 role/aria/tabindex attribute(s) (e.g. webui/src/dev/gallery/conversation.tsx, webui/src/dev/gallery/foundations.tsx, webui/src/dev/gallery/shared-views.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 289 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in nanobot/webui/settings_services.py, 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.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. User interface: 289 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. Boot: crawled PUBLIC routes only — add a Playwright storageState (e.g. playwright/.auth/user.json) or a test auth-setup to crawl authenticated screens rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:8765: page.goto: net::ERR_CONNECTION_RESET at http://127.0.0.1:8765/
Call log:
- navigating to "http://127.0.0.1:8765/", waiting until "load"
rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:18790: page.goto: net::ERR_SOCKET_NOT_CONNECTED at http://127.0.0.1:18790/
Call log:
- navigating to "http://127.0.0.1:18790/", waiting until "load"
ran the repo's playwright suite against the booted app but captured no surfaces (suite failed to install/run, or visited no pages) — see runtime diagnostics.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python is most of its product and is not read 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.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python is most of its product and is not read 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.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 120 further occurrence(s) are not listed individually; the score already reflects all 160.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 368 further occurrence(s) are not listed individually; the score already reflects all 408.
R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 4 further occurrence(s) are not listed individually; the score already reflects all 44.
R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 2 further occurrence(s) are not listed individually; the score already reflects all 42.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 83 further occurrence(s) are not listed individually; the score already reflects all 123.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 131 further occurrence(s) are not listed individually; the score already reflects all 171.
X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala 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 (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
457 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was App.Shell at 312. A further 8 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 FileReferenceChip.fileKindForPath at 55 — they are counted neither in the figure above nor in this dimension's score. 2 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: tui/src/rendering/mermaid/render.ts (render.renderDiagram at 17), tui/src/menus/session-menu.ts (SessionMenu.constructor at 16). 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.
+ 452 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 37 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with App.Shell (cyclomatic 312), ThreadViewport.ThreadViewport (cyclomatic 301), ThreadTranscript.accept (cyclomatic 285). — 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 37 together lifts Cyclomatic Complexity from 2.0 to about 4.4/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 623 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 59 bodies over 60 down to 60 or less in Cognitive Complexity — start with App.Shell (cognitive 313), ThreadTranscript.accept (cognitive 299), ThreadViewport.ThreadViewport (cognitive 274). — 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 59 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes6.6 / 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 114 FunctionTooLong finding(s) in God Classes — start with App.tsx (3), ProviderSettings.tsx (3), AppsSettings.tsx (3). — One of this dimension's main actionable groups (114 warning-level).
Resolve the 84 FileTooLong finding(s) in God Classes — start with service.py (2), ThreadComposer.tsx, App.tsx. — One of this dimension's main actionable groups (84 warning-level).
Resolve the 16 TooManyMethods finding(s) in God Classes — start with service.py (2), app.ts, loop.py. — One of this dimension's main actionable groups (16 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
66 duplicated block group(s) detected. 1.2 % of the production lines (2,736 of 222,783) are in a reported copy. A further 66 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 3 of the 132 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .tsx, .ts (41% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
+ 61 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with context_graph.py, process_runtime.py, github_copilot_provider.py. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 7 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with context.py, schema.py, gateway.py. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 7 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with commands.py, gateway.py, image_generation.py. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
3 production modules (npm+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with mcp_oauth.py, context_governance.py. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 2 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
9 skipped (9 with a documented reason), 2 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 3381 tests. Measured on the JavaScript/TypeScript suite only — at least 574 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: reselecting the detected language saves it · ×2webui/browser/gallery-language.spec.ts:65
Mock-dominated test: refreshes the bootstrap token before REST settings auth expires · ×18webui/src/tests/app-layout.test.tsx:4582
Resolve the 18 Mock-dominated test finding(s) in Test Quality — start with nanobot-client.test.ts (5), quick-pair.test.tsx (4), chat-list.test.tsx (2). — One of this dimension's main actionable groups (18 recommendation-level).
Resolve the 2 No assertions finding(s) in Test Quality — start with gallery-language.spec.ts, composer.test.ts. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability8.0 / 10Adequategated by 1 critical finding✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
1 flaky across 2 measured tier(s). JavaScript/TypeScript (bun:test via `npm install --ignore-scripts` (no lockfile) in tui/ (297 tests); vitest via `npm ci --ignore-scripts` in webui/ (3829 tests)): measured (1 flaky); Python (repository root, 541 test files): measured (0 flaky).
Flaky test: webui/src/tests/thread-shell.test.tsx::ThreadShell starts a fresh trace-detail read after leaving and returning to the same chat
What to do
Resolve the 1 Flaky test finding(s) in Test Reliability. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d11_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether 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 32 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 6 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (26 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 1 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: webui/src/components/thread/ThreadComposer.tsx (74×474=35076); webui/src/App.tsx (75×312=23400); webui/src/components/thread/ThreadShell.tsx (83×277=22991) Repeated repair below the complexity floor: REDACTED (16 of 23 changes were fixes); REDACTED (13 of 24 changes were fixes); REDACTED (13 of 18 changes were fixes)
Resolve the 160 Hotspot finding(s) in Churn × Complexity Hotspots — start with recovery.py (2), ThreadComposer.tsx, App.tsx. — One of this dimension's main actionable groups (160 warning-level).
Resolve the 38 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (38 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 Factor8.4 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
104 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is webui/src/lib/thread-event-projection.ts. Counted over 650 of the 1038 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 · ×2
What to do
Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 recommendation-level).
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.
5 deducted task-comment markers across 222783 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
TodoComment · ×5nanobot/webui/history.py:238
What to do
Resolve the 5 TodoComment finding(s) in Explicit Debt — start with init_skill.py (2), history.py, sqlite_store.py. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 66 document(s) read across 3 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with pyproject.toml. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
3 of 3 build units (Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D27 · Navigability8.7 / 10Strong✓ Tool-verified
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
64 % of calls cross a namespace and 1 % go through an interface, but 61 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated. Measured over the .py source only — this repository's .tsx, .ts was not sampled for call sites, so this score covers part of the tree, not all of it.
Resolve the 1 Pass-through layer finding(s) in Navigability — start with mention-menu.ts. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d27_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: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
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).
68 finding(s): 0 critical, 51 high, 13 medium, 4 low. 46 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 38 file(s) — `REDACTED` (lines 26–73), `nanobot/channels/dingtalk/webui/index.ts` (line 20), `nanobot/channels/discord/webui/index.ts` (line 22), `nanobot/channels/email/webui/index.ts` (line 68), `nanobot/channels/feishu/webui/index.tsx` (line 39), … (+33 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 1 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
+ 9 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 46 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (46 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (12 issue-level).
Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D32 · Data Compliance (PII/GDPR)9.0 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.
Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using our own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.
1 finding(s): 0 critical, 0 high, 1 medium, 0 low. semgrep could not parse 28 file(s) — `nanobot/channels/dingtalk/webui/index.ts`, `nanobot/channels/discord/webui/index.ts`, `nanobot/channels/email/webui/index.ts`, `nanobot/channels/feishu/webui/index.tsx`, `nanobot/channels/linear/webui/index.tsx`, … (+23 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d32_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.
1 of 650 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is nanobot/skills/skill-creator/scripts/init_skill.py. Counted over 650 of the 1038 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 10 Change coupling finding(s) in Change Coupling — start with settings_models.py (2), commands.py (2), inbound_commands.py. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 6 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 alternatives7.0 / 10Strong✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). — webui/src/components/AttachmentTile.tsx:50
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.4 / 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 <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. — webui/src/components/pairing/PairingCodePopup.tsx:129
This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×5) — webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:217, webui/src/components/settings/capabilities/TranscriptionSettings.tsx:161, webui/src/components/settings/capabilities/TranscriptionSettings.tsx:168, …
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. — webui/src/components/settings/system/AppsSettings.tsx:267
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.
An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative. — webui/src/components/FilePreviewPanelView.tsx:70
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — webui/src/components/pairing/PairingCodePopup.tsx:77
This <div> binds pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. 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. — webui/src/components/thread/ContextGraphScene.tsx:225
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×2) — webui/src/components/thread/SubagentTaskDock.tsx:224, webui/src/dev/gallery/shell.tsx:103
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — 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:. — webui/src/components/ConnectionBadge.tsx:47
<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). (×5) — webui/src/components/FilePreviewPanelView.tsx:53, webui/src/components/MarkdownTextRenderer.tsx:689, webui/src/components/PreviewPane.tsx:101, …
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. — webui/src/components/MarkdownTextRenderer.tsx:752
<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). (×4) — webui/src/components/MessageBubble.tsx:217, webui/src/components/PreviewPane.tsx:97, webui/src/components/thread/ModelPresetBadge.tsx:317, …
<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). (×4) — webui/src/components/SessionSearchDialog.tsx:181, webui/src/components/remote/HostSwitcherView.tsx:70, webui/src/components/thread/PromptNavigator.tsx:117, …
`.settings-list-row: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. — webui/src/globals.css:1654
`.goal-island-panel` 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. — webui/src/components/thread/goal-island.css:80
`.remote-dialog` 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. — webui/src/components/remote/remote-layout.css:6
`.composer-status-strip[data-state="enter"]` moves (`animation: composer-status-strip-enter 280ms cubic-bezier(0.16, 1, 0.3, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/globals.css:760
`.composer-action-glyph` moves (`transition: opacity 140ms ease-out, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/globals.css:1103
`.sidebar-selection-highlight` moves (`transition: transform 300ms ease-out, width 300ms ease-out, height 300ms ease-out,
var(--theme-paint-transition, background-color 0s)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/globals.css:1176
`.star-prompt-decoration` moves (`transition: opacity 120ms ease-out, transform 180ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/components/StarPrompt.css:17
`.star-prompt-action:focus-visible .star-prompt-decoration` moves (`animation: star-prompt-pop 640ms cubic-bezier(.22, 1, .36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/components/StarPrompt.css:33
`.star-prompt-action:focus-visible .star-prompt-sparkle` moves (`animation: star-prompt-twinkle 420ms ease-out 250ms both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/components/StarPrompt.css:36
`.star-prompt-action:hover .star-prompt-decoration` moves (`animation: star-prompt-pop 640ms cubic-bezier(.22, 1, .36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/components/StarPrompt.css:44
`.star-prompt-action:hover .star-prompt-sparkle` moves (`animation: star-prompt-twinkle 420ms ease-out 250ms both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/components/StarPrompt.css:47
`.goal-island-panel[data-state="open"] .goal-island-panel-content` moves (`animation: goal-island-content-in 200ms ease-out 100ms both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/components/thread/goal-island.css:204
`.goal-island-panel[data-state="closed"] .goal-island-panel-content` moves (`animation: goal-island-content-out 80ms ease-in both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — webui/src/components/thread/goal-island.css:214
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · 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.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (`hatch_build.py`).
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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 bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 5 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. — REDACTED:7
`tui/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — tui/package.json:14
What to do
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Do you agree with this assessment?
P5 · DR & Backup3.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
No persistence guard on critical data stores — use Docker named volumes (or your orchestrator's persistent-volume equivalent) so the data store can't be wiped by a container recreate (or, in cloud, set purge-protection / soft-delete / prevent_destroy).
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`httpx.Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — nanobot/channels/telegram/validation.py:27, nanobot/providers/openai_codex_provider.py:822, nanobot/providers/xai_grok_provider.py:674
`httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — nanobot/providers/openai_responses/backend.py:264
What to do
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`verify_installed_release` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — scripts/verify_installed_release.py:165
What to do
Python: await the async equivalent (asyncio.sleep, an async HTTP client such as httpx.AsyncClient or aiohttp, asyncio.create_subprocess_exec), or move the blocking call off the loop with `await asyncio.to_thread(...)`; never call asyncio.run inside a coroutine — await the coroutine.
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 — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
19 duplicated blocks under webui/src/ have copies in at least two of the sibling directories components, dev, hooks, lib, providers, workers — 11 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 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 19 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. — webui/src/hooks/useAttachedImages.ts:163
17 duplicated blocks under webui/src/components/settings/ have copies in at least two of the sibling directories capabilities, channels, models, notifications, overview, shared (+1 more sibling(s) not listed) — 7 of them are reported below, and 10 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 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 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 17 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. — webui/src/components/settings/overview/OverviewSettings.tsx:213
13 duplicated blocks under the repository root have copies in at least two of the sibling directories nanobot, tui, webui — 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. — nanobot/channels/weixin/webui/WeixinPanelView.tsx:112
12 duplicated blocks under webui/src/components/ have copies in at least two of the sibling directories pairing, remote, settings, thread, ui, workbench — 5 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 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 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 12 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. — webui/src/components/settings/system/AppsSettings.tsx:1379
5 duplicated blocks under webui/ have copies in at least two of the sibling directories browser, src — 1 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 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. — webui/browser/code-highlighting-fixture.tsx:12
webui/src/components/CliAppMentionText.tsx:174 · webui/src/components/CliAppMentionText.tsx:243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webui/src/components/CliAppMentionText.tsx:174
nanobot/channels/linear/webui/member-access-store.ts:24 · nanobot/channels/linear/webui/workspace-store.ts:20 — the two spans are one implementation copied and then locally edited — 478 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. — nanobot/channels/linear/webui/member-access-store.ts:24
webui/src/components/thread/AgentActivityCluster.tsx:1134 · webui/src/components/thread/AgentActivityCluster.tsx:1237 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/thread/AgentActivityCluster.tsx:1134
webui/src/components/thread/ThreadComposer.tsx:2607 · webui/src/components/thread/ThreadComposer.tsx:2758 — the two spans are one implementation copied and then locally edited — 199 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. — webui/src/components/thread/ThreadComposer.tsx:2607
tui/src/menus/mention-menu.ts:6 · tui/src/menus/skill-menu.ts:6 — the two spans are one implementation copied and then locally edited — 327 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. — tui/src/menus/mention-menu.ts:6
webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:120 · webui/src/components/settings/capabilities/TranscriptionSettings.tsx:100 — the two spans are one implementation copied and then locally edited — 276 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. — webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:120
webui/src/components/settings/overview/OverviewSettings.tsx:213 · webui/src/components/settings/shared/ModelControls.tsx:611 — the two spans are one implementation copied and then locally edited — 131 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. — webui/src/components/settings/overview/OverviewSettings.tsx:213
webui/src/components/ChatList.tsx:229 · webui/src/components/Sidebar.tsx:50 — the 2 copies are spread across 2 files, and the CITED SPAN is inside a TYPE DECLARATION, not executable code. There is no function to extract and no call site to call one from, so do not read this as an extract-a-helper row: the collapse a type offers is a generic — name the shape once, parameterised over the part that varies, and have each copy instantiate it. First check what actually differs between the copies: where they are a MATRIX of cases (one entry per input, differing precisely in the case each one pins), the repetition IS the enumeration and collapsing it would delete cases rather than de-duplicate anything — leave those alone. Reported because the copies that are not a matrix drift apart the first time only one of them is edited. — webui/src/components/ChatList.tsx:229
webui/src/components/ChatList.tsx:1112 · webui/src/components/ChatList.tsx:1587 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — webui/src/components/ChatList.tsx:1112
webui/src/components/thread/activity/generic-tool-model.ts:364 · webui/src/components/thread/activity/trace-activity-model.ts:136 — the two spans are one implementation copied and then locally edited — 169 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. — webui/src/components/thread/activity/generic-tool-model.ts:364
webui/src/components/settings/system/useSystemSettingsEffects.ts:50 · webui/src/components/settings/system/useSystemSettingsEffects.ts:133 — the two spans are one implementation copied and then locally edited — 181 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. — webui/src/components/settings/system/useSystemSettingsEffects.ts:50
webui/src/components/thread/AgentActivityCluster.tsx:1423 · webui/src/components/thread/AgentActivityCluster.tsx:1500 — all 2 copies are in the same file, 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. — webui/src/components/thread/AgentActivityCluster.tsx:1423
nanobot/channels/weixin/webui/WeixinPanelView.tsx:112 · webui/src/components/settings/channels/ChannelSetupSurfaceView.tsx:113 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — nanobot/channels/weixin/webui/WeixinPanelView.tsx:112
webui/src/components/settings/system/AppsSettings.tsx:1379 · webui/src/components/thread/ThreadComposer.tsx:2715 — 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. — webui/src/components/settings/system/AppsSettings.tsx:1379
webui/src/components/thread/AgentActivityCluster.tsx:1376 · webui/src/components/thread/AgentActivityCluster.tsx:1452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webui/src/components/thread/AgentActivityCluster.tsx:1376
webui/src/components/settings/shared/SettingsTextEditor.tsx:18 · webui/src/components/settings/shared/SharedProxySetupDialog.tsx:12 — the two spans are one implementation copied and then locally edited — 132 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. — webui/src/components/settings/shared/SettingsTextEditor.tsx:18
webui/src/components/settings/channels/ChannelIdentity.tsx:179 · webui/src/components/settings/system/AppsSettings.tsx:1513 — the two spans are one implementation copied and then locally edited — 78 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. — webui/src/components/settings/channels/ChannelIdentity.tsx:179
webui/src/components/thread/ThreadComposer.tsx:1197 · webui/src/components/thread/ThreadComposer.tsx:1218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webui/src/components/thread/ThreadComposer.tsx:1197
webui/src/components/thread/ThreadComposer.tsx:1790 · webui/src/components/thread/ThreadComposer.tsx:1814 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/thread/ThreadComposer.tsx:1790
webui/src/components/MessageBubble.tsx:585 · webui/src/components/MessageBubble.tsx:618 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/MessageBubble.tsx:585
tui/src/client/nanobot-client.ts:255 · webui/src/lib/nanobot-client.ts:655 — the two spans are one implementation copied and then locally edited — 105 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. — tui/src/client/nanobot-client.ts:255
webui/src/components/settings/SkillsCatalogSettings.tsx:298 · webui/src/components/settings/SkillsMarketplace.tsx:127 — the two spans are one implementation copied and then locally edited — 77 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. — webui/src/components/settings/SkillsCatalogSettings.tsx:298
webui/src/components/workbench/PaneWorkbench.tsx:461 · webui/src/components/workbench/PaneWorkbench.tsx:571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webui/src/components/workbench/PaneWorkbench.tsx:461
webui/src/components/ChatList.tsx:1029 · webui/src/components/ChatList.tsx:1511 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/ChatList.tsx:1029
webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:81 · webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:187 — the two spans are one implementation copied and then locally edited — 86 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. — webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:81
webui/src/components/settings/models/ProviderSettings.tsx:478 · webui/src/components/settings/models/ProviderSettings.tsx:495 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/settings/models/ProviderSettings.tsx:478
webui/src/components/thread/ThreadShell.tsx:1328 · webui/src/components/thread/ThreadShell.tsx:1381 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — webui/src/components/thread/ThreadShell.tsx:1328
webui/src/lib/api.ts:644 · webui/src/lib/api.ts:1044 · webui/src/lib/api.ts:1068 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/lib/api.ts:644
webui/src/components/settings/capabilities/WebSettings.tsx:203 · webui/src/components/settings/models/ProviderSettings.tsx:849 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — webui/src/components/settings/capabilities/WebSettings.tsx:203
webui/src/components/settings/models/ProviderSettings.tsx:920 · webui/src/components/settings/models/ProviderSettings.tsx:1052 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/settings/models/ProviderSettings.tsx:920
webui/src/components/thread/ThreadComposer.tsx:2578 · webui/src/components/thread/ThreadComposer.tsx:2742 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/thread/ThreadComposer.tsx:2578
webui/src/components/ChatList.tsx:727 · webui/src/components/ChatList.tsx:742 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/ChatList.tsx:727
webui/src/components/LanguageSwitcher.tsx:16 · webui/src/components/settings/models/ModelAPIControl.tsx:72 — 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. — webui/src/components/LanguageSwitcher.tsx:16
webui/src/components/workbench/PaneWorkbench.tsx:445 · webui/src/components/workbench/PaneWorkbench.tsx:552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — webui/src/components/workbench/PaneWorkbench.tsx:445
webui/src/components/workbench/workbench-layout.ts:304 · webui/src/components/workbench/workbench-layout.ts:319 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — webui/src/components/workbench/workbench-layout.ts:304
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 · 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.
accept has cyclomatic complexity 265 and cognitive complexity 317; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/lib/thread-transcript.ts:554
ThreadComposer has cyclomatic complexity 177 and cognitive complexity 141; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — webui/src/components/thread/ThreadComposer.tsx:549
reduceThreadEvent has cyclomatic complexity 157 and cognitive complexity 267; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/lib/thread-event-projection.ts:893
(anonymous) has cyclomatic complexity 130 and cognitive complexity 175; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tui/src/app/app.ts:1320
UpdateFlowProvider has cyclomatic complexity 128 and cognitive complexity 82; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — webui/src/providers/UpdateFlowProvider.tsx:28
accept has cyclomatic complexity 105 and cognitive complexity 147; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — tui/src/app/app.ts:690
RemoteConnectionsPage has cyclomatic complexity 105 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/remote/RemoteConnectionsPage.tsx:29
Shell has cyclomatic complexity 96 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — webui/src/App.tsx:821
ThreadShell has cyclomatic complexity 95 and cognitive complexity 82; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — webui/src/components/thread/ThreadShell.tsx:359
WorkspaceProjectPicker has cyclomatic complexity 90 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. — webui/src/components/thread/WorkspaceControls.tsx:158
parseThreadProjectionEvent has cyclomatic complexity 89 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/lib/api.ts:322
QuickPairSetupView has cyclomatic complexity 89 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/remote/QuickPairSetupView.tsx:62
decodeInboundEvent has cyclomatic complexity 84 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. — tui/src/client/validation.ts:137
handle has cyclomatic complexity 82 and cognitive complexity 117; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/hooks/useNanobotStream.ts:672
handleMessage has cyclomatic complexity 79 and cognitive complexity 113; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/lib/nanobot-client.ts:903
ModelIdPicker has cyclomatic complexity 79 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/shared/ModelControls.tsx:187
ThreadViewport has cyclomatic complexity 74 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/thread/ThreadViewport.tsx:271
project has cyclomatic complexity 71 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/lib/thread-transcript.ts:367
RemoteInstances has cyclomatic complexity 70 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/remote/RemoteInstances.tsx:17
renderProviderForm has cyclomatic complexity 70 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — webui/src/components/settings/models/ProviderSettings.tsx:656
McpAppsCatalogRow has cyclomatic complexity 68 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/system/AppsSettings.tsx:501
applyObservation has cyclomatic complexity 57 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. — webui/src/lib/client-run-ledger.ts:230
saveModelSettings has cyclomatic complexity 52 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/models/useModelSettingsActions.ts:169
LinearPanelView has cyclomatic complexity 51 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — nanobot/channels/linear/webui/LinearPanelView.tsx:67
(anonymous) has cyclomatic complexity 49 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:275
AutomationDetailPanel has cyclomatic complexity 48 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/system/AutomationsSettings.tsx:469
describe has cyclomatic complexity 47 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/lib/thread-transcript.ts:313
(anonymous) has cyclomatic complexity 47 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/ChatList.tsx:854
ChannelQrConnectFlowView has cyclomatic complexity 47 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/channels/ChannelQrConnectFlowView.tsx:49
SettingsPage has cyclomatic complexity 43 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/settings/SettingsPage.tsx:80
VersionCheckRowView has cyclomatic complexity 43 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/overview/VersionCheckRowView.tsx:20
WebSettings has cyclomatic complexity 41 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/capabilities/WebSettings.tsx:77
ChannelSetupSurfaceView has cyclomatic complexity 41 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/settings/channels/ChannelSetupSurfaceView.tsx:51
submit has cyclomatic complexity 40 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — tui/src/app/app.ts:508
MessageBlockMenuActions has cyclomatic complexity 40 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/MessageBubble.tsx:151
ModelPresetBadge has cyclomatic complexity 40 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/thread/ModelPresetBadge.tsx:106
(anonymous) has cyclomatic complexity 40 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/thread/ThreadMessages.tsx:200
fetchHistory has cyclomatic complexity 39 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. — tui/src/client/api.ts:181
attachProjectedReasoning has cyclomatic complexity 39 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — webui/src/lib/thread-event-projection.ts:621
onKeyDown has cyclomatic complexity 39 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — webui/src/components/thread/ThreadComposer.tsx:1787
Do you agree with this assessment?
R3 · Large Files6.7 / 10Strong✓ 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.
webui/src/components/thread/ThreadComposer.tsx has 2778 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/thread/ThreadComposer.tsx:1
webui/src/App.tsx has 2689 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/App.tsx:1
tui/src/app/app.ts has 2532 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — tui/src/app/app.ts:1
webui/src/components/ChatList.tsx has 1954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/ChatList.tsx:1
webui/src/lib/api.ts has 1561 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/lib/api.ts:1
webui/src/components/thread/ThreadShell.tsx has 1521 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/thread/ThreadShell.tsx:1
webui/src/components/settings/system/AppsSettings.tsx has 1493 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/system/AppsSettings.tsx:1
webui/src/components/thread/AgentActivityCluster.tsx has 1437 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/thread/AgentActivityCluster.tsx:1
webui/src/components/thread/ThreadViewport.tsx has 1361 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/thread/ThreadViewport.tsx:1
webui/src/lib/nanobot-client.ts has 1241 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/lib/nanobot-client.ts:1
webui/src/lib/thread-event-projection.ts has 1204 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/lib/thread-event-projection.ts:1
webui/src/components/settings/system/AutomationsSettings.tsx has 1203 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/system/AutomationsSettings.tsx:1
webui/src/components/settings/models/ProviderSettings.tsx has 1179 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/models/ProviderSettings.tsx:1
webui/src/components/thread/ThreadMessages.tsx has 1119 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/thread/ThreadMessages.tsx:1
webui/src/components/settings/models/ModelsSettings.tsx has 1073 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/models/ModelsSettings.tsx:1
webui/src/hooks/useNanobotStream.ts has 1050 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/hooks/useNanobotStream.ts:1
webui/src/lib/thread-transcript.ts has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/lib/thread-transcript.ts:1
REDACTED has 840 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
webui/src/components/workbench/PaneWorkbench.tsx has 806 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/workbench/PaneWorkbench.tsx:1
webui/src/components/MarkdownTextRenderer.tsx has 797 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/MarkdownTextRenderer.tsx:1
webui/src/components/settings/SettingsPage.tsx has 796 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/SettingsPage.tsx:1
webui/src/components/MessageBubble.tsx has 764 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/MessageBubble.tsx:1
webui/src/components/thread/WorkspaceControls.tsx has 759 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/thread/WorkspaceControls.tsx:1
tui/src/rendering/transcript.ts has 752 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — tui/src/rendering/transcript.ts:1
webui/src/components/settings/SkillsCatalogSettings.tsx has 743 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/SkillsCatalogSettings.tsx:1
webui/src/components/settings/system/McpManagementDialog.tsx has 725 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/system/McpManagementDialog.tsx:1
webui/src/components/settings/SkillsMarketplace.tsx has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/SkillsMarketplace.tsx:1
webui/src/components/settings/system/createSystemSettingsActions.ts has 657 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/system/createSystemSettingsActions.ts:1
webui/src/components/settings/shared/ModelControls.tsx has 651 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/shared/ModelControls.tsx:1
webui/src/components/thread/ModelPresetBadge.tsx has 650 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/thread/ModelPresetBadge.tsx:1
webui/src/components/settings/models/useModelSettingsActions.ts has 631 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/models/useModelSettingsActions.ts:1
webui/src/components/remote/RemoteConnectionsPage.tsx has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/remote/RemoteConnectionsPage.tsx:1
tui/src/client/api.ts has 509 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — tui/src/client/api.ts:1
webui/src/components/thread/thread-motion.ts has 483 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/thread/thread-motion.ts:1
webui/src/components/settings/channels/ChannelSetupPanel.tsx has 476 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/channels/ChannelSetupPanel.tsx:1
webui/src/lib/client-run-ledger.ts has 469 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/lib/client-run-ledger.ts:1
webui/src/components/settings/useSettingsController.ts has 448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/components/settings/useSettingsController.ts:1
webui/src/hooks/useVoiceRecorder.ts has 441 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/hooks/useVoiceRecorder.ts:1
webui/src/hooks/useAttachedImages.ts has 437 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — webui/src/hooks/useAttachedImages.ts:1
tui/src/client/nanobot-client.ts has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — tui/src/client/nanobot-client.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 Coverage9.2 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — webui/browser/fixture.tsx:1, nanobot/channels/weixin/webui/WeixinPanel.tsx:1, webui/browser/subagent-dock-fixture.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
46 outdated package(s); JS/npm CVEs scored in D30
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code10.0 / 10Exemplary✓ 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.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×3) — nanobot/channels/email/webui/index.ts:1, nanobot/channels/feishu/webui/FeishuAssistantsPanelView.tsx:1, nanobot/channels/feishu/webui/FeishuAssistantsPanelView.tsx:2
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · 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.
The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception. (×2) — nanobot/command/builtin.py:195, nanobot/command/builtin.py:459
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
This function unwraps IPv4-MAPPED IPv6 (`::ffff:`, line 55) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 54 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright. — webui/src/components/thread/activity/web-url.ts:54
What to do
Each finding names the IPv4 branch that rejects the host and the IPv6 branch that accepts the same host in another notation. Confirm from the two, then unwrap every IPv4-in-IPv6 embedding before classifying, or reject non-native IPv6 outright.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.7 / 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.
`sanitizeConnectionFailure` is exported, takes a document from its caller (line 100) and hands it to `collect`, which calls itself at line 112 (`collect`) with a piece of `value` (and at line 114, line 120, line 122) — and nowhere in `collect` 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 `collect` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — tui/src/client/connection.ts:112
`redact_request_secrets` is public and takes `value: Any` from its caller, and it calls itself at line 71 (`redact_request_secrets`) with a piece of `value` (and at line 78) — and nowhere in `redact_request_secrets` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_request_secrets` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — nanobot/webui/request_settings.py:71
`restore_request_secrets` is public and takes `submitted: Any` from its caller, and it calls itself at line 94 (`restore_request_secrets`) with a piece of `submitted` (and at line 105) — and nowhere in `restore_request_secrets` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `restore_request_secrets` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — nanobot/webui/request_settings.py:94
`sanitize_surrogates_deep` is public and takes `value: Any` from its caller, and it calls itself at line 83 (`sanitize_surrogates_deep`) with a piece of `value` (and at line 92, line 99) — and nowhere in `sanitize_surrogates_deep` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `sanitize_surrogates_deep` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — nanobot/utils/helpers.py:83
`merge_missing_defaults` is public and takes `existing: object` from its caller, and it calls itself at line 178 (`merge_missing_defaults`) with a piece of `existing` — and nowhere in `merge_missing_defaults` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `merge_missing_defaults` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — nanobot/config/loader.py:178
`from_config` is public and takes `section: Any` from its caller, and it calls itself at line 94 (`self.from_config`) with a piece of `section` — and nowhere in `from_config` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `from_config` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — nanobot/channels/contracts.py:94
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 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 6/8 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`refreshAssetManifest` 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 })`. — webui/public/sw.js:188
`fetchGatewayConnection` 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 })`. — tui/src/client/connection.ts:12
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
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. (×36) — webui/src/App.tsx:214, webui/src/App.tsx:561, webui/src/App.tsx: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. (×4) — webui/src/App.tsx:651, webui/src/App.tsx:1880, webui/src/main.tsx:54, …
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.
~1.7 `!` null assertions per 1k TypeScript source lines — 167 assertion(s) across the 95815 source line(s) of the 512 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: webui/src/lib/thread-transcript.ts (40), webui/src/lib/thread-page-fragments.ts (29), webui/src/components/thread/activity/PierreFileDiff.tsx (9). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 50 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — AX6 reached only 41% of this repository's production lines — python (130,799 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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 runtime tier booted this repository's service, but crawled PUBLIC routes only — add a Playwright storageState (e.g. playwright/.auth/user.json) or a test auth-setup to crawl authenticated screens rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:8765: page.goto: net::ERR_CONNECTION_RESET at http://127.0.0.1:8765/
Call log:
- navigating to "http://127.0.0.1:8765/", waiting until "load"
rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:18790: page.goto: net::ERR_SOCKET_NOT_CONNECTED at http://127.0.0.1:18790/
Call log:
- navigating to "http://127.0.0.1:18790/", waiting until "load"
ran the repo's playwright suite against the booted app but captured no surfaces (suite failed to install/run, or visited no pages) — see runtime diagnostics. This repository also has a user interface (289 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates) that the booted service does not serve, and this scan has no strategy that reaches it — so no WCAG success criterion was verified in a rendered page on this run. That is a gap in OUR tooling, not a finding about your application: nothing here says the interface is inaccessible. The static accessibility checks still ran.
AXS1 Runtime exposed surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D12 Dependency Hygiene — Not scored — 6 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency does not read html yet; not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Python surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — no ADRs to check
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 195 value object(s); 31 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — 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
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage data present for 433 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 41% of this repository's production lines — python (130,799 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X18 Disposal-pattern correctness — X18 reached only 41% of this repository's production lines — python (130,799 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — X29 reached only 41% of this repository's production lines — python (130,799 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
AC2 · Forms & labels· <label> that labels no control · ×1
<label> that labels no control webui/src/components/pairing/PairingCodePopup.tsx:129— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC4 · Keyboard semantics· Double-click handler on a non-interactive <div> · ×1
Double-click handler on a non-interactive <div> webui/src/components/thread/ContextGraphScene.tsx:225— This <div> binds pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. 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.
AC4 · Keyboard semantics· Click handler on a non-interactive <li> · ×1
Click handler on a non-interactive <li> webui/src/components/thread/SubagentTaskDock.tsx:224— 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 <div> · ×1
Click handler on a non-interactive <div> webui/src/dev/gallery/shell.tsx:103— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Flaky test: webui/src/tests/thread-shell.test.tsx::ThreadShell starts a fresh trace-detail read after leaving and returning to the same chat — Passed 2×, failed 1× across repeated runs.
Unlisted import 'lucide-react' nanobot/channels/email/webui/index.ts:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'react' nanobot/channels/feishu/webui/FeishuAssistantsPanelView.tsx:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'react-i18next' nanobot/channels/feishu/webui/FeishuAssistantsPanelView.tsx:2— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Hotspot: webui/src/components/thread/ThreadComposer.tsx webui/src/components/thread/ThreadComposer.tsx:549— webui/src/components/thread/ThreadComposer.tsx changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 474 in ThreadComposer.ThreadComposer at line 549. 39 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/thread/ThreadComposer.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: webui/src/App.tsx webui/src/App.tsx:821— webui/src/App.tsx changed 75 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 312 in App.Shell at line 821. 39 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/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: webui/src/components/thread/ThreadShell.tsx webui/src/components/thread/ThreadShell.tsx:359— webui/src/components/thread/ThreadShell.tsx changed 83 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 277 in ThreadShell.ThreadShell at line 359. 46 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/thread/ThreadShell.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: webui/src/components/thread/ThreadViewport.tsx webui/src/components/thread/ThreadViewport.tsx:271— webui/src/components/thread/ThreadViewport.tsx changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 301 in ThreadViewport.ThreadViewport at line 271. 31 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/thread/ThreadViewport.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: tui/src/app/app.ts tui/src/app/app.ts:1320— tui/src/app/app.ts changed 86 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 130 in NanobotTui.handleKey at line 1320. 3 of those changes were fix/bug commits, and the other 83 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- tui/src/app/app.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: webui/src/components/thread/WorkspaceControls.tsx webui/src/components/thread/WorkspaceControls.tsx:158— webui/src/components/thread/WorkspaceControls.tsx changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 274 in WorkspaceControls.WorkspaceProjectPicker at line 158. 23 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/thread/WorkspaceControls.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: webui/src/hooks/useNanobotStream.ts webui/src/hooks/useNanobotStream.ts:118— webui/src/hooks/useNanobotStream.ts changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 153 in useNanobotStream.useNanobotStream at line 118. 24 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/hooks/useNanobotStream.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: webui/src/components/settings/models/ModelsSettings.tsx webui/src/components/settings/models/ModelsSettings.tsx:202— webui/src/components/settings/models/ModelsSettings.tsx changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 157 in ModelsSettings.ModelsSettings at line 202. 18 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/settings/models/ModelsSettings.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: webui/src/lib/api.ts webui/src/lib/api.ts:322— webui/src/lib/api.ts changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in api.parseThreadProjectionEvent at line 322. 13 of those changes were fix/bug commits, and the other 35 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/lib/api.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: webui/src/components/ChatList.tsx webui/src/components/ChatList.tsx:272— webui/src/components/ChatList.tsx changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 175 in ChatList.ChatList at line 272. 11 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/ChatList.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: nanobot/agent/loop.py nanobot/agent/loop.py:1092— nanobot/agent/loop.py changed 86 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in AgentLoop._run_agent_loop at line 1092. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/agent/loop.py`: 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: webui/src/components/settings/SettingsPage.tsx webui/src/components/settings/SettingsPage.tsx:80— webui/src/components/settings/SettingsPage.tsx changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in SettingsPage.SettingsPage at line 80. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/settings/SettingsPage.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: webui/src/components/remote/RemoteConnectionsPage.tsx webui/src/components/remote/RemoteConnectionsPage.tsx:29— webui/src/components/remote/RemoteConnectionsPage.tsx changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 247 in RemoteConnectionsPage.RemoteConnectionsPage at line 29. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/remote/RemoteConnectionsPage.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: nanobot/agent/runner.py nanobot/agent/runner.py:400— nanobot/agent/runner.py changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in AgentRunner._run_core at line 400. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/agent/runner.py`: 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: nanobot/webui/transcript.py nanobot/webui/transcript.py:1469— nanobot/webui/transcript.py changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in transcript._client_projection_event at line 1469. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/webui/transcript.py`: 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: webui/src/lib/thread-event-projection.ts webui/src/lib/thread-event-projection.ts:893— webui/src/lib/thread-event-projection.ts changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 150 in thread-event-projection.reduceThreadEvent at line 893. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/lib/thread-event-projection.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: webui/src/components/settings/models/ProviderSettings.tsx webui/src/components/settings/models/ProviderSettings.tsx:531— webui/src/components/settings/models/ProviderSettings.tsx changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 111 in ProviderSettings.ProvidersSettings at line 531. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/settings/models/ProviderSettings.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: nanobot/webui/ws_http.py nanobot/webui/ws_http.py:1597— nanobot/webui/ws_http.py changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in GatewayHTTPHandler._handle_webui_automation_action at line 1597. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/webui/ws_http.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:837— REDACTED changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in OpenAICompatProvider._build_kwargs at line 837. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: webui/src/lib/nanobot-client.ts webui/src/lib/nanobot-client.ts:903— webui/src/lib/nanobot-client.ts changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in NanobotClient.handleMessage at line 903. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/lib/nanobot-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: webui/src/components/workbench/PaneWorkbench.tsx webui/src/components/workbench/PaneWorkbench.tsx:191— webui/src/components/workbench/PaneWorkbench.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 117 in PaneWorkbench.PaneWorkbench at line 191. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/workbench/PaneWorkbench.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: webui/src/components/thread/ThreadMessages.tsx webui/src/components/thread/ThreadMessages.tsx:83— webui/src/components/thread/ThreadMessages.tsx changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in ThreadMessages.ThreadMessages at line 83. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/thread/ThreadMessages.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: nanobot/webui/inbound_commands.py nanobot/webui/inbound_commands.py:553— nanobot/webui/inbound_commands.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in WebUICommandRouter._dispatch_message_once at line 553. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/webui/inbound_commands.py`: 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: webui/src/components/thread/ModelPresetBadge.tsx webui/src/components/thread/ModelPresetBadge.tsx:106— webui/src/components/thread/ModelPresetBadge.tsx changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in ModelPresetBadge.ModelPresetBadge at line 106. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/thread/ModelPresetBadge.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: webui/src/lib/thread-transcript.ts webui/src/lib/thread-transcript.ts:554— webui/src/lib/thread-transcript.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 285 in ThreadTranscript.accept at line 554. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/lib/thread-transcript.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.
FunctionTooLong: App.Shell webui/src/App.tsx:821— FunctionTooLong — Shell runs 1639 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1539 over it, 16.39× 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: ThreadComposer.ThreadComposer webui/src/components/thread/ThreadComposer.tsx:549— FunctionTooLong — ThreadComposer runs 1544 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1444 over it, 15.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ThreadShell.ThreadShell webui/src/components/thread/ThreadShell.tsx:359— FunctionTooLong — ThreadShell runs 1047 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 947 over it, 10.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ThreadViewport.ThreadViewport webui/src/components/thread/ThreadViewport.tsx:271— FunctionTooLong — ThreadViewport runs 954 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 854 over it, 9.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ModelsSettings.ModelsSettings webui/src/components/settings/models/ModelsSettings.tsx:202— FunctionTooLong — ModelsSettings runs 713 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 613 over it, 7.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SettingsPage.SettingsPage webui/src/components/settings/SettingsPage.tsx:80— FunctionTooLong — SettingsPage 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: PaneWorkbench.PaneWorkbench webui/src/components/workbench/PaneWorkbench.tsx:191— FunctionTooLong — PaneWorkbench runs 565 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 465 over it, 5.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: ProviderSettings.ProvidersSettings webui/src/components/settings/models/ProviderSettings.tsx:531— FunctionTooLong — ProvidersSettings runs 562 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 462 over it, 5.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: createSystemSettingsActions.createSystemSettingsActions webui/src/components/settings/system/createSystemSettingsActions.ts:76— FunctionTooLong — createSystemSettingsActions runs 491 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 391 over it, 4.91× 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: useModelSettingsActions.useModelSettingsActions webui/src/components/settings/models/useModelSettingsActions.ts:73— FunctionTooLong — useModelSettingsActions runs 489 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 389 over it, 4.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: WorkspaceControls.WorkspaceProjectPicker webui/src/components/thread/WorkspaceControls.tsx:158— FunctionTooLong — WorkspaceProjectPicker runs 472 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 372 over it, 4.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: RemoteConnectionsPage.RemoteConnectionsPage webui/src/components/remote/RemoteConnectionsPage.tsx:29— FunctionTooLong — RemoteConnectionsPage runs 466 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 366 over it, 4.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: AppsSettings.McpAppsCatalogRow webui/src/components/settings/system/AppsSettings.tsx:501— FunctionTooLong — McpAppsCatalogRow runs 376 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 276 over it, 3.76× 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: ModelControls.ModelIdPicker webui/src/components/settings/shared/ModelControls.tsx:187— FunctionTooLong — ModelIdPicker runs 359 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 259 over it, 3.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useSettingsController.useSettingsController webui/src/components/settings/useSettingsController.ts:75— FunctionTooLong — useSettingsController runs 335 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 235 over it, 3.35× 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: ModelPresetBadge.ModelPresetBadge webui/src/components/thread/ModelPresetBadge.tsx:106— FunctionTooLong — ModelPresetBadge runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: LinearPanelView.LinearPanelView nanobot/channels/linear/webui/LinearPanelView.tsx:67— FunctionTooLong — LinearPanelView runs 316 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 216 over it, 3.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AutomationsSettings.AutomationsSettings webui/src/components/settings/system/AutomationsSettings.tsx:63— FunctionTooLong — AutomationsSettings runs 313 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 213 over it, 3.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: thread-event-projection.reduceThreadEvent webui/src/lib/thread-event-projection.ts:893— FunctionTooLong — reduceThreadEvent runs 289 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AppsSettings.AppsCatalogSettings webui/src/components/settings/system/AppsSettings.tsx:104— FunctionTooLong — AppsCatalogSettings runs 286 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 186 over it, 2.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: AppsSettings.McpCustomServerPanel webui/src/components/settings/system/AppsSettings.tsx:1003— FunctionTooLong — McpCustomServerPanel runs 285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useHostSessions.useHostSessions webui/src/components/remote/useHostSessions.ts:21— FunctionTooLong — useHostSessions runs 271 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 171 over it, 2.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SkillsMarketplace.SkillsMarketplace webui/src/components/settings/SkillsMarketplace.tsx:43— FunctionTooLong — SkillsMarketplace runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.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: MarkdownTextRenderer.MarkdownTextRenderer webui/src/components/MarkdownTextRenderer.tsx:525— FunctionTooLong — MarkdownTextRenderer 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.
FunctionTooLong: ChannelSetupPanel.ChannelSetupSurface webui/src/components/settings/channels/ChannelSetupPanel.tsx:163— FunctionTooLong — ChannelSetupSurface 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.
FileTooLong: thread/ThreadComposer.tsx webui/src/components/thread/ThreadComposer.tsx— FileTooLong — 2458 significant lines (blank, comment-only and punctuation-only lines excluded), about 63% of them inside a single declaration: ThreadComposer (549-2381). The bar is 500 significant lines; this is 1958 over it, 4.92× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/App.tsx webui/src/App.tsx— FileTooLong — 2307 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: Shell (821-2816). The bar is 500 significant lines; this is 1807 over it, 4.61× 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: agent/loop.py nanobot/agent/loop.py— FileTooLong — 2152 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1652 over it, 4.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: app/app.ts tui/src/app/app.ts— FileTooLong — 2152 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: NanobotTui (132-2641). The bar is 500 significant lines; this is 1652 over it, 4.30× 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: webui/transcript.py nanobot/webui/transcript.py— FileTooLong — 1987 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1487 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: webui/ws_http.py nanobot/webui/ws_http.py— FileTooLong — 1854 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1354 over it, 3.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/ChatList.tsx webui/src/components/ChatList.tsx— FileTooLong — 1745 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1245 over it, 3.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: webui/settings_models.py nanobot/webui/settings_models.py— FileTooLong — 1744 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1244 over it, 3.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: lib/types.ts webui/src/lib/types.ts— FileTooLong — 1496 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 996 over it, 2.99× 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: cli/onboard.py nanobot/cli/onboard.py— FileTooLong — 1491 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 991 over it, 2.98× 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 — 1488 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 988 over it, 2.98× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: providers/image_generation.py nanobot/providers/image_generation.py— FileTooLong — 1477 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 977 over it, 2.95× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: system/AppsSettings.tsx webui/src/components/settings/system/AppsSettings.tsx— FileTooLong — 1404 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 904 over it, 2.81× 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/mcp.py nanobot/agent/tools/mcp.py— FileTooLong — 1350 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 850 over it, 2.70× 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: thread/ThreadShell.tsx webui/src/components/thread/ThreadShell.tsx— FileTooLong — 1347 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: ThreadShell (359-1581). The bar is 500 significant lines; this is 847 over it, 2.69× 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: providers/base.py nanobot/providers/base.py— FileTooLong — 1343 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 843 over it, 2.69× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: agent/runner.py nanobot/agent/runner.py— FileTooLong — 1309 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 809 over it, 2.62× 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: lib/api.ts webui/src/lib/api.ts— FileTooLong — 1300 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 800 over it, 2.60× 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: thread/AgentActivityCluster.tsx webui/src/components/thread/AgentActivityCluster.tsx— FileTooLong — 1216 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 716 over it, 2.43× 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: thread/ThreadViewport.tsx webui/src/components/thread/ThreadViewport.tsx— FileTooLong — 1164 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: ThreadViewport (271-1429). The bar is 500 significant lines; this is 664 over it, 2.33× 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: webui/mcp_presets_api.py nanobot/webui/mcp_presets_api.py— FileTooLong — 1141 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 641 over it, 2.28× 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/web.py nanobot/agent/tools/web.py— FileTooLong — 1108 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 608 over it, 2.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: models/ProviderSettings.tsx webui/src/components/settings/models/ProviderSettings.tsx— FileTooLong — 1091 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 591 over it, 2.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tools/filesystem.py nanobot/agent/tools/filesystem.py— FileTooLong — 1083 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 583 over it, 2.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: system/AutomationsSettings.tsx webui/src/components/settings/system/AutomationsSettings.tsx— FileTooLong — 1078 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 578 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.
+ 59 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file webui/browser/fixture.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 nanobot/channels/weixin/webui/WeixinPanel.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 webui/browser/subagent-dock-fixture.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 webui/browser/skeleton-additions-fixture.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 tui/scripts/release-notices.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 webui/browser/typography-fixture.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 webui/browser/theme-toggle-fixture.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 webui/browser/skeleton-fixture.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 webui/browser/attachment-layout-fixture.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 webui/browser/history-hydration-fixture.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 webui/browser/overlay-focus-fixture.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 webui/browser/idle-compaction-fixture.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 webui/browser/session-transition-fixture.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 webui/browser/inline-references-fixture.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 webui/browser/mobile-chat-layout-fixture.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 webui/browser/continuity-fixture.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 webui/browser/file-diff-fixture.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 webui/browser/activity-logos-fixture.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 webui/browser/chat-failure-fixture.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 webui/browser/exec-session-fixture.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 webui/browser/history-boundary-fixture.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 nanobot/channels/weixin/webui/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 nanobot/channels/feishu/webui/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 webui/browser/context-graph-fixture.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 webui/browser/new-chat-skeleton-fixture.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.
Swallowed exception (empty catch) webui/src/App.tsx:214— 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) webui/src/App.tsx:561— 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) webui/src/App.tsx:651— `.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) webui/src/App.tsx:784— 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) webui/src/App.tsx:795— 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) webui/src/App.tsx:1132— 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) webui/src/App.tsx:1137— 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) webui/src/App.tsx:1877— 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) webui/src/App.tsx:1880— `.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) webui/src/App.tsx:1981— 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) webui/src/main.tsx:54— `.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) webui/src/workers/imageEncode.worker.ts:169— 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) webui/src/providers/UpdateFlowProvider.tsx:25— 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) webui/src/providers/UpdateFlowProvider.tsx:118— 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) webui/src/providers/UpdateFlowProvider.tsx:223— 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) webui/src/lib/api.ts:123— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) webui/src/lib/bootstrap.ts:26— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) webui/src/lib/bootstrap.ts:34— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) webui/src/lib/clipboard.ts:7— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) webui/src/lib/composer-draft.ts:44— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) webui/src/lib/composer-draft.ts:53— 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) webui/src/lib/local-preferences.ts:72— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) webui/src/lib/nanobot-client.ts:575— 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) webui/src/lib/nanobot-client.ts:1021— 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) webui/src/lib/nanobot-client.ts:1051— 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.
Repeated repair: REDACTED REDACTED:58— REDACTED changed 23 times in last 90 days and 16 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is runtime._gateway_health_ready at line 58), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(gateway): reuse Windows-safe atomic lease I/O”; “fix(gateway): request graceful Windows shutdown (#6353)”; “fix(gateway): recover degraded WebSocket listener (#5544)”; “fix(runtime): preserve interrupted turns on gateway exit”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: REDACTED REDACTED:248— REDACTED changed 24 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 15 (its worst body is tui_launcher._download_release_tui at line 248), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tui): surface chat connection failures (#5543)”; “fix(gateway): recover degraded WebSocket listener (#5544)”; “fix(release): package TUI compliance materials”; “fix(gateway): preserve shared runtime identity”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: REDACTED REDACTED:374— REDACTED changed 18 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 12 (its worst body is webui_support._ensure_local_webui_channel at line 374), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): support WSL browser launch and clearer startup output (#6150)”; “fix(cli): avoid duplicate WebUI config announcement (#5988)”; “fix(webui): make headless login self-explanatory (#5735)”; “fix(cli): protect Windows browser credential handoff [skip ci]”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: nanobot/process_runtime.py nanobot/process_runtime.py:182— nanobot/process_runtime.py changed 16 times in last 90 days and 11 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 ManagedProcessRuntime.status at line 182), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): stop Windows identity polling memory leak”; “fix(gateway): request graceful Windows shutdown (#6353)”; “fix: improve log reliability and correlation”; “fix(gateway): preserve runtime identity compatibility”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/process_runtime.py`: 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: nanobot/cli/gateway.py nanobot/cli/gateway.py:38— nanobot/cli/gateway.py changed 12 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 2 (its worst body is gateway._resolved_config_selector at line 38), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(gateway): avoid restarting stopped systemd services”; “fix(cli): reject misplaced gateway instance selectors (#6229)”; “fix: improve log reliability and correlation”; “fix(gateway): prevent lifecycle races”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/cli/gateway.py`: 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: webui/src/hooks/useSessions.ts webui/src/hooks/useSessions.ts:54— webui/src/hooks/useSessions.ts changed 15 times in last 90 days and 9 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 useSessions.useSessions.refresh at line 54), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): avoid remounting outgoing conversations (#6540)”; “fix(webui): keep saved topics bound to their project (#6509)”; “fix(webui): admit history without dropping live output (NAN-311)”; “fix(webui): show route-aligned skeletons from first paint (#6303)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/hooks/useSessions.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: nanobot/events.py nanobot/events.py:110— nanobot/events.py changed 13 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is EventSink.accepts at line 110), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sessions): preserve cross-session input ownership and history (#6613)”; “fix(webui): update usage and tool progress during active turns (#6553)”; “fix(agent): preserve streamed replies after model failures (#6494)”; “fix(webui): recover model failures and align chat controls”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/events.py`: 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: nanobot/agent/tools/base.py nanobot/agent/tools/base.py:141— nanobot/agent/tools/base.py changed 10 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 4 (its worst body is Tool.validate_params at line 141), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tools): validate arguments with jsonschema without coercion (#6648)”; “fix: decode nested JSON tool arguments by schema”; “fix: use JSON equality for enum validation”; “fix(tools): accept integral JSON numbers for integer parameters”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/agent/tools/base.py`: 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: nanobot/utils/document.py nanobot/utils/document.py:455— nanobot/utils/document.py changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is document.extract_pdf_pages at line 455), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(documents): preserve complete PDF pages across reads”; “fix(grep): preserve XLSX cell locators for literal tabs”; “fix(documents): skip chart-only sheets when reading XLSX files”; “fix(documents): preserve empty PPTX table columns”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/utils/document.py`: 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: webui/src/components/settings/system/AutomationChatBinding.tsx webui/src/components/settings/system/AutomationChatBinding.tsx:10— webui/src/components/settings/system/AutomationChatBinding.tsx changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is AutomationChatBinding.AutomationChatBinding at line 10), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): refine automation chat review layout”; “fix(automations): clarify chat review and scheduling choices”; “fix(webui): keep automation change-back state accurate”; “fix(webui): use consistent chat names for scheduled tasks”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/settings/system/AutomationChatBinding.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: webui/src/lib/provider-brand.ts webui/src/lib/provider-brand.ts:271— webui/src/lib/provider-brand.ts changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is provider-brand.inferProviderFromModelName at line 271), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): keep model management available and bundle core provider logos”; “fix(webui): align provider icons across compact surfaces”; “fix(webui): finish provider icon fallback and tile audit”; “fix(webui): use compact MiMo and Copilot brand marks”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/lib/provider-brand.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: webui/src/dev/gallery/conversation.tsx webui/src/dev/gallery/conversation.tsx:255— webui/src/dev/gallery/conversation.tsx changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is conversation.SandboxPreview at line 255), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): name the gateway sandbox launcher in setup guidance”; “fix(webui): keep context sidebar owned by the pane layout”; “fix(webui): keep permission hints outside locked-thread drafts”; “fix(webui): localize the component gallery”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/dev/gallery/conversation.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: webui/src/components/settings/overview/AppearanceSettingsView.tsx webui/src/components/settings/overview/AppearanceSettingsView.tsx:15— webui/src/components/settings/overview/AppearanceSettingsView.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 AppearanceSettingsView.AppearanceSettingsView at line 15), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): reorder appearance settings and trim preview”; “fix(webui): move appearance help to hints and smooth theme preview”; “fix(webui): refine browser notifications (NAN-227)”; “fix(webui): make browser notification failures actionable”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/settings/overview/AppearanceSettingsView.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: nanobot/bus/notification_delivery.py nanobot/bus/notification_delivery.py:37— nanobot/bus/notification_delivery.py 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 notification_delivery.notification_is_deliverable at line 37), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): update usage and tool progress during active turns (#6553)”; “fix(channels): preserve explicit compaction feedback and silent delivery”; “fix: stop sending context compaction notifications”; “fix(ui): surface model retry status (NAN-34) (#5504)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/bus/notification_delivery.py`: 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: webui/src/components/ui/sheet.tsx webui/src/components/ui/sheet.tsx:74— webui/src/components/ui/sheet.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 sheet.SheetContent at line 74), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): keep sheet close focus rings keyboard-only”; “fix(webui): scope sidebar autofocus to mobile navigation”; “fix(webui): prevent mobile sidebar tooltip and double-tap navigation”; “fix(webui): simplify mobile composer controls and context sheet”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/ui/sheet.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: nanobot/cron/bound_runner.py nanobot/cron/bound_runner.py:62— nanobot/cron/bound_runner.py 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 5 (its worst body is bound_runner.run_bound_cron_job at line 62), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(channels): retain scheduled results across pre-send outages”; “fix(channels): preserve recovery order and adapter ownership”; “fix(channels): retain scheduled results across pre-send outages”; “fix(webui): show per-run automation replies and simplify details”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/cron/bound_runner.py`: 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: webui/src/lib/thread-message-cache.ts webui/src/lib/thread-message-cache.ts:29— webui/src/lib/thread-message-cache.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is ThreadMessageCache.readLoadedMessages at line 29), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): preserve session caches during history revalidation (#6636)”; “fix(webui): admit history without dropping live output (NAN-311)”; “fix(webui): preserve answer checkpoints and stream order (#6368)”; “fix(webui): cache and defer thread history”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/lib/thread-message-cache.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: webui/src/components/thread/ModelFallbackNotice.tsx webui/src/components/thread/ModelFallbackNotice.tsx:8— webui/src/components/thread/ModelFallbackNotice.tsx 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 5 (its worst body is ModelFallbackNotice.ModelFallbackNotice at line 8), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): recover model failures and align chat controls”; “fix(webui): align fallback notice and clarify settings action”; “fix(webui): show provider logos in model notices”; “fix(webui): identify OAuth reauthentication behind fallback replies”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/thread/ModelFallbackNotice.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: nanobot/agent/tools/registry.py nanobot/agent/tools/registry.py:120— nanobot/agent/tools/registry.py 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 7 (its worst body is ToolRegistry.prepare_call at line 120), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tools): validate arguments with jsonschema without coercion (#6648)”; “fix(agent): make tool error guidance neutral (#6227)”; “fix(agent): wait for exec sessions without polling (#5526)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/agent/tools/registry.py`: 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: webui/src/components/icons/product-icons.tsx webui/src/components/icons/product-icons.tsx:5— webui/src/components/icons/product-icons.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 product-icons.productIcon.Icon at line 5), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): simplify workspace picker icon”; “fix(webui): refine sidebar icon consistency and spacing”; “fix(webui): restore symmetry of the settings gear (#6298)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/icons/product-icons.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: webui/src/lib/webui-thread-cache.ts webui/src/lib/webui-thread-cache.ts:7— webui/src/lib/webui-thread-cache.ts changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is webui-thread-cache.reloadPayload at line 7), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): preserve session caches during history revalidation (#6636)”; “fix(webui): retain system context graph after compaction (#6608)”; “fix(webui): reconcile turns after reconnect (#6211)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/lib/webui-thread-cache.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: nanobot/providers/openai_responses/backend.py nanobot/providers/openai_responses/backend.py:275— nanobot/providers/openai_responses/backend.py 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 9 (its worst body is ResponsesBackend.sdk_request at line 275), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(compaction): retain native state across retry and recovery (#6558)”; “fix(providers): tighten tool calls and compatibility fallbacks”; “fix(providers): prepare inline image batches and recover Codex transport (#6107)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/providers/openai_responses/backend.py`: 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: nanobot/cli/desktop_target.py nanobot/cli/desktop_target.py:85— nanobot/cli/desktop_target.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is desktop_target.dispatch_bare_desktop_target at line 85), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): simplify Desktop picker controls [skip ci]”; “fix(cli): make Desktop target selection keyboard navigable [skip ci]”; “fix(cli): harden attach-only Desktop selection [skip ci]”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- nanobot/cli/desktop_target.py`: 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/client-events/notifications.ts packages/client-events/notifications.ts:70— packages/client-events/notifications.ts 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 14 (its worst body is notifications.decodeNotification at line 70), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): preserve streamed replies after model failures (#6494)”; “fix(webui): recover model failures and align chat controls”; “fix(ui): surface model retry status (NAN-34) (#5504)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- packages/client-events/notifications.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: webui/src/components/thread/StreamErrorNotice.tsx webui/src/components/thread/StreamErrorNotice.tsx:62— webui/src/components/thread/StreamErrorNotice.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 5 (its worst body is StreamErrorNotice.resolveCopy at line 62), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): recover model failures and align chat controls”; “fix(ui): keep theme text and selections readable (#6226)”; “fix(ui): surface model retry status (NAN-34) (#5504)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 00:32:10 +08:00' --until='2026-11-14 00:32:10 +08:00' --full-history --no-merges -- webui/src/components/thread/StreamErrorNotice.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.
TooManyMethods: NanobotTui tui/src/app/app.ts:132— TooManyMethods — 104 methods. The bar is 30 methods; this is 74 over it, 3.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AgentLoop nanobot/agent/loop.py:207— TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NanobotClient webui/src/lib/nanobot-client.ts:230— TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GatewayHTTPHandler nanobot/webui/ws_http.py:405— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× 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: SessionState nanobot/session/state.py:41— TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CliAppManager nanobot/apps/cli/service.py:414— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 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.
TooManyMethods: MemoryStore nanobot/agent/memory.py:52— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LLMProvider nanobot/providers/base.py:379— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpenAICompatProvider REDACTED:436— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SubagentManager nanobot/agent/subagent.py:206— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× 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: Transcript tui/src/rendering/transcript.ts:111— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SqliteSessionStore nanobot/session/sqlite_store.py:165— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SessionManager nanobot/session/manager.py:430— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: CronService nanobot/cron/service.py:186— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BedrockProvider nanobot/providers/bedrock_provider.py:51— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AgentRunner nanobot/agent/runner.py:168— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NanobotTui tui/src/app/app.ts:132— ClassTooLong — 2021 significant lines (blank, comment-only and punctuation-only lines excluded), 104 methods. The bar is 400 significant lines; this is 1621 over it, 5.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: ThreadComposer webui/src/components/thread/ThreadComposer.tsx:1— ClassTooLong — 1544 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 1144 over it, 3.86× 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: ThreadShell webui/src/components/thread/ThreadShell.tsx:1— ClassTooLong — 1047 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 647 over it, 2.62× 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: ThreadViewport webui/src/components/thread/ThreadViewport.tsx:1— ClassTooLong — 954 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 554 over it, 2.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ChatList webui/src/components/ChatList.tsx:1— ClassTooLong — 860 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 460 over it, 2.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: useNanobotStream webui/src/hooks/useNanobotStream.ts:1— ClassTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 399 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NanobotClient webui/src/lib/nanobot-client.ts:230— ClassTooLong — 778 significant lines (blank, comment-only and punctuation-only lines excluded), 74 methods. The bar is 400 significant lines; this is 378 over it, 1.95× 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: ModelsSettings webui/src/components/settings/models/ModelsSettings.tsx:1— ClassTooLong — 713 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 313 over it, 1.78× 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: SettingsPage webui/src/components/settings/SettingsPage.tsx:1— ClassTooLong — 655 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 255 over it, 1.64× 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: ThreadTranscript webui/src/lib/thread-transcript.ts:229— ClassTooLong — 617 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 217 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PaneWorkbench webui/src/components/workbench/PaneWorkbench.tsx:1— ClassTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 165 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Transcript tui/src/rendering/transcript.ts:111— ClassTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 134 over it, 1.34× 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: createSystemSettingsActions webui/src/components/settings/system/createSystemSettingsActions.ts:1— ClassTooLong — 491 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 91 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: useModelSettingsActions webui/src/components/settings/models/useModelSettingsActions.ts:1— ClassTooLong — 489 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 89 over it, 1.22× 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: RemoteConnectionsPage webui/src/components/remote/RemoteConnectionsPage.tsx:1— ClassTooLong — 466 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 66 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Focus outline removed inline webui/src/components/FilePreviewPanelView.tsx:53— <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 webui/src/components/MarkdownTextRenderer.tsx:689— <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 webui/src/components/MessageBubble.tsx:217— <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 webui/src/components/PreviewPane.tsx:97— <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 webui/src/components/PreviewPane.tsx:101— <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 webui/src/components/SessionSearchDialog.tsx:181— <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 webui/src/components/SidebarResizeHandle.tsx:31— <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 webui/src/components/remote/HostSwitcherView.tsx:70— <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 webui/src/components/thread/ModelPresetBadge.tsx:317— <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 webui/src/components/thread/PromptNavigator.tsx:117— <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 webui/src/components/thread/ThreadMessages.tsx:492— <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 webui/src/components/ui/image-viewport.tsx:125— <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 webui/src/components/ui/input.tsx:13— <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).
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×11
Animation without a prefers-reduced-motion guard webui/src/components/ConnectionBadge.tsx:47— <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — 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:.
Animation without a prefers-reduced-motion guard webui/src/globals.css:760— `.composer-status-strip[data-state="enter"]` moves (`animation: composer-status-strip-enter 280ms cubic-bezier(0.16, 1, 0.3, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/globals.css:1103— `.composer-action-glyph` moves (`transition: opacity 140ms ease-out, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/globals.css:1176— `.sidebar-selection-highlight` moves (`transition: transform 300ms ease-out, width 300ms ease-out, height 300ms ease-out,
var(--theme-paint-transition, background-color 0s)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/components/StarPrompt.css:17— `.star-prompt-decoration` moves (`transition: opacity 120ms ease-out, transform 180ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/components/StarPrompt.css:33— `.star-prompt-action:focus-visible .star-prompt-decoration` moves (`animation: star-prompt-pop 640ms cubic-bezier(.22, 1, .36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/components/StarPrompt.css:36— `.star-prompt-action:focus-visible .star-prompt-sparkle` moves (`animation: star-prompt-twinkle 420ms ease-out 250ms both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/components/StarPrompt.css:44— `.star-prompt-action:hover .star-prompt-decoration` moves (`animation: star-prompt-pop 640ms cubic-bezier(.22, 1, .36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/components/StarPrompt.css:47— `.star-prompt-action:hover .star-prompt-sparkle` moves (`animation: star-prompt-twinkle 420ms ease-out 250ms both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/components/thread/goal-island.css:204— `.goal-island-panel[data-state="open"] .goal-island-panel-content` moves (`animation: goal-island-content-in 200ms ease-out 100ms both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard webui/src/components/thread/goal-island.css:214— `.goal-island-panel[data-state="closed"] .goal-island-panel-content` moves (`animation: goal-island-content-out 80ms ease-in both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Change coupling: settings_models.py ↔ useModelSettingsActions.ts nanobot/webui/settings_models.py:1— `nanobot/webui/settings_models.py` and `webui/src/components/settings/models/useModelSettingsActions.ts` change together 91% of the time (10 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `28d73b69` perf(webui): streamline model preset saves (#6631); `1066adb1` fix: isolate preset requests and confirm parameter saves; `d4b01285` feat(models): add per-preset request overrides — run `git show` on any of them.
Change coupling: inbound_commands.py ↔ ws_http.py nanobot/webui/inbound_commands.py:1— `nanobot/webui/inbound_commands.py` and `nanobot/webui/ws_http.py` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `219dd13f` fix(webui): enforce workspace authority across queued inputs; `80ac41b1` refactor(sessions): persist archive state in SQLite (#6536); `4a14faa4` fix(webui): keep saved topics bound to their project (#6509) — run `git show` on any of them.
Change coupling: REDACTED ↔ index.ts REDACTED:1— `REDACTED` and `tui/src/index.ts` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `48e7c4f6` feat(cli): attach terminal clients to the selected Desktop [skip ci]; `3a62b0b7` fix(tui): surface chat connection failures (#5543); `26764f24` feat(tui): add /detach command (#5461) — run `git show` on any of them.
Change coupling: settings_models.py ↔ useSettingsController.ts nanobot/webui/settings_models.py:1— `nanobot/webui/settings_models.py` and `webui/src/components/settings/useSettingsController.ts` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `28d73b69` perf(webui): streamline model preset saves (#6631); `23941355` feat(images): reuse named connections and image request settings; `1066adb1` fix: isolate preset requests and confirm parameter saves — run `git show` on any of them.
Change coupling: commands.py ↔ stream.py nanobot/cli/commands.py:1— `nanobot/cli/commands.py` and `nanobot/cli/stream.py` 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 — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `3fab7362` fix(cli): keep trace output under assistant header; `3a27af00` feat(cli): display model reasoning content during streaming; `d630ac90` fix(cli): prevent TUI content duplication via transient Live and rend… — run `git show` on any of them.
Change coupling: settings_routes.py ↔ types.ts nanobot/webui/settings_routes.py:1— `nanobot/webui/settings_routes.py` and `webui/src/lib/types.ts` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `8af6313c` fix(webui): refresh pairing prompts on gateway changes (#6401); `73a27e07` feat(webui): show resolved Auto API in preset selector; `2ac802b2` feat(usage): add unified provider usage backend — run `git show` on any of them.
Change coupling: ThreadShell.tsx ↔ useSessions.ts webui/src/components/thread/ThreadShell.tsx:1— `webui/src/components/thread/ThreadShell.tsx` and `webui/src/hooks/useSessions.ts` change together 50% of the time (15 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `c1ed649b` fix(webui): avoid remounting outgoing conversations (#6540); `4a14faa4` fix(webui): keep saved topics bound to their project (#6509); `b37a2369` fix(webui): admit history without dropping live output (NAN-311) — run `git show` on any of them.
Change coupling: app.ts ↔ picker-menu.ts tui/src/app/app.ts:1— `tui/src/app/app.ts` and `tui/src/menus/picker-menu.ts` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `2850114e` feat(tui): surface session activity states (at that commit the files were still `tui/src/app.ts` and `tui/src/picker-menu.ts`); `7e60d52f` fix(tui): prevent terminal cell artifacts (at that commit the files were still `tui/src/app.ts` and `tui/src/picker-menu.ts`); `a6320171` fix(tui): keep runtime controls interactive (at that commit the files were still `tui/src/app.ts` and `tui/src/picker-menu.ts`) — run `git show` on any of them.
Change coupling: sessions.py ↔ session_access.py nanobot/agent/tools/sessions.py:1— `nanobot/agent/tools/sessions.py` and `nanobot/webui/session_access.py` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `49043054` refactor(session): decouple history tools from WebUI replay (#6017); `6e9ae5bd` refactor(session): remove request-scoped access grants (#5238); `d99f589a` refactor(session): clarify reference boundaries — run `git show` on any of them.
Change coupling: commands.py ↔ evaluator.py nanobot/cli/commands.py:1— `nanobot/cli/commands.py` and `nanobot/utils/evaluator.py` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `dcb37259` feat(heartbeat): custom evaluator prompt; `a50b3ac0` fix: harden cron session automation flows; `e3df3103` fix(heartbeat): skip when HEARTBEAT.md has no tasks and fail closed o… — run `git show` on any of them.
Duplicated block (6 lines × 2) nanobot/context_graph.py:66— nanobot/context_graph.py:66-71 | nanobot/context_graph.py:80-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) nanobot/process_runtime.py:432— nanobot/process_runtime.py:432-437 | nanobot/process_runtime.py:517-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) nanobot/providers/github_copilot_provider.py:423— nanobot/providers/github_copilot_provider.py:423-428 | nanobot/providers/openai_codex_provider.py:839-844 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) nanobot/session/state.py:984— nanobot/session/state.py:984-991 | nanobot/session/state.py:1085-1090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) nanobot/update_uv.py:45— nanobot/update_uv.py:45-50 | REDACTED:91-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) nanobot/agent/skills.py:373— nanobot/agent/skills.py:373-378 | nanobot/webui/skills_api.py:195-200 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) nanobot/agent/tools/web.py:528— nanobot/agent/tools/web.py:528-533 | nanobot/agent/tools/web.py:667-672 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) scripts/release_candidate.py:79— scripts/release_candidate.py:79-84 | scripts/release_candidate.py:115-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) nanobot/agent/context.py:164— nanobot/agent/context.py:164-176 | nanobot/agent/context_governance.py:316-328 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) nanobot/agent/tools/schema.py:73— nanobot/agent/tools/schema.py:73-85 | nanobot/agent/tools/schema.py:107-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) nanobot/cli/gateway.py:367— nanobot/cli/gateway.py:367-379 | nanobot/cli/gateway.py:390-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) nanobot/cli/provider.py:169— nanobot/cli/provider.py:169-181 | nanobot/cli/provider.py:198-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) nanobot/providers/openai_codex_provider.py:914— nanobot/providers/openai_codex_provider.py:914-926 | nanobot/providers/xai_grok_provider.py:843-855 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) nanobot/utils/document.py:198— nanobot/utils/document.py:198-210 | nanobot/utils/document.py:473-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) nanobot/webui/recovery.py:331— nanobot/webui/recovery.py:331-343 | nanobot/webui/recovery.py:345-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) nanobot/cli/commands.py:475— nanobot/cli/commands.py:475-480 | nanobot/cli/commands.py:499-503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/cli/commands.py:475` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `name` to `str = typer.Argument(..., help="Feature name (e.g. weixin, matrix, bedrock)")` in one and `str = typer.Argument(..., help="Channel name (e.g. telegram, matrix, slack)")` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) nanobot/cli/gateway.py:263— nanobot/cli/gateway.py:263-267 | nanobot/cli/gateway.py:280-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/cli/gateway.py:263` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) nanobot/providers/image_generation.py:400— nanobot/providers/image_generation.py:400-404 | nanobot/providers/image_generation.py:814-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) nanobot/utils/atomic_file.py:35— nanobot/utils/atomic_file.py:35-39 | nanobot/utils/atomic_file.py:75-79 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `nanobot/utils/atomic_file.py:67` calls `RenameInfo` and `nanobot/utils/atomic_file.py:33` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) nanobot/agent/cron_turns.py:47— nanobot/agent/cron_turns.py:47-51 | nanobot/triggers/local_turns.py:45-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) nanobot/agent/loop.py:2595— nanobot/agent/loop.py:2595-2599 | nanobot/webui/workspaces.py:230-234 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) nanobot/cron/session_turns.py:56— nanobot/cron/session_turns.py:56-60 | nanobot/triggers/local_session_turns.py:45-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×6
Edited copy of a member (16 corresponding lines) nanobot/cli/commands.py:461— nanobot/cli/commands.py:461-481 | nanobot/cli/commands.py:489-504 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) nanobot/agent/context.py:157— nanobot/agent/context.py:157-176 | nanobot/agent/context_governance.py:313-328 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) REDACTED:786— REDACTED:786-801 | nanobot/process_runtime.py:465-480 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) nanobot/agent/tools/filesystem.py:867— nanobot/agent/tools/filesystem.py:867-882 | nanobot/agent/tools/filesystem.py:938-955 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) nanobot/webui/ws_http.py:1011— nanobot/webui/ws_http.py:1011-1026 | nanobot/webui/ws_http.py:1363-1380 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) nanobot/webui/mcp_presets_api.py:660— nanobot/webui/mcp_presets_api.py:660-675 | nanobot/webui/mcp_presets_api.py:679-697 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×6
Recursive walk over a caller-supplied document has no depth cap tui/src/client/connection.ts:112— `sanitizeConnectionFailure` is exported, takes a document from its caller (line 100) and hands it to `collect`, which calls itself at line 112 (`collect`) with a piece of `value` (and at line 114, line 120, line 122) — and nowhere in `collect` 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 `collect` 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 nanobot/webui/request_settings.py:71— `redact_request_secrets` is public and takes `value: Any` from its caller, and it calls itself at line 71 (`redact_request_secrets`) with a piece of `value` (and at line 78) — and nowhere in `redact_request_secrets` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_request_secrets` 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 nanobot/webui/request_settings.py:94— `restore_request_secrets` is public and takes `submitted: Any` from its caller, and it calls itself at line 94 (`restore_request_secrets`) with a piece of `submitted` (and at line 105) — and nowhere in `restore_request_secrets` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `restore_request_secrets` 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 nanobot/utils/helpers.py:83— `sanitize_surrogates_deep` is public and takes `value: Any` from its caller, and it calls itself at line 83 (`sanitize_surrogates_deep`) with a piece of `value` (and at line 92, line 99) — and nowhere in `sanitize_surrogates_deep` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `sanitize_surrogates_deep` 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 nanobot/config/loader.py:178— `merge_missing_defaults` is public and takes `existing: object` from its caller, and it calls itself at line 178 (`merge_missing_defaults`) with a piece of `existing` — and nowhere in `merge_missing_defaults` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `merge_missing_defaults` 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 nanobot/channels/contracts.py:94— `from_config` is public and takes `section: Any` from its caller, and it calls itself at line 94 (`self.from_config`) with a piece of `section` — and nowhere in `from_config` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `from_config` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
AC2 · Forms & labels· <NumberInput> field component without a label · ×5
<NumberInput> field component without a label webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:217— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumberInput> field component without a label webui/src/components/settings/capabilities/TranscriptionSettings.tsx:161— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumberInput> field component without a label webui/src/components/settings/capabilities/TranscriptionSettings.tsx:168— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumberInput> field component without a label webui/src/components/settings/capabilities/WebSettings.tsx:253— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<NumberInput> field component without a label webui/src/components/settings/capabilities/WebSettings.tsx:261— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
TodoComment nanobot/webui/history.py:238— # TODO(0.5.0): Remove legacy WebUI history import and startup hooks; retain throughout 0.4.x. — 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 nanobot/skills/skill-creator/scripts/init_skill.py:62— ## [TODO: Replace with the first main section based on chosen structure] — 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 nanobot/skills/skill-creator/scripts/init_skill.py:124— # TODO: Add actual script logic here — 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 nanobot/session/sqlite_store.py:268— # TODO(0.5.0): Remove JSONL import and backup finalization; retain throughout 0.4.x. — 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 nanobot/config/network.py:77— # TODO(0.5.0): Remove legacy proxy migration and its Config validator; retain throughout 0.4.x. — 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.
MethodTooLong: ThreadTranscript.accept webui/src/lib/thread-transcript.ts:554— MethodTooLong — accept runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NanobotTui.handleKey tui/src/app/app.ts:1320— MethodTooLong — handleKey runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NanobotTui.accept tui/src/app/app.ts:690— MethodTooLong — accept runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× 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: NanobotClient.handleMessage webui/src/lib/nanobot-client.ts:903— MethodTooLong — handleMessage 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: ThreadTranscript.project webui/src/lib/thread-transcript.ts:367— MethodTooLong — project runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (11 lines × 2) nanobot/context_graph.py:58— nanobot/context_graph.py:58-68 | nanobot/session/history_graph.py:117-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) nanobot/providers/fallback_provider.py:328— nanobot/providers/fallback_provider.py:328-338 | nanobot/providers/fallback_provider.py:453-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/providers/fallback_provider.py:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) nanobot/providers/github_copilot_provider.py:424— nanobot/providers/github_copilot_provider.py:424-434 | nanobot/providers/xai_grok_provider.py:691-701 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) nanobot/providers/openai_codex_provider.py:760— nanobot/providers/openai_codex_provider.py:760-770 | nanobot/providers/xai_grok_provider.py:640-650 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) scripts/docker_compose_smoke.py:142— scripts/docker_compose_smoke.py:142-153 | scripts/docker_compose_smoke.py:187-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×4
Edited copy of a member (10 corresponding lines) nanobot/providers/bedrock_provider.py:32— nanobot/providers/bedrock_provider.py:32-41 | REDACTED:357-370 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) nanobot/webui/settings_routes.py:686— nanobot/webui/settings_routes.py:686-695 | nanobot/webui/settings_routes.py:719-728 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) nanobot/webui/ws_http.py:1486— nanobot/webui/ws_http.py:1486-1495 | nanobot/webui/ws_http.py:1498-1507 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) nanobot/session/location.py:58— nanobot/session/location.py:58-67 | nanobot/utils/atomic_file.py:119-128 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×4
Edited copy of a member (8 corresponding lines) nanobot/cli/onboard.py:360— nanobot/cli/onboard.py:360-370 | nanobot/cli/onboard.py:1333-1340 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) REDACTED:262— REDACTED:262-271 | REDACTED:1234-1241 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) nanobot/webui/ws_http.py:1810— nanobot/webui/ws_http.py:1810-1819 | nanobot/webui/ws_http.py:1822-1829 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) nanobot/agent/tools/registry.py:87— nanobot/agent/tools/registry.py:87-94 | REDACTED:729-746 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×4
Edited copy of a member (9 corresponding lines) nanobot/providers/base.py:150— nanobot/providers/base.py:150-174 | nanobot/providers/xai_grok_provider.py:500-508 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) nanobot/webui/sidebar_state.py:241— nanobot/webui/sidebar_state.py:241-250 | nanobot/webui/sidebar_state.py:254-262 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) nanobot/session/manager.py:106— nanobot/session/manager.py:106-114 | nanobot/webui/settings_models.py:517-526 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) nanobot/webui/settings_system.py:1161— nanobot/webui/settings_system.py:1161-1169 | nanobot/webui/ws_http.py:1943-1951 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (8 lines × 2) nanobot/cli/terminal.py:271— nanobot/cli/terminal.py:271-278 | nanobot/cli/terminal.py:315-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) REDACTED:791— REDACTED:791-798 | nanobot/process_runtime.py:470-477 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:791` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) nanobot/optional_features.py:698— nanobot/optional_features.py:698-705 | nanobot/optional_features.py:775-782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) nanobot/session/sqlite_store.py:742— nanobot/session/sqlite_store.py:742-749 | nanobot/session/sqlite_store.py:772-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/session/sqlite_store.py:742` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) nanobot/agent/tools/mcp_oauth.py:131— nanobot/agent/tools/mcp_oauth.py:131-135 | nanobot/agent/tools/mcp_oauth.py:146-150 | nanobot/agent/tools/mcp_oauth.py:151-155 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) nanobot/context_graph.py:65— nanobot/context_graph.py:65-69 | nanobot/context_graph.py:79-83 | nanobot/session/history_graph.py:134-138 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) nanobot/providers/github_copilot_provider.py:506— nanobot/providers/github_copilot_provider.py:506-510 | nanobot/providers/openai_codex_provider.py:898-902 | nanobot/providers/xai_grok_provider.py:818-822 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `nanobot/providers/github_copilot_provider.py:501` calls `_catalog_mapping`, `cast`, `isinstance` and `nanobot/providers/openai_codex_provider.py:894` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) nanobot/providers/github_copilot_provider.py:514— nanobot/providers/github_copilot_provider.py:514-518 | nanobot/providers/openai_codex_provider.py:906-910 | nanobot/providers/xai_grok_provider.py:826-830 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Outbound HTTP without resilience nanobot/channels/telegram/validation.py:27— `httpx.Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience nanobot/providers/openai_codex_provider.py:822— `httpx.Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience nanobot/providers/openai_responses/backend.py:264— `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience nanobot/providers/xai_grok_provider.py:674— `httpx.Client(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Duplicated block (15 lines × 2 locations) webui/src/components/ChatList.tsx:727— webui/src/components/ChatList.tsx:727 · webui/src/components/ChatList.tsx:742 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 2 locations) webui/src/components/LanguageSwitcher.tsx:16— webui/src/components/LanguageSwitcher.tsx:16 · webui/src/components/settings/models/ModelAPIControl.tsx:72 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (15 lines × 2 locations) webui/src/components/workbench/PaneWorkbench.tsx:445— webui/src/components/workbench/PaneWorkbench.tsx:445 · webui/src/components/workbench/PaneWorkbench.tsx:552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2 locations) webui/src/components/workbench/workbench-layout.ts:304— webui/src/components/workbench/workbench-layout.ts:304 · webui/src/components/workbench/workbench-layout.ts:319 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×3
Focus outline removed in CSS without a :focus replacement webui/src/globals.css:1654— `.settings-list-row: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 webui/src/components/thread/goal-island.css:80— `.goal-island-panel` 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 webui/src/components/remote/remote-layout.css:6— `.remote-dialog` 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.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×3
Edited copy of a member (11 corresponding lines) nanobot/webui/outbound_delivery.py:498— nanobot/webui/outbound_delivery.py:498-511 | nanobot/webui/outbound_delivery.py:517-527 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) nanobot/webui/settings_models.py:480— nanobot/webui/settings_models.py:480-491 | nanobot/webui/sidebar_state.py:75-85 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) nanobot/providers/azure_openai_provider.py:294— nanobot/providers/azure_openai_provider.py:294-304 | nanobot/providers/azure_openai_provider.py:320-334 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×3
Edited copy of a member (18 corresponding lines) nanobot/webui/transcript.py:1221— nanobot/webui/transcript.py:1221-1239 | nanobot/webui/transcript.py:1243-1260 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) nanobot/agent/tools/mcp.py:865— nanobot/agent/tools/mcp.py:865-882 | nanobot/agent/tools/mcp.py:939-961 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) nanobot/triggers/local_store.py:200— nanobot/triggers/local_store.py:200-217 | nanobot/triggers/local_store.py:220-237 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×3
Edited copy of a member (12 corresponding lines) nanobot/webui/transcript.py:542— nanobot/webui/transcript.py:542-553 | nanobot/webui/transcript.py:1455-1466 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) nanobot/webui/outbound_delivery.py:391— nanobot/webui/outbound_delivery.py:391-405 | nanobot/webui/outbound_delivery.py:432-443 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) nanobot/providers/base.py:61— nanobot/providers/base.py:61-76 | REDACTED:236-247 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×3
Edited copy of a member (13 corresponding lines) nanobot/agent/skills.py:365— nanobot/agent/skills.py:365-378 | nanobot/webui/skills_api.py:188-200 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) nanobot/utils/atomic_file.py:132— nanobot/utils/atomic_file.py:132-144 | nanobot/utils/atomic_file.py:148-170 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) nanobot/webui/sidebar_state.py:225— nanobot/webui/sidebar_state.py:225-237 | nanobot/webui/workspaces.py:94-106 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×3
Edited copy of a member (2 corresponding lines) nanobot/webui/session_access.py:28— nanobot/webui/session_access.py:28-29 | nanobot/webui/skills_marketplace.py:61-62 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) nanobot/agent/tools/mcp_oauth.py:195— nanobot/agent/tools/mcp_oauth.py:195-196 | nanobot/providers/xai_oauth.py:762-764 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) scripts/release_candidate.py:41— scripts/release_candidate.py:41-45 | scripts/release_plan.py:20-21 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2 locations) webui/src/components/ChatList.tsx:1029— webui/src/components/ChatList.tsx:1029 · webui/src/components/ChatList.tsx:1511 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (17 lines × 2 locations) webui/src/components/settings/models/ProviderSettings.tsx:478— webui/src/components/settings/models/ProviderSettings.tsx:478 · webui/src/components/settings/models/ProviderSettings.tsx:495 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (17 lines × 2 locations) webui/src/components/thread/ThreadShell.tsx:1328— webui/src/components/thread/ThreadShell.tsx:1328 · webui/src/components/thread/ThreadShell.tsx:1381 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
Duplicated block (16 lines × 2 locations) webui/src/components/settings/capabilities/WebSettings.tsx:203— webui/src/components/settings/capabilities/WebSettings.tsx:203 · webui/src/components/settings/models/ProviderSettings.tsx:849 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (16 lines × 2 locations) webui/src/components/settings/models/ProviderSettings.tsx:920— webui/src/components/settings/models/ProviderSettings.tsx:920 · webui/src/components/settings/models/ProviderSettings.tsx:1052 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) webui/src/components/thread/ThreadComposer.tsx:2578— webui/src/components/thread/ThreadComposer.tsx:2578 · webui/src/components/thread/ThreadComposer.tsx:2742 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
No assertions: reselecting the detected language saves it webui/browser/gallery-language.spec.ts:65— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: keeps clipboard failures visible while an agent turn is active tui/src/app/composer.test.ts:487— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
UpdateFlowProvider.UpdateFlowProvider::confirm (cognitive 37) webui/src/providers/UpdateFlowProvider.tsx:207— UpdateFlowProvider.UpdateFlowProvider::confirm has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (28 pts), error handling 3 (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. This shape REPEATS in the file: 2 other methods here (UpdateFlowProvider.UpdateFlowProvider, UpdateFlowProvider.UpdateFlowProvider::inspect) 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.
UpdateFlowProvider.UpdateFlowProvider::inspect (cognitive 16) webui/src/providers/UpdateFlowProvider.tsx:170— UpdateFlowProvider.UpdateFlowProvider::inspect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (UpdateFlowProvider.UpdateFlowProvider, UpdateFlowProvider.UpdateFlowProvider::confirm) 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.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×2
Edited copy of a member (40 corresponding lines) REDACTED:136— REDACTED:136-188 | nanobot/providers/azure_openai_provider.py:219-258 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) nanobot/command/builtin.py:466— nanobot/command/builtin.py:466-505 | nanobot/command/builtin.py:509-555 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) REDACTED:437— REDACTED:437-499 | nanobot/providers/bedrock_provider.py:269-293 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) nanobot/session/state.py:602— nanobot/session/state.py:602-626 | nanobot/session/state.py:772-807 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×2
Edited copy of a member (21 corresponding lines) nanobot/apps/cli/service.py:477— nanobot/apps/cli/service.py:477-497 | nanobot/apps/cli/service.py:506-527 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) nanobot/webui/ws_http.py:1954— nanobot/webui/ws_http.py:1954-1977 | nanobot/webui/ws_http.py:1984-2004 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×2
Edited copy of a member (14 corresponding lines) nanobot/webui/ws_http.py:1861— nanobot/webui/ws_http.py:1861-1877 | nanobot/webui/ws_http.py:1880-1893 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) nanobot/bus/runtime_events.py:217— nanobot/bus/runtime_events.py:217-230 | nanobot/bus/runtime_events.py:262-275 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×2
Edited copy of a member (6 corresponding lines) nanobot/agent/tools/mcp_oauth.py:200— nanobot/agent/tools/mcp_oauth.py:200-205 | nanobot/providers/xai_oauth.py:780-786 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) nanobot/session/sqlite_store.py:491— nanobot/session/sqlite_store.py:491-496 | nanobot/session/sqlite_store.py:499-508 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×2
Edited copies of one member (3 members, 8+ corresponding lines) nanobot/session/sqlite_store.py:741— nanobot/session/sqlite_store.py:741-751 | nanobot/session/sqlite_store.py:756-763 | nanobot/session/sqlite_store.py:768-781 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) nanobot/__init__.py:81— nanobot/__init__.py:81-88 | nanobot/cli/agent.py:37-44 | nanobot/cron/__init__.py:14-21 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×2
Edited copy of a member (7 corresponding lines) nanobot/agent/tools/exec_session.py:215— nanobot/agent/tools/exec_session.py:215-221 | nanobot/agent/tools/exec_session.py:400-406 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) nanobot/webui/remote_pairing.py:322— nanobot/webui/remote_pairing.py:322-328 | nanobot/webui/remote_pairing.py:331-338 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×2
Edited copy of a member (4 corresponding lines) nanobot/session/jsonl_migration.py:79— nanobot/session/jsonl_migration.py:79-82 | nanobot/session/sqlite_store.py:55-58 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) nanobot/webui/settings_routes.py:203— nanobot/webui/settings_routes.py:203-206 | nanobot/webui/ws_http.py:298-301 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2) nanobot/agent/tools/web.py:752— nanobot/agent/tools/web.py:752-768 | nanobot/agent/tools/web.py:796-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) nanobot/webui/sidebar_state.py:309— nanobot/webui/sidebar_state.py:309-325 | nanobot/webui/workspaces.py:122-138 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) nanobot/agent/tools/filesystem.py:867— nanobot/agent/tools/filesystem.py:867-882 | nanobot/agent/tools/filesystem.py:940-955 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) REDACTED:1603— REDACTED:1603-1618 | REDACTED:1657-1672 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1603` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) nanobot/providers/image_generation.py:1030— nanobot/providers/image_generation.py:1030-1041 | nanobot/providers/image_generation.py:1720-1731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) nanobot/webui/skills_marketplace.py:213— nanobot/webui/skills_marketplace.py:213-224 | nanobot/webui/skills_marketplace.py:251-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/webui/skills_marketplace.py:213` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) nanobot/webui/ws_http.py:1011— nanobot/webui/ws_http.py:1011-1019 | nanobot/webui/ws_http.py:1131-1139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) nanobot/utils/helpers.py:705— nanobot/utils/helpers.py:705-713 | nanobot/utils/helpers.py:763-771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) nanobot/context_graph.py:77— nanobot/context_graph.py:77-83 | nanobot/session/history_graph.py:132-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) nanobot/providers/base.py:1427— nanobot/providers/base.py:1427-1433 | nanobot/providers/fallback_provider.py:285-291 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Low cohesion: MCPOAuthStorage (LCOM4 5) nanobot/agent/tools/mcp_oauth.py:208— MCPOAuthStorage's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ContextGovernor (LCOM4 4) nanobot/agent/context_governance.py:267— ContextGovernor's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Duplicated block (23 lines × 2 locations) webui/src/components/settings/system/AppsSettings.tsx:1379— webui/src/components/settings/system/AppsSettings.tsx:1379 · webui/src/components/thread/ThreadComposer.tsx:2715 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (23 lines × 2 locations) webui/src/components/thread/AgentActivityCluster.tsx:1376— webui/src/components/thread/AgentActivityCluster.tsx:1376 · webui/src/components/thread/AgentActivityCluster.tsx:1452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2 locations) webui/src/components/thread/ThreadComposer.tsx:1197— webui/src/components/thread/ThreadComposer.tsx:1197 · webui/src/components/thread/ThreadComposer.tsx:1218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2 locations) webui/src/components/thread/ThreadComposer.tsx:1790— webui/src/components/thread/ThreadComposer.tsx:1790 · webui/src/components/thread/ThreadComposer.tsx:1814 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (18 matched lines × 2 locations) · ×2
Duplicated block with local edits (18 matched lines × 2 locations) tui/src/client/nanobot-client.ts:255— tui/src/client/nanobot-client.ts:255 · webui/src/lib/nanobot-client.ts:655 — the two spans are one implementation copied and then locally edited — 105 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (18 matched lines × 2 locations) webui/src/components/settings/SkillsCatalogSettings.tsx:298— webui/src/components/settings/SkillsCatalogSettings.tsx:298 · webui/src/components/settings/SkillsMarketplace.tsx:127 — the two spans are one implementation copied and then locally edited — 77 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.
X1 · Async correctness· Task from `asyncio.create_task` is not kept · ×2
Task from `asyncio.create_task` is not kept nanobot/command/builtin.py:195— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Task from `asyncio.create_task` is not kept nanobot/command/builtin.py:459— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
X2 · Cancellation propagation· Async function without AbortSignal · ×2
Async function without AbortSignal: refreshAssetManifest webui/public/sw.js:188— `refreshAssetManifest` 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: fetchGatewayConnection tui/src/client/connection.ts:12— `fetchGatewayConnection` 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 })`.
AC1 · Text alternatives· <video> without a captions track · ×1
<video> without a captions track webui/src/components/AttachmentTile.tsx:50— 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).
AC2 · Forms & labels· <SearchInput> field component without a label · ×1
<SearchInput> field component without a label webui/src/components/settings/system/AppsSettings.tsx:267— 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.
Empty <h1> heading webui/src/components/FilePreviewPanelView.tsx:70— An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×1
Modal dialog does not manage focus webui/src/components/pairing/PairingCodePopup.tsx:77— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Low contrast Tailwind colour pair (2.5:1) webui/src/components/MarkdownTextRenderer.tsx:752— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
App.Shell (cyclomatic 312) webui/src/App.tsx:821— App.Shell has cyclomatic complexity 312 (threshold 15). Of this number, 86 points are the body's own statements and 226 belong to 92 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.
ThreadViewport.ThreadViewport (cyclomatic 301) webui/src/components/thread/ThreadViewport.tsx:271— ThreadViewport.ThreadViewport has cyclomatic complexity 301 (threshold 15). Of this number, 74 points are the body's own statements and 227 belong to 52 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.
ThreadTranscript.accept (cyclomatic 285) webui/src/lib/thread-transcript.ts:554— ThreadTranscript.accept has cyclomatic complexity 285 (threshold 15). Of this number, 263 points are the body's own statements and 22 belong to 9 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
WorkspaceControls.WorkspaceProjectPicker (cyclomatic 274) webui/src/components/thread/WorkspaceControls.tsx:158— WorkspaceControls.WorkspaceProjectPicker has cyclomatic complexity 274 (threshold 15). Of this number, 82 points are the body's own statements and 192 belong to 57 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.
ChatList.ChatList (cyclomatic 175) webui/src/components/ChatList.tsx:272— ChatList.ChatList has cyclomatic complexity 175 (threshold 15). Of this number, 23 points are the body's own statements and 152 belong to 45 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.
ThreadComposer.ThreadComposer (cyclomatic 166) webui/src/components/thread/ThreadComposer.tsx:549— ThreadComposer.ThreadComposer has cyclomatic complexity 166 (threshold 15). To reduce it, separate the cases: extract each independent 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 (ThreadComposer.ThreadComposer::onKeyDown) 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.
useNanobotStream.useNanobotStream (cyclomatic 153) webui/src/hooks/useNanobotStream.ts:118— useNanobotStream.useNanobotStream has cyclomatic complexity 153 (threshold 15). Most of this is not in the body itself: 6 of the 153 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 672, 558, 635, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
thread-event-projection.reduceThreadEvent (cyclomatic 150) webui/src/lib/thread-event-projection.ts:893— thread-event-projection.reduceThreadEvent has cyclomatic complexity 150 (threshold 15). Of this number, 147 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.
NanobotTui.handleKey (cyclomatic 130) tui/src/app/app.ts:1320— NanobotTui.handleKey has cyclomatic complexity 130 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UpdateFlowProvider.UpdateFlowProvider (cyclomatic 128) webui/src/providers/UpdateFlowProvider.tsx:28— UpdateFlowProvider.UpdateFlowProvider has cyclomatic complexity 128 (threshold 15). To reduce it, separate the cases: extract each independent 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 (UpdateFlowProvider.UpdateFlowProvider::confirm) 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.
ContextGraphScene.ContextGraphScene (cyclomatic 125) webui/src/components/thread/ContextGraphScene.tsx:15— ContextGraphScene.ContextGraphScene has cyclomatic complexity 125 (threshold 15). Of this number, 29 points are the body's own statements and 96 belong to 28 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.
PaneWorkbench.PaneWorkbench (cyclomatic 117) webui/src/components/workbench/PaneWorkbench.tsx:191— PaneWorkbench.PaneWorkbench has cyclomatic complexity 117 (threshold 15). Most of this is not in the body itself: 14 of the 117 points are its own statements and the rest belongs to 31 function literals inside it that branch (lines 706, 298, 586, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RemoteConnectionsPage.RemoteConnectionsPage (cyclomatic 115) webui/src/components/remote/RemoteConnectionsPage.tsx:29— RemoteConnectionsPage.RemoteConnectionsPage has cyclomatic complexity 115 (threshold 15). To reduce it, separate the cases: extract each independent 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 (RemoteConnectionsPage.RemoteConnectionsPage::connect) 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.
NanobotTui.accept (cyclomatic 107) tui/src/app/app.ts:690— NanobotTui.accept has cyclomatic complexity 107 (threshold 15). Of this number, 105 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.
RemoteInstances.RemoteInstances (cyclomatic 107) webui/src/components/remote/RemoteInstances.tsx:17— RemoteInstances.RemoteInstances has cyclomatic complexity 107 (threshold 15). Of this number, 70 points are the body's own statements and 37 belong to 18 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModelControls.ModelIdPicker (cyclomatic 104) webui/src/components/settings/shared/ModelControls.tsx:187— ModelControls.ModelIdPicker has cyclomatic complexity 104 (threshold 15). Of this number, 75 points are the body's own statements and 29 belong to 12 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.
api.parseThreadProjectionEvent (cyclomatic 104) webui/src/lib/api.ts:322— api.parseThreadProjectionEvent has cyclomatic complexity 104 (threshold 15). Of this number, 93 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
QuickPairSetupView.QuickPairSetupView (cyclomatic 96) webui/src/components/remote/QuickPairSetupView.tsx:62— QuickPairSetupView.QuickPairSetupView has cyclomatic complexity 96 (threshold 15). Of this number, 89 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
parsing.consume_responses_events (cyclomatic 95) nanobot/providers/openai_responses/parsing.py:369— parsing.consume_responses_events 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.
RemoteInstances.action (cyclomatic 91) nanobot/webui/remote_instances.py:237— RemoteInstances.action has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WebUICommandRouter._dispatch_message_once (cyclomatic 88) nanobot/webui/inbound_commands.py:553— WebUICommandRouter._dispatch_message_once has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LinearPanelView.LinearPanelView (cyclomatic 86) nanobot/channels/linear/webui/LinearPanelView.tsx:67— LinearPanelView.LinearPanelView has cyclomatic complexity 86 (threshold 15). Of this number, 49 points are the body's own statements and 37 belong to 12 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.
ModelPresetBadge.ModelPresetBadge (cyclomatic 86) webui/src/components/thread/ModelPresetBadge.tsx:106— ModelPresetBadge.ModelPresetBadge has cyclomatic complexity 86 (threshold 15). Of this number, 39 points are the body's own statements and 47 belong to 21 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.
validation.decodeInboundEvent (cyclomatic 84) tui/src/client/validation.ts:137— validation.decodeInboundEvent has cyclomatic complexity 84 (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.
ThreadShell.ThreadShell (cyclomatic 83) webui/src/components/thread/ThreadShell.tsx:359— ThreadShell.ThreadShell has cyclomatic complexity 83 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 (ThreadShell.ThreadShell::composer) 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.
transcript._client_projection_event (cyclomatic 79) nanobot/webui/transcript.py:1469— transcript._client_projection_event has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SubagentTasks.SubagentTasksProvider (cyclomatic 79) webui/src/components/thread/SubagentTasks.tsx:56— SubagentTasks.SubagentTasksProvider has cyclomatic complexity 79 (threshold 15). Of this number, 25 points are the body's own statements and 54 belong to 15 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppsSettings.McpAppsCatalogRow (cyclomatic 77) webui/src/components/settings/system/AppsSettings.tsx:501— AppsSettings.McpAppsCatalogRow has cyclomatic complexity 77 (threshold 15). Of this number, 67 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NanobotClient.handleMessage (cyclomatic 77) webui/src/lib/nanobot-client.ts:903— NanobotClient.handleMessage has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ThreadTranscript.project (cyclomatic 75) webui/src/lib/thread-transcript.ts:367— ThreadTranscript.project has cyclomatic complexity 75 (threshold 15). Of this number, 69 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RuntimeConfigSettings.RuntimeConfigSettings (cyclomatic 72) webui/src/components/settings/system/RuntimeConfigSettings.tsx:174— RuntimeConfigSettings.RuntimeConfigSettings has cyclomatic complexity 72 (threshold 15). Most of this is not in the body itself: 6 of the 72 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 227, 201, 217, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SubagentTaskDock.TaskDock (cyclomatic 70) webui/src/components/thread/SubagentTaskDock.tsx:23— SubagentTaskDock.TaskDock has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 15 of the 70 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 122, a function literal at line 131, a function literal at line 171, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ThreadMessages.ThreadMessages (cyclomatic 66) webui/src/components/thread/ThreadMessages.tsx:83— ThreadMessages.ThreadMessages has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 15 of the 66 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 200, a function literal at line 117, renderPrelude, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
svg-image.diagramImageTemplate (cyclomatic 63) REDACTED:255— svg-image.diagramImageTemplate 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 3 function items inside it that branch (a function literal at line 275, text, a function literal at line 336). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProviderSettings.ProvidersSettings::renderProviderForm (cyclomatic 63) webui/src/components/settings/models/ProviderSettings.tsx:656— ProviderSettings.ProvidersSettings::renderProviderForm has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ProviderSettings.ProvidersSettings) 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.
AutomationChatBindingView.AutomationChatBindingView (cyclomatic 63) webui/src/components/settings/system/AutomationChatBindingView.tsx:37— AutomationChatBindingView.AutomationChatBindingView has cyclomatic complexity 63 (threshold 15). Of this number, 36 points are the body's own statements and 27 belong to 10 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentRunner._run_core (cyclomatic 62) nanobot/agent/runner.py:400— AgentRunner._run_core has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OpenAICompatProvider._build_kwargs (cyclomatic 60) REDACTED:837— OpenAICompatProvider._build_kwargs has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GrepTool._execute_sync (cyclomatic 57) nanobot/agent/tools/search.py:680— GrepTool._execute_sync has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClientRunLedger.applyObservation (cyclomatic 57) webui/src/lib/client-run-ledger.ts:230— ClientRunLedger.applyObservation has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelSetupPanel.ChannelSetupSurface (cyclomatic 53) webui/src/components/settings/channels/ChannelSetupPanel.tsx:163— ChannelSetupPanel.ChannelSetupSurface has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 12 of the 53 points are its own statements and the rest belongs to 19 function items inside it that branch (saveChannelDraft, saveCredentialSettings, checkCurrentSettings, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.DialogContent (cyclomatic 53) webui/src/components/ui/dialog.tsx:77— dialog.DialogContent has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 6 of the 53 points are its own statements and the rest belongs to 13 function items inside it that branch (finishDrag, a function literal at line 226, a function literal at line 152, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AgentLoop._run_agent_loop (cyclomatic 50) nanobot/agent/loop.py:1092— AgentLoop._run_agent_loop has cyclomatic complexity 50 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AutomationsSettings.AutomationsSettings (cyclomatic 50) webui/src/components/settings/system/AutomationsSettings.tsx:63— AutomationsSettings.AutomationsSettings has cyclomatic complexity 50 (threshold 15). Of this number, 31 points are the body's own statements and 19 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SandboxSettings.SandboxSettings (cyclomatic 50) webui/src/components/settings/system/SandboxSettings.tsx:20— SandboxSettings.SandboxSettings has cyclomatic complexity 50 (threshold 15). Of this number, 36 points are the body's own statements and 14 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditFileTool.execute (cyclomatic 49) nanobot/agent/tools/filesystem.py:1079— EditFileTool.execute has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AutomationsSettings.AutomationDetailPanel (cyclomatic 49) webui/src/components/settings/system/AutomationsSettings.tsx:469— AutomationsSettings.AutomationDetailPanel has cyclomatic complexity 49 (threshold 15). Of this number, 47 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FallbackProvider._try_candidates (cyclomatic 48) nanobot/providers/fallback_provider.py:489— FallbackProvider._try_candidates 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.
useSidebarHostBridge.useSidebarHostBridge (cyclomatic 48) REDACTED:7— useSidebarHostBridge.useSidebarHostBridge has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 4 of the 48 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 37, 96, 99, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useModelSettingsActions.useModelSettingsActions.saveModelSettings (cyclomatic 48) webui/src/components/settings/models/useModelSettingsActions.ts:169— useModelSettingsActions.useModelSettingsActions.saveModelSettings has cyclomatic complexity 48 (threshold 15). Of this number, 46 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.
transcript.build_webui_thread_response (cyclomatic 47) nanobot/webui/transcript.py:1863— transcript.build_webui_thread_response 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.
Config._match_provider (cyclomatic 45) nanobot/config/schema.py:578— Config._match_provider 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.
ChannelQrConnectFlowView.ChannelQrConnectFlowView (cyclomatic 45) webui/src/components/settings/channels/ChannelQrConnectFlowView.tsx:49— ChannelQrConnectFlowView.ChannelQrConnectFlowView has cyclomatic complexity 45 (threshold 15). Of this number, 40 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.
useSystemSettingsEffects.useSystemSettingsEffects (cyclomatic 45) webui/src/components/settings/system/useSystemSettingsEffects.ts:23— useSystemSettingsEffects.useSystemSettingsEffects 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 17 function literals inside it that branch (lines 98, 189, 135, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentActivityCluster.FoldedAgentActivity (cyclomatic 45) webui/src/components/thread/AgentActivityCluster.tsx:233— AgentActivityCluster.FoldedAgentActivity has cyclomatic complexity 45 (threshold 15). Of this number, 32 points are the body's own statements and 13 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.
ApplyPatchTool.execute (cyclomatic 44) nanobot/agent/tools/apply_patch.py:91— ApplyPatchTool.execute has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
webui.webui (cyclomatic 44) nanobot/cli/webui.py:68— webui.webui has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UsagePanel.render (cyclomatic 44) tui/src/views/usage-panel.ts:110— UsagePanel.render has cyclomatic complexity 44 (threshold 15). Of this number, 33 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VersionCheckRowView.VersionCheckRowView (cyclomatic 44) webui/src/components/settings/overview/VersionCheckRowView.tsx:20— VersionCheckRowView.VersionCheckRowView has cyclomatic complexity 44 (threshold 15). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AppsSettings.AppsCatalogSettings (cyclomatic 44) webui/src/components/settings/system/AppsSettings.tsx:104— AppsSettings.AppsCatalogSettings has cyclomatic complexity 44 (threshold 15). Of this number, 34 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.
McpManagementDialog.McpManagementDialog (cyclomatic 44) webui/src/components/settings/system/McpManagementDialog.tsx:43— McpManagementDialog.McpManagementDialog has cyclomatic complexity 44 (threshold 15). Of this number, 29 points are the body's own statements and 15 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ThreadMessages.ThreadDisplayUnit (cyclomatic 44) webui/src/components/thread/ThreadMessages.tsx:576— ThreadMessages.ThreadDisplayUnit has cyclomatic complexity 44 (threshold 15). Of this number, 31 points are the body's own statements and 13 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ResponsesWebSocketSession.request (cyclomatic 43) nanobot/providers/openai_responses/websocket.py:129— ResponsesWebSocketSession.request has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
text.outlineDiagramText (cyclomatic 43) tui/src/rendering/mermaid/text.ts:23— text.outlineDiagramText has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 14 of the 43 points are its own statements and the rest belongs to 9 function items inside it that branch (collect, style, declaration, …). 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.
SkillsMarketplace.SkillsMarketplace (cyclomatic 43) webui/src/components/settings/SkillsMarketplace.tsx:43— SkillsMarketplace.SkillsMarketplace has cyclomatic complexity 43 (threshold 15). Of this number, 21 points are the body's own statements and 22 belong to 17 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.
subagent-tasks.isSubagentTask (cyclomatic 43) webui/src/lib/subagent-tasks.ts:25— subagent-tasks.isSubagentTask has cyclomatic complexity 43 (threshold 15). Of this number, 40 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.
Session.get_history (cyclomatic 42) nanobot/session/manager.py:211— Session.get_history has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComposerUsagePopover.ComposerUsagePopover (cyclomatic 42) webui/src/components/thread/ComposerUsagePopover.tsx:25— ComposerUsagePopover.ComposerUsagePopover has cyclomatic complexity 42 (threshold 15). Of this number, 23 points are the body's own statements and 19 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
api.parseWebuiThreadPayload (cyclomatic 42) webui/src/lib/api.ts:421— api.parseWebuiThreadPayload has cyclomatic complexity 42 (threshold 15). Of this number, 28 points are the body's own statements and 14 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ThreadTranscript.describe (cyclomatic 42) webui/src/lib/thread-transcript.ts:313— ThreadTranscript.describe has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OpenAICodexProvider._call_codex (cyclomatic 41) nanobot/providers/openai_codex_provider.py:208— OpenAICodexProvider._call_codex has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
segmented-control.SegmentedControl (cyclomatic 41) webui/src/components/ui/segmented-control.tsx:50— segmented-control.SegmentedControl has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 8 of the 41 points are its own statements and the rest belongs to 6 function items inside it that branch (handleKeyDown, a function literal at line 165, a function literal at line 85, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Gallery.Gallery (cyclomatic 41) webui/src/dev/gallery/Gallery.tsx:40— Gallery.Gallery has cyclomatic complexity 41 (threshold 15). Of this number, 23 points are the body's own statements and 18 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NanobotTui.submit (cyclomatic 40) tui/src/app/app.ts:508— NanobotTui.submit has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PromptNavigator.PromptNavigator (cyclomatic 40) webui/src/components/thread/PromptNavigator.tsx:27— PromptNavigator.PromptNavigator 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 9 function literals inside it that branch (lines 45, 143, 128, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
onboard._configure_pydantic_model (cyclomatic 39) nanobot/cli/onboard.py:786— onboard._configure_pydantic_model 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.
update_worker.run_job (cyclomatic 39) REDACTED:713— update_worker.run_job 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.
settings_runtime.update_runtime_config (cyclomatic 39) nanobot/webui/settings_runtime.py:82— settings_runtime.update_runtime_config 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.
transcript._build_prompt_view (cyclomatic 39) nanobot/webui/transcript.py:2135— transcript._build_prompt_view 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.
FileReferenceChip.FileReferenceChip (cyclomatic 39) webui/src/components/FileReferenceChip.tsx:49— FileReferenceChip.FileReferenceChip has cyclomatic complexity 39 (threshold 15). Of this number, 35 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. This is NOT this file's highest cyclomatic complexity: FileReferenceChip.fileKindForPath (cyclomatic 55) 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.
MarkdownTextRenderer.MarkdownTextRenderer (cyclomatic 39) webui/src/components/MarkdownTextRenderer.tsx:525— MarkdownTextRenderer.MarkdownTextRenderer has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 6 of the 39 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 550, 537, 546, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MessageBubble.MessageBlockMenuActions (cyclomatic 39) webui/src/components/MessageBubble.tsx:151— MessageBubble.MessageBlockMenuActions 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.
ThreadComposer.ThreadComposer::onKeyDown (cyclomatic 39) webui/src/components/thread/ThreadComposer.tsx:1787— ThreadComposer.ThreadComposer::onKeyDown 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. This shape REPEATS in the file: one other method here (ThreadComposer.ThreadComposer) 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.
GatewayHTTPHandler._handle_webui_automation_action (cyclomatic 38) nanobot/webui/ws_http.py:1597— GatewayHTTPHandler._handle_webui_automation_action 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.
LinearPanel.LinearPanel (cyclomatic 38) nanobot/channels/linear/webui/LinearPanel.tsx:22— LinearPanel.LinearPanel has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 6 of the 38 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 160, saveSecret, disconnectWorkspace, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
api.fetchHistory (cyclomatic 38) tui/src/client/api.ts:181— api.fetchHistory 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.
SessionSearchDialog.SessionSearchDialog (cyclomatic 38) webui/src/components/SessionSearchDialog.tsx:37— SessionSearchDialog.SessionSearchDialog has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 10 of the 38 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 215, handleKeyDown, a function literal at line 109, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
QuickPairSetup.QuickPairSetup (cyclomatic 38) webui/src/components/remote/QuickPairSetup.tsx:12— QuickPairSetup.QuickPairSetup has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 7 of the 38 points are its own statements and the rest belongs to 10 function items inside it that branch (run, a function literal at line 79, 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.
ChannelSetupSurfaceView.ChannelSetupSurfaceView (cyclomatic 38) webui/src/components/settings/channels/ChannelSetupSurfaceView.tsx:51— ChannelSetupSurfaceView.ChannelSetupSurfaceView has cyclomatic complexity 38 (threshold 15). Of this number, 36 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
history.collect_legacy_history (cyclomatic 37) nanobot/webui/history.py:152— history.collect_legacy_history 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.
WebUIOutboundDelivery.send (cyclomatic 37) nanobot/webui/outbound_delivery.py:274— WebUIOutboundDelivery.send 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.
svg.resolveDiagramSvg (cyclomatic 37) tui/src/rendering/mermaid/svg.ts:22— svg.resolveDiagramSvg has cyclomatic complexity 37 (threshold 15). Of this number, 19 points are the body's own statements and 18 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PromptRail.PromptRail (cyclomatic 37) webui/src/components/thread/PromptRail.tsx:22— PromptRail.PromptRail has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 8 of the 37 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 150, a function literal at line 117, a function literal at line 41, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AgentLoop._dispatch_one (cyclomatic 36) nanobot/agent/loop.py:1520— AgentLoop._dispatch_one 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.
MessageTool.execute (cyclomatic 36) nanobot/agent/tools/message.py:141— MessageTool.execute 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.
OpenAICompatProvider.chat_stream (cyclomatic 36) REDACTED:1627— OpenAICompatProvider.chat_stream 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.
useHostSessions.useHostSessions (cyclomatic 36) webui/src/components/remote/useHostSessions.ts:21— useHostSessions.useHostSessions has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 2 of the 36 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 311, 295, 304, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SettingsPage.SettingsPage::renderSettingsSection (cyclomatic 36) webui/src/components/settings/SettingsPage.tsx:224— SettingsPage.SettingsPage::renderSettingsSection 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. This shape REPEATS in the file: one other method here (SettingsPage.SettingsPage) 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.
SkillsCatalogSettings.SkillDetailSheet (cyclomatic 36) webui/src/components/settings/SkillsCatalogSettings.tsx:279— SkillsCatalogSettings.SkillDetailSheet has cyclomatic complexity 36 (threshold 15). Of this number, 25 points are the body's own statements and 11 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BrowserNotificationSettings.BrowserNotificationSettings (cyclomatic 36) webui/src/components/settings/notifications/BrowserNotificationSettings.tsx:11— BrowserNotificationSettings.BrowserNotificationSettings has cyclomatic complexity 36 (threshold 15). Of this number, 29 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
inventory-plugin.componentInventory (cyclomatic 36) webui/src/dev/gallery/inventory-plugin.ts:29— inventory-plugin.componentInventory has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 2 of the 36 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 76, visit, recordImport, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
thread-event-projection.attachProjectedReasoning (cyclomatic 36) webui/src/lib/thread-event-projection.ts:621— thread-event-projection.attachProjectedReasoning 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AgentLoop._save_turn (cyclomatic 35) nanobot/agent/loop.py:2356— AgentLoop._save_turn 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.
WebSearchTool._effective_provider (cyclomatic 35) nanobot/agent/tools/web.py:332— WebSearchTool._effective_provider 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.
settings_system.coerce_channel_value (cyclomatic 35) nanobot/webui/settings_system.py:308— settings_system.coerce_channel_value 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.
SettingsPage.SettingsPage (cyclomatic 35) webui/src/components/settings/SettingsPage.tsx:80— SettingsPage.SettingsPage has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (SettingsPage.SettingsPage::renderSettingsSection) 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.
update_worker.main (cyclomatic 34) REDACTED:905— update_worker.main has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
settings_capabilities.update_image_generation_settings (cyclomatic 34) nanobot/webui/settings_capabilities.py:350— settings_capabilities.update_image_generation_settings 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.
settings_models.update_model_configuration (cyclomatic 34) nanobot/webui/settings_models.py:1367— settings_models.update_model_configuration has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
transcript._select_transcript_page (cyclomatic 34) nanobot/webui/transcript.py:411— transcript._select_transcript_page 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.
RemoteConnectionsPage.RemoteConnectionsPage::connect (cyclomatic 34) webui/src/components/remote/RemoteConnectionsPage.tsx:143— RemoteConnectionsPage.RemoteConnectionsPage::connect has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (RemoteConnectionsPage.RemoteConnectionsPage) 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.
useHostSessions.useHostSessions.readDirectory (cyclomatic 34) webui/src/components/remote/useHostSessions.ts:108— useHostSessions.useHostSessions.readDirectory has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 123, a function literal at line 142, 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.
ChannelInstancesPanelView.ChannelInstancesPanelView (cyclomatic 34) webui/src/components/settings/channels/ChannelInstancesPanelView.tsx:51— ChannelInstancesPanelView.ChannelInstancesPanelView has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 137, saveSelectedInstanceSettings, toggleInstance, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
image-viewport.ImageViewport (cyclomatic 34) webui/src/components/ui/image-viewport.tsx:30— image-viewport.ImageViewport has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 129, a function literal at line 75, 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.
OpenAICompatProvider._parse (cyclomatic 33) REDACTED:1373— OpenAICompatProvider._parse 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.
LatexParser.command (cyclomatic 33) REDACTED:652— LatexParser.command 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.
ChatList.ActivePaneRows (cyclomatic 33) webui/src/components/ChatList.tsx:1418— ChatList.ActivePaneRows 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 3 function literals inside it that branch (lines 1490, 1540, 1548). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
HostSwitcherView.HostMenuItems (cyclomatic 33) webui/src/components/remote/HostSwitcherView.tsx:24— HostSwitcherView.HostMenuItems 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 6 function items inside it that branch (a function literal at line 50, a function literal at line 40, a function literal at line 82, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WebSettings.WebSettings (cyclomatic 33) webui/src/components/settings/capabilities/WebSettings.tsx:77— WebSettings.WebSettings 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.
CredentialForm.CredentialForm (cyclomatic 33) webui/src/components/settings/channels/CredentialForm.tsx:81— CredentialForm.CredentialForm 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 2 function literals inside it that branch (lines 100, 169). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelsSettings.ModelsSettings::renderPresetEditor (cyclomatic 33) webui/src/components/settings/models/ModelsSettings.tsx:433— ModelsSettings.ModelsSettings::renderPresetEditor has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ModelsSettings.ModelsSettings) 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.
ModelsSettings.ModelsSettings (cyclomatic 33) webui/src/components/settings/models/ModelsSettings.tsx:202— ModelsSettings.ModelsSettings has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ModelsSettings.ModelsSettings::renderPresetEditor) 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.
ChannelsSettings.ChannelsSettings (cyclomatic 33) webui/src/components/settings/system/ChannelsSettings.tsx:20— ChannelsSettings.ChannelsSettings has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 15 of the 33 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 133, 59, 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.
thread-display-projection.projectWebuiThreadMessages (cyclomatic 33) webui/src/lib/thread-display-projection.ts:30— thread-display-projection.projectWebuiThreadMessages 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.
AgentLoop._build_turn (cyclomatic 32) nanobot/agent/loop.py:2081— AgentLoop._build_turn 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.
onboard._configure_quick_start_provider (cyclomatic 32) nanobot/cli/onboard.py:1567— onboard._configure_quick_start_provider 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.
WebUISettingsRouter.dispatch (cyclomatic 32) nanobot/webui/settings_routes.py:282— WebUISettingsRouter.dispatch 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.
App.readShellRoute (cyclomatic 32) webui/src/App.tsx:241— App.readShellRoute has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CodeBlock.CodeBlock (cyclomatic 32) webui/src/components/CodeBlock.tsx:130— CodeBlock.CodeBlock has cyclomatic complexity 32 (threshold 15). Of this number, 18 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.
Sidebar.Sidebar (cyclomatic 32) webui/src/components/Sidebar.tsx:117— Sidebar.Sidebar has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useHostSessions.useHostSessions.connect (cyclomatic 32) webui/src/components/remote/useHostSessions.ts:176— useHostSessions.useHostSessions.connect has cyclomatic complexity 32 (threshold 15). Of this number, 30 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.
ChannelQrConnectFlow.ChannelQrConnectFlow (cyclomatic 32) webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:24— ChannelQrConnectFlow.ChannelQrConnectFlow has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 90, a function literal at line 81, 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.
AutomationRunAtPicker.AutomationRunAtPicker (cyclomatic 32) webui/src/components/settings/system/AutomationRunAtPicker.tsx:46— AutomationRunAtPicker.AutomationRunAtPicker has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (onDayKeyDown, a function literal at line 157, navigate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
recovery.restore_runtime_checkpoint (cyclomatic 31) nanobot/session/recovery.py:323— recovery.restore_runtime_checkpoint 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.
update_uv.prepare_uv (cyclomatic 31) nanobot/update_uv.py:265— update_uv.prepare_uv has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LinearMemberAccessView.LinearMemberAccessView (cyclomatic 31) nanobot/channels/linear/webui/LinearMemberAccessView.tsx:27— LinearMemberAccessView.LinearMemberAccessView has cyclomatic complexity 31 (threshold 15). Of this number, 19 points are the body's own statements and 12 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.
LinearSecretField.LinearSecretField (cyclomatic 31) nanobot/channels/linear/webui/LinearSecretField.tsx:12— LinearSecretField.LinearSecretField has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 33, save, a function literal at line 98, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
MessageBubble.MessageBubble (cyclomatic 31) webui/src/components/MessageBubble.tsx:404— MessageBubble.MessageBubble 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.
HostSwitcherView.HostSwitcherView (cyclomatic 31) webui/src/components/remote/HostSwitcherView.tsx:104— HostSwitcherView.HostSwitcherView has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelCatalogRow.ChannelCatalogRow (cyclomatic 31) webui/src/components/settings/channels/ChannelCatalogRow.tsx:19— ChannelCatalogRow.ChannelCatalogRow has cyclomatic complexity 31 (threshold 15). Of this number, 26 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.
RuntimeSettings.RuntimeSettings (cyclomatic 31) webui/src/components/settings/system/RuntimeSettings.tsx:17— RuntimeSettings.RuntimeSettings has cyclomatic complexity 31 (threshold 15). Of this number, 28 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.
generic-tool-model.activityLabel (cyclomatic 31) webui/src/components/thread/activity/generic-tool-model.ts:209— generic-tool-model.activityLabel 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.
ssh-address.parseSSHAddress (cyclomatic 31) webui/src/lib/ssh-address.ts:9— ssh-address.parseSSHAddress 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.
imageEncode.worker.sniffImageMime (cyclomatic 31) webui/src/workers/imageEncode.worker.ts:66— imageEncode.worker.sniffImageMime has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
WebSearchTool._search_volcengine (cyclomatic 30) nanobot/agent/tools/web.py:942— WebSearchTool._search_volcengine 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.
data_access.data_access (cyclomatic 30) nanobot/data_access.py:296— data_access.data_access 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.
routing.resolve_provider_route (cyclomatic 30) nanobot/providers/routing.py:93— routing.resolve_provider_route has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
update_stop.stop_reviewed_gateways (cyclomatic 30) nanobot/update_stop.py:178— update_stop.stop_reviewed_gateways 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.
WebUICommandRouter.start_webui_request (cyclomatic 30) nanobot/webui/inbound_commands.py:908— WebUICommandRouter.start_webui_request 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.
RemoteInstances._connect (cyclomatic 30) nanobot/webui/remote_instances.py:472— RemoteInstances._connect has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
api.fetchSessions (cyclomatic 30) tui/src/client/api.ts:391— api.fetchSessions has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 415). 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.
NanobotTui.constructor (cyclomatic 30) tui/src/app/app.ts:232— NanobotTui.constructor has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body's own statements and 13 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsControls.RestartSettingsFooter (cyclomatic 30) webui/src/components/settings/shared/SettingsControls.tsx:245— SettingsControls.RestartSettingsFooter has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RuntimeConfigSettings.useRuntimeConfigSettings.save (cyclomatic 30) webui/src/components/settings/system/RuntimeConfigSettings.tsx:73— RuntimeConfigSettings.useRuntimeConfigSettings.save has cyclomatic complexity 30 (threshold 15). Of this number, 27 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.
channels.ChannelFormPreview (cyclomatic 30) webui/src/dev/gallery/channels.tsx:25— channels.ChannelFormPreview 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 11 function items inside it that branch (a function literal at line 46, validate, a function literal at line 102, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
api.hasValidProjectionMetadata (cyclomatic 30) webui/src/lib/api.ts:278— api.hasValidProjectionMetadata 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
nanobot-client.runObservation (cyclomatic 30) webui/src/lib/nanobot-client.ts:177— nanobot-client.runObservation 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.
ReadFileTool.execute (cyclomatic 29) nanobot/agent/tools/filesystem.py:389— ReadFileTool.execute 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.
ReadFileTool._read_text (cyclomatic 29) nanobot/agent/tools/filesystem.py:500— ReadFileTool._read_text 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.
LLMProvider._run_with_retry (cyclomatic 29) nanobot/providers/base.py:1585— LLMProvider._run_with_retry 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.
BedrockProvider._parse_stream_event (cyclomatic 29) nanobot/providers/bedrock_provider.py:549— BedrockProvider._parse_stream_event 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.
OpenAICompatProvider._build_responses_body (cyclomatic 29) REDACTED:1137— OpenAICompatProvider._build_responses_body 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.
WebUICommandRouter.dispatch (cyclomatic 29) nanobot/webui/inbound_commands.py:328— WebUICommandRouter.dispatch 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.
SystemSettingsHandler.handle (cyclomatic 29) nanobot/webui/settings_system.py:505— SystemSettingsHandler.handle has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MermaidBlock.MermaidBlock (cyclomatic 29) webui/src/components/markdown-diagrams/MermaidBlock.tsx:27— MermaidBlock.MermaidBlock has cyclomatic complexity 29 (threshold 15). Of this number, 16 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.
ThreadMotionCoordinator.flushGeometry (cyclomatic 29) webui/src/components/thread/thread-motion.ts:453— ThreadMotionCoordinator.flushGeometry 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.
useQueuedPrompt.normalizeQueuedPrompt (cyclomatic 29) webui/src/components/thread/useQueuedPrompt.ts:90— useQueuedPrompt.normalizeQueuedPrompt has cyclomatic complexity 29 (threshold 15). Of this number, 18 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.
thread-page-fragments.joinThreadFragments (cyclomatic 29) webui/src/lib/thread-page-fragments.ts:9— thread-page-fragments.joinThreadFragments has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 34, same, a function literal at line 17, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ExecTool._prepare_command (cyclomatic 28) nanobot/agent/tools/shell.py:349— ExecTool._prepare_command 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.
ExecTool._guard_command (cyclomatic 28) nanobot/agent/tools/shell.py:581— ExecTool._guard_command 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.
LLMUsageStore.usage_payload (cyclomatic 28) nanobot/llm_usage/store.py:403— LLMUsageStore.usage_payload 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.
AnthropicProvider.chat_stream (cyclomatic 28) REDACTED:767— AnthropicProvider.chat_stream 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.
factory._make_provider_core (cyclomatic 28) nanobot/providers/factory.py:55— factory._make_provider_core 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.
parsing._hosted_web_search_event (cyclomatic 28) nanobot/providers/openai_responses/parsing.py:89— parsing._hosted_web_search_event 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.
mcp_presets_api._mcp_server_config (cyclomatic 28) nanobot/webui/mcp_presets_api.py:1006— mcp_presets_api._mcp_server_config has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AttachmentTile.AttachmentTile (cyclomatic 28) webui/src/components/AttachmentTile.tsx:20— AttachmentTile.AttachmentTile 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.
ImageGallery.ImageGallery (cyclomatic 28) webui/src/components/ImageGallery.tsx:11— ImageGallery.ImageGallery 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 8 function literals inside it that branch (lines 68, 57, 23, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ContextInspector.ContextInspector::content (cyclomatic 28) webui/src/components/thread/ContextInspector.tsx:64— ContextInspector.ContextInspector::content has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
useAttachedImages.useAttachedImages.enqueue (cyclomatic 28) webui/src/hooks/useAttachedImages.ts:274— useAttachedImages.useAttachedImages.enqueue has cyclomatic complexity 28 (threshold 15). Of this number, 20 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExecTool._extract_posix_paths_from_token (cyclomatic 27) nanobot/agent/tools/shell.py:812— ExecTool._extract_posix_paths_from_token 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.
XAIGrokProvider._call_xai (cyclomatic 27) nanobot/providers/xai_grok_provider.py:101— XAIGrokProvider._call_xai 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.
settings_capabilities.update_web_search_settings (cyclomatic 27) nanobot/webui/settings_capabilities.py:268— settings_capabilities.update_web_search_settings 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.
settings_models.provider_models_payload (cyclomatic 27) nanobot/webui/settings_models.py:644— settings_models.provider_models_payload 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.
transcript.build_session_thread_response (cyclomatic 27) nanobot/webui/transcript.py:1792— transcript.build_session_thread_response 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.
api.fetchMentionCandidates (cyclomatic 27) tui/src/client/api.ts:450— api.fetchMentionCandidates has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
App.App (cyclomatic 27) webui/src/App.tsx:606— App.App 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 11 function items inside it that branch (a function literal at line 652, handleNativeEngineRestart, a function literal at line 615, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AppsSettings.McpCustomServerPanel (cyclomatic 27) webui/src/components/settings/system/AppsSettings.tsx:1003— AppsSettings.McpCustomServerPanel 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.
AutomationsSettings.formatCronScheduleSummary (cyclomatic 27) webui/src/components/settings/system/AutomationsSettings.tsx:1159— AutomationsSettings.formatCronScheduleSummary 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.
usePromptHistory.usePromptHistory (cyclomatic 27) webui/src/hooks/usePromptHistory.ts:51— usePromptHistory.usePromptHistory has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 232, 94, 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.
AgentLoop._process_message (cyclomatic 26) nanobot/agent/loop.py:1736— AgentLoop._process_message 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.
MemoryArchiver.archive (cyclomatic 26) nanobot/agent/memory.py:783— MemoryArchiver.archive 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.
WebSearchTool._search_deepseek (cyclomatic 26) nanobot/agent/tools/web.py:815— WebSearchTool._search_deepseek 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.
converters.convert_tool_output (cyclomatic 26) nanobot/providers/openai_responses/converters.py:101— converters.convert_tool_output 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.
settings_capabilities.update_transcription_settings (cyclomatic 26) nanobot/webui/settings_capabilities.py:470— settings_capabilities.update_transcription_settings 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.
settings_models.update_provider_settings (cyclomatic 26) nanobot/webui/settings_models.py:1661— settings_models.update_provider_settings 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.
QQConnectFlowView.QQConnectFlowView (cyclomatic 26) nanobot/channels/qq/webui/QQConnectFlowView.tsx:45— QQConnectFlowView.QQConnectFlowView has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiffViewer.render (cyclomatic 26) tui/src/views/diff-viewer.ts:251— DiffViewer.render has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiagramViewer.paint (cyclomatic 26) tui/src/rendering/mermaid/viewer.ts:186— DiagramViewer.paint has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 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.
ImageGenerationSettings.ImageGenerationSettings (cyclomatic 26) webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:49— ImageGenerationSettings.ImageGenerationSettings has cyclomatic complexity 26 (threshold 15). Of this number, 22 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.
useModelPresetDrag.useModelPresetDrag (cyclomatic 26) webui/src/components/settings/models/useModelPresetDrag.ts:14— useModelPresetDrag.useModelPresetDrag 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 7 function literals inside it that branch (lines 51, 121, 86, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ThreadShell.ThreadShell::composer (cyclomatic 26) webui/src/components/thread/ThreadShell.tsx:1257— ThreadShell.ThreadShell::composer 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: one other method here (ThreadShell.ThreadShell) 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.
WorkspaceControls.WorkspaceAccessMenu (cyclomatic 26) webui/src/components/thread/WorkspaceControls.tsx:692— WorkspaceControls.WorkspaceAccessMenu 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 9 function literals inside it that branch (lines 775, 721, 719, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ThinkingReasoningShell.ThinkingReasoningShell (cyclomatic 26) webui/src/components/thread/activity/ThinkingReasoningShell.tsx:19— ThinkingReasoningShell.ThinkingReasoningShell 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.
exec-session-model.describeExecSession (cyclomatic 26) webui/src/components/thread/activity/exec-session-model.ts:146— exec-session-model.describeExecSession 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.
useNanobotStream.useNanobotStream.send (cyclomatic 26) webui/src/hooks/useNanobotStream.ts:958— useNanobotStream.useNanobotStream.send has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 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.
ClientRunLedger.applyCommand (cyclomatic 26) webui/src/lib/client-run-ledger.ts:159— ClientRunLedger.applyCommand has cyclomatic complexity 26 (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.
network.migrate_legacy_proxy_config (cyclomatic 25) nanobot/config/network.py:78— network.migrate_legacy_proxy_config 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.
transcript._history_prompt_summaries (cyclomatic 25) nanobot/webui/transcript.py:2080— transcript._history_prompt_summaries 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.
NanobotClient.handleMessage (cyclomatic 25) tui/src/client/nanobot-client.ts:308— NanobotClient.handleMessage 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.
DiagramViewer.handleKey (cyclomatic 25) tui/src/rendering/mermaid/viewer.ts:102— DiagramViewer.handleKey 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.
FileActions.FileActions (cyclomatic 25) webui/src/components/FileActions.tsx:26— FileActions.FileActions 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 9 function items inside it that branch (a function literal at line 59, a function literal at line 53, copy, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
svg-image.style (cyclomatic 25) REDACTED:178— svg-image.style 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.
TokenUsageCard.TokenUsageCard (cyclomatic 25) webui/src/components/settings/TokenUsageCard.tsx:51— TokenUsageCard.TokenUsageCard has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 140, 160, 153, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TokenUsageModelTrend.TokenUsageModelTrend (cyclomatic 25) webui/src/components/settings/TokenUsageModelTrend.tsx:13— TokenUsageModelTrend.TokenUsageModelTrend 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 9 function items inside it that branch (a function literal at line 60, a function literal at line 134, spoken, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ChannelValidationProgress.ChannelValidationProgress (cyclomatic 25) webui/src/components/settings/channels/ChannelValidationProgress.tsx:69— ChannelValidationProgress.ChannelValidationProgress has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body's own statements and 11 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.
useModelSettingsActions.useModelSettingsActions.saveProvider (cyclomatic 25) webui/src/components/settings/models/useModelSettingsActions.ts:436— useModelSettingsActions.useModelSettingsActions.saveProvider 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.
McpManagementDialog.ConnectionPanel (cyclomatic 25) webui/src/components/settings/system/McpManagementDialog.tsx:535— McpManagementDialog.ConnectionPanel has cyclomatic complexity 25 (threshold 15). Of this number, 22 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.
useSettingsController.useSettingsController (cyclomatic 25) webui/src/components/settings/useSettingsController.ts:75— useSettingsController.useSettingsController has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 185, 208, 179, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AssistantSelectionAction.AssistantSelectionAction (cyclomatic 25) webui/src/components/thread/AssistantSelectionAction.tsx:44— AssistantSelectionAction.AssistantSelectionAction has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 81, 53, 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.
SessionInfoPopoverView.SessionInfoPopoverView (cyclomatic 25) webui/src/components/thread/SessionInfoPopoverView.tsx:53— SessionInfoPopoverView.SessionInfoPopoverView has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 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.
api.fetchPromptIndex (cyclomatic 25) webui/src/lib/api.ts:543— api.fetchPromptIndex has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AgentLoop._restore_turn (cyclomatic 24) nanobot/agent/loop.py:1950— AgentLoop._restore_turn 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.
_MCPWrapperBase._request_with_recovery (cyclomatic 24) nanobot/agent/tools/mcp.py:574— _MCPWrapperBase._request_with_recovery 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.
jsonl_migration.read_jsonl (cyclomatic 24) nanobot/session/jsonl_migration.py:85— jsonl_migration.read_jsonl 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.
update_fallback.supervise (cyclomatic 24) nanobot/update_fallback.py:284— update_fallback.supervise 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.
update_manager.read_manager_policy (cyclomatic 24) nanobot/update_manager.py:113— update_manager.read_manager_policy 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.
pty_smoke.smoke (cyclomatic 24) tui/scripts/pty_smoke.py:77— pty_smoke.smoke 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.
MermaidBlock.sync (cyclomatic 24) tui/src/rendering/mermaid/block.ts:132— MermaidBlock.sync has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 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.
CliAppMentionText.splitCapabilityMentionSegments (cyclomatic 24) webui/src/components/CliAppMentionText.tsx:44— CliAppMentionText.splitCapabilityMentionSegments 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.
ProviderSettings.ProviderOAuthLoginDialog (cyclomatic 24) webui/src/components/settings/models/ProviderSettings.tsx:167— ProviderSettings.ProviderOAuthLoginDialog has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProviderSettings.ProvidersSettings (cyclomatic 24) webui/src/components/settings/models/ProviderSettings.tsx:531— ProviderSettings.ProvidersSettings has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ProviderSettings.ProvidersSettings::renderProviderForm) 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.
ReadingSettings.ReadingSettings (cyclomatic 24) webui/src/components/settings/overview/ReadingSettings.tsx:12— ReadingSettings.ReadingSettings has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (commitDraft, a function literal at line 94, 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.
ThreadMessages.MessageBlockMenu (cyclomatic 24) webui/src/components/thread/ThreadMessages.tsx:427— ThreadMessages.MessageBlockMenu has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 443, 542, 554, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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: ThreadMessages.threadDisplayUnitPropsEqual (cyclomatic 33) 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.
ThreadMessages.completedMessageBlocks (cyclomatic 24) webui/src/components/thread/ThreadMessages.tsx:1055— ThreadMessages.completedMessageBlocks has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (flushGroup, a function literal at line 1065, a function literal at line 1083, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: ThreadMessages.threadDisplayUnitPropsEqual (cyclomatic 33) 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.
ActivityStep.ActivityStep (cyclomatic 24) webui/src/components/thread/activity/ActivityStep.tsx:31— ActivityStep.ActivityStep has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
diff-selection.selectedDiffRows (cyclomatic 24) webui/src/components/thread/activity/diff-selection.ts:4— diff-selection.selectedDiffRows 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.
web-url.isPrivateHostname (cyclomatic 24) webui/src/components/thread/activity/web-url.ts:27— web-url.isPrivateHostname 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.
model-preset.toModelBadgeInfo (cyclomatic 24) webui/src/components/thread/model-preset.ts:38— model-preset.toModelBadgeInfo 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.
ansi.applySgrParams (cyclomatic 24) webui/src/lib/ansi.ts:144— ansi.applySgrParams 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.
TurnDelivery._publish_event (cyclomatic 23) nanobot/agent/turn_delivery.py:467— TurnDelivery._publish_event 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.
OpenAICompatProvider._sanitize_messages (cyclomatic 23) REDACTED:631— OpenAICompatProvider._sanitize_messages 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.
quick_validate.validate_skill (cyclomatic 23) nanobot/skills/skill-creator/scripts/quick_validate.py:128— quick_validate.validate_skill 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.
update_guidance.update_guide (cyclomatic 23) nanobot/update_guidance.py:53— update_guidance.update_guide 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.
update_restart.run_restarts (cyclomatic 23) nanobot/update_restart.py:160— update_restart.run_restarts 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.
WorkerSpec.read (cyclomatic 23) REDACTED:275— WorkerSpec.read 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.
helpers.split_message (cyclomatic 23) nanobot/utils/helpers.py:594— helpers.split_message 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.
history.fact_from_record (cyclomatic 23) nanobot/webui/history.py:48— history.fact_from_record 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.
RecoveryCoordinator._recover_session (cyclomatic 23) nanobot/webui/recovery.py:257— RecoveryCoordinator._recover_session 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.
NanobotClient.open (cyclomatic 23) tui/src/client/nanobot-client.ts:67— NanobotClient.open has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
latex.mathSpanAt (cyclomatic 23) REDACTED:382— latex.mathSpanAt 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.
DiagramJobs.observe (cyclomatic 23) tui/src/rendering/mermaid/jobs.ts:123— DiagramJobs.observe has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 126). 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.
FilePreviewPanelView.FilePreviewPanelView (cyclomatic 23) webui/src/components/FilePreviewPanelView.tsx:19— FilePreviewPanelView.FilePreviewPanelView has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PairingCodePopup.PairingCodePopup (cyclomatic 23) webui/src/components/pairing/PairingCodePopup.tsx:13— PairingCodePopup.PairingCodePopup has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SSHHostPickerView.SSHHostPickerView (cyclomatic 23) webui/src/components/remote/SSHHostPickerView.tsx:23— SSHHostPickerView.SSHHostPickerView has cyclomatic complexity 23 (threshold 15). Of this number, 17 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.
SSHHostPicker.SSHHostPicker (cyclomatic 23) webui/src/components/remote/SSHHostPicker.tsx:12— SSHHostPicker.SSHHostPicker 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 4 function literals inside it that branch (lines 21, 46, 27, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AutomationCalendar.AutomationCalendar (cyclomatic 23) webui/src/components/settings/system/AutomationCalendar.tsx:231— AutomationCalendar.AutomationCalendar has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 287, a function literal at line 265, a function literal at line 378, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
GoalIsland.GoalIsland (cyclomatic 23) webui/src/components/thread/GoalIsland.tsx:12— GoalIsland.GoalIsland has cyclomatic complexity 23 (threshold 15). Of this number, 17 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.
trace-activity-model.describeTraceLine (cyclomatic 23) webui/src/components/thread/activity/trace-activity-model.ts:18— trace-activity-model.describeTraceLine 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.
combobox.useComboboxNavigation (cyclomatic 23) webui/src/components/ui/combobox.tsx:22— combobox.useComboboxNavigation has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
thread-transcript.matchUnits (cyclomatic 23) webui/src/lib/thread-transcript.ts:158— thread-transcript.matchUnits 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.
ExecTool._resolve_shell (cyclomatic 22) nanobot/agent/tools/shell.py:488— ExecTool._resolve_shell 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.
onboard._validate_field_constraint (cyclomatic 22) nanobot/cli/onboard.py:305— onboard._validate_field_constraint 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.
onboard._configure_model_presets (cyclomatic 22) nanobot/cli/onboard.py:943— onboard._configure_model_presets 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.
optional_features.with_channel_runtime_status (cyclomatic 22) nanobot/optional_features.py:552— optional_features.with_channel_runtime_status 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.
github_copilot_provider.login_github_copilot (cyclomatic 22) nanobot/providers/github_copilot_provider.py:80— github_copilot_provider.login_github_copilot 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.
parsing.parse_response_output (cyclomatic 22) nanobot/providers/openai_responses/parsing.py:608— parsing.parse_response_output 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.
SessionState._apply_turn (cyclomatic 22) nanobot/session/state.py:527— SessionState._apply_turn has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
update_worker._verification_child (cyclomatic 22) REDACTED:625— update_worker._verification_child 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.
helpers._estimate_prompt_tokens_with_source (cyclomatic 22) nanobot/utils/helpers.py:698— helpers._estimate_prompt_tokens_with_source 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.
mcp_presets_api.mcp_presets_settings_action (cyclomatic 22) nanobot/webui/mcp_presets_api.py:1301— mcp_presets_api.mcp_presets_settings_action 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.
settings_models._model_metadata_payload (cyclomatic 22) nanobot/webui/settings_models.py:537— settings_models._model_metadata_payload 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.
GatewayHTTPHandler._handle_webui_automation_result (cyclomatic 22) nanobot/webui/ws_http.py:1555— GatewayHTTPHandler._handle_webui_automation_result 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.
connection.sanitizeConnectionFailure (cyclomatic 22) tui/src/client/connection.ts:100— connection.sanitizeConnectionFailure has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to one function item inside it that branches (collect). 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.
svg-image.typography (cyclomatic 22) REDACTED:116— svg-image.typography 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.
ModelAPIControl.ModelAPIControl (cyclomatic 22) webui/src/components/settings/models/ModelAPIControl.tsx:12— ModelAPIControl.ModelAPIControl has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AutomationRunDialogView.AutomationRunDialogView (cyclomatic 22) webui/src/components/settings/system/AutomationRunDialogView.tsx:16— AutomationRunDialogView.AutomationRunDialogView 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.
generic-tool-model.activityDetail (cyclomatic 22) webui/src/components/thread/activity/generic-tool-model.ts:301— generic-tool-model.activityDetail has cyclomatic complexity 22 (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.
useSandboxNotice.useSandboxNotice (cyclomatic 22) webui/src/components/thread/useSandboxNotice.ts:18— useSandboxNotice.useSandboxNotice 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 3 function literals inside it that branch (lines 29, 45, 26). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
usePromptHistory.usePromptHistory.read (cyclomatic 22) webui/src/hooks/usePromptHistory.ts:159— usePromptHistory.usePromptHistory.read has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NanobotClient.sendMessage (cyclomatic 22) webui/src/lib/nanobot-client.ts:794— NanobotClient.sendMessage 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.
FindFilesTool._execute_sync (cyclomatic 21) nanobot/agent/tools/search.py:431— FindFilesTool._execute_sync has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExecTool._split_shell_segments (cyclomatic 21) nanobot/agent/tools/shell.py:693— ExecTool._split_shell_segments 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.
ShellOutputFilter.feed (cyclomatic 21) nanobot/agent/tools/shell_output.py:15— ShellOutputFilter.feed 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.
TurnDelivery.complete (cyclomatic 21) nanobot/agent/turn_delivery.py:353— TurnDelivery.complete 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.
update.update (cyclomatic 21) nanobot/cli/update.py:9— update.update 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.
optional_features.optional_features_payload (cyclomatic 21) nanobot/optional_features.py:441— optional_features.optional_features_payload 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.
AnthropicProvider._build_kwargs (cyclomatic 21) REDACTED:576— AnthropicProvider._build_kwargs has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LLMProvider._sanitize_empty_content (cyclomatic 21) nanobot/providers/base.py:631— LLMProvider._sanitize_empty_content 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.
LLMProvider._enforce_role_alternation (cyclomatic 21) nanobot/providers/base.py:941— LLMProvider._enforce_role_alternation 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.
FallbackProvider._should_fallback (cyclomatic 21) nanobot/providers/fallback_provider.py:757— FallbackProvider._should_fallback has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
context_observer._restore (cyclomatic 21) nanobot/webui/context_observer.py:89— context_observer._restore 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.
ModelSettingsHandler.handle (cyclomatic 21) nanobot/webui/settings_models.py:1992— ModelSettingsHandler.handle has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
settings_models.oauth_provider_status (cyclomatic 21) nanobot/webui/settings_models.py:208— settings_models.oauth_provider_status 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.
skills_marketplace._skillhub_skill (cyclomatic 21) nanobot/webui/skills_marketplace.py:820— skills_marketplace._skillhub_skill has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ssh_process.ssh_error (cyclomatic 21) nanobot/webui/ssh_process.py:10— ssh_process.ssh_error has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GatewayHTTPHandler._dispatch_misc_routes (cyclomatic 21) nanobot/webui/ws_http.py:1748— GatewayHTTPHandler._dispatch_misc_routes has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NanobotTui.handlePaste (cyclomatic 21) tui/src/app/app.ts:1984— NanobotTui.handlePaste 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 3 function literals inside it that branch (lines 1997, 2012, 2008). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SkillsMarketplace.MarketplaceSkillRow (cyclomatic 21) webui/src/components/settings/SkillsMarketplace.tsx:488— SkillsMarketplace.MarketplaceSkillRow 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.
ReasoningEffortPicker.ReasoningEffortPicker (cyclomatic 21) webui/src/components/settings/models/ReasoningEffortPicker.tsx:14— ReasoningEffortPicker.ReasoningEffortPicker 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 5 function literals inside it that branch (lines 59, 84, 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.
ShellRuntimeControl.ShellRuntimeControl (cyclomatic 21) webui/src/components/settings/system/ShellRuntimeControl.tsx:18— ShellRuntimeControl.ShellRuntimeControl has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
thread-event-projection.findStreamingAssistantIndex (cyclomatic 21) webui/src/lib/thread-event-projection.ts:92— thread-event-projection.findStreamingAssistantIndex 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.
thread-event-projection.answerStreamIndex (cyclomatic 21) webui/src/lib/thread-event-projection.ts:546— thread-event-projection.answerStreamIndex has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
model-request.composerUsageSnapshots (cyclomatic 21) webui/src/lib/model-request.ts:27— model-request.composerUsageSnapshots 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 3 function literals inside it that branch (lines 40, 33, 48). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentLoop._prepare_injected_input (cyclomatic 20) nanobot/agent/loop.py:1001— AgentLoop._prepare_injected_input 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.
AgentLoop.process_direct (cyclomatic 20) nanobot/agent/loop.py:2507— AgentLoop.process_direct 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.
MCPProvider.reload (cyclomatic 20) nanobot/agent/tools/mcp.py:1494— MCPProvider.reload 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.
onboard._handle_fallback_models_field (cyclomatic 20) nanobot/cli/onboard.py:688— onboard._handle_fallback_models_field 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.
remote.pair (cyclomatic 20) REDACTED:163— remote.pair 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.
AssemblyAITranscriptionProvider.transcribe (cyclomatic 20) nanobot/providers/transcription.py:464— AssemblyAITranscriptionProvider.transcribe 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.
xai_grok_provider._parse_xai_grok_models (cyclomatic 20) nanobot/providers/xai_grok_provider.py:683— xai_grok_provider._parse_xai_grok_models 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.
SqliteSessionStore.append_history (cyclomatic 20) nanobot/session/sqlite_store.py:588— SqliteSessionStore.append_history 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.
GitStore.summarize_working_tree (cyclomatic 20) nanobot/utils/gitstore.py:287— GitStore.summarize_working_tree has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
automation_results.cron_run_response (cyclomatic 20) nanobot/webui/automation_results.py:25— automation_results.cron_run_response 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.
McpOAuthManager._payload (cyclomatic 20) nanobot/webui/mcp_oauth_api.py:404— McpOAuthManager._payload 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.
settings_models.update_agent_model_settings (cyclomatic 20) nanobot/webui/settings_models.py:1211— settings_models.update_agent_model_settings 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.
transcript._session_user_event (cyclomatic 20) nanobot/webui/transcript.py:825— transcript._session_user_event 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.
GatewayHTTPHandler._handle_webui_thread_get (cyclomatic 20) nanobot/webui/ws_http.py:1253— GatewayHTTPHandler._handle_webui_thread_get 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.
ProviderIcon.ProviderIcon (cyclomatic 20) webui/src/components/settings/shared/ProviderIcon.tsx:7— ProviderIcon.ProviderIcon 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.
AutomationsSettings.AutomationEditDialog (cyclomatic 20) webui/src/components/settings/system/AutomationsSettings.tsx:690— AutomationsSettings.AutomationEditDialog has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
graph-presentation.createGraphPresentation.advance (cyclomatic 20) webui/src/components/thread/graph-presentation.ts:46— graph-presentation.createGraphPresentation.advance has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useNanobotStream.useNanobotStream.applyPendingStreamEvents (cyclomatic 20) webui/src/hooks/useNanobotStream.ts:313— useNanobotStream.useNanobotStream.applyPendingStreamEvents 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.
useReconnectRuns.useReconnectRuns (cyclomatic 20) webui/src/hooks/useReconnectRuns.ts:11— useReconnectRuns.useReconnectRuns has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 27, 54, 14). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
thread-event-projection.projectToolActivity (cyclomatic 20) webui/src/lib/thread-event-projection.ts:747— thread-event-projection.projectToolActivity 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.
UpdateFlowProvider.UpdateFlowProvider::confirm (cyclomatic 20) webui/src/providers/UpdateFlowProvider.tsx:207— UpdateFlowProvider.UpdateFlowProvider::confirm 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 (UpdateFlowProvider.UpdateFlowProvider) 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.
execution._execute_tool_call_inner (cyclomatic 19) nanobot/agent/tools/execution.py:136— execution._execute_tool_call_inner 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.
ListDirTool.execute (cyclomatic 19) nanobot/agent/tools/filesystem.py:1306— ListDirTool.execute 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.
CliAppManager.uninstall (cyclomatic 19) nanobot/apps/cli/service.py:1253— CliAppManager.uninstall 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.
terminal._maybe_print_interactive_progress (cyclomatic 19) nanobot/cli/terminal.py:351— terminal._maybe_print_interactive_progress 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.
UpdateGoalTool.execute (cyclomatic 19) nanobot/goal/tools.py:290— UpdateGoalTool.execute 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.
AnthropicProvider._handle_error (cyclomatic 19) REDACTED:135— AnthropicProvider._handle_error 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.
update_backup.ensure_backup (cyclomatic 19) nanobot/update_backup.py:144— update_backup.ensure_backup 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.
update_profiles._observe (cyclomatic 19) nanobot/update_profiles.py:124— update_profiles._observe 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.
helpers.estimate_message_tokens (cyclomatic 19) nanobot/utils/helpers.py:759— helpers.estimate_message_tokens 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.
mcp_presets_api.mcp_presets_test_action (cyclomatic 19) nanobot/webui/mcp_presets_api.py:739— mcp_presets_api.mcp_presets_test_action 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.
api.fetchSessionUsage (cyclomatic 19) tui/src/client/api.ts:140— api.fetchSessionUsage 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.
NanobotTui.handleComposerContentChange (cyclomatic 19) tui/src/app/app.ts:1861— NanobotTui.handleComposerContentChange 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.
MarkdownTextRenderer.inlineLinkPreviewFromListItem (cyclomatic 19) webui/src/components/MarkdownTextRenderer.tsx:400— MarkdownTextRenderer.inlineLinkPreviewFromListItem 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.
StartupSkeleton.readStartupLayout (cyclomatic 19) webui/src/components/StartupSkeleton.tsx:6— StartupSkeleton.readStartupLayout 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.
Task.decode (cyclomatic 19) webui/src/components/markdown-diagrams/runtime.ts:224— Task.decode has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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.
ChannelPairing.ChannelPairing (cyclomatic 19) webui/src/components/pairing/ChannelPairing.tsx:13— ChannelPairing.ChannelPairing 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 35, 78, 43, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SettingsSidebar.SettingsSidebar (cyclomatic 19) webui/src/components/settings/SettingsSidebar.tsx:63— SettingsSidebar.SettingsSidebar has cyclomatic complexity 19 (threshold 15). Of this number, 16 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.
useCapabilitySettingsActions.useCapabilitySettingsActions.saveWebSearch (cyclomatic 19) webui/src/components/settings/capabilities/useCapabilitySettingsActions.ts:146— useCapabilitySettingsActions.useCapabilitySettingsActions.saveWebSearch 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.
CatalogSkeleton.CatalogSkeleton (cyclomatic 19) webui/src/components/settings/shared/CatalogSkeleton.tsx:4— CatalogSkeleton.CatalogSkeleton 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 28). 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.
AutomationCalendar.CalendarEntryRow (cyclomatic 19) webui/src/components/settings/system/AutomationCalendar.tsx:109— AutomationCalendar.CalendarEntryRow 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.
RecoveryNotice.RecoveryNotice (cyclomatic 19) webui/src/components/thread/RecoveryNotice.tsx:20— RecoveryNotice.RecoveryNotice has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 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.
activity-timeline.projectOrderedTurn (cyclomatic 19) webui/src/lib/activity-timeline.ts:144— activity-timeline.projectOrderedTurn has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
context-graph.isContextGraph (cyclomatic 19) webui/src/lib/context-graph.ts:3— context-graph.isContextGraph has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 7, 15). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
remark-tex-math.tokenizeMathFlow (cyclomatic 19) webui/src/lib/remark-tex-math.ts:301— remark-tex-math.tokenizeMathFlow 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 7 function items inside it that branch (content, contentStart, afterOpen, …). 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.
ContextGovernor._merge_adjacent_user_messages_for_model (cyclomatic 18) nanobot/agent/context_governance.py:331— ContextGovernor._merge_adjacent_user_messages_for_model has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mcp_oauth._stored_server (cyclomatic 18) nanobot/agent/tools/mcp_oauth.py:117— mcp_oauth._stored_server 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.
WebSearchTool._search_olostep (cyclomatic 18) nanobot/agent/tools/web.py:440— WebSearchTool._search_olostep 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.
loader._resolve_in_place (cyclomatic 18) nanobot/config/loader.py:234— loader._resolve_in_place 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.
BedrockProvider._content_blocks (cyclomatic 18) nanobot/providers/bedrock_provider.py:141— BedrockProvider._content_blocks 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.
OpenRouterImageGenerationClient.generate (cyclomatic 18) nanobot/providers/image_generation.py:346— OpenRouterImageGenerationClient.generate 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.
openai_codex_provider._codex_error_response (cyclomatic 18) nanobot/providers/openai_codex_provider.py:679— openai_codex_provider._codex_error_response 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.
_ChatStreamAccumulator.add (cyclomatic 18) REDACTED:1835— _ChatStreamAccumulator.add 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.
xai_grok_provider._xai_hosted_tool_event (cyclomatic 18) nanobot/providers/xai_grok_provider.py:442— xai_grok_provider._xai_hosted_tool_event 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.
ReleaseFeed.stable (cyclomatic 18) nanobot/release_feed.py:211— ReleaseFeed.stable 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.
network.resolve_url_target (cyclomatic 18) nanobot/security/network.py:76— network.resolve_url_target 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.
SqliteSessionStore.save (cyclomatic 18) nanobot/session/sqlite_store.py:393— SqliteSessionStore.save has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mcp_presets_api.mcp_presets_action (cyclomatic 18) nanobot/webui/mcp_presets_api.py:1195— mcp_presets_api.mcp_presets_action 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.
RemoteInstances._check (cyclomatic 18) nanobot/webui/remote_instances.py:193— RemoteInstances._check 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.
settings_models.create_model_configuration (cyclomatic 18) nanobot/webui/settings_models.py:1298— settings_models.create_model_configuration 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.
GatewayHTTPHandler._dispatch_remote_instances (cyclomatic 18) nanobot/webui/ws_http.py:677— GatewayHTTPHandler._dispatch_remote_instances 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.
conpty_smoke.smoke (cyclomatic 18) tui/scripts/conpty_smoke.py:55— conpty_smoke.smoke 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.
LinearAvatar.LinearAvatar (cyclomatic 18) nanobot/channels/linear/webui/LinearAvatar.tsx:7— LinearAvatar.LinearAvatar has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tool-renderers.toolLabel (cyclomatic 18) tui/src/rendering/tool-renderers.ts:38— tool-renderers.toolLabel 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.
footer-hints.hintsFor (cyclomatic 18) tui/src/views/footer-hints.ts:67— footer-hints.hintsFor 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.
ImageLightbox.ImageLightbox (cyclomatic 18) webui/src/components/ImageLightbox.tsx:30— ImageLightbox.ImageLightbox has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 53, 43, 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.
MessageBubble.mergeMcpMentionPresets (cyclomatic 18) webui/src/components/MessageBubble.tsx:588— MessageBubble.mergeMcpMentionPresets 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.
AgentActivityCluster.ActivityTraceTimeline (cyclomatic 18) webui/src/components/thread/AgentActivityCluster.tsx:775— AgentActivityCluster.ActivityTraceTimeline has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 810, flushNormalLines). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AgentActivityCluster.ActivityTraceRow (cyclomatic 18) webui/src/components/thread/AgentActivityCluster.tsx:955— AgentActivityCluster.ActivityTraceRow 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.
SubagentTaskDock.TaskTree (cyclomatic 18) webui/src/components/thread/SubagentTaskDock.tsx:219— SubagentTaskDock.TaskTree 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 224, 225, 246). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FileEditRow.FileUnifiedDiff (cyclomatic 18) webui/src/components/thread/activity/FileEditRow.tsx:155— FileEditRow.FileUnifiedDiff has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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.
workbench-layout.bspGeometry (cyclomatic 18) webui/src/components/workbench/workbench-layout.ts:252— workbench-layout.bspGeometry 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 4 function literals inside it that branch (lines 305, 311, 320, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
bootstrap.deriveWsUrl (cyclomatic 18) webui/src/lib/bootstrap.ts:100— bootstrap.deriveWsUrl 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.
NanobotClient.applyRunEffects (cyclomatic 18) webui/src/lib/nanobot-client.ts:470— NanobotClient.applyRunEffects has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
latest-thread-request.fetchLatestWebuiThread (cyclomatic 18) webui/src/lib/latest-thread-request.ts:23— latest-thread-request.fetchLatestWebuiThread has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 81, a function literal at line 57, 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.
model-request.reconcileModelRequest (cyclomatic 18) webui/src/lib/model-request.ts:7— model-request.reconcileModelRequest 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.
WebUIBuildHook.initialize (cyclomatic 17) hatch_build.py:46— WebUIBuildHook.initialize 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.
AgentLoop.__init__ (cyclomatic 17) nanobot/agent/loop.py:274— AgentLoop.__init__ 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.
ContentPage._append_match (cyclomatic 17) nanobot/agent/tools/_search_content.py:98— ContentPage._append_match 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.
ImageGenerationTool._provider_client (cyclomatic 17) nanobot/agent/tools/image_generation.py:115— ImageGenerationTool._provider_client has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ToolLoader.load (cyclomatic 17) nanobot/agent/tools/loader.py:89— ToolLoader.load 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.
MyTool._format_value (cyclomatic 17) nanobot/agent/tools/self.py:198— MyTool._format_value 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.
desktop_tui._connection (cyclomatic 17) REDACTED:34— desktop_tui._connection has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
onboard._format_value (cyclomatic 17) nanobot/cli/onboard.py:262— onboard._format_value 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.
context_graph.parse_context_graph (cyclomatic 17) nanobot/context_graph.py:56— context_graph.parse_context_graph 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.
processes.spawn_process_tree (cyclomatic 17) nanobot/execution/processes.py:51— processes.spawn_process_tree has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
store._handle_pairing_subcommand (cyclomatic 17) nanobot/pairing/store.py:361— store._handle_pairing_subcommand 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.
AnthropicProvider._assistant_blocks (cyclomatic 17) REDACTED:306— AnthropicProvider._assistant_blocks 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.
AnthropicProvider._parse_response (cyclomatic 17) REDACTED:660— AnthropicProvider._parse_response 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.
openai_codex_provider._parse_openai_codex_models (cyclomatic 17) nanobot/providers/openai_codex_provider.py:838— openai_codex_provider._parse_openai_codex_models 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.
converters.convert_messages (cyclomatic 17) nanobot/providers/openai_responses/converters.py:13— converters.convert_messages 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.
jsonl_migration.finish_workspace_migration (cyclomatic 17) nanobot/session/jsonl_migration.py:233— jsonl_migration.finish_workspace_migration 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.
update.update_installation (cyclomatic 17) nanobot/update.py:251— update.update_installation 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.
update_plan.inspect_installation (cyclomatic 17) nanobot/update_plan.py:109— update_plan.inspect_installation 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.
update_uv.cache_digest (cyclomatic 17) nanobot/update_uv.py:124— update_uv.cache_digest 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.
automation_chats.automation_chats (cyclomatic 17) nanobot/webui/automation_chats.py:31— automation_chats.automation_chats 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.
settings_models.login_oauth_provider (cyclomatic 17) nanobot/webui/settings_models.py:1742— settings_models.login_oauth_provider has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GatewayHTTPHandler._dispatch_resolved (cyclomatic 17) nanobot/webui/ws_http.py:618— GatewayHTTPHandler._dispatch_resolved 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.
attachments.uploadAttachments (cyclomatic 17) packages/client-events/attachments.ts:89— attachments.uploadAttachments 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.
api.parseHistoryEvents (cyclomatic 17) tui/src/client/api.ts:67— api.parseHistoryEvents has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PickerMenu.render (cyclomatic 17) tui/src/menus/picker-menu.ts:145— PickerMenu.render 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.
Transcript.prependHistory (cyclomatic 17) tui/src/rendering/transcript.ts:271— Transcript.prependHistory has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MessageBubble.MessageMedia (cyclomatic 17) webui/src/components/MessageBubble.tsx:651— MessageBubble.MessageMedia 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.
PreviewPane.PreviewPane (cyclomatic 17) webui/src/components/PreviewPane.tsx:14— PreviewPane.PreviewPane 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 5 function items inside it that branch (a function literal at line 56, a function literal at line 65, a function literal at line 30, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SidebarTopicRename.SidebarTopicRename (cyclomatic 17) webui/src/components/SidebarTopicRename.tsx:13— SidebarTopicRename.SidebarTopicRename 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 (a function literal at line 58, 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.
StarPrompt.StarPrompt (cyclomatic 17) webui/src/components/StarPrompt.tsx:20— StarPrompt.StarPrompt has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 47, a function literal at line 42, a function literal at line 39, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SkillsCatalogSettings.SkillsCatalogSettings (cyclomatic 17) webui/src/components/settings/SkillsCatalogSettings.tsx:42— SkillsCatalogSettings.SkillsCatalogSettings has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 56, 144, 81, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SharedProxySetupDialog.SharedProxySetupDialog (cyclomatic 17) webui/src/components/settings/shared/SharedProxySetupDialog.tsx:9— SharedProxySetupDialog.SharedProxySetupDialog has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (save, a function literal at line 21, 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.
ModelPresetBadge.PresetPill (cyclomatic 17) webui/src/components/thread/ModelPresetBadge.tsx:532— ModelPresetBadge.PresetPill has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ThreadComposer.CliAppMentionPalette (cyclomatic 17) webui/src/components/thread/ThreadComposer.tsx:2581— ThreadComposer.CliAppMentionPalette 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 2 function literals inside it that branch (lines 2629, 2596). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
sidebar-panel.SidebarPanelContent (cyclomatic 17) webui/src/components/ui/sidebar-panel.tsx:42— sidebar-panel.SidebarPanelContent has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useNanobotStream.useNanobotStream.applyStreamError (cyclomatic 17) webui/src/hooks/useNanobotStream.ts:245— useNanobotStream.useNanobotStream.applyStreamError has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 259, 271). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
chat-groups.groupSessions (cyclomatic 17) webui/src/lib/chat-groups.ts:39— chat-groups.groupSessions 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.
(anonymous) (cyclomatic 17) webui/public/sw.js:241— (anonymous) has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ContextGovernor.backfill_missing_tool_results (cyclomatic 16) nanobot/agent/context_governance.py:1016— ContextGovernor.backfill_missing_tool_results 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.
AgentLoop._persist_user_message_early (cyclomatic 16) nanobot/agent/loop.py:698— AgentLoop._persist_user_message_early 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.
SubagentManager._create_task (cyclomatic 16) nanobot/agent/subagent.py:581— SubagentManager._create_task 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.
ExecSessionTool._wait (cyclomatic 16) nanobot/agent/tools/exec_session.py:854— ExecSessionTool._wait 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.
ReadFileTool._read_office_doc (cyclomatic 16) nanobot/agent/tools/filesystem.py:636— ReadFileTool._read_office_doc 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.
MyTool._inspect (cyclomatic 16) nanobot/agent/tools/self.py:254— MyTool._inspect 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.
CliAppManager.catalog (cyclomatic 16) nanobot/apps/cli/service.py:541— CliAppManager.catalog 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.
gateway_runtime._deliver_to_channel (cyclomatic 16) REDACTED:66— gateway_runtime._deliver_to_channel 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.
onboard._input_text (cyclomatic 16) nanobot/cli/onboard.py:438— onboard._input_text 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.
windows_browser.launch_browser (cyclomatic 16) nanobot/cli/windows_browser.py:47— windows_browser.launch_browser 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.
CronService.update_job (cyclomatic 16) nanobot/cron/service.py:858— CronService.update_job 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.
data_access._reservation (cyclomatic 16) nanobot/data_access.py:73— data_access._reservation 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.
BedrockProvider._handle_error (cyclomatic 16) nanobot/providers/bedrock_provider.py:681— BedrockProvider._handle_error 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.
sandbox_launcher.resolve_sandbox_launcher (cyclomatic 16) nanobot/security/sandbox_launcher.py:28— sandbox_launcher.resolve_sandbox_launcher 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.
recovery.runtime_checkpoint_is_well_formed (cyclomatic 16) nanobot/session/recovery.py:251— recovery.runtime_checkpoint_is_well_formed 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.
WebuiTurnRoutePolicy.__call__ (cyclomatic 16) nanobot/session/webui_turns.py:384— WebuiTurnRoutePolicy.__call__ 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.
quick_validate._parse_simple_frontmatter (cyclomatic 16) nanobot/skills/skill-creator/scripts/quick_validate.py:36— quick_validate._parse_simple_frontmatter 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.
update_fallback.preserve_program (cyclomatic 16) nanobot/update_fallback.py:127— update_fallback.preserve_program 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.
update_recovery.main (cyclomatic 16) nanobot/update_recovery.py:18— update_recovery.main has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
McpOAuthManager.submit_callback_url (cyclomatic 16) nanobot/webui/mcp_oauth_api.py:229— McpOAuthManager.submit_callback_url 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.
WebUIOutboundDelivery._message_payload (cyclomatic 16) nanobot/webui/outbound_delivery.py:445— WebUIOutboundDelivery._message_payload 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.
Tunnel._stream (cyclomatic 16) nanobot/webui/remote_ssh.py:267— Tunnel._stream has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
transcript.build_user_transcript_event (cyclomatic 16) nanobot/webui/transcript.py:760— transcript.build_user_transcript_event 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.
GatewayHTTPHandler._handle_session_delete (cyclomatic 16) nanobot/webui/ws_http.py:1427— GatewayHTTPHandler._handle_session_delete 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.
GatewayHTTPHandler._serve_static (cyclomatic 16) nanobot/webui/ws_http.py:2057— GatewayHTTPHandler._serve_static 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.
WeixinPanel.WeixinPanel (cyclomatic 16) nanobot/channels/weixin/webui/WeixinPanel.tsx:22— WeixinPanel.WeixinPanel 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 6 function items inside it that branch (a function literal at line 101, a function literal at line 131, a function literal at line 78, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
DiagramJobs.start (cyclomatic 16) tui/src/rendering/mermaid/jobs.ts:89— DiagramJobs.start 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.
desktop.desktopConnectionSource (cyclomatic 16) tui/src/platform/desktop.ts:10— desktop.desktopConnectionSource 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.
SettingsSidebar.MobileSettingsNavigation (cyclomatic 16) webui/src/components/settings/SettingsSidebar.tsx:193— SettingsSidebar.MobileSettingsNavigation has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useModelSettingsActions.useModelSettingsActions.runProviderOAuth (cyclomatic 16) webui/src/components/settings/models/useModelSettingsActions.ts:524— useModelSettingsActions.useModelSettingsActions.runProviderOAuth 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.
ModelControls.ProviderPicker (cyclomatic 16) webui/src/components/settings/shared/ModelControls.tsx:86— ModelControls.ProviderPicker has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsFeature.SettingsFeature (cyclomatic 16) webui/src/components/settings/shared/SettingsFeature.tsx:25— SettingsFeature.SettingsFeature has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ThreadComposer.SlashCommandPalette (cyclomatic 16) webui/src/components/thread/ThreadComposer.tsx:2745— ThreadComposer.SlashCommandPalette has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2775). 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.
ThreadShell.recentComposerRoundUsage (cyclomatic 16) webui/src/components/thread/ThreadShell.tsx:116— ThreadShell.recentComposerRoundUsage 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.
ThreadShell.useInstalledSettingItems (cyclomatic 16) webui/src/components/thread/ThreadShell.tsx:283— ThreadShell.useInstalledSettingItems 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 301, 324, 295, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
channels-linear.PanelComposition (cyclomatic 16) webui/src/dev/gallery/channels-linear.tsx:121— channels-linear.PanelComposition has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
usePromptHistory.usePromptHistory.prompts (cyclomatic 16) webui/src/hooks/usePromptHistory.ts:124— usePromptHistory.usePromptHistory.prompts has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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.
thread-event-projection.closeReasoningStream (cyclomatic 16) webui/src/lib/thread-event-projection.ts:149— thread-event-projection.closeReasoningStream has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
markdown-streaming-blocks.parseMathAwareMarkdownBlocks (cyclomatic 16) webui/src/lib/markdown-streaming-blocks.ts:23— markdown-streaming-blocks.parseMathAwareMarkdownBlocks 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.
remark-tex-math.tokenizeGuardedDollarMathText (cyclomatic 16) webui/src/lib/remark-tex-math.ts:125— remark-tex-math.tokenizeGuardedDollarMathText 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 items inside it that branch (data, close, escaped, …). 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.
App.Shell (cognitive 313) webui/src/App.tsx:821— App.Shell has cognitive complexity 313 (threshold 15). Drivers by points: if/else 124 (140 pts), boolean chains 87, ternaries 59 (71 pts), error handling 10, loops 5 (nesting depth added 28). Of this number, 78 points are the body's own statements and 235 belong to 92 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ThreadTranscript.accept (cognitive 299) webui/src/lib/thread-transcript.ts:554— ThreadTranscript.accept has cognitive complexity 299 (threshold 15). Drivers by points: if/else 61 (116 pts), boolean chains 96, loops 42 (66 pts), ternaries 14 (21 pts) (nesting depth added 86). Of this number, 291 points are the body's own statements and 8 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreadViewport.ThreadViewport (cognitive 274) webui/src/components/thread/ThreadViewport.tsx:271— ThreadViewport.ThreadViewport has cognitive complexity 274 (threshold 15). Drivers by points: if/else 107 (123 pts), boolean chains 92, ternaries 42 (54 pts), loops 4 (5 pts) (nesting depth added 29). Of this number, 67 points are the body's own statements and 207 belong to 52 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ChatList.ChatList (cognitive 269) webui/src/components/ChatList.tsx:272— ChatList.ChatList has cognitive complexity 269 (threshold 15). Drivers by points: ternaries 57 (125 pts), if/else 54 (77 pts), boolean chains 51, loops 12 (16 pts) (nesting depth added 95). Of this number, 28 points are the body's own statements and 241 belong to 45 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.
WorkspaceControls.WorkspaceProjectPicker (cognitive 242) webui/src/components/thread/WorkspaceControls.tsx:158— WorkspaceControls.WorkspaceProjectPicker has cognitive complexity 242 (threshold 15). Drivers by points: boolean chains 105, if/else 76 (88 pts), ternaries 33 (45 pts), error handling 3, loops 1 (nesting depth added 24). Of this number, 74 points are the body's own statements and 168 belong to 57 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.
thread-event-projection.reduceThreadEvent (cognitive 216) webui/src/lib/thread-event-projection.ts:893— thread-event-projection.reduceThreadEvent has cognitive complexity 216 (threshold 15). Drivers by points: if/else 54 (108 pts), ternaries 31 (65 pts), boolean chains 34, loops 3 (9 pts) (nesting depth added 94). Of this number, 215 points are the body's own statements and 1 belongs 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.
useNanobotStream.useNanobotStream (cognitive 192) webui/src/hooks/useNanobotStream.ts:118— useNanobotStream.useNanobotStream has cognitive complexity 192 (threshold 15). Drivers by points: if/else 77 (107 pts), ternaries 28 (53 pts), boolean chains 32 (nesting depth added 55). Most of this is not in the body itself: 3 of the 192 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 672, 558, 449, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
parsing.consume_responses_events (cognitive 184) nanobot/providers/openai_responses/parsing.py:369— parsing.consume_responses_events has cognitive complexity 184 (threshold 15). Drivers by points: if/else 39 (132 pts), boolean chains 39, ternaries 3 (12 pts), loops 1 (nesting depth added 102). 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.
NanobotTui.handleKey (cognitive 170) tui/src/app/app.ts:1320— NanobotTui.handleKey has cognitive complexity 170 (threshold 15). Drivers by points: if/else 60 (99 pts), boolean chains 37, ternaries 12 (31 pts), error handling 1 (3 pts) (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.
ModelControls.ModelIdPicker (cognitive 168) webui/src/components/settings/shared/ModelControls.tsx:187— ModelControls.ModelIdPicker has cognitive complexity 168 (threshold 15). Drivers by points: ternaries 37 (114 pts), boolean chains 42, if/else 12 (nesting depth added 77). Of this number, 128 points are the body's own statements and 40 belong to 12 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.
ThreadComposer.ThreadComposer (cognitive 166) webui/src/components/thread/ThreadComposer.tsx:549— ThreadComposer.ThreadComposer has cognitive complexity 166 (threshold 15). Drivers by points: if/else 155 (186 pts), ternaries 116 (181 pts), boolean chains 131, loops 2 (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 (ThreadComposer.ThreadComposer::onKeyDown) 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.
RemoteInstances.action (cognitive 152) nanobot/webui/remote_instances.py:237— RemoteInstances.action has cognitive complexity 152 (threshold 15). Drivers by points: if/else 57 (109 pts), boolean chains 28, ternaries 3 (6 pts), loops 2 (5 pts), error handling 2 (4 pts) (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.
transcript._client_projection_event (cognitive 150) nanobot/webui/transcript.py:1469— transcript._client_projection_event has cognitive complexity 150 (threshold 15). Drivers by points: if/else 52 (113 pts), boolean chains 17, ternaries 7 (16 pts), loops 2 (4 pts) (nesting depth added 72). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NanobotTui.accept (cognitive 136) tui/src/app/app.ts:690— NanobotTui.accept has cognitive complexity 136 (threshold 15). Drivers by points: if/else 47 (98 pts), boolean chains 23, ternaries 6 (14 pts), match/switch 1 (nesting depth added 59). Of this number, 132 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.
PaneWorkbench.PaneWorkbench (cognitive 136) webui/src/components/workbench/PaneWorkbench.tsx:191— PaneWorkbench.PaneWorkbench has cognitive complexity 136 (threshold 15). Drivers by points: if/else 42 (65 pts), ternaries 31 (42 pts), boolean chains 22, loops 5 (6 pts), match/switch 1 (nesting depth added 35). Most of this is not in the body itself: 11 of the 136 points are its own statements and the rest belongs to 31 function literals inside it that branch (lines 298, 706, 586, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AppsSettings.McpAppsCatalogRow (cognitive 129) webui/src/components/settings/system/AppsSettings.tsx:501— AppsSettings.McpAppsCatalogRow has cognitive complexity 129 (threshold 15). Drivers by points: ternaries 31 (94 pts), boolean chains 23, if/else 5 (12 pts) (nesting depth added 70). Of this number, 113 points are the body's own statements and 16 belong to 4 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UpdateFlowProvider.UpdateFlowProvider (cognitive 119) webui/src/providers/UpdateFlowProvider.tsx:28— UpdateFlowProvider.UpdateFlowProvider has cognitive complexity 119 (threshold 15). Drivers by points: ternaries 32 (87 pts), if/else 48 (75 pts), boolean chains 61, error handling 8 (12 pts) (nesting depth added 86). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (UpdateFlowProvider.UpdateFlowProvider::inspect, UpdateFlowProvider.UpdateFlowProvider::confirm) 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.
UsagePanel.render (cognitive 117) tui/src/views/usage-panel.ts:110— UsagePanel.render has cognitive complexity 117 (threshold 15). Drivers by points: ternaries 16 (65 pts), if/else 17 (39 pts), boolean chains 10, loops 1 (3 pts) (nesting depth added 73). Of this number, 88 points are the body's own statements and 29 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.
ThreadTranscript.project (cognitive 115) webui/src/lib/thread-transcript.ts:367— ThreadTranscript.project has cognitive complexity 115 (threshold 15). Drivers by points: if/else 25 (50 pts), ternaries 10 (23 pts), boolean chains 21, loops 11 (21 pts) (nesting depth added 48). Of this number, 100 points are the body's own statements and 15 belong to 5 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.
AgentRunner._run_core (cognitive 113) nanobot/agent/runner.py:400— AgentRunner._run_core has cognitive complexity 113 (threshold 15). Drivers by points: if/else 39 (88 pts), boolean chains 24, loops 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuickPairSetupView.QuickPairSetupView (cognitive 113) webui/src/components/remote/QuickPairSetupView.tsx:62— QuickPairSetupView.QuickPairSetupView has cognitive complexity 113 (threshold 15). Drivers by points: ternaries 33 (74 pts), boolean chains 35, if/else 4 (nesting depth added 41). Of this number, 108 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NanobotClient.handleMessage (cognitive 110) webui/src/lib/nanobot-client.ts:903— NanobotClient.handleMessage has cognitive complexity 110 (threshold 15). Drivers by points: if/else 40 (59 pts), boolean chains 22, error handling 4 (11 pts), ternaries 5 (11 pts), loops 3 (7 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebUICommandRouter._dispatch_message_once (cognitive 109) nanobot/webui/inbound_commands.py:553— WebUICommandRouter._dispatch_message_once has cognitive complexity 109 (threshold 15). Drivers by points: if/else 47 (64 pts), boolean chains 23, ternaries 12 (16 pts), error handling 4, loops 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextGraphScene.ContextGraphScene (cognitive 108) webui/src/components/thread/ContextGraphScene.tsx:15— ContextGraphScene.ContextGraphScene has cognitive complexity 108 (threshold 15). Drivers by points: if/else 43 (53 pts), boolean chains 40, ternaries 10 (12 pts), loops 3 (nesting depth added 12). Of this number, 25 points are the body's own statements and 83 belong to 28 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.
RuntimeConfigSettings.RuntimeConfigSettings (cognitive 107) webui/src/components/settings/system/RuntimeConfigSettings.tsx:174— RuntimeConfigSettings.RuntimeConfigSettings has cognitive complexity 107 (threshold 15). Drivers by points: ternaries 23 (69 pts), boolean chains 30, if/else 8 (nesting depth added 46). Most of this is not in the body itself: 5 of the 107 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 227, 201, 284, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelPresetBadge.ModelPresetBadge (cognitive 107) webui/src/components/thread/ModelPresetBadge.tsx:106— ModelPresetBadge.ModelPresetBadge has cognitive complexity 107 (threshold 15). Drivers by points: ternaries 26 (47 pts), if/else 27 (36 pts), boolean chains 24 (nesting depth added 30). Of this number, 50 points are the body's own statements and 57 belong to 21 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.
RemoteConnectionsPage.RemoteConnectionsPage (cognitive 103) webui/src/components/remote/RemoteConnectionsPage.tsx:29— RemoteConnectionsPage.RemoteConnectionsPage has cognitive complexity 103 (threshold 15). Drivers by points: boolean chains 103, if/else 64 (94 pts), ternaries 30 (45 pts), error handling 9 (11 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RemoteConnectionsPage.RemoteConnectionsPage::connect) 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.
ResponsesWebSocketSession.request (cognitive 98) nanobot/providers/openai_responses/websocket.py:129— ResponsesWebSocketSession.request has cognitive complexity 98 (threshold 15). Drivers by points: if/else 15 (37 pts), ternaries 12 (36 pts), error handling 6 (16 pts), boolean chains 8, loops 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApplyPatchTool.execute (cognitive 91) nanobot/agent/tools/apply_patch.py:91— ApplyPatchTool.execute has cognitive complexity 91 (threshold 15). Drivers by points: if/else 26 (63 pts), error handling 6 (12 pts), loops 6 (7 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomationsSettings.AutomationsSettings (cognitive 91) webui/src/components/settings/system/AutomationsSettings.tsx:63— AutomationsSettings.AutomationsSettings has cognitive complexity 91 (threshold 15). Drivers by points: ternaries 29 (73 pts), boolean chains 10, if/else 7 (8 pts) (nesting depth added 45). Of this number, 44 points are the body's own statements and 47 belong to 7 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.
GrepTool._execute_sync (cognitive 90) nanobot/agent/tools/search.py:680— GrepTool._execute_sync has cognitive complexity 90 (threshold 15). Drivers by points: if/else 29 (53 pts), error handling 9 (13 pts), ternaries 8 (12 pts), boolean chains 8, loops 2 (4 pts) (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.
transcript.build_webui_thread_response (cognitive 87) nanobot/webui/transcript.py:1863— transcript.build_webui_thread_response has cognitive complexity 87 (threshold 15). Drivers by points: if/else 24 (61 pts), boolean chains 17, loops 2 (5 pts), ternaries 3 (4 pts) (nesting depth added 41). 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.
RemoteInstances.RemoteInstances (cognitive 86) webui/src/components/remote/RemoteInstances.tsx:17— RemoteInstances.RemoteInstances has cognitive complexity 86 (threshold 15). Drivers by points: boolean chains 42, if/else 23, ternaries 16 (19 pts), loops 2 (nesting depth added 3). Of this number, 48 points are the body's own statements and 38 belong to 18 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.
api.parseThreadProjectionEvent (cognitive 84) webui/src/lib/api.ts:322— api.parseThreadProjectionEvent has cognitive complexity 84 (threshold 15). Drivers by points: boolean chains 43, if/else 21 (40 pts), match/switch 1 (nesting depth added 19). Of this number, 82 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FallbackProvider._try_candidates (cognitive 83) nanobot/providers/fallback_provider.py:489— FallbackProvider._try_candidates has cognitive complexity 83 (threshold 15). Drivers by points: if/else 26 (50 pts), boolean chains 17, ternaries 5 (13 pts), error handling 1 (2 pts), 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.
OpenAICompatProvider._build_kwargs (cognitive 81) REDACTED:837— OpenAICompatProvider._build_kwargs has cognitive complexity 81 (threshold 15). Drivers by points: if/else 30 (48 pts), boolean chains 25, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.get_history (cognitive 81) nanobot/session/manager.py:211— Session.get_history has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (56 pts), boolean chains 12, loops 5 (9 pts), ternaries 1 (4 pts) (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.
ProviderSettings.ProvidersSettings::renderProviderForm (cognitive 81) webui/src/components/settings/models/ProviderSettings.tsx:656— ProviderSettings.ProvidersSettings::renderProviderForm has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 28 (62 pts), boolean chains 19 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ProviderSettings.ProvidersSettings) 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.
OpenAICompatProvider.chat_stream (cognitive 78) REDACTED:1627— OpenAICompatProvider.chat_stream has cognitive complexity 78 (threshold 15). Drivers by points: if/else 15 (39 pts), ternaries 3 (15 pts), error handling 7 (11 pts), boolean chains 8, loops 2 (5 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinearPanelView.LinearPanelView (cognitive 78) nanobot/channels/linear/webui/LinearPanelView.tsx:67— LinearPanelView.LinearPanelView has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 24 (38 pts), boolean chains 31, if/else 8 (9 pts) (nesting depth added 15). Of this number, 41 points are the body's own statements and 37 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._configure_pydantic_model (cognitive 77) nanobot/cli/onboard.py:786— onboard._configure_pydantic_model has cognitive complexity 77 (threshold 15). Drivers by points: if/else 27 (62 pts), boolean chains 8, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
svg-image.diagramImageTemplate (cognitive 75) REDACTED:255— svg-image.diagramImageTemplate has cognitive complexity 75 (threshold 15). Drivers by points: if/else 37 (56 pts), boolean chains 17, loops 2 (nesting depth added 19). Most of this is not in the body itself: 8 of the 75 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 275, text, a function literal at line 336). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SubagentTasks.SubagentTasksProvider (cognitive 75) webui/src/components/thread/SubagentTasks.tsx:56— SubagentTasks.SubagentTasksProvider has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 16 (25 pts), if/else 23 (24 pts), boolean chains 23, loops 1 (2 pts), error handling 1 (nesting depth added 11). Of this number, 29 points are the body's own statements and 46 belong to 15 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Config._match_provider (cognitive 74) nanobot/config/schema.py:578— Config._match_provider has cognitive complexity 74 (threshold 15). Drivers by points: if/else 22 (49 pts), boolean chains 14, loops 5 (6 pts), ternaries 3 (5 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreadShell.ThreadShell (cognitive 74) webui/src/components/thread/ThreadShell.tsx:359— ThreadShell.ThreadShell has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 79 (99 pts), if/else 81 (95 pts), boolean chains 75, loops 3, error handling 2 (nesting depth added 34). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (ThreadShell.ThreadShell::composer) 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.
ClientRunLedger.applyObservation (cognitive 72) webui/src/lib/client-run-ledger.ts:230— ClientRunLedger.applyObservation has cognitive complexity 72 (threshold 15). Drivers by points: if/else 30 (52 pts), boolean chains 19, ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
converters.convert_tool_output (cognitive 68) nanobot/providers/openai_responses/converters.py:101— converters.convert_tool_output has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (50 pts), ternaries 2 (8 pts), loops 2 (6 pts), boolean chains 4 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript._build_prompt_view (cognitive 68) nanobot/webui/transcript.py:2135— transcript._build_prompt_view has cognitive complexity 68 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 8 (12 pts), boolean chains 9, ternaries 3 (7 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppsSettings.AppsCatalogSettings (cognitive 67) webui/src/components/settings/system/AppsSettings.tsx:104— AppsSettings.AppsCatalogSettings has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 27 (54 pts), boolean chains 13 (nesting depth added 27). Of this number, 53 points are the body's own statements and 14 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.
validation.decodeInboundEvent (cognitive 66) tui/src/client/validation.ts:137— validation.decodeInboundEvent has cognitive complexity 66 (threshold 15). Drivers by points: boolean chains 39, if/else 21, ternaries 3 (6 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SubagentTaskDock.TaskDock (cognitive 66) webui/src/components/thread/SubagentTaskDock.tsx:23— SubagentTaskDock.TaskDock has cognitive complexity 66 (threshold 15). Drivers by points: if/else 29, boolean chains 23, ternaries 11 (14 pts) (nesting depth added 3). Most of this is not in the body itself: 14 of the 66 points are its own statements and the rest belongs to 18 function items inside it that branch (changeOpen, a function literal at line 131, a function literal at line 171, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
history.collect_legacy_history (cognitive 64) nanobot/webui/history.py:152— history.collect_legacy_history has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (43 pts), loops 7 (11 pts), boolean chains 9, ternaries 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.
onboard._configure_quick_start_provider (cognitive 62) nanobot/cli/onboard.py:1567— onboard._configure_quick_start_provider has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (51 pts), boolean chains 6, ternaries 2 (4 pts), loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreadTranscript.describe (cognitive 62) webui/src/lib/thread-transcript.ts:313— ThreadTranscript.describe has cognitive complexity 62 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 15, loops 5 (15 pts), ternaries 7 (15 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.
settings_runtime.update_runtime_config (cognitive 61) nanobot/webui/settings_runtime.py:82— settings_runtime.update_runtime_config has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (30 pts), error handling 7 (16 pts), loops 6 (9 pts), boolean chains 6 (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.
transcript._history_prompt_summaries (cognitive 61) nanobot/webui/transcript.py:2080— transcript._history_prompt_summaries has cognitive complexity 61 (threshold 15). Drivers by points: if/else 11 (39 pts), loops 5 (12 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomationsSettings.AutomationDetailPanel (cognitive 61) webui/src/components/settings/system/AutomationsSettings.tsx:469— AutomationsSettings.AutomationDetailPanel has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 27 (43 pts), boolean chains 15, if/else 1 (3 pts) (nesting depth added 18). Of this number, 56 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.
SandboxSettings.SandboxSettings (cognitive 61) webui/src/components/settings/system/SandboxSettings.tsx:20— SandboxSettings.SandboxSettings has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 23 (36 pts), boolean chains 14, if/else 9 (10 pts), error handling 1 (nesting depth added 14). Of this number, 45 points are the body's own statements and 16 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.
ThreadMessages.ThreadDisplayUnit (cognitive 61) webui/src/components/thread/ThreadMessages.tsx:576— ThreadMessages.ThreadDisplayUnit has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 19 (41 pts), boolean chains 10, if/else 9 (10 pts) (nesting depth added 23). Of this number, 48 points are the body's own statements and 13 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditFileTool.execute (cognitive 60) nanobot/agent/tools/filesystem.py:1079— EditFileTool.execute has cognitive complexity 60 (threshold 15). Drivers by points: if/else 30 (42 pts), boolean chains 12, error handling 3, ternaries 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomationChatBindingView.AutomationChatBindingView (cognitive 60) webui/src/components/settings/system/AutomationChatBindingView.tsx:37— AutomationChatBindingView.AutomationChatBindingView has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 20 (29 pts), boolean chains 23, if/else 6, error handling 1, loops 1 (nesting depth added 9). Of this number, 36 points are the body's own statements and 24 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_system.coerce_channel_value (cognitive 59) nanobot/webui/settings_system.py:308— settings_system.coerce_channel_value has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (43 pts), error handling 3 (6 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.fetchHistory (cognitive 59) tui/src/client/api.ts:181— api.fetchHistory has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (35 pts), ternaries 6 (13 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteConnectionsPage.RemoteConnectionsPage::connect (cognitive 59) webui/src/components/remote/RemoteConnectionsPage.tsx:143— RemoteConnectionsPage.RemoteConnectionsPage::connect has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (44 pts), boolean chains 8, error handling 2 (4 pts), ternaries 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RemoteConnectionsPage.RemoteConnectionsPage) 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.
update_stop.stop_reviewed_gateways (cognitive 58) nanobot/update_stop.py:178— update_stop.stop_reviewed_gateways has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (38 pts), boolean chains 8, error handling 2 (6 pts), loops 3 (6 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentLoop._save_turn (cognitive 57) nanobot/agent/loop.py:2356— AgentLoop._save_turn has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 11, ternaries 2 (5 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebUIOutboundDelivery.send (cognitive 56) nanobot/webui/outbound_delivery.py:274— WebUIOutboundDelivery.send has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (36 pts), ternaries 7 (15 pts), boolean chains 5 (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.
NanobotTui.updateMeta (cognitive 56) tui/src/app/app.ts:1666— NanobotTui.updateMeta has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 10 (55 pts), if/else 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ChannelQrConnectFlowView.ChannelQrConnectFlowView (cognitive 56) webui/src/components/settings/channels/ChannelQrConnectFlowView.tsx:49— ChannelQrConnectFlowView.ChannelQrConnectFlowView has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 19 (37 pts), boolean chains 15, if/else 4 (nesting depth added 18). Of this number, 51 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.
thread-transcript.matchUnits (cognitive 56) webui/src/lib/thread-transcript.ts:158— thread-transcript.matchUnits has cognitive complexity 56 (threshold 15). Drivers by points: loops 12 (26 pts), if/else 7 (22 pts), ternaries 2 (6 pts), boolean chains 2 (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.
_MCPWrapperBase._request_with_recovery (cognitive 55) nanobot/agent/tools/mcp.py:574— _MCPWrapperBase._request_with_recovery has cognitive complexity 55 (threshold 15). Drivers by points: if/else 8 (24 pts), ternaries 6 (19 pts), error handling 3 (6 pts), boolean chains 5, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
webui.webui (cognitive 55) nanobot/cli/webui.py:68— webui.webui has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 15, error handling 4 (5 pts), ternaries 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuntimeSettings.RuntimeSettings (cognitive 55) webui/src/components/settings/system/RuntimeSettings.tsx:17— RuntimeSettings.RuntimeSettings has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 27 (52 pts), boolean chains 1, error handling 1, if/else 1 (nesting depth added 25). Of this number, 50 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gallery.Gallery (cognitive 55) webui/src/dev/gallery/Gallery.tsx:40— Gallery.Gallery has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 24 (39 pts), boolean chains 9, if/else 6 (7 pts) (nesting depth added 16). Of this number, 36 points are the body's own statements and 19 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentLoop._run_agent_loop (cognitive 54) nanobot/agent/loop.py:1092— AgentLoop._run_agent_loop has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 19 (23 pts), boolean chains 21, if/else 8 (10 pts) (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.
AgentLoop._dispatch_one (cognitive 54) nanobot/agent/loop.py:1520— AgentLoop._dispatch_one has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 14, error handling 5 (8 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update_worker.run_job (cognitive 54) REDACTED:713— update_worker.run_job has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (34 pts), ternaries 6 (11 pts), boolean chains 7, error handling 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
svg.resolveDiagramSvg (cognitive 54) tui/src/rendering/mermaid/svg.ts:22— svg.resolveDiagramSvg has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 10, loops 3 (4 pts), ternaries 1 (nesting depth added 19). Of this number, 28 points are the body's own statements and 26 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.
ThreadMessages.ThreadMessages (cognitive 54) webui/src/components/thread/ThreadMessages.tsx:83— ThreadMessages.ThreadMessages has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 27 (29 pts), boolean chains 22, if/else 3 (nesting depth added 2). Most of this is not in the body itself: 11 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 200, a function literal at line 182, a function literal at line 117, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ContextGovernor._merge_adjacent_user_messages_for_model (cognitive 53) nanobot/agent/context_governance.py:331— ContextGovernor._merge_adjacent_user_messages_for_model has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 9 (29 pts), if/else 5 (15 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
useSidebarHostBridge.useSidebarHostBridge (cognitive 53) REDACTED:7— useSidebarHostBridge.useSidebarHostBridge has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 16, ternaries 5 (7 pts), loops 1 (nesting depth added 10). Most of this is not in the body itself: 3 of the 53 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 37, 99, 96, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SkillsCatalogSettings.SkillDetailSheet (cognitive 53) webui/src/components/settings/SkillsCatalogSettings.tsx:279— SkillsCatalogSettings.SkillDetailSheet has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 17 (35 pts), boolean chains 10, if/else 6, error handling 2 (nesting depth added 18). Of this number, 39 points are the body's own statements and 14 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.
ChannelSetupPanel.ChannelSetupSurface (cognitive 53) webui/src/components/settings/channels/ChannelSetupPanel.tsx:163— ChannelSetupPanel.ChannelSetupSurface has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (24 pts), ternaries 12 (13 pts), boolean chains 11, error handling 4, loops 1 (nesting depth added 3). Most of this is not in the body itself: 11 of the 53 points are its own statements and the rest belongs to 19 function items inside it that branch (saveCredentialSettings, saveChannelDraft, checkCurrentSettings, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
inventory-plugin.componentInventory (cognitive 53) webui/src/dev/gallery/inventory-plugin.ts:29— inventory-plugin.componentInventory has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 11, loops 4 (8 pts), ternaries 3 (7 pts) (nesting depth added 23). Most of this is not in the body itself: 1 of the 53 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 76, recordImport, visit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
settings_capabilities.update_image_generation_settings (cognitive 52) nanobot/webui/settings_capabilities.py:350— settings_capabilities.update_image_generation_settings has cognitive complexity 52 (threshold 15). Drivers by points: if/else 26 (44 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionCheckRowView.VersionCheckRowView (cognitive 51) webui/src/components/settings/overview/VersionCheckRowView.tsx:20— VersionCheckRowView.VersionCheckRowView has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 11 (35 pts), boolean chains 16 (nesting depth added 24). 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.
ExecTool._guard_command (cognitive 50) nanobot/agent/tools/shell.py:581— ExecTool._guard_command has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 7, error handling 2 (7 pts), loops 2 (4 pts), ternaries 2 (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.
OpenAICodexProvider._call_codex (cognitive 50) nanobot/providers/openai_codex_provider.py:208— OpenAICodexProvider._call_codex has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 14 (19 pts), if/else 13 (18 pts), boolean chains 11, error handling 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayHTTPHandler._handle_webui_automation_action (cognitive 50) nanobot/webui/ws_http.py:1597— GatewayHTTPHandler._handle_webui_automation_action has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (38 pts), error handling 3 (6 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.
SessionSearchDialog.SessionSearchDialog (cognitive 50) webui/src/components/SessionSearchDialog.tsx:37— SessionSearchDialog.SessionSearchDialog has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 14 (25 pts), if/else 15 (18 pts), boolean chains 7 (nesting depth added 14). Most of this is not in the body itself: 10 of the 50 points are its own statements and the rest belongs to 12 function items inside it that branch (handleKeyDown, a function literal at line 215, a function literal at line 109, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useAttachedImages.useAttachedImages.enqueue (cognitive 50) webui/src/hooks/useAttachedImages.ts:274— useAttachedImages.useAttachedImages.enqueue has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 8 (25 pts), if/else 10 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 26). Of this number, 30 points are the body's own statements and 20 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.
OpenAICompatProvider._build_responses_body (cognitive 49) REDACTED:1137— OpenAICompatProvider._build_responses_body has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 10, loops 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatList.ActivePaneRows (cognitive 49) webui/src/components/ChatList.tsx:1418— ChatList.ActivePaneRows has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 9, if/else 2 (4 pts) (nesting depth added 19). None of this is in the body itself: all 49 points belong to 3 function literals inside it that branch (lines 1490, 1540, 1548). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MessageBubble.MessageBubble (cognitive 49) webui/src/components/MessageBubble.tsx:404— MessageBubble.MessageBubble has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 17 (37 pts), boolean chains 8, if/else 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentActivityCluster.FoldedAgentActivity (cognitive 49) webui/src/components/thread/AgentActivityCluster.tsx:233— AgentActivityCluster.FoldedAgentActivity has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 12 (26 pts), boolean chains 14, if/else 8, error handling 1 (nesting depth added 14). Of this number, 37 points are the body's own statements and 12 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.
ExecTool._extract_posix_paths_from_token (cognitive 48) nanobot/agent/tools/shell.py:812— ExecTool._extract_posix_paths_from_token has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 8, loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._configure_model_presets (cognitive 48) nanobot/cli/onboard.py:943— onboard._configure_model_presets has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (40 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NanobotTui.submit (cognitive 48) tui/src/app/app.ts:508— NanobotTui.submit has cognitive complexity 48 (threshold 15). Drivers by points: if/else 34 (41 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SkillsMarketplace.SkillsMarketplace (cognitive 48) webui/src/components/settings/SkillsMarketplace.tsx:43— SkillsMarketplace.SkillsMarketplace has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 18 (28 pts), if/else 11, boolean chains 8, error handling 1 (nesting depth added 10). Of this number, 25 points are the body's own statements and 23 belong to 17 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
segmented-control.SegmentedControl (cognitive 48) webui/src/components/ui/segmented-control.tsx:50— segmented-control.SegmentedControl has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 16 (22 pts), if/else 14 (16 pts), boolean chains 10 (nesting depth added 8). Most of this is not in the body itself: 11 of the 48 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 165, handleKeyDown, a function literal at line 85, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
thread-display-projection.projectWebuiThreadMessages (cognitive 48) webui/src/lib/thread-display-projection.ts:30— thread-display-projection.projectWebuiThreadMessages has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 8, ternaries 2 (7 pts), loops 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thread-page-fragments.joinThreadFragments (cognitive 48) webui/src/lib/thread-page-fragments.ts:9— thread-page-fragments.joinThreadFragments has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 8, ternaries 4 (7 pts), loops 4 (6 pts) (nesting depth added 18). Most of this is not in the body itself: 10 of the 48 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 34, same, a function literal at line 17, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ExecTool._prepare_command (cognitive 47) nanobot/agent/tools/shell.py:349— ExecTool._prepare_command has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 7, ternaries 4 (6 pts), error handling 2 (5 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.
LLMProvider._sanitize_empty_content (cognitive 47) nanobot/providers/base.py:631— LLMProvider._sanitize_empty_content has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (30 pts), ternaries 3 (8 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLMProvider._run_with_retry (cognitive 47) nanobot/providers/base.py:1585— LLMProvider._run_with_retry has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 12, ternaries 4 (8 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockProvider._parse_stream_event (cognitive 47) nanobot/providers/bedrock_provider.py:549— BedrockProvider._parse_stream_event has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 10 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ChannelSetupSurfaceView.ChannelSetupSurfaceView (cognitive 47) webui/src/components/settings/channels/ChannelSetupSurfaceView.tsx:51— ChannelSetupSurfaceView.ChannelSetupSurfaceView has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 20 (37 pts), boolean chains 8, if/else 2 (nesting depth added 17). Of this number, 44 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.
ChannelsSettings.ChannelsSettings (cognitive 47) webui/src/components/settings/system/ChannelsSettings.tsx:20— ChannelsSettings.ChannelsSettings has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 16 (32 pts), boolean chains 10, if/else 5 (nesting depth added 16). Of this number, 20 points are the body's own statements and 27 belong to 10 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.
transcript.build_session_thread_response (cognitive 46) nanobot/webui/transcript.py:1792— transcript.build_session_thread_response has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 4 (10 pts), boolean chains 8, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageBubble.MessageBlockMenuActions (cognitive 46) webui/src/components/MessageBubble.tsx:151— MessageBubble.MessageBlockMenuActions has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 16 (29 pts), boolean chains 17 (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.
useSystemSettingsEffects.useSystemSettingsEffects (cognitive 46) webui/src/components/settings/system/useSystemSettingsEffects.ts:23— useSystemSettingsEffects.useSystemSettingsEffects has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31 (33 pts), boolean chains 10, error handling 2, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 46 points belong to 17 function literals inside it that branch (lines 98, 189, 135, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ChannelCatalogRow.ChannelCatalogRow (cognitive 45) webui/src/components/settings/channels/ChannelCatalogRow.tsx:19— ChannelCatalogRow.ChannelCatalogRow has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 15 (30 pts), boolean chains 10, if/else 3 (5 pts) (nesting depth added 17). Of this number, 33 points are the body's own statements and 12 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.
ReadFileTool._read_text (cognitive 44) nanobot/agent/tools/filesystem.py:500— ReadFileTool._read_text has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (25 pts), ternaries 3 (9 pts), error handling 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebSearchTool._effective_provider (cognitive 44) nanobot/agent/tools/web.py:332— WebSearchTool._effective_provider has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 13, 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.
optional_features.with_channel_runtime_status (cognitive 44) nanobot/optional_features.py:552— optional_features.with_channel_runtime_status has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (29 pts), ternaries 3 (7 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebUICommandRouter.start_webui_request (cognitive 44) nanobot/webui/inbound_commands.py:908— WebUICommandRouter.start_webui_request has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 8, error handling 3 (6 pts), ternaries 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebUISettingsRouter.dispatch (cognitive 44) nanobot/webui/settings_routes.py:282— WebUISettingsRouter.dispatch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 2 (6 pts), boolean chains 5, ternaries 3 (5 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.
useModelSettingsActions.useModelSettingsActions.saveModelSettings (cognitive 44) webui/src/components/settings/models/useModelSettingsActions.ts:169— useModelSettingsActions.useModelSettingsActions.saveModelSettings has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 15 (19 pts), if/else 9 (13 pts), boolean chains 9, error handling 2 (3 pts) (nesting depth added 9). Of this number, 42 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.
AppsSettings.McpCustomServerPanel (cognitive 44) webui/src/components/settings/system/AppsSettings.tsx:1003— AppsSettings.McpCustomServerPanel has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 20 (39 pts), boolean chains 5 (nesting depth added 19). Of this number, 42 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.
parsing._hosted_web_search_event (cognitive 43) nanobot/providers/openai_responses/parsing.py:89— parsing._hosted_web_search_event has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 10, ternaries 4 (5 pts), loops 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript._select_transcript_page (cognitive 43) nanobot/webui/transcript.py:411— transcript._select_transcript_page has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 14, ternaries 6, 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.
QuickPairSetup.QuickPairSetup (cognitive 43) webui/src/components/remote/QuickPairSetup.tsx:12— QuickPairSetup.QuickPairSetup has cognitive complexity 43 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 9, ternaries 4 (9 pts), error handling 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 43 points are its own statements and the rest belongs to 10 function items inside it that branch (run, a function literal at line 79, 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.
ssh-address.parseSSHAddress (cognitive 43) webui/src/lib/ssh-address.ts:9— ssh-address.parseSSHAddress has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 8, loops 2, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadFileTool.execute (cognitive 42) nanobot/agent/tools/filesystem.py:389— ReadFileTool.execute has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 3 (6 pts), boolean chains 3, ternaries 2 (3 pts), error handling 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.
ToolLoader.load (cognitive 42) nanobot/agent/tools/loader.py:89— ToolLoader.load has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 3 (6 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAICompatProvider._sanitize_messages (cognitive 42) REDACTED:631— OpenAICompatProvider._sanitize_messages has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebUICommandRouter.dispatch (cognitive 42) nanobot/webui/inbound_commands.py:328— WebUICommandRouter.dispatch has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (29 pts), error handling 5 (10 pts), boolean chains 2, ternaries 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.
LatexParser.command (cognitive 42) REDACTED:652— LatexParser.command has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (26 pts), ternaries 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.parseWebuiThreadPayload (cognitive 42) webui/src/lib/api.ts:421— api.parseWebuiThreadPayload has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 11, loops 1 (2 pts), ternaries 1 (nesting depth added 11). Of this number, 25 points are the body's own statements and 17 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
data_access.data_access (cognitive 41) nanobot/data_access.py:296— data_access.data_access has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 11, loops 4 (7 pts), ternaries 2 (4 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recovery.restore_runtime_checkpoint (cognitive 41) nanobot/session/recovery.py:323— recovery.restore_runtime_checkpoint has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 8, ternaries 6 (8 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.fetchMentionCandidates (cognitive 41) tui/src/client/api.ts:450— api.fetchMentionCandidates has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 5 (9 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 18). Of this number, 36 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsPage.SettingsPage (cognitive 41) webui/src/components/settings/SettingsPage.tsx:80— SettingsPage.SettingsPage has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 29 (55 pts), boolean chains 26, if/else 19 (25 pts), match/switch 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SettingsPage.SettingsPage::renderSettingsSection) 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.
PromptRail.PromptRail (cognitive 41) webui/src/components/thread/PromptRail.tsx:22— PromptRail.PromptRail has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 12 (15 pts), boolean chains 8, loops 1 (nesting depth added 5). Most of this is not in the body itself: 8 of the 41 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 150, a function literal at line 47, a function literal at line 76, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
LLMUsageStore.usage_payload (cognitive 40) nanobot/llm_usage/store.py:403— LLMUsageStore.usage_payload has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (17 pts), if/else 10 (14 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helpers._estimate_prompt_tokens_with_source (cognitive 40) nanobot/utils/helpers.py:698— helpers._estimate_prompt_tokens_with_source has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 5 (10 pts), loops 3 (6 pts), boolean chains 4, error handling 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models.update_provider_settings (cognitive 40) nanobot/webui/settings_models.py:1661— settings_models.update_provider_settings has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileReferenceChip.FileReferenceChip (cognitive 40) webui/src/components/FileReferenceChip.tsx:49— FileReferenceChip.FileReferenceChip has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 21 (26 pts), boolean chains 12, if/else 2 (nesting depth added 5). Of this number, 35 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ThreadComposer.ThreadComposer::onKeyDown (cognitive 40) webui/src/components/thread/ThreadComposer.tsx:1787— ThreadComposer.ThreadComposer::onKeyDown has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 9 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ThreadComposer.ThreadComposer) 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.
MessageTool.execute (cognitive 39) nanobot/agent/tools/message.py:141— MessageTool.execute has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 11, ternaries 10 (11 pts), error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
onboard._validate_field_constraint (cognitive 39) nanobot/cli/onboard.py:305— onboard._validate_field_constraint has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 7, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
factory._make_provider_core (cognitive 39) nanobot/providers/factory.py:55— factory._make_provider_core has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 15 (29 pts), if/else 4 (6 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAICompatProvider._parse (cognitive 39) REDACTED:1373— OpenAICompatProvider._parse has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 17, loops 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
context_observer._restore (cognitive 39) nanobot/webui/context_observer.py:89— context_observer._restore has cognitive complexity 39 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (11 pts), boolean chains 7, ternaries 2 (6 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.
settings_models.update_model_configuration (cognitive 39) nanobot/webui/settings_models.py:1367— settings_models.update_model_configuration has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 11 (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.
LinearSecretField.LinearSecretField (cognitive 39) nanobot/channels/linear/webui/LinearSecretField.tsx:12— LinearSecretField.LinearSecretField has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 10 (21 pts), boolean chains 9, if/else 6 (8 pts), error handling 1 (nesting depth added 13). Of this number, 25 points are the body's own statements and 14 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.
ComposerUsagePopover.ComposerUsagePopover (cognitive 39) webui/src/components/thread/ComposerUsagePopover.tsx:25— ComposerUsagePopover.ComposerUsagePopover has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 15 (21 pts), boolean chains 15, if/else 3 (nesting depth added 6). Of this number, 19 points are the body's own statements and 20 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.
image-viewport.ImageViewport (cognitive 39) webui/src/components/ui/image-viewport.tsx:30— image-viewport.ImageViewport has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (21 pts), ternaries 6 (10 pts), boolean chains 7, loops 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 39 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 129, a function literal at line 75, 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.
ContextGovernor.backfill_missing_tool_results (cognitive 38) nanobot/agent/context_governance.py:1016— ContextGovernor.backfill_missing_tool_results has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 4 (7 pts), ternaries 1 (7 pts), boolean chains 2 (nesting depth added 24). 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.
AgentLoop._build_turn (cognitive 38) nanobot/agent/loop.py:2081— AgentLoop._build_turn has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 13, ternaries 4 (9 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.
MemoryArchiver.archive (cognitive 38) nanobot/agent/memory.py:783— MemoryArchiver.archive has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TurnDelivery._publish_event (cognitive 38) nanobot/agent/turn_delivery.py:467— TurnDelivery._publish_event has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
network.migrate_legacy_proxy_config (cognitive 38) nanobot/config/network.py:78— network.migrate_legacy_proxy_config has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 8, loops 4 (5 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
jsonl_migration.read_jsonl (cognitive 38) nanobot/session/jsonl_migration.py:85— jsonl_migration.read_jsonl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 7, 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.
update_worker.main (cognitive 38) REDACTED:905— update_worker.main has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 15, if/else 10, ternaries 6 (10 pts), error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
automation_results.cron_run_response (cognitive 38) nanobot/webui/automation_results.py:25— automation_results.cron_run_response has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteInstances._connect (cognitive 38) nanobot/webui/remote_instances.py:472— RemoteInstances._connect has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 5, loops 2, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
settings_capabilities.update_transcription_settings (cognitive 38) nanobot/webui/settings_capabilities.py:470— settings_capabilities.update_transcription_settings has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 6, error handling 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.
FilePreviewPanelView.FilePreviewPanelView (cognitive 38) webui/src/components/FilePreviewPanelView.tsx:19— FilePreviewPanelView.FilePreviewPanelView has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 14 (32 pts), boolean chains 6 (nesting depth added 18). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
MarkdownTextRenderer.MarkdownTextRenderer (cognitive 38) webui/src/components/MarkdownTextRenderer.tsx:525— MarkdownTextRenderer.MarkdownTextRenderer has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17, boolean chains 11, ternaries 10. Most of this is not in the body itself: 5 of the 38 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 550, 537, 546, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
onboard._handle_fallback_models_field (cognitive 37) nanobot/cli/onboard.py:688— onboard._handle_fallback_models_field has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicProvider.chat_stream (cognitive 37) REDACTED:767— AnthropicProvider.chat_stream has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 13, error handling 3 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XAIGrokProvider._call_xai (cognitive 37) nanobot/providers/xai_grok_provider.py:101— XAIGrokProvider._call_xai has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 10, error handling 3 (5 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update_uv.cache_digest (cognitive 37) nanobot/update_uv.py:124— update_uv.cache_digest has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helpers.split_message (cognitive 37) nanobot/utils/helpers.py:594— helpers.split_message has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 4, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useHostSessions.useHostSessions.readDirectory (cognitive 37) webui/src/components/remote/useHostSessions.ts:108— useHostSessions.useHostSessions.readDirectory has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 12, ternaries 1 (3 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 123, a function literal at line 142, 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.
ChannelInstancesPanelView.ChannelInstancesPanelView (cognitive 37) webui/src/components/settings/channels/ChannelInstancesPanelView.tsx:51— ChannelInstancesPanelView.ChannelInstancesPanelView has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 13, if/else 3, error handling 2 (nesting depth added 6). Most of this is not in the body itself: 2 of the 37 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 137, toggleInstance, saveSelectedInstanceSettings, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ThinkingReasoningShell.ThinkingReasoningShell (cognitive 37) webui/src/components/thread/activity/ThinkingReasoningShell.tsx:19— ThinkingReasoningShell.ThinkingReasoningShell has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 16 (28 pts), boolean chains 8, if/else 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
optional_features.optional_features_payload (cognitive 36) nanobot/optional_features.py:441— optional_features.optional_features_payload has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 6 (13 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_capabilities.update_web_search_settings (cognitive 36) nanobot/webui/settings_capabilities.py:268— settings_capabilities.update_web_search_settings has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 7, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostSwitcherView.HostMenuItems (cognitive 36) webui/src/components/remote/HostSwitcherView.tsx:24— HostSwitcherView.HostMenuItems has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 14, ternaries 3 (6 pts) (nesting depth added 7). Most of this is not in the body itself: 9 of the 36 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 50, a function literal at line 40, a function literal at line 82, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useHostSessions.useHostSessions (cognitive 36) webui/src/components/remote/useHostSessions.ts:21— useHostSessions.useHostSessions has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 17, if/else 12 (15 pts), ternaries 2, error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 311, 295, 304, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SettingsPage.SettingsPage::renderSettingsSection (cognitive 36) webui/src/components/settings/SettingsPage.tsx:224— SettingsPage.SettingsPage::renderSettingsSection has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 12 (25 pts), boolean chains 9, if/else 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SettingsPage.SettingsPage) 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.
McpManagementDialog.McpManagementDialog (cognitive 36) webui/src/components/settings/system/McpManagementDialog.tsx:43— McpManagementDialog.McpManagementDialog has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 15 (19 pts), boolean chains 11, if/else 6 (nesting depth added 4). Of this number, 24 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
RuntimeConfigSettings.useRuntimeConfigSettings.save (cognitive 36) webui/src/components/settings/system/RuntimeConfigSettings.tsx:73— RuntimeConfigSettings.useRuntimeConfigSettings.save has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 9, ternaries 3 (7 pts), error handling 1, loops 1 (nesting depth added 10). Of this number, 33 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.
activity-message-model.coalesceActivityMessages (cognitive 36) webui/src/components/thread/activity/activity-message-model.ts:14— activity-message-model.coalesceActivityMessages has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
exec-session-model.execSessionCommands (cognitive 36) webui/src/components/thread/activity/exec-session-model.ts:97— exec-session-model.execSessionCommands has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (17 pts), ternaries 2 (9 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
channels.ChannelFormPreview (cognitive 36) webui/src/dev/gallery/channels.tsx:25— channels.ChannelFormPreview has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 11 (13 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 10 of the 36 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 46, validate, 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.
ListDirTool.execute (cognitive 35) nanobot/agent/tools/filesystem.py:1306— ListDirTool.execute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 2 (8 pts), loops 2 (4 pts), boolean chains 2, error handling 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLMProvider._enforce_role_alternation (cognitive 35) nanobot/providers/base.py:941— LLMProvider._enforce_role_alternation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 7, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update_uv.prepare_uv (cognitive 35) nanobot/update_uv.py:265— update_uv.prepare_uv has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 9, loops 4, ternaries 2, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LinearMemberAccessView.LinearMemberAccessView (cognitive 35) nanobot/channels/linear/webui/LinearMemberAccessView.tsx:27— LinearMemberAccessView.LinearMemberAccessView has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 14 (22 pts), boolean chains 8, if/else 3 (4 pts), loops 1 (nesting depth added 9). Of this number, 18 points are the body's own statements and 17 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinearPanel.LinearPanel (cognitive 35) nanobot/channels/linear/webui/LinearPanel.tsx:22— LinearPanel.LinearPanel has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 11, ternaries 5 (6 pts), error handling 3 (5 pts) (nesting depth added 4). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 16 function items inside it that branch (disconnectWorkspace, a function literal at line 160, a function literal at line 201, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WebSettings.WebSettings (cognitive 35) webui/src/components/settings/capabilities/WebSettings.tsx:77— WebSettings.WebSettings has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 13 (22 pts), boolean chains 13 (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.
ProviderSettings.ProvidersSettings (cognitive 35) webui/src/components/settings/models/ProviderSettings.tsx:531— ProviderSettings.ProvidersSettings has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 47 (97 pts), boolean chains 31, if/else 12 (15 pts) (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ProviderSettings.ProvidersSettings::renderProviderForm) 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.
thread-event-projection.attachProjectedReasoning (cognitive 35) webui/src/lib/thread-event-projection.ts:621— thread-event-projection.attachProjectedReasoning has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 13, ternaries 4 (6 pts), loops 1 (nesting depth added 8). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebSearchTool._search_volcengine (cognitive 34) nanobot/agent/tools/web.py:942— WebSearchTool._search_volcengine has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 13, error handling 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.
converters.convert_messages (cognitive 34) nanobot/providers/openai_responses/converters.py:13— converters.convert_messages has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parsing.parse_response_output (cognitive 34) nanobot/providers/openai_responses/parsing.py:608— parsing.parse_response_output has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (20 pts), boolean chains 8, loops 2 (4 pts), ternaries 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp_presets_api.mcp_presets_settings_action (cognitive 34) nanobot/webui/mcp_presets_api.py:1301— mcp_presets_api.mcp_presets_settings_action has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 8 (16 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.
SystemSettingsHandler.handle (cognitive 34) nanobot/webui/settings_system.py:505— SystemSettingsHandler.handle has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (25 pts), error handling 3 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ModelsSettings.ModelsSettings::renderPresetEditor (cognitive 34) webui/src/components/settings/models/ModelsSettings.tsx:433— ModelsSettings.ModelsSettings::renderPresetEditor has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 15 (22 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. This shape REPEATS in the file: one other method here (ModelsSettings.ModelsSettings) 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.
ProviderSettings.ProviderOAuthLoginDialog (cognitive 34) webui/src/components/settings/models/ProviderSettings.tsx:167— ProviderSettings.ProviderOAuthLoginDialog has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 17 (27 pts), boolean chains 4, if/else 2 (3 pts) (nesting depth added 11). Of this number, 30 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.
ProviderIcon.ProviderIcon (cognitive 34) webui/src/components/settings/shared/ProviderIcon.tsx:7— ProviderIcon.ProviderIcon has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 14 (29 pts), boolean chains 5 (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.
SettingsSectionSkeleton.Row (cognitive 34) webui/src/components/settings/shared/SettingsSectionSkeleton.tsx:20— SettingsSectionSkeleton.Row has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 9 (33 pts), boolean chains 1 (nesting depth added 24). 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.
useQueuedPrompt.normalizeQueuedPrompt (cognitive 34) webui/src/components/thread/useQueuedPrompt.ts:90— useQueuedPrompt.normalizeQueuedPrompt has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 13 (17 pts), if/else 6 (9 pts), boolean chains 8 (nesting depth added 7). Of this number, 17 points are the body's own statements and 17 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.
AgentLoop._restore_turn (cognitive 33) nanobot/agent/loop.py:1950— AgentLoop._restore_turn has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 8, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyTool._format_value (cognitive 33) nanobot/agent/tools/self.py:198— MyTool._format_value has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 8 (14 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WebSearchTool._search_deepseek (cognitive 33) nanobot/agent/tools/web.py:815— WebSearchTool._search_deepseek has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 3 (7 pts), error handling 3, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiagramJobs.observe (cognitive 33) tui/src/rendering/mermaid/jobs.ts:123— DiagramJobs.observe has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 14). Most of this is not in the body itself: 6 of the 33 points are its own statements and the rest belongs to one function literal inside it that branches (line 126). 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.
App.App (cognitive 33) webui/src/App.tsx:606— App.App has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 5 (7 pts), error handling 5, boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 3 of the 33 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 652, a function literal at line 615, a function literal at line 714, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
svg-image.style (cognitive 33) REDACTED:178— svg-image.style has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostSwitcherView.HostSwitcherView (cognitive 33) webui/src/components/remote/HostSwitcherView.tsx:104— HostSwitcherView.HostSwitcherView has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 17 (23 pts), boolean chains 7, if/else 2 (3 pts) (nesting depth added 7). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomationCalendar.AutomationCalendar (cognitive 33) webui/src/components/settings/system/AutomationCalendar.tsx:231— AutomationCalendar.AutomationCalendar has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 14 (24 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 11). Most of this is not in the body itself: 11 of the 33 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 287, a function literal at line 265, a function literal at line 378, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
generic-tool-model.activityLabel (cognitive 33) webui/src/components/thread/activity/generic-tool-model.ts:209— generic-tool-model.activityLabel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 7 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreadMotionCoordinator.flushGeometry (cognitive 33) webui/src/components/thread/thread-motion.ts:453— ThreadMotionCoordinator.flushGeometry has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (22 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.
ContextGovernor.drop_orphan_tool_results (cognitive 32) nanobot/agent/context_governance.py:985— ContextGovernor.drop_orphan_tool_results has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecTool._split_shell_segments (cognitive 32) nanobot/agent/tools/shell.py:693— ExecTool._split_shell_segments has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 5, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CliAppManager.catalog (cognitive 32) nanobot/apps/cli/service.py:541— CliAppManager.catalog has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 2 (5 pts), loops 3 (4 pts), boolean chains 3, error handling 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.
update_backup.ensure_backup (cognitive 32) nanobot/update_backup.py:144— update_backup.ensure_backup has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (5 pts), boolean chains 3, error handling 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.
update_profiles._observe (cognitive 32) nanobot/update_profiles.py:124— update_profiles._observe has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 3 (7 pts), boolean chains 3, error handling 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.
CredentialForm.CredentialForm (cognitive 32) webui/src/components/settings/channels/CredentialForm.tsx:81— CredentialForm.CredentialForm has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 15 (20 pts), boolean chains 9, if/else 3 (nesting depth added 5). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 100, 169). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useModelSettingsActions.useModelSettingsActions.saveProvider (cognitive 32) webui/src/components/settings/models/useModelSettingsActions.ts:436— useModelSettingsActions.useModelSettingsActions.saveProvider has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 3, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsSectionSkeleton.RuntimeGroups (cognitive 32) webui/src/components/settings/shared/SettingsSectionSkeleton.tsx:69— SettingsSectionSkeleton.RuntimeGroups has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 7 (28 pts), boolean chains 4 (nesting depth added 21). None of this is in the body itself: all 32 points belong to 3 function literals inside it that branch (lines 74, 70, 74). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
exec-session-model.describeExecSession (cognitive 32) webui/src/components/thread/activity/exec-session-model.ts:146— exec-session-model.describeExecSession has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 10 (19 pts), boolean chains 8, if/else 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecSessionTool._wait (cognitive 31) nanobot/agent/tools/exec_session.py:854— ExecSessionTool._wait has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 5 (13 pts), boolean chains 4, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecTool._resolve_shell (cognitive 31) nanobot/agent/tools/shell.py:488— ExecTool._resolve_shell has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
commands.status (cognitive 31) nanobot/cli/commands.py:508— commands.status has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 3 (6 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_grok_provider._parse_xai_grok_models (cognitive 31) nanobot/providers/xai_grok_provider.py:683— xai_grok_provider._parse_xai_grok_models has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 4 (9 pts), boolean chains 6, 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.
text.outlineDiagramText (cognitive 31) tui/src/rendering/mermaid/text.ts:23— text.outlineDiagramText has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 9 (22 pts), ternaries 8 (20 pts), boolean chains 7 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (text.outlineDiagramText::collect) 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.
Sidebar.Sidebar (cognitive 31) webui/src/components/Sidebar.tsx:117— Sidebar.Sidebar has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 17 (19 pts), boolean chains 12 (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.
useHostSessions.useHostSessions.connect (cognitive 31) webui/src/components/remote/useHostSessions.ts:176— useHostSessions.useHostSessions.connect has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 8, ternaries 2 (4 pts), error handling 1 (nesting depth added 6). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelQrConnectFlow.ChannelQrConnectFlow (cognitive 31) webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:24— ChannelQrConnectFlow.ChannelQrConnectFlow has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9, ternaries 4 (6 pts), error handling 4 (nesting depth added 3). Most of this is not in the body itself: 2 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 90, a function literal at line 156, submitPoll, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AutomationRunDialogView.AutomationRunDialogView (cognitive 31) webui/src/components/settings/system/AutomationRunDialogView.tsx:16— AutomationRunDialogView.AutomationRunDialogView has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 16 (27 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpManagementDialog.ConnectionPanel (cognitive 31) webui/src/components/settings/system/McpManagementDialog.tsx:535— McpManagementDialog.ConnectionPanel has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 18 (25 pts), boolean chains 6 (nesting depth added 7). Of this number, 25 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.
PromptNavigator.PromptNavigator (cognitive 31) webui/src/components/thread/PromptNavigator.tsx:27— PromptNavigator.PromptNavigator has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 12, ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 143, 128, 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.
windows_browser.launch_browser (cognitive 30) nanobot/cli/windows_browser.py:47— windows_browser.launch_browser has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 3 (9 pts), boolean chains 3, loops 1 (3 pts), ternaries 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.
loader._resolve_in_place (cognitive 30) nanobot/config/loader.py:234— loader._resolve_in_place has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 5 (10 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockProvider._content_blocks (cognitive 30) nanobot/providers/bedrock_provider.py:141— BedrockProvider._content_blocks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
routing.resolve_provider_route (cognitive 30) nanobot/providers/routing.py:93— routing.resolve_provider_route has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 10 (13 pts), ternaries 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SessionState._apply_turn (cognitive 30) nanobot/session/state.py:527— SessionState._apply_turn has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 7, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models.provider_models_payload (cognitive 30) nanobot/webui/settings_models.py:644— settings_models.provider_models_payload has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 10, ternaries 2 (3 pts), error handling 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
GatewayHTTPHandler._handle_webui_automation_result (cognitive 30) nanobot/webui/ws_http.py:1555— GatewayHTTPHandler._handle_webui_automation_result has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 6, ternaries 2 (4 pts), error handling 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PickerMenu.render (cognitive 30) tui/src/menus/picker-menu.ts:145— PickerMenu.render has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 9 (21 pts), if/else 4 (6 pts), boolean chains 2, loops 1 (nesting depth added 14). Of this number, 26 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.
App.readShellRoute (cognitive 30) webui/src/App.tsx:241— App.readShellRoute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10, ternaries 6 (9 pts), boolean chains 7, error handling 2 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
useModelPresetDrag.useModelPresetDrag (cognitive 30) webui/src/components/settings/models/useModelPresetDrag.ts:14— useModelPresetDrag.useModelPresetDrag has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6, loops 2, ternaries 1 (2 pts) (nesting depth added 7). None of this is in the body itself: all 30 points belong to 7 function literals inside it that branch (lines 51, 121, 86, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SessionInfoPopoverView.SessionInfoPopoverView (cognitive 30) webui/src/components/thread/SessionInfoPopoverView.tsx:53— SessionInfoPopoverView.SessionInfoPopoverView has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 7 (9 pts), boolean chains 5, error handling 2 (nesting depth added 7). Most of this is not in the body itself: 13 of the 30 points are its own statements and the rest belongs to 8 function items inside it that branch (handleAction, handleEdit, detailPlaceholder, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FindFilesTool._execute_sync (cognitive 29) nanobot/agent/tools/search.py:431— FindFilesTool._execute_sync has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ShellOutputFilter.feed (cognitive 29) nanobot/agent/tools/shell_output.py:15— ShellOutputFilter.feed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, ternaries 1 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
remote.pair (cognitive 29) REDACTED:163— remote.pair has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 2 (4 pts), loops 1 (3 pts), boolean chains 2, error handling 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqliteSessionStore.append_history (cognitive 29) nanobot/session/sqlite_store.py:588— SqliteSessionStore.append_history has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (2 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.
update_worker._verification_child (cognitive 29) REDACTED:625— update_worker._verification_child has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4, loops 2 (3 pts), error handling 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.
mcp_presets_api._mcp_server_config (cognitive 29) nanobot/webui/mcp_presets_api.py:1006— mcp_presets_api._mcp_server_config has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 11, ternaries 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mcp_presets_api.mcp_presets_action (cognitive 29) nanobot/webui/mcp_presets_api.py:1195— mcp_presets_api.mcp_presets_action has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 1 (3 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models.oauth_provider_status (cognitive 29) nanobot/webui/settings_models.py:208— settings_models.oauth_provider_status has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 7, error handling 3 (6 pts), if/else 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tool-renderers.toolLabel (cognitive 29) tui/src/rendering/tool-renderers.ts:38— tool-renderers.toolLabel has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 9 (10 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.
MermaidBlock.MermaidBlock (cognitive 29) webui/src/components/markdown-diagrams/MermaidBlock.tsx:27— MermaidBlock.MermaidBlock has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 12, ternaries 7 (11 pts), if/else 6 (nesting depth added 4). Of this number, 16 points are the body's own statements and 13 belong to 8 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TokenUsageCard.TokenUsageCard (cognitive 29) webui/src/components/settings/TokenUsageCard.tsx:51— TokenUsageCard.TokenUsageCard has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 8, loops 2 (3 pts), if/else 1 (2 pts) (nesting depth added 8). Of this number, 15 points are the body's own statements and 14 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelsSettings.ModelsSettings (cognitive 29) webui/src/components/settings/models/ModelsSettings.tsx:202— ModelsSettings.ModelsSettings has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 52 (97 pts), boolean chains 54, if/else 26 (38 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent 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 (ModelsSettings.ModelsSettings::renderPresetEditor) 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.
BrowserNotificationSettings.BrowserNotificationSettings (cognitive 29) webui/src/components/settings/notifications/BrowserNotificationSettings.tsx:11— BrowserNotificationSettings.BrowserNotificationSettings has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 14, ternaries 7 (8 pts), if/else 6 (7 pts) (nesting depth added 2). Of this number, 21 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AutomationsSettings.AutomationEditDialog (cognitive 29) webui/src/components/settings/system/AutomationsSettings.tsx:690— AutomationsSettings.AutomationEditDialog has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 9 (18 pts), boolean chains 7, if/else 3 (4 pts) (nesting depth added 10). Of this number, 22 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.
ThreadShell.ThreadShell::composer (cognitive 29) webui/src/components/thread/ThreadShell.tsx:1257— ThreadShell.ThreadShell::composer has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 15 (23 pts), boolean chains 6 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ThreadShell.ThreadShell) 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.
activity-timeline.projectOrderedTurn (cognitive 29) webui/src/lib/activity-timeline.ts:144— activity-timeline.projectOrderedTurn has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 2, loops 2 (nesting depth added 10). Of this number, 23 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientRunLedger.applyCommand (cognitive 29) webui/src/lib/client-run-ledger.ts:159— ClientRunLedger.applyCommand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (9 pts), boolean chains 3, match/switch 1 (nesting depth added 14). 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.
onboard.run_onboard (cognitive 28) nanobot/cli/onboard.py:1851— onboard.run_onboard has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (24 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicProvider._assistant_blocks (cognitive 28) REDACTED:306— AnthropicProvider._assistant_blocks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, loops 3 (4 pts), ternaries 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.
update_fallback.supervise (cognitive 28) nanobot/update_fallback.py:284— update_fallback.supervise has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 5 (7 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RemoteInstances._check (cognitive 28) nanobot/webui/remote_instances.py:193— RemoteInstances._check has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, loops 1 (3 pts), error handling 2, ternaries 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.
pty_smoke.smoke (cognitive 28) tui/scripts/pty_smoke.py:77— pty_smoke.smoke has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, loops 3, error handling 1 (2 pts), 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.
api.fetchSessions (cognitive 28) tui/src/client/api.ts:391— api.fetchSessions has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 6 (7 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 415). 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.
NanobotClient.handleMessage (cognitive 28) tui/src/client/nanobot-client.ts:308— NanobotClient.handleMessage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiffViewer.render (cognitive 28) tui/src/views/diff-viewer.ts:251— DiffViewer.render has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 11, if/else 3 (4 pts), loops 1 (nesting depth added 5). Of this number, 26 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Transcript.prependHistory (cognitive 28) tui/src/rendering/transcript.ts:271— Transcript.prependHistory has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (7 pts), boolean chains 5, loops 1 (nesting depth added 12). Of this number, 21 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.
AutomationCalendar.CalendarEntryRow (cognitive 28) webui/src/components/settings/system/AutomationCalendar.tsx:109— AutomationCalendar.CalendarEntryRow has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 12 (22 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useNanobotStream.useNanobotStream.applyPendingStreamEvents (cognitive 28) webui/src/hooks/useNanobotStream.ts:313— useNanobotStream.useNanobotStream.applyPendingStreamEvents has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), boolean chains 5, 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.
subagent-tasks.mergeSubagentTasks (cognitive 28) webui/src/lib/subagent-tasks.ts:45— subagent-tasks.mergeSubagentTasks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (20 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 14). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextGovernor.strip_malformed_tool_calls (cognitive 27) nanobot/agent/context_governance.py:930— ContextGovernor.strip_malformed_tool_calls has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentLoop._process_message (cognitive 27) nanobot/agent/loop.py:1736— AgentLoop._process_message has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 9, ternaries 4 (6 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
TurnDelivery.complete (cognitive 27) nanobot/agent/turn_delivery.py:353— TurnDelivery.complete has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 9, 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.
commands.onboard (cognitive 27) nanobot/cli/commands.py:155— commands.onboard has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (25 pts), error handling 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.
update.update (cognitive 27) nanobot/cli/update.py:9— update.update has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
optional_features.install_packages (cognitive 27) nanobot/optional_features.py:230— optional_features.install_packages has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (7 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.
AnthropicProvider._convert_messages (cognitive 27) REDACTED:197— AnthropicProvider._convert_messages has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
github_copilot_provider.login_github_copilot (cognitive 27) nanobot/providers/github_copilot_provider.py:80— github_copilot_provider.login_github_copilot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update_manager.read_manager_policy (cognitive 27) nanobot/update_manager.py:113— update_manager.read_manager_policy has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 6 (7 pts), boolean chains 6, error handling 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.
RecoveryCoordinator._recover_session (cognitive 27) nanobot/webui/recovery.py:257— RecoveryCoordinator._recover_session has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, ternaries 4 (6 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript._client_projection_events (cognitive 27) nanobot/webui/transcript.py:1735— transcript._client_projection_events has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, loops 1, ternaries 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.
CliAppMentionText.splitCapabilityMentionSegments (cognitive 27) webui/src/components/CliAppMentionText.tsx:44— CliAppMentionText.splitCapabilityMentionSegments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (7 pts), boolean chains 6, loops 1 (nesting depth added 7). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageGallery.ImageGallery (cognitive 27) webui/src/components/ImageGallery.tsx:11— ImageGallery.ImageGallery has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 6, if/else 5 (nesting depth added 2). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 68, 57, 23, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ImageGenerationSettings.ImageGenerationSettings (cognitive 27) webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:49— ImageGenerationSettings.ImageGenerationSettings has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 10 (nesting depth added 6). 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 into named stages: move each independent 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-selection.selectedDiffRows (cognitive 27) webui/src/components/thread/activity/diff-selection.ts:4— diff-selection.selectedDiffRows has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 4 (7 pts), 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.
useNanobotStream.useNanobotStream.send (cognitive 27) webui/src/hooks/useNanobotStream.ts:958— useNanobotStream.useNanobotStream.send has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 12 (14 pts), if/else 7, boolean chains 6 (nesting depth added 2). Of this number, 15 points are the body's own statements and 12 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.
ReadFileTool._read_office_doc (cognitive 26) nanobot/agent/tools/filesystem.py:636— ReadFileTool._read_office_doc has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._format_value (cognitive 26) nanobot/cli/onboard.py:262— onboard._format_value has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (8 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file_references.source_receipt (cognitive 26) nanobot/file_references.py:82— file_references.source_receipt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 1 (3 pts), ternaries 3, boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parsing._extract_reasoning_summary_from_output (cognitive 26) nanobot/providers/openai_responses/parsing.py:584— parsing._extract_reasoning_summary_from_output has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (7 pts), boolean chains 4 (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.
jsonl_migration.migrate_jsonl (cognitive 26) nanobot/session/jsonl_migration.py:153— jsonl_migration.migrate_jsonl has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitStore.summarize_working_tree (cognitive 26) nanobot/utils/gitstore.py:287— GitStore.summarize_working_tree has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 5 (7 pts), error handling 3 (4 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.
helpers.estimate_message_tokens (cognitive 26) nanobot/utils/helpers.py:759— helpers.estimate_message_tokens has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteInstances.snapshot (cognitive 26) nanobot/webui/remote_instances.py:131— RemoteInstances.snapshot has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models._model_metadata_payload (cognitive 26) nanobot/webui/settings_models.py:537— settings_models._model_metadata_payload has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 6, ternaries 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.
settings_models.update_agent_model_settings (cognitive 26) nanobot/webui/settings_models.py:1211— settings_models.update_agent_model_settings 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.
skills_marketplace._load_weekly_installs (cognitive 26) nanobot/webui/skills_marketplace.py:877— skills_marketplace._load_weekly_installs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript.has_pending_tool_calls (cognitive 26) nanobot/webui/transcript.py:1304— transcript.has_pending_tool_calls has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QQConnectFlowView.QQConnectFlowView (cognitive 26) nanobot/channels/qq/webui/QQConnectFlowView.tsx:45— QQConnectFlowView.QQConnectFlowView has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 6, if/else 2, match/switch 1 (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.
AttachmentTile.AttachmentTile (cognitive 26) webui/src/components/AttachmentTile.tsx:20— AttachmentTile.AttachmentTile has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 9, 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.
CodeBlock.CodeBlock (cognitive 26) webui/src/components/CodeBlock.tsx:130— CodeBlock.CodeBlock has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 9, if/else 6 (nesting depth added 3). Of this number, 14 points are the body's own statements and 12 belong to 7 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PairingCodePopup.PairingCodePopup (cognitive 26) webui/src/components/pairing/PairingCodePopup.tsx:13— PairingCodePopup.PairingCodePopup has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 6, if/else 3 (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.
SkillsCatalogSettings.SkillsCatalogSettings (cognitive 26) webui/src/components/settings/SkillsCatalogSettings.tsx:42— SkillsCatalogSettings.SkillsCatalogSettings has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (18 pts), boolean chains 5, if/else 3 (nesting depth added 11). Of this number, 16 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, 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.
TokenUsageModelTrend.TokenUsageModelTrend (cognitive 26) webui/src/components/settings/TokenUsageModelTrend.tsx:13— TokenUsageModelTrend.TokenUsageModelTrend has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 6, if/else 3 (4 pts), loops 2 (nesting depth added 2). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 60, a function literal at line 134, spoken, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AgentActivityCluster.ActivityTraceRow (cognitive 26) webui/src/components/thread/AgentActivityCluster.tsx:955— AgentActivityCluster.ActivityTraceRow has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (21 pts), boolean chains 4, if/else 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.
AgentLoop._prepare_injected_input (cognitive 25) nanobot/agent/loop.py:1001— AgentLoop._prepare_injected_input has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 5 (8 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
execution._execute_tool_call_inner (cognitive 25) nanobot/agent/tools/execution.py:136— execution._execute_tool_call_inner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 2, ternaries 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CliAppManager._iter_artifact_candidates (cognitive 25) nanobot/apps/cli/service.py:1351— CliAppManager._iter_artifact_candidates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 2 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._configure_providers (cognitive 25) nanobot/cli/onboard.py:1092— onboard._configure_providers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (7 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
store._handle_pairing_subcommand (cognitive 25) nanobot/pairing/store.py:361— store._handle_pairing_subcommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 4 (8 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AssemblyAITranscriptionProvider.transcribe (cognitive 25) nanobot/providers/transcription.py:464— AssemblyAITranscriptionProvider.transcribe has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (5 pts), boolean chains 4, 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.
transcription._request_json_with_retry (cognitive 25) nanobot/providers/transcription.py:112— transcription._request_json_with_retry has cognitive complexity 25 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 3 (7 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jsonl_migration.finish_workspace_migration (cognitive 25) nanobot/session/jsonl_migration.py:233— jsonl_migration.finish_workspace_migration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 3 (5 pts), loops 3, 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.
quick_validate._parse_simple_frontmatter (cognitive 25) nanobot/skills/skill-creator/scripts/quick_validate.py:36— quick_validate._parse_simple_frontmatter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, ternaries 1 (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.
quick_validate.validate_skill (cognitive 25) nanobot/skills/skill-creator/scripts/quick_validate.py:128— quick_validate.validate_skill has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
update_restart.run_restarts (cognitive 25) nanobot/update_restart.py:160— update_restart.run_restarts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4 (6 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
automation_chats.automation_chats (cognitive 25) nanobot/webui/automation_chats.py:31— automation_chats.automation_chats has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, ternaries 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
history.fact_from_record (cognitive 25) nanobot/webui/history.py:48— history.fact_from_record has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 10, 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.
settings_models.login_oauth_provider (cognitive 25) nanobot/webui/settings_models.py:1742— settings_models.login_oauth_provider has cognitive complexity 25 (threshold 15). Drivers by points: error handling 8 (16 pts), if/else 5, boolean chains 2, 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.
transcript._with_backfilled_user (cognitive 25) nanobot/webui/transcript.py:1175— transcript._with_backfilled_user has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (19 pts), boolean chains 5, loops 1 (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.
attachments.uploadAttachments (cognitive 25) packages/client-events/attachments.ts:89— attachments.uploadAttachments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (7 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.
footer-hints.hintsFor (cognitive 25) tui/src/views/footer-hints.ts:67— footer-hints.hintsFor has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 9, 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.
ChannelValidationProgress.ChannelValidationProgress (cognitive 25) webui/src/components/settings/channels/ChannelValidationProgress.tsx:69— ChannelValidationProgress.ChannelValidationProgress has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 7, if/else 2 (nesting depth added 5). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 127, 86, 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.
SettingsControls.RestartSettingsFooter (cognitive 25) webui/src/components/settings/shared/SettingsControls.tsx:245— SettingsControls.RestartSettingsFooter has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 9, if/else 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.
AgentActivityCluster.activityTraceEntries (cognitive 25) webui/src/components/thread/AgentActivityCluster.tsx:704— AgentActivityCluster.activityTraceEntries has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 10). 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.
combobox.useComboboxNavigation (cognitive 25) webui/src/components/ui/combobox.tsx:22— combobox.useComboboxNavigation has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 9, if/else 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenRouterImageGenerationClient.generate (cognitive 24) nanobot/providers/image_generation.py:346— OpenRouterImageGenerationClient.generate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeminiImageGenerationClient._generate_gemini_flash (cognitive 24) nanobot/providers/image_generation.py:767— GeminiImageGenerationClient._generate_gemini_flash has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelSettingsHandler.handle (cognitive 24) nanobot/webui/settings_models.py:1992— ModelSettingsHandler.handle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 3 (5 pts), boolean chains 3, ternaries 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, 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.
connection.sanitizeConnectionFailure (cognitive 24) tui/src/client/connection.ts:100— connection.sanitizeConnectionFailure has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (18 pts), loops 2 (5 pts), boolean chains 1 (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 one function item inside it that branches (collect). 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.
latex.renderLatexAsUnicode (cognitive 24) REDACTED:265— latex.renderLatexAsUnicode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiagramViewer.handleKey (cognitive 24) tui/src/rendering/mermaid/viewer.ts:102— DiagramViewer.handleKey has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 6 (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.
SkillsMarketplace.MarketplaceSkillRow (cognitive 24) webui/src/components/settings/SkillsMarketplace.tsx:488— SkillsMarketplace.MarketplaceSkillRow has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 14 (21 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomationsSettings.formatCronScheduleSummary (cognitive 24) webui/src/components/settings/system/AutomationsSettings.tsx:1159— AutomationsSettings.formatCronScheduleSummary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
graph-canvas.paintGraph (cognitive 24) webui/src/components/thread/graph-canvas.ts:32— graph-canvas.paintGraph has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (5 pts), ternaries 2 (4 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.
ThreadMessages.MessageBlockMenu (cognitive 24) webui/src/components/thread/ThreadMessages.tsx:427— ThreadMessages.MessageBlockMenu has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 6 (7 pts), boolean chains 6 (nesting depth added 3). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 443, 542, 554, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ThreadMessages.currentActivityClusterIndices (cognitive 24) webui/src/components/thread/ThreadMessages.tsx:914— ThreadMessages.currentActivityClusterIndices has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, 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.
ThreadMessages.completedMessageBlocks (cognitive 24) webui/src/components/thread/ThreadMessages.tsx:1055— ThreadMessages.completedMessageBlocks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, loops 4, ternaries 1 (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 4 function items inside it that branch (flushGroup, a function literal at line 1065, a function literal at line 1083, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WorkspaceControls.WorkspaceAccessMenu (cognitive 24) webui/src/components/thread/WorkspaceControls.tsx:692— WorkspaceControls.WorkspaceAccessMenu has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 9, if/else 5. Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 775, 719, 721, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useSandboxNotice.useSandboxNotice (cognitive 24) webui/src/components/thread/useSandboxNotice.ts:18— useSandboxNotice.useSandboxNotice has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, ternaries 2 (4 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 29, 26, 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.
usePromptHistory.usePromptHistory.read (cognitive 24) webui/src/hooks/usePromptHistory.ts:159— usePromptHistory.usePromptHistory.read has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 5 (9 pts), boolean chains 4, error handling 1 (nesting depth added 5). 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.
ansi.applySgrParams (cognitive 24) webui/src/lib/ansi.ts:144— ansi.applySgrParams has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 4, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
api.request (cognitive 24) webui/src/lib/api.ts:95— api.request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (6 pts), boolean chains 4, error handling 1 (3 pts) (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.
NanobotClient.sendMessage (cognitive 24) webui/src/lib/nanobot-client.ts:794— NanobotClient.sendMessage has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (13 pts), if/else 6 (7 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
thread-event-projection.answerStreamIndex (cognitive 24) webui/src/lib/thread-event-projection.ts:546— thread-event-projection.answerStreamIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-groups.groupSessions (cognitive 24) webui/src/lib/chat-groups.ts:39— chat-groups.groupSessions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 2 (5 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.
MyTool._inspect (cognitive 23) nanobot/agent/tools/self.py:254— MyTool._inspect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CliAppManager.uninstall (cognitive 23) nanobot/apps/cli/service.py:1253— CliAppManager.uninstall has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9, ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._input_text (cognitive 23) nanobot/cli/onboard.py:438— onboard._input_text has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 3 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
context_graph.parse_context_graph (cognitive 23) nanobot/context_graph.py:56— context_graph.parse_context_graph has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, loops 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processes.spawn_process_tree (cognitive 23) nanobot/execution/processes.py:51— processes.spawn_process_tree has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, ternaries 3, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openai_codex_provider._parse_openai_codex_models (cognitive 23) nanobot/providers/openai_codex_provider.py:838— openai_codex_provider._parse_openai_codex_models has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 6, if/else 3 (5 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAICompatProvider._extract_text_content (cognitive 23) REDACTED:1244— OpenAICompatProvider._extract_text_content has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcription._post_stepfun_asr_with_retry (cognitive 23) nanobot/providers/transcription.py:308— transcription._post_stepfun_asr_with_retry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 3 (5 pts), ternaries 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
network.resolve_url_target (cognitive 23) nanobot/security/network.py:76— network.resolve_url_target has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 4 (6 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionLocation._claim_workspace_namespace (cognitive 23) nanobot/session/location.py:177— SessionLocation._claim_workspace_namespace has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recovery._checkpoint_tool_call_ids (cognitive 23) nanobot/session/recovery.py:193— recovery._checkpoint_tool_call_ids has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update.update_installation (cognitive 23) nanobot/update.py:251— update.update_installation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, error handling 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.
update_guidance.update_guide (cognitive 23) nanobot/update_guidance.py:53— update_guidance.update_guide has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 4 (7 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RotatingTextOutput.write (cognitive 23) nanobot/utils/rotating_output.py:52— RotatingTextOutput.write has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayHTTPHandler._dispatch_misc_routes (cognitive 23) nanobot/webui/ws_http.py:1748— GatewayHTTPHandler._dispatch_misc_routes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (19 pts), error handling 1 (2 pts), 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.
NanobotClient.open (cognitive 23) tui/src/client/nanobot-client.ts:67— NanobotClient.open has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2, error handling 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NanobotTui.handlePaste (cognitive 23) tui/src/app/app.ts:1984— NanobotTui.handlePaste has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4 (nesting depth added 8). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2012, 1997, 2008). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FileActions.FileActions (cognitive 23) webui/src/components/FileActions.tsx:26— FileActions.FileActions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, ternaries 3 (nesting depth added 3). Most of this is not in the body itself: 4 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 59, copy, 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.
svg-image.typography (cognitive 23) REDACTED:116— svg-image.typography has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SettingsSidebar.SettingsSidebar (cognitive 23) webui/src/components/settings/SettingsSidebar.tsx:63— SettingsSidebar.SettingsSidebar has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 13 (18 pts), boolean chains 4, if/else 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CatalogSkeleton.CatalogSkeleton (cognitive 23) webui/src/components/settings/shared/CatalogSkeleton.tsx:4— CatalogSkeleton.CatalogSkeleton has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 6 (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 28). 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.
GoalIsland.GoalIsland (cognitive 23) webui/src/components/thread/GoalIsland.tsx:12— GoalIsland.GoalIsland has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 4, if/else 4 (nesting depth added 3). Of this number, 18 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ThreadShell.recentComposerRoundUsage (cognitive 23) webui/src/components/thread/ThreadShell.tsx:116— ThreadShell.recentComposerRoundUsage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (6 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
trace-activity-model.describeTraceLine (cognitive 23) webui/src/components/thread/activity/trace-activity-model.ts:18— trace-activity-model.describeTraceLine has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (8 pts), if/else 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.
useReconnectRuns.useReconnectRuns (cognitive 23) webui/src/hooks/useReconnectRuns.ts:11— useReconnectRuns.useReconnectRuns has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 5). None of this is in the body itself: all 23 points belong to 3 function literals inside it that branch (lines 27, 54, 14). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
nanobot-client.runObservation (cognitive 23) webui/src/lib/nanobot-client.ts:177— nanobot-client.runObservation has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 6, if/else 2 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentRunner._drain_injections (cognitive 22) nanobot/agent/runner.py:253— AgentRunner._drain_injections has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (3 pts), error handling 2, 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.
_RefreshingOAuthClientProvider._handle_refresh_response (cognitive 22) nanobot/agent/tools/mcp_oauth.py:651— _RefreshingOAuthClientProvider._handle_refresh_response has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turn_hooks.build_agent_turn_hook (cognitive 22) nanobot/agent/turn_hooks.py:41— turn_hooks.build_agent_turn_hook has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 3 (5 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal._maybe_print_interactive_progress (cognitive 22) nanobot/cli/terminal.py:351— terminal._maybe_print_interactive_progress has cognitive complexity 22 (threshold 15). Drivers by points: if/else 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, 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.
UpdateGoalTool.execute (cognitive 22) nanobot/goal/tools.py:290— UpdateGoalTool.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8, 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.
AnthropicProvider._handle_error (cognitive 22) REDACTED:135— AnthropicProvider._handle_error has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 4, boolean chains 3, error handling 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicProvider._parse_response (cognitive 22) REDACTED:660— AnthropicProvider._parse_response has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (6 pts), loops 2 (5 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.
images._prepare_copies (cognitive 22) nanobot/providers/images.py:98— images._prepare_copies has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), boolean chains 2, 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.
ReleaseFeed.stable (cognitive 22) nanobot/release_feed.py:211— ReleaseFeed.stable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recovery._checkpoint_prefix_is_complete (cognitive 22) nanobot/session/recovery.py:224— recovery._checkpoint_prefix_is_complete has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 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.
SqliteSessionStore.save (cognitive 22) nanobot/session/sqlite_store.py:393— SqliteSessionStore.save has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update._release_windows_launchers (cognitive 22) nanobot/update.py:191— update._release_windows_launchers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkerSpec.read (cognitive 22) REDACTED:275— WorkerSpec.read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 4, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GatewayHTTPHandler._handle_webui_thread_get (cognitive 22) nanobot/webui/ws_http.py:1253— GatewayHTTPHandler._handle_webui_thread_get has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, error handling 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
api.fetchSessionUsage (cognitive 22) tui/src/client/api.ts:140— api.fetchSessionUsage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
latex.mathSpanAt (cognitive 22) REDACTED:382— latex.mathSpanAt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageBubble.MessageMedia (cognitive 22) webui/src/components/MessageBubble.tsx:651— MessageBubble.MessageMedia has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (5 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellRuntimeControl.ShellRuntimeControl (cognitive 22) webui/src/components/settings/system/ShellRuntimeControl.tsx:18— ShellRuntimeControl.ShellRuntimeControl has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 7, if/else 3 (4 pts) (nesting depth added 4). Of this number, 12 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.
useSettingsController.useSettingsController (cognitive 22) webui/src/components/settings/useSettingsController.ts:75— useSettingsController.useSettingsController has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 13, if/else 8, ternaries 1. Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 185, 208, 179, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ThreadComposer.CliAppMentionPalette (cognitive 22) webui/src/components/thread/ThreadComposer.tsx:2581— ThreadComposer.CliAppMentionPalette has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 16 (22 pts) (nesting depth added 6). 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 2629, 2596). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ActivityStep.ActivityStep (cognitive 22) webui/src/components/thread/activity/ActivityStep.tsx:31— ActivityStep.ActivityStep has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 7 (nesting depth added 1). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
usePromptHistory.usePromptHistory (cognitive 22) webui/src/hooks/usePromptHistory.ts:51— usePromptHistory.usePromptHistory has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 5. Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 232, 94, 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.
ContextGovernor.normalize_tool_result (cognitive 21) nanobot/agent/context_governance.py:839— ContextGovernor.normalize_tool_result has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentLoop._persist_user_message_early (cognitive 21) nanobot/agent/loop.py:698— AgentLoop._persist_user_message_early has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentLoop.process_direct (cognitive 21) nanobot/agent/loop.py:2507— AgentLoop.process_direct has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
BedrockProvider._merge_consecutive (cognitive 21) nanobot/providers/bedrock_provider.py:268— BedrockProvider._merge_consecutive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAICompatProvider._ensure_gemini_thought_signatures (cognitive 21) REDACTED:748— OpenAICompatProvider._ensure_gemini_thought_signatures has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_grok_provider._xai_hosted_tool_event (cognitive 21) nanobot/providers/xai_grok_provider.py:442— xai_grok_provider._xai_hosted_tool_event has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebuiTurnRoutePolicy.__call__ (cognitive 21) nanobot/session/webui_turns.py:384— WebuiTurnRoutePolicy.__call__ has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (7 pts), if/else 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
package_skill.package_skill (cognitive 21) nanobot/skills/skill-creator/scripts/package_skill.py:34— package_skill.package_skill has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp_presets_api.normalize_mcp_preset_mentions (cognitive 21) nanobot/webui/mcp_presets_api.py:131— mcp_presets_api.normalize_mcp_preset_mentions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
media_api.serve_signed_media (cognitive 21) nanobot/webui/media_api.py:198— media_api.serve_signed_media has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 4 (6 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.
WebUIOutboundDelivery.send_batch (cognitive 21) nanobot/webui/outbound_delivery.py:223— WebUIOutboundDelivery.send_batch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (5 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
skills_marketplace._skillhub_skill (cognitive 21) nanobot/webui/skills_marketplace.py:820— skills_marketplace._skillhub_skill has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (7 pts), if/else 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GatewayHTTPHandler._dispatch_remote_instances (cognitive 21) nanobot/webui/ws_http.py:677— GatewayHTTPHandler._dispatch_remote_instances has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 4 (5 pts), 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.
GatewayHTTPHandler._sessions_list_payload (cognitive 21) nanobot/webui/ws_http.py:1062— GatewayHTTPHandler._sessions_list_payload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 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.
latex.fencedCodeEnd (cognitive 21) REDACTED:461— latex.fencedCodeEnd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelAPIControl.ModelAPIControl (cognitive 21) webui/src/components/settings/models/ModelAPIControl.tsx:12— ModelAPIControl.ModelAPIControl has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 6, if/else 4 (6 pts) (nesting depth added 3). Of this number, 12 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ReadingSettings.ReadingSettings (cognitive 21) webui/src/components/settings/overview/ReadingSettings.tsx:12— ReadingSettings.ReadingSettings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, ternaries 4 (nesting depth added 2). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 7 function items inside it that branch (commitDraft, a function literal at line 106, a function literal at line 26, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
McpManagementDialog.ToolsPanel (cognitive 21) webui/src/components/settings/system/McpManagementDialog.tsx:362— McpManagementDialog.ToolsPanel has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (17 pts), boolean chains 2, if/else 2 (nesting depth added 8). Of this number, 17 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreadHistoryStatus.ThreadHistoryStatus (cognitive 21) webui/src/components/thread/ThreadHistoryStatus.tsx:16— ThreadHistoryStatus.ThreadHistoryStatus has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (18 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.
PaneWorkbench.paneInDirection (cognitive 21) webui/src/components/workbench/PaneWorkbench.tsx:128— PaneWorkbench.paneInDirection has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 4 (7 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bootstrap.deriveWsUrl (cognitive 21) webui/src/lib/bootstrap.ts:100— bootstrap.deriveWsUrl has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5 (7 pts), boolean chains 5 (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.
model-request.composerUsageSnapshots (cognitive 21) webui/src/lib/model-request.ts:27— model-request.composerUsageSnapshots has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 40, 33, 48). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
(anonymous) (cognitive 21) webui/public/sw.js:241— (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, error handling 2, ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 288, 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.
AgentLoop._run_session_queue (cognitive 20) nanobot/agent/loop.py:1463— AgentLoop._run_session_queue has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 3 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentRunner.run (cognitive 20) nanobot/agent/runner.py:300— AgentRunner.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 4 (6 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SubagentManager._create_task (cognitive 20) nanobot/agent/subagent.py:581— SubagentManager._create_task has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 1 (2 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MCPProvider.reload (cognitive 20) nanobot/agent/tools/mcp.py:1494— MCPProvider.reload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, error handling 2 (3 pts), loops 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mcp._normalize_nullable_schema (cognitive 20) nanobot/agent/tools/mcp.py:460— mcp._normalize_nullable_schema has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp_oauth._stored_server (cognitive 20) nanobot/agent/tools/mcp_oauth.py:117— mcp_oauth._stored_server has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 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.
gateway_runtime._heartbeat_has_active_tasks (cognitive 20) REDACTED:240— gateway_runtime._heartbeat_has_active_tasks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gateway_runtime._run_claimed_gateway (cognitive 20) REDACTED:443— gateway_runtime._run_claimed_gateway has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 2, error handling 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.
CronService._execute_job (cognitive 20) nanobot/cron/service.py:593— CronService._execute_job has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 3, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnthropicProvider._merge_consecutive (cognitive 20) REDACTED:436— AnthropicProvider._merge_consecutive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FallbackProvider._should_fallback (cognitive 20) nanobot/providers/fallback_provider.py:757— FallbackProvider._should_fallback has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GraphDecoder.graph (cognitive 20) nanobot/session/history_graph.py:179— GraphDecoder.graph has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdatePlans.prepare (cognitive 20) nanobot/update_plan.py:279— UpdatePlans.prepare has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helpers.sanitize_surrogates_deep (cognitive 20) nanobot/utils/helpers.py:69— helpers.sanitize_surrogates_deep has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (6 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helpers.find_legal_message_start (cognitive 20) nanobot/utils/helpers.py:470— helpers.find_legal_message_start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (4 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp_presets_api.mcp_presets_test_action (cognitive 20) nanobot/webui/mcp_presets_api.py:739— mcp_presets_api.mcp_presets_test_action has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8, ternaries 5 (6 pts), boolean chains 3, error handling 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WebUIOutboundDelivery._message_payload (cognitive 20) nanobot/webui/outbound_delivery.py:445— WebUIOutboundDelivery._message_payload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_capabilities._image_generation_provider_rows (cognitive 20) nanobot/webui/settings_capabilities.py:84— settings_capabilities._image_generation_provider_rows has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 7, 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.
sidebar_state._clean_workbench (cognitive 20) nanobot/webui/sidebar_state.py:155— sidebar_state._clean_workbench has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 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.
ssh_process.ssh_error (cognitive 20) nanobot/webui/ssh_process.py:10— ssh_process.ssh_error has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ws_http._parse_automation_update (cognitive 20) nanobot/webui/ws_http.py:2123— ws_http._parse_automation_update has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MermaidBlock.sync (cognitive 20) tui/src/rendering/mermaid/block.ts:132— MermaidBlock.sync has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 5, ternaries 2, error handling 1. Of this number, 11 points are the body's own statements and 9 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.
svg-image.drawingValue (cognitive 20) REDACTED:157— svg-image.drawingValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 7). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 158). 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.
pele.worker.onmessage (cognitive 20) webui/src/components/markdown-diagrams/pele.worker.ts:9— pele.worker.onmessage has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 6 (7 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelPairing.ChannelPairing (cognitive 20) webui/src/components/pairing/ChannelPairing.tsx:13— ChannelPairing.ChannelPairing has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (5 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 4). None of this is in the body itself: all 20 points belong to 11 function literals inside it that branch (lines 35, 43, 78, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentActivityCluster.ActivityTraceTimeline (cognitive 20) webui/src/components/thread/AgentActivityCluster.tsx:775— AgentActivityCluster.ActivityTraceTimeline has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3, boolean chains 2 (nesting depth added 4). Of this number, 10 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
graph-presentation.createGraphPresentation.update (cognitive 20) webui/src/components/thread/graph-presentation.ts:21— graph-presentation.createGraphPresentation.update has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3, ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thread-event-projection.projectToolActivity (cognitive 20) webui/src/lib/thread-event-projection.ts:747— thread-event-projection.projectToolActivity has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (15 pts), boolean chains 3, if/else 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat-groups.limitGroups (cognitive 20) webui/src/lib/chat-groups.ts:135— chat-groups.limitGroups has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
latest-thread-request.fetchLatestWebuiThread (cognitive 20) webui/src/lib/latest-thread-request.ts:23— latest-thread-request.fetchLatestWebuiThread has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3 (nesting depth added 5). 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 (a function literal at line 81, a function literal at line 57, 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.
remark-tex-math.tokenizeMathFlow (cognitive 20) webui/src/lib/remark-tex-math.ts:301— remark-tex-math.tokenizeMathFlow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, ternaries 5 (7 pts), boolean chains 4 (nesting depth added 2). None of this is in the body itself: all 20 points belong to 7 function items inside it that branch (content, contentStart, afterOpen, …). 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.
imageEncode.worker.sniffImageMime (cognitive 20) webui/src/workers/imageEncode.worker.ts:66— imageEncode.worker.sniffImageMime has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentLoop.run (cognitive 19) nanobot/agent/loop.py:1315— AgentLoop.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model_runtime._override_key (cognitive 19) nanobot/agent/model_runtime.py:26— model_runtime._override_key has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CronTool._parse_schedule (cognitive 19) nanobot/agent/tools/cron.py:196— CronTool._parse_schedule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CronTool._update_job (cognitive 19) nanobot/agent/tools/cron.py:243— CronTool._update_job has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ExecSession._watch_timeout (cognitive 19) nanobot/agent/tools/exec_session.py:267— _ExecSession._watch_timeout has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (3 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.
WebSearchTool._search_olostep (cognitive 19) nanobot/agent/tools/web.py:440— WebSearchTool._search_olostep has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, error handling 3, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebSearchTool._search_exa (cognitive 19) nanobot/agent/tools/web.py:676— WebSearchTool._search_exa has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, error handling 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_macos_dock._serve (cognitive 19) nanobot/cli/_macos_dock.py:52— _macos_dock._serve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (5 pts), loops 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tui_launcher.launch_tui (cognitive 19) REDACTED:73— tui_launcher.launch_tui has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 3 (5 pts), boolean chains 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AnthropicProvider._build_kwargs (cognitive 19) REDACTED:576— AnthropicProvider._build_kwargs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
BedrockProvider._assistant_blocks (cognitive 19) nanobot/providers/bedrock_provider.py:232— BedrockProvider._assistant_blocks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockProvider._parse_response (cognitive 19) nanobot/providers/bedrock_provider.py:509— BedrockProvider._parse_response has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 8, 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.
SessionState._submit (cognitive 19) nanobot/session/state.py:141— SessionState._submit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
skills_api._install_options (cognitive 19) nanobot/webui/skills_api.py:203— skills_api._install_options has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript._compact_completed_stream_deltas (cognitive 19) nanobot/webui/transcript.py:283— transcript._compact_completed_stream_deltas has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 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.
transcript._session_user_event (cognitive 19) nanobot/webui/transcript.py:825— transcript._session_user_event has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, ternaries 7, boolean chains 2, error handling 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.
GatewayHTTPHandler._handle_session_delete (cognitive 19) nanobot/webui/ws_http.py:1427— GatewayHTTPHandler._handle_session_delete has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayHTTPHandler._serve_static (cognitive 19) nanobot/webui/ws_http.py:2057— GatewayHTTPHandler._serve_static has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
DiagramJobs.start (cognitive 19) tui/src/rendering/mermaid/jobs.ts:89— DiagramJobs.start has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (6 pts), boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 18 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.
DiagramViewer.paint (cognitive 19) tui/src/rendering/mermaid/viewer.ts:186— DiagramViewer.paint has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 3. Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 213, 224, 227). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
NanobotTui.handleComposerContentChange (cognitive 19) tui/src/app/app.ts:1861— NanobotTui.handleComposerContentChange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SSHHostPicker.SSHHostPicker (cognitive 19) webui/src/components/remote/SSHHostPicker.tsx:12— SSHHostPicker.SSHHostPicker has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 2 (4 pts), error handling 1 (nesting depth added 3). 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 literals inside it that branch (lines 21, 46, 41, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useModelSettingsActions.useModelSettingsActions.runProviderOAuth (cognitive 19) webui/src/components/settings/models/useModelSettingsActions.ts:524— useModelSettingsActions.useModelSettingsActions.runProviderOAuth has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (5 pts), boolean chains 4, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelControls.ProviderPicker (cognitive 19) webui/src/components/settings/shared/ModelControls.tsx:86— ModelControls.ProviderPicker has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 6, if/else 4 (nesting depth added 3). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
AutomationRunAtPicker.AutomationRunAtPicker (cognitive 19) webui/src/components/settings/system/AutomationRunAtPicker.tsx:46— AutomationRunAtPicker.AutomationRunAtPicker has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 3, ternaries 3, match/switch 1. Most of this is not in the body itself: 7 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 157, navigate, a function literal at line 67, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AssistantSelectionAction.AssistantSelectionAction (cognitive 19) webui/src/components/thread/AssistantSelectionAction.tsx:44— AssistantSelectionAction.AssistantSelectionAction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, ternaries 5 (7 pts), boolean chains 5 (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 7 function literals inside it that branch (lines 53, 79, 113, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ContextInspector.ContextInspector::content (cognitive 19) webui/src/components/thread/ContextInspector.tsx:64— ContextInspector.ContextInspector::content has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, ternaries 7 (8 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.
ThreadComposer.SlashCommandPalette (cognitive 19) webui/src/components/thread/ThreadComposer.tsx:2745— ThreadComposer.SlashCommandPalette has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 4 (nesting depth added 5). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 2775). 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.
FileEditRow.FileUnifiedDiff (cognitive 19) webui/src/components/thread/activity/FileEditRow.tsx:155— FileEditRow.FileUnifiedDiff has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 7, if/else 3 (nesting depth added 2). Of this number, 10 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ThreadMotionCoordinator.observeScroll (cognitive 19) webui/src/components/thread/thread-motion.ts:353— ThreadMotionCoordinator.observeScroll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). 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.
content.FilePreview (cognitive 19) webui/src/dev/gallery/content.tsx:10— content.FilePreview has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (17 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.
useSessions.useSessions.refresh (cognitive 19) webui/src/hooks/useSessions.ts:54— useSessions.useSessions.refresh has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 2 (4 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). 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 57, 69, 66, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
model-request.reconcileModelRequest (cognitive 19) webui/src/lib/model-request.ts:7— model-request.reconcileModelRequest has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 pts), 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.
ThreadTranscript.registerInput (cognitive 19) webui/src/lib/thread-transcript.ts:298— ThreadTranscript.registerInput has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 5, if/else 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebUIBuildHook.initialize (cognitive 18) hatch_build.py:46— WebUIBuildHook.initialize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AgentLoop.__init__ (cognitive 18) nanobot/agent/loop.py:274— AgentLoop.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SkillsLoader._discover_skills (cognitive 18) nanobot/agent/skills.py:121— SkillsLoader._discover_skills has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillsLoader._build_skills_summary (cognitive 18) nanobot/agent/skills.py:273— SkillsLoader._build_skills_summary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContentPage.scan (cognitive 18) nanobot/agent/tools/_search_content.py:75— ContentPage.scan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContentPage._append_match (cognitive 18) nanobot/agent/tools/_search_content.py:98— ContentPage._append_match has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 7, boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
execution.execute_tool_calls (cognitive 18) nanobot/agent/tools/execution.py:55— execution.execute_tool_calls has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 4 (5 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_RefreshingOAuthClientProvider.async_auth_flow (cognitive 18) nanobot/agent/tools/mcp_oauth.py:773— _RefreshingOAuthClientProvider.async_auth_flow has cognitive complexity 18 (threshold 15). Drivers by points: error handling 5 (11 pts), if/else 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.
ReadSessionTool.execute (cognitive 18) nanobot/agent/tools/sessions.py:167— ReadSessionTool.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (5 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
gateway_runtime._deliver_to_channel (cognitive 18) REDACTED:66— gateway_runtime._deliver_to_channel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
onboard._get_field_type_info (cognitive 18) nanobot/cli/onboard.py:197— onboard._get_field_type_info has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
data_access._reservation (cognitive 18) nanobot/data_access.py:73— data_access._reservation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
openai_codex_provider._codex_error_response (cognitive 18) nanobot/providers/openai_codex_provider.py:679— openai_codex_provider._codex_error_response has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 5, if/else 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_ChatStreamAccumulator.add (cognitive 18) REDACTED:1835— _ChatStreamAccumulator.add has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OpenAICompatProvider._extract_error_metadata (cognitive 18) REDACTED:1475— OpenAICompatProvider._extract_error_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openai_compat_provider._extract_tc_extras (cognitive 18) REDACTED:274— openai_compat_provider._extract_tc_extras has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 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.
sandbox_launcher.resolve_sandbox_launcher (cognitive 18) nanobot/security/sandbox_launcher.py:28— sandbox_launcher.resolve_sandbox_launcher has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2, error handling 1, 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.
recovery.pending_followups (cognitive 18) nanobot/session/recovery.py:112— recovery.pending_followups has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (6 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.
update_fallback.restore_service (cognitive 18) nanobot/update_fallback.py:220— update_fallback.restore_service has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 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.
update_jobs._prepare_wheels (cognitive 18) nanobot/update_jobs.py:237— update_jobs._prepare_wheels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update_plan.inspect_installation (cognitive 18) nanobot/update_plan.py:109— update_plan.inspect_installation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update_stop._prepare_gateway_stop (cognitive 18) nanobot/update_stop.py:119— update_stop._prepare_gateway_stop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpOAuthManager._payload (cognitive 18) nanobot/webui/mcp_oauth_api.py:404— McpOAuthManager._payload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, error handling 1 (2 pts), ternaries 1 (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.
RecoveryCoordinator.scan (cognitive 18) nanobot/webui/recovery.py:83— RecoveryCoordinator.scan has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 2 (4 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_system.save_channel_config_values (cognitive 18) nanobot/webui/settings_system.py:240— settings_system.save_channel_config_values has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2, ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
star_prompt.update_star_prompt (cognitive 18) nanobot/webui/star_prompt.py:25— star_prompt.update_star_prompt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, 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.
transcript._transcript_turn_signature (cognitive 18) nanobot/webui/transcript.py:1030— transcript._transcript_turn_signature has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayHTTPHandler._dispatch_resolved (cognitive 18) nanobot/webui/ws_http.py:618— GatewayHTTPHandler._dispatch_resolved has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GatewayHTTPHandler._handle_local_trigger_action (cognitive 18) nanobot/webui/ws_http.py:1686— GatewayHTTPHandler._handle_local_trigger_action has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 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.
ws_http._parse_automation_schedule (cognitive 18) nanobot/webui/ws_http.py:2178— ws_http._parse_automation_schedule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
conpty_smoke.smoke (cognitive 18) tui/scripts/conpty_smoke.py:55— conpty_smoke.smoke has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, loops 2, 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.
text.outlineDiagramText::collect (cognitive 18) tui/src/rendering/mermaid/text.ts:80— text.outlineDiagramText::collect has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 2 (7 pts), if/else 4 (6 pts), boolean chains 4, 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: one other method here (text.outlineDiagramText) 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.
sw.self.addEventListener("fetch") (cognitive 18) webui/public/sw.js:241— sw.self.addEventListener("fetch") has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 288, 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.
AgentActivityCluster.countActivity (cognitive 18) webui/src/components/thread/AgentActivityCluster.tsx:106— AgentActivityCluster.countActivity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentActivityCluster.CliRunRow (cognitive 18) webui/src/components/thread/AgentActivityCluster.tsx:1400— AgentActivityCluster.CliRunRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (AgentActivityCluster.McpRunRow) 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.
AgentActivityCluster.McpRunRow (cognitive 18) webui/src/components/thread/AgentActivityCluster.tsx:1476— AgentActivityCluster.McpRunRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (AgentActivityCluster.CliRunRow) 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.
ModelPresetBadge.PresetPill (cognitive 18) webui/src/components/thread/ModelPresetBadge.tsx:532— ModelPresetBadge.PresetPill has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 6, if/else 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RecoveryNotice.RecoveryNotice (cognitive 18) webui/src/components/thread/RecoveryNotice.tsx:20— RecoveryNotice.RecoveryNotice has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 6, if/else 4 (nesting depth added 1). Of this number, 13 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, 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.
ThreadComposer.ComposerInlineReferenceOverlay (cognitive 18) webui/src/components/thread/ThreadComposer.tsx:2470— ThreadComposer.ComposerInlineReferenceOverlay has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 4, if/else 2 (nesting depth added 5). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 2500). 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.
sidebar-panel.SidebarPanelContent (cognitive 18) webui/src/components/ui/sidebar-panel.tsx:42— sidebar-panel.SidebarPanelContent has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 5, if/else 2 (nesting depth added 2). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
api.fetchSubagentTasks (cognitive 18) webui/src/lib/api.ts:704— api.fetchSubagentTasks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (6 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.
ClientRunLedger.canApplyCanonical (cognitive 18) webui/src/lib/client-run-ledger.ts:319— ClientRunLedger.canApplyCanonical has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thread-event-projection.findStreamingAssistantIndex (cognitive 18) webui/src/lib/thread-event-projection.ts:92— thread-event-projection.findStreamingAssistantIndex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
markdown-streaming-blocks.parseMathAwareMarkdownBlocks (cognitive 18) webui/src/lib/markdown-streaming-blocks.ts:23— markdown-streaming-blocks.parseMathAwareMarkdownBlocks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextBuilder._load_bootstrap_files (cognitive 17) nanobot/agent/context.py:178— ContextBuilder._load_bootstrap_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextGovernor.strip_placeholder_assistant_messages (cognitive 17) nanobot/agent/context_governance.py:892— ContextGovernor.strip_placeholder_assistant_messages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentLoop._aclose_unlocked (cognitive 17) nanobot/agent/loop.py:1663— AgentLoop._aclose_unlocked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4, error handling 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.
plugins.enabled_agent_plugin_skill_documents (cognitive 17) nanobot/agent/plugins.py:94— plugins.enabled_agent_plugin_skill_documents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentProgressHook.on_tool_execution_event (cognitive 17) nanobot/agent/progress_hook.py:156— AgentProgressHook.on_tool_execution_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 2 (5 pts), ternaries 2 (5 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.
_TextRange._feed_normalized (cognitive 17) nanobot/agent/tools/filesystem.py:272— _TextRange._feed_normalized has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyTool._validate_json_safe (cognitive 17) nanobot/agent/tools/self.py:466— MyTool._validate_json_safe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 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.
ExecTool._extract_absolute_paths (cognitive 17) nanobot/agent/tools/shell.py:780— ExecTool._extract_absolute_paths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
desktop_tui._connection (cognitive 17) REDACTED:34— desktop_tui._connection has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), error handling 1, loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
entry._dispatch (cognitive 17) nanobot/cli/entry.py:107— entry._dispatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, ternaries 3 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
loader._migrate_config (cognitive 17) nanobot/config/loader.py:339— loader._migrate_config has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 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.
github_copilot_provider._parse_github_copilot_models (cognitive 17) nanobot/providers/github_copilot_provider.py:422— github_copilot_provider._parse_github_copilot_models has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OAuthModelCatalog.get (cognitive 17) nanobot/providers/oauth_catalog_cache.py:114— OAuthModelCatalog.get has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
converters.convert_user_message (cognitive 17) nanobot/providers/openai_responses/converters.py:75— converters.convert_user_message has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SDKStreamingHook.after_iteration (cognitive 17) nanobot/sdk/streaming.py:199— SDKStreamingHook.after_iteration has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 3, if/else 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.
webui_turns._title_inputs (cognitive 17) nanobot/session/webui_turns.py:129— webui_turns._title_inputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
progress_events.build_tool_event_finish_payloads (cognitive 17) nanobot/utils/progress_events.py:114— progress_events.build_tool_event_finish_payloads has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build.iter_webui_source_files (cognitive 17) nanobot/webui/build.py:78— build.iter_webui_source_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli_apps_api.normalize_cli_app_mentions (cognitive 17) nanobot/webui/cli_apps_api.py:57— cli_apps_api.normalize_cli_app_mentions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebUIOutboundDelivery.send_delta (cognitive 17) nanobot/webui/outbound_delivery.py:538— WebUIOutboundDelivery.send_delta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSHMaster.arguments (cognitive 17) nanobot/webui/remote_mux.py:21— SSHMaster.arguments has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 3 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteProxy._handle (cognitive 17) nanobot/webui/remote_proxy.py:179— RemoteProxy._handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
settings_models._model_row_payload (cognitive 17) nanobot/webui/settings_models.py:584— settings_models._model_row_payload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, 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.
settings_models.create_model_configuration (cognitive 17) nanobot/webui/settings_models.py:1298— settings_models.create_model_configuration has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
transcript.build_user_transcript_event (cognitive 17) nanobot/webui/transcript.py:760— transcript.build_user_transcript_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NanobotTui.prepareChat (cognitive 17) tui/src/app/app.ts:932— NanobotTui.prepareChat has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatList.WorkbenchTabHeader (cognitive 17) webui/src/components/ChatList.tsx:1269— ChatList.WorkbenchTabHeader has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 2, if/else 2 (nesting depth added 2). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
PreviewPane.PreviewPane (cognitive 17) webui/src/components/PreviewPane.tsx:14— PreviewPane.PreviewPane has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, ternaries 5, boolean chains 2. 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 65, a function literal at line 56, a function literal at line 30, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Sidebar.SidebarActionButton (cognitive 17) webui/src/components/Sidebar.tsx:360— Sidebar.SidebarActionButton has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidebarTopicRename.SidebarTopicRename (cognitive 17) webui/src/components/SidebarTopicRename.tsx:13— SidebarTopicRename.SidebarTopicRename has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, ternaries 3, error handling 1 (nesting depth added 2). 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 items inside it that branch (a function literal at line 58, 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.
SSHHostPickerView.SSHHostPickerView (cognitive 17) webui/src/components/remote/SSHHostPickerView.tsx:23— SSHHostPickerView.SSHHostPickerView has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (6 pts), if/else 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
useCapabilitySettingsActions.useCapabilitySettingsActions.saveWebSearch (cognitive 17) webui/src/components/settings/capabilities/useCapabilitySettingsActions.ts:146— useCapabilitySettingsActions.useCapabilitySettingsActions.saveWebSearch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, error handling 1, ternaries 1. Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReasoningEffortPicker.ReasoningEffortPicker (cognitive 17) webui/src/components/settings/models/ReasoningEffortPicker.tsx:14— ReasoningEffortPicker.ReasoningEffortPicker has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 3. 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 literals inside it that branch (lines 59, 84, 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.
ModelControls.ProviderPickerIcon (cognitive 17) webui/src/components/settings/shared/ModelControls.tsx:585— ModelControls.ProviderPickerIcon has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 3, if/else 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsFeature.SettingsFeature (cognitive 17) webui/src/components/settings/shared/SettingsFeature.tsx:25— SettingsFeature.SettingsFeature has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, ternaries 4 (nesting depth added 3). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 76, a function literal at line 45, changeOpen, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AgentActivityCluster.AgentActivityCluster (cognitive 17) webui/src/components/thread/AgentActivityCluster.tsx:173— AgentActivityCluster.AgentActivityCluster has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubagentTaskDock.TaskTree (cognitive 17) webui/src/components/thread/SubagentTaskDock.tsx:219— SubagentTaskDock.TaskTree has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 5, if/else 2 (nesting depth added 3). 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 224, 225, 246). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ThreadMessages.scrollAnchorsForUnits (cognitive 17) webui/src/components/thread/ThreadMessages.tsx:967— ThreadMessages.scrollAnchorsForUnits has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (5 pts), ternaries 4 (5 pts), if/else 2 (4 pts), boolean chains 3 (nesting depth added 4). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 968, 993). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ThreadViewport.visibleHistoryUnit (cognitive 17) webui/src/components/thread/ThreadViewport.tsx:127— ThreadViewport.visibleHistoryUnit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (5 pts), loops 2 (5 pts), ternaries 1 (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.
GenericToolRun.activityIcon (cognitive 17) webui/src/components/thread/activity/GenericToolRun.tsx:61— GenericToolRun.activityIcon has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
generic-tool-model.parseGenericToolTrace (cognitive 17) webui/src/components/thread/activity/generic-tool-model.ts:88— generic-tool-model.parseGenericToolTrace has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 5, if/else 4 (5 pts) (nesting depth added 4). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
web-search-model.textCandidates (cognitive 17) webui/src/components/thread/activity/web-search-model.ts:175— web-search-model.textCandidates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-preset.toModelBadgeInfo (cognitive 17) webui/src/components/thread/model-preset.ts:38— model-preset.toModelBadgeInfo has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (7 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
loaded-message-search.findLoadedMessagePreview (cognitive 17) webui/src/lib/loaded-message-search.ts:26— loaded-message-search.findLoadedMessagePreview has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextGovernor.summarize_provider_compaction (cognitive 16) nanobot/agent/context_governance.py:563— ContextGovernor.summarize_provider_compaction 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.
plugins._stdio_cwd (cognitive 16) nanobot/agent/plugins.py:403— plugins._stdio_cwd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentRunner._response_input_ids (cognitive 16) nanobot/agent/runner.py:197— AgentRunner._response_input_ids 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.
SubagentManager.run_inline (cognitive 16) nanobot/agent/subagent.py:680— SubagentManager.run_inline has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (4 pts), boolean chains 2, error handling 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.
ImageGenerationTool._provider_client (cognitive 16) nanobot/agent/tools/image_generation.py:115— ImageGenerationTool._provider_client has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 5, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MCPProvider.connect (cognitive 16) nanobot/agent/tools/mcp.py:1430— MCPProvider.connect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
MCPOAuthStorage._snapshot_from_entry (cognitive 16) nanobot/agent/tools/mcp_oauth.py:314— MCPOAuthStorage._snapshot_from_entry has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 6, boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyTool._modify (cognitive 16) nanobot/agent/tools/self.py:319— MyTool._modify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
service._console_script_distribution (cognitive 16) nanobot/apps/cli/service.py:286— service._console_script_distribution has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent.agent (cognitive 16) nanobot/cli/agent.py:53— agent.agent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent._run_classic (cognitive 16) nanobot/cli/agent.py:130— agent._run_classic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
desktop_tui.main (cognitive 16) REDACTED:143— desktop_tui.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._show_summary (cognitive 16) nanobot/cli/onboard.py:1343— onboard._show_summary has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (8 pts), loops 4, if/else 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tui_launcher._download_release_tui (cognitive 16) REDACTED:248— tui_launcher._download_release_tui has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 3 (4 pts), boolean chains 2, error handling 2, ternaries 1 (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.
loader._missing_env_issues (cognitive 16) nanobot/config/loader.py:279— loader._missing_env_issues has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 5 (6 pts), boolean chains 2 (nesting depth added 5). 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.
CronService.update_job (cognitive 16) nanobot/cron/service.py:858— CronService.update_job has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
service._validate_schedule_for_add (cognitive 16) nanobot/cron/service.py:90— service._validate_schedule_for_add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayRuntime._claim_current_process (cognitive 16) REDACTED:443— GatewayRuntime._claim_current_process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime._gateway_health_ready (cognitive 16) REDACTED:58— runtime._gateway_health_ready has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, error handling 2, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
images._inline_images (cognitive 16) nanobot/providers/images.py:31— images._inline_images has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 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.
errors.is_unsupported_feature_error (cognitive 16) nanobot/providers/openai_responses/errors.py:28— errors.is_unsupported_feature_error has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
manager._text_preview (cognitive 16) nanobot/session/manager.py:73— manager._text_preview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
webui_turns.maybe_generate_webui_title (cognitive 16) nanobot/session/webui_turns.py:154— webui_turns.maybe_generate_webui_title has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update_fallback.preserve_program (cognitive 16) nanobot/update_fallback.py:127— update_fallback.preserve_program has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UpdatePlan.valid_plan (cognitive 16) nanobot/update_plan.py:180— UpdatePlan.valid_plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
update_process.run_preparation_child (cognitive 16) REDACTED:164— update_process.run_preparation_child has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RotatingTextOutput._rotate (cognitive 16) nanobot/utils/rotating_output.py:144— RotatingTextOutput._rotate has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (5 pts), if/else 4 (5 pts), ternaries 2 (5 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.
http_utils.accepts_gzip (cognitive 16) nanobot/webui/http_utils.py:89— http_utils.accepts_gzip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 1 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nanobot_features_api.nanobot_features_action (cognitive 16) nanobot/webui/nanobot_features_api.py:36— nanobot_features_api.nanobot_features_action has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, error handling 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.
outbound_wire.project_notification (cognitive 16) nanobot/webui/outbound_wire.py:261— outbound_wire.project_notification has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tunnel._stream (cognitive 16) nanobot/webui/remote_ssh.py:267— Tunnel._stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 4, error handling 3, loops 2, ternaries 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
request_settings.validate_request_config (cognitive 16) nanobot/webui/request_settings.py:115— request_settings.validate_request_config has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 3 (6 pts), loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models._provider_config_updates (cognitive 16) nanobot/webui/settings_models.py:133— settings_models._provider_config_updates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, error handling 1 (2 pts), loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models._provider_settings_rows (cognitive 16) nanobot/webui/settings_models.py:408— settings_models._provider_settings_rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models.model_settings_payload (cognitive 16) nanobot/webui/settings_models.py:1057— settings_models.model_settings_payload has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (6 pts), loops 2, if/else 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models.complete_oauth_provider (cognitive 16) nanobot/webui/settings_models.py:1860— settings_models.complete_oauth_provider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, error handling 3 (4 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.
settings_system.update_agent_system_settings (cognitive 16) nanobot/webui/settings_system.py:196— settings_system.update_agent_system_settings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript.normalize_session_mentions_metadata (cognitive 16) nanobot/webui/transcript.py:692— transcript.normalize_session_mentions_metadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
latex.validMathStructure (cognitive 16) REDACTED:353— latex.validMathStructure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Transcript.userMessageContent (cognitive 16) tui/src/rendering/transcript.ts:652— Transcript.userMessageContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 5). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CliAppMentionText.CliAppMentionToken (cognitive 16) webui/src/components/CliAppMentionText.tsx:174— CliAppMentionText.CliAppMentionToken has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CliAppMentionText.McpPresetMentionToken) 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.
CliAppMentionText.McpPresetMentionToken (cognitive 16) webui/src/components/CliAppMentionText.tsx:243— CliAppMentionText.McpPresetMentionToken has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CliAppMentionText.CliAppMentionToken) 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.
ImageLightbox.ImageLightbox (cognitive 16) webui/src/components/ImageLightbox.tsx:30— ImageLightbox.ImageLightbox has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, ternaries 3. Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 53, 43, 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.
UpdateGuide.UpdateGuide (cognitive 16) webui/src/components/UpdateGuide.tsx:33— UpdateGuide.UpdateGuide has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 5 (6 pts), boolean chains 3, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (check). 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.
SettingsSidebar.MobileSettingsNavigation (cognitive 16) webui/src/components/settings/SettingsSidebar.tsx:193— SettingsSidebar.MobileSettingsNavigation has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 5 (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: 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.
OverviewSettings.OverviewValueLogo (cognitive 16) webui/src/components/settings/overview/OverviewSettings.tsx:200— OverviewSettings.OverviewValueLogo has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 2, 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.
IdleCompactionControl.IdleCompactionControl (cognitive 16) webui/src/components/settings/system/IdleCompactionControl.tsx:8— IdleCompactionControl.IdleCompactionControl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, ternaries 4 (5 pts) (nesting depth added 3). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 31, 54, 24, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentActivityCluster.foldSessionChecks (cognitive 16) webui/src/components/thread/AgentActivityCluster.tsx:679— AgentActivityCluster.foldSessionChecks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AgentActivityCluster.collectCliRuns (cognitive 16) webui/src/components/thread/AgentActivityCluster.tsx:1169— AgentActivityCluster.collectCliRuns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (AgentActivityCluster.collectMcpRuns) 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.
AgentActivityCluster.collectMcpRuns (cognitive 16) webui/src/components/thread/AgentActivityCluster.tsx:1272— AgentActivityCluster.collectMcpRuns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (AgentActivityCluster.collectCliRuns) 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.
graph-presentation.createGraphPresentation.advance (cognitive 16) webui/src/components/thread/graph-presentation.ts:46— graph-presentation.createGraphPresentation.advance has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2, ternaries 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent 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.DialogContent::finishDrag (cognitive 16) webui/src/components/ui/dialog.tsx:101— dialog.DialogContent::finishDrag has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 3 (4 pts), ternaries 3 (4 pts), loops 1 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workbench-model.attachWorkbenchPane (cognitive 16) webui/src/components/workbench/workbench-model.ts:251— workbench-model.attachWorkbenchPane has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, 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.
channels-linear.PanelComposition (cognitive 16) webui/src/dev/gallery/channels-linear.tsx:121— channels-linear.PanelComposition has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (10 pts), boolean chains 5, if/else 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, 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.
useComposerMentionInput.useComposerMentionInput (cognitive 16) webui/src/hooks/useComposerMentionInput.ts:9— useComposerMentionInput.useComposerMentionInput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 56, 140, 137). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useTheme.useTheme.setTheme (cognitive 16) webui/src/hooks/useTheme.ts:87— useTheme.useTheme.setTheme has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, error handling 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.hasValidProjectionMetadata (cognitive 16) webui/src/lib/api.ts:278— api.hasValidProjectionMetadata has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 16. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NanobotClient.applyRunEffects (cognitive 16) webui/src/lib/nanobot-client.ts:470— NanobotClient.applyRunEffects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
remark-tex-math.tokenizeGuardedDollarMathText (cognitive 16) webui/src/lib/remark-tex-math.ts:125— remark-tex-math.tokenizeGuardedDollarMathText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 16 points belong to 5 function items inside it that branch (data, close, escaped, …). 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.
manifestedAssetPaths (cognitive 16) webui/public/sw.js:168— manifestedAssetPaths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), other 2, boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change-coupling hub: REDACTED → REDACTED, REDACTED, REDACTED, commands.py nanobot/channels/mochat/runtime.py— `nanobot/channels/mochat/runtime.py` changes together with 4 other files — `nanobot/channels/discord/runtime.py`, `nanobot/channels/feishu/runtime.py`, `nanobot/channels/telegram/runtime.py`, `nanobot/cli/commands.py` — 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) nanobot/webui/skills_marketplace.py:121— nanobot/webui/skills_marketplace.py:121-156 | nanobot/webui/skills_marketplace.py:209-238 | nanobot/webui/skills_marketplace.py:247-274 | nanobot/webui/skills_marketplace.py:282-309 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) nanobot/context_graph.py:57— nanobot/context_graph.py:57-89 | nanobot/session/history_graph.py:117-142 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) nanobot/agent/tools/web.py:733— nanobot/agent/tools/web.py:733-769 | nanobot/agent/tools/web.py:772-813 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) nanobot/webui/cli_apps_api.py:58— nanobot/webui/cli_apps_api.py:58-84 | nanobot/webui/mcp_presets_api.py:136-164 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) nanobot/webui/sidebar_state.py:298— nanobot/webui/sidebar_state.py:298-325 | nanobot/webui/workspaces.py:110-138 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) nanobot/webui/settings_system.py:611— nanobot/webui/settings_system.py:611-629 | nanobot/webui/settings_system.py:632-653 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) nanobot/providers/image_generation.py:1671— nanobot/providers/image_generation.py:1671-1708 | nanobot/providers/image_generation.py:1823-1860 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) nanobot/providers/image_generation.py:1027— nanobot/providers/image_generation.py:1027-1046 | nanobot/providers/image_generation.py:1718-1736 | nanobot/providers/image_generation.py:1870-1893 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) nanobot/providers/fallback_provider.py:324— nanobot/providers/fallback_provider.py:324-343 | nanobot/providers/fallback_provider.py:444-468 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) nanobot/cli/provider.py:165— nanobot/cli/provider.py:165-183 | nanobot/cli/provider.py:194-210 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) REDACTED:397— REDACTED:397-411 | REDACTED:418-433 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) nanobot/providers/transcription.py:198— nanobot/providers/transcription.py:198-224 | nanobot/providers/transcription.py:236-258 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) nanobot/providers/transcription.py:602— nanobot/providers/transcription.py:602-627 | nanobot/providers/transcription.py:650-666 | nanobot/providers/transcription.py:689-705 | nanobot/providers/transcription.py:726-742 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) nanobot/webui/sidebar_state.py:103— nanobot/webui/sidebar_state.py:103-111 | nanobot/webui/sidebar_state.py:115-124 | nanobot/webui/sidebar_state.py:128-138 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×1
Edited copy of a member (5 corresponding lines) nanobot/providers/openai_codex_provider.py:186— nanobot/providers/openai_codex_provider.py:186-193 | nanobot/providers/xai_grok_provider.py:79-83 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 2+ corresponding lines) · ×1
Edited copies of one member (3 members, 2+ corresponding lines) nanobot/providers/github_copilot_provider.py:497— nanobot/providers/github_copilot_provider.py:497-498 | nanobot/providers/openai_codex_provider.py:893-894 | nanobot/providers/xai_grok_provider.py:809-810 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) nanobot/agent/tools/mcp.py:124— nanobot/agent/tools/mcp.py:124-126 | REDACTED:256-258 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (31 lines × 2) nanobot/webui/settings_models.py:1230— nanobot/webui/settings_models.py:1230-1260 | nanobot/webui/settings_models.py:1395-1425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) tui/scripts/conpty_smoke.py:65— tui/scripts/conpty_smoke.py:65-86 | tui/scripts/pty_smoke.py:80-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15–20 lines × 2) nanobot/goal/tools.py:216— nanobot/goal/tools.py:216-230 | nanobot/goal/tools.py:315-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) REDACTED:156— REDACTED:156-175 | REDACTED:1492-1511 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) nanobot/command/builtin.py:488— nanobot/command/builtin.py:488-505 | nanobot/command/builtin.py:538-555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–17 lines × 2) nanobot/providers/transcription.py:561— nanobot/providers/transcription.py:561-575 | nanobot/providers/transcription.py:611-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–16 lines × 2) nanobot/providers/factory.py:169— nanobot/providers/factory.py:169-182 | nanobot/webui/settings_models.py:1581-1596 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/providers/factory.py:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) nanobot/providers/image_generation.py:1223— nanobot/providers/image_generation.py:1223-1237 | nanobot/providers/image_generation.py:1307-1321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/providers/image_generation.py:1223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) nanobot/providers/image_generation.py:1694— nanobot/providers/image_generation.py:1694-1708 | nanobot/providers/image_generation.py:1847-1860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) REDACTED:136— REDACTED:136-149 | REDACTED:1476-1489 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–12 lines × 3) nanobot/webui/skills_marketplace.py:124— nanobot/webui/skills_marketplace.py:124-134 | nanobot/webui/skills_marketplace.py:214-225 | nanobot/webui/skills_marketplace.py:285-295 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/webui/skills_marketplace.py:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `nanobot/webui/skills_marketplace.py:135` calls `set` and `nanobot/webui/skills_marketplace.py:296` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 3) nanobot/providers/image_generation.py:502— nanobot/providers/image_generation.py:502-512 | nanobot/providers/image_generation.py:1030-1039 | nanobot/providers/image_generation.py:1720-1729 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/providers/image_generation.py:502` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) nanobot/session/state.py:615— nanobot/session/state.py:615-624 | nanobot/session/state.py:659-668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 2) nanobot/webui/recovery.py:162— nanobot/webui/recovery.py:162-170 | nanobot/webui/recovery.py:316-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) nanobot/webui/recovery.py:162— nanobot/webui/recovery.py:162-170 | nanobot/webui/recovery.py:278-286 | nanobot/webui/recovery.py:316-324 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 2) tui/scripts/conpty_smoke.py:125— tui/scripts/conpty_smoke.py:125-132 | tui/scripts/pty_smoke.py:157-165 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `tui/scripts/pty_smoke.py:157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) nanobot/session/sqlite_store.py:756— nanobot/session/sqlite_store.py:756-762 | nanobot/session/sqlite_store.py:768-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/session/sqlite_store.py:756` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 3) nanobot/agent/tools/web.py:591— nanobot/agent/tools/web.py:591-597 | nanobot/agent/tools/web.py:762-768 | nanobot/agent/tools/web.py:806-812 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/agent/tools/web.py:591` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (2–6 lines × 3) nanobot/cli/gateway.py:142— nanobot/cli/gateway.py:142-143 | nanobot/cli/gateway.py:292-297 | nanobot/cli/gateway.py:343-348 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `nanobot/cli/gateway.py:292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) nanobot/agent/__init__.py:38— nanobot/agent/__init__.py:38-47 | nanobot/agent/tools/__init__.py:41-50 | nanobot/config/__init__.py:44-53 | nanobot/llm_usage/__init__.py:29-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (6 lines × 3) nanobot/webui/cli_apps_api.py:49— nanobot/webui/cli_apps_api.py:49-54 | nanobot/webui/mcp_presets_api.py:123-128 | nanobot/webui/sidebar_state.py:66-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Sync-over-async blocking scripts/verify_installed_release.py:165— `verify_installed_release` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Duplication concentrated across 6 sibling directories (19 clone groups) webui/src/hooks/useAttachedImages.ts:163— 19 duplicated blocks under webui/src/ have copies in at least two of the sibling directories components, dev, hooks, lib, providers, workers — 11 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 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 19 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 (17 clone groups) webui/src/components/settings/overview/OverviewSettings.tsx:213— 17 duplicated blocks under webui/src/components/settings/ have copies in at least two of the sibling directories capabilities, channels, models, notifications, overview, shared (+1 more sibling(s) not listed) — 7 of them are reported below, and 10 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 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 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 17 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 (13 clone groups) nanobot/channels/weixin/webui/WeixinPanelView.tsx:112— 13 duplicated blocks under the repository root have copies in at least two of the sibling directories nanobot, tui, webui — 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 (12 clone groups) webui/src/components/settings/system/AppsSettings.tsx:1379— 12 duplicated blocks under webui/src/components/ have copies in at least two of the sibling directories pairing, remote, settings, thread, ui, workbench — 5 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 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 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 12 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) webui/browser/code-highlighting-fixture.tsx:12— 5 duplicated blocks under webui/ have copies in at least two of the sibling directories browser, src — 1 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 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.
Duplicated block (68 lines × 2 locations) webui/src/components/CliAppMentionText.tsx:174— webui/src/components/CliAppMentionText.tsx:174 · webui/src/components/CliAppMentionText.tsx:243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (53 matched lines × 2 locations) · ×1
Duplicated block with local edits (53 matched lines × 2 locations) nanobot/channels/linear/webui/member-access-store.ts:24— nanobot/channels/linear/webui/member-access-store.ts:24 · nanobot/channels/linear/webui/workspace-store.ts:20 — the two spans are one implementation copied and then locally edited — 478 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 (52 lines × 2 locations) webui/src/components/thread/AgentActivityCluster.tsx:1134— webui/src/components/thread/AgentActivityCluster.tsx:1134 · webui/src/components/thread/AgentActivityCluster.tsx:1237 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (45 matched lines × 2 locations) · ×1
Duplicated block with local edits (45 matched lines × 2 locations) webui/src/components/thread/ThreadComposer.tsx:2607— webui/src/components/thread/ThreadComposer.tsx:2607 · webui/src/components/thread/ThreadComposer.tsx:2758 — the two spans are one implementation copied and then locally edited — 199 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 (44 matched lines × 2 locations) · ×1
Duplicated block with local edits (44 matched lines × 2 locations) tui/src/menus/mention-menu.ts:6— tui/src/menus/mention-menu.ts:6 · tui/src/menus/skill-menu.ts:6 — the two spans are one implementation copied and then locally edited — 327 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 (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:120— webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:120 · webui/src/components/settings/capabilities/TranscriptionSettings.tsx:100 — the two spans are one implementation copied and then locally edited — 276 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 (36 matched lines × 2 locations) · ×1
Duplicated block with local edits (36 matched lines × 2 locations) webui/src/components/settings/overview/OverviewSettings.tsx:213— webui/src/components/settings/overview/OverviewSettings.tsx:213 · webui/src/components/settings/shared/ModelControls.tsx:611 — the two spans are one implementation copied and then locally edited — 131 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 (33 matched lines × 2 locations) · ×1
Duplicated block with local edits (33 matched lines × 2 locations) webui/src/components/ChatList.tsx:229— webui/src/components/ChatList.tsx:229 · webui/src/components/Sidebar.tsx:50 — the 2 copies are spread across 2 files, and the CITED SPAN is inside a TYPE DECLARATION, not executable code. There is no function to extract and no call site to call one from, so do not read this as an extract-a-helper row: the collapse a type offers is a generic — name the shape once, parameterised over the part that varies, and have each copy instantiate it. First check what actually differs between the copies: where they are a MATRIX of cases (one entry per input, differing precisely in the case each one pins), the repetition IS the enumeration and collapsing it would delete cases rather than de-duplicate anything — leave those alone. Reported because the copies that are not a matrix drift apart the first time only one of them is edited.
Duplicated block (32 lines × 2 locations) webui/src/components/ChatList.tsx:1112— webui/src/components/ChatList.tsx:1112 · webui/src/components/ChatList.tsx:1587 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (32 matched lines × 2 locations) · ×1
Duplicated block with local edits (32 matched lines × 2 locations) webui/src/components/thread/activity/generic-tool-model.ts:364— webui/src/components/thread/activity/generic-tool-model.ts:364 · webui/src/components/thread/activity/trace-activity-model.ts:136 — the two spans are one implementation copied and then locally edited — 169 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 (28 matched lines × 2 locations) · ×1
Duplicated block with local edits (28 matched lines × 2 locations) webui/src/components/settings/system/useSystemSettingsEffects.ts:50— webui/src/components/settings/system/useSystemSettingsEffects.ts:50 · webui/src/components/settings/system/useSystemSettingsEffects.ts:133 — the two spans are one implementation copied and then locally edited — 181 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 (28 lines × 2 locations) webui/src/components/thread/AgentActivityCluster.tsx:1423— webui/src/components/thread/AgentActivityCluster.tsx:1423 · webui/src/components/thread/AgentActivityCluster.tsx:1500 — all 2 copies are in the same file, 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.
Duplicated block (25 lines × 2 locations) nanobot/channels/weixin/webui/WeixinPanelView.tsx:112— nanobot/channels/weixin/webui/WeixinPanelView.tsx:112 · webui/src/components/settings/channels/ChannelSetupSurfaceView.tsx:113 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (22 matched lines × 2 locations) · ×1
Duplicated block with local edits (22 matched lines × 2 locations) webui/src/components/settings/shared/SettingsTextEditor.tsx:18— webui/src/components/settings/shared/SettingsTextEditor.tsx:18 · webui/src/components/settings/shared/SharedProxySetupDialog.tsx:12 — the two spans are one implementation copied and then locally edited — 132 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 (21 matched lines × 2 locations) · ×1
Duplicated block with local edits (21 matched lines × 2 locations) webui/src/components/settings/channels/ChannelIdentity.tsx:179— webui/src/components/settings/channels/ChannelIdentity.tsx:179 · webui/src/components/settings/system/AppsSettings.tsx:1513 — the two spans are one implementation copied and then locally edited — 78 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 (19 lines × 2 locations) webui/src/components/MessageBubble.tsx:585— webui/src/components/MessageBubble.tsx:585 · webui/src/components/MessageBubble.tsx:618 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (18 lines × 2 locations) webui/src/components/workbench/PaneWorkbench.tsx:461— webui/src/components/workbench/PaneWorkbench.tsx:461 · webui/src/components/workbench/PaneWorkbench.tsx:571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:81— webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:81 · webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:187 — the two spans are one implementation copied and then locally edited — 86 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 (17 lines × 3 locations) webui/src/lib/api.ts:644— webui/src/lib/api.ts:644 · webui/src/lib/api.ts:1044 · webui/src/lib/api.ts:1068 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function accept (cyclomatic 265, cognitive 317) webui/src/lib/thread-transcript.ts:554— accept has cyclomatic complexity 265 and cognitive complexity 317; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ThreadComposer (cyclomatic 177, cognitive 141) webui/src/components/thread/ThreadComposer.tsx:549— ThreadComposer has cyclomatic complexity 177 and cognitive complexity 141; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 reduceThreadEvent (cyclomatic 157, cognitive 267) webui/src/lib/thread-event-projection.ts:893— reduceThreadEvent has cyclomatic complexity 157 and cognitive complexity 267; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 130, cognitive 175) tui/src/app/app.ts:1320— (anonymous) has cyclomatic complexity 130 and cognitive complexity 175; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function UpdateFlowProvider (cyclomatic 128, cognitive 82) webui/src/providers/UpdateFlowProvider.tsx:28— UpdateFlowProvider has cyclomatic complexity 128 and cognitive complexity 82; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 accept (cyclomatic 105, cognitive 147) tui/src/app/app.ts:690— accept has cyclomatic complexity 105 and cognitive complexity 147; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 RemoteConnectionsPage (cyclomatic 105, cognitive 88) webui/src/components/remote/RemoteConnectionsPage.tsx:29— RemoteConnectionsPage has cyclomatic complexity 105 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 Shell (cyclomatic 96, cognitive 83) webui/src/App.tsx:821— Shell has cyclomatic complexity 96 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ThreadShell (cyclomatic 95, cognitive 82) webui/src/components/thread/ThreadShell.tsx:359— ThreadShell has cyclomatic complexity 95 and cognitive complexity 82; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 WorkspaceProjectPicker (cyclomatic 90, cognitive 78) webui/src/components/thread/WorkspaceControls.tsx:158— WorkspaceProjectPicker has cyclomatic complexity 90 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 parseThreadProjectionEvent (cyclomatic 89, cognitive 85) webui/src/lib/api.ts:322— parseThreadProjectionEvent has cyclomatic complexity 89 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 QuickPairSetupView (cyclomatic 89, cognitive 71) webui/src/components/remote/QuickPairSetupView.tsx:62— QuickPairSetupView has cyclomatic complexity 89 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 decodeInboundEvent (cyclomatic 84, cognitive 78) tui/src/client/validation.ts:137— decodeInboundEvent has cyclomatic complexity 84 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 handle (cyclomatic 82, cognitive 117) webui/src/hooks/useNanobotStream.ts:672— handle has cyclomatic complexity 82 and cognitive complexity 117; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleMessage (cyclomatic 79, cognitive 113) webui/src/lib/nanobot-client.ts:903— handleMessage has cyclomatic complexity 79 and cognitive complexity 113; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ModelIdPicker (cyclomatic 79, cognitive 64) webui/src/components/settings/shared/ModelControls.tsx:187— ModelIdPicker has cyclomatic complexity 79 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ThreadViewport (cyclomatic 74, cognitive 58) webui/src/components/thread/ThreadViewport.tsx:271— ThreadViewport has cyclomatic complexity 74 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function project (cyclomatic 71, cognitive 101) webui/src/lib/thread-transcript.ts:367— project has cyclomatic complexity 71 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 RemoteInstances (cyclomatic 70, cognitive 62) webui/src/components/remote/RemoteInstances.tsx:17— RemoteInstances has cyclomatic complexity 70 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 renderProviderForm (cyclomatic 70, cognitive 55) webui/src/components/settings/models/ProviderSettings.tsx:656— renderProviderForm has cyclomatic complexity 70 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 McpAppsCatalogRow (cyclomatic 68, cognitive 51) webui/src/components/settings/system/AppsSettings.tsx:501— McpAppsCatalogRow has cyclomatic complexity 68 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function applyObservation (cyclomatic 57, cognitive 74) webui/src/lib/client-run-ledger.ts:230— applyObservation has cyclomatic complexity 57 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 saveModelSettings (cyclomatic 52, cognitive 43) webui/src/components/settings/models/useModelSettingsActions.ts:169— saveModelSettings has cyclomatic complexity 52 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function LinearPanelView (cyclomatic 51, cognitive 36) nanobot/channels/linear/webui/LinearPanelView.tsx:67— LinearPanelView has cyclomatic complexity 51 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 49, cognitive 62) REDACTED:275— (anonymous) has cyclomatic complexity 49 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 AutomationDetailPanel (cyclomatic 48, cognitive 43) webui/src/components/settings/system/AutomationsSettings.tsx:469— AutomationDetailPanel has cyclomatic complexity 48 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function describe (cyclomatic 47, cognitive 70) webui/src/lib/thread-transcript.ts:313— describe has cyclomatic complexity 47 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 47, cognitive 50) webui/src/components/ChatList.tsx:854— (anonymous) has cyclomatic complexity 47 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ChannelQrConnectFlowView (cyclomatic 47, cognitive 41) webui/src/components/settings/channels/ChannelQrConnectFlowView.tsx:49— ChannelQrConnectFlowView has cyclomatic complexity 47 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SettingsPage (cyclomatic 43, cognitive 38) webui/src/components/settings/SettingsPage.tsx:80— SettingsPage has cyclomatic complexity 43 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 VersionCheckRowView (cyclomatic 43, cognitive 34) webui/src/components/settings/overview/VersionCheckRowView.tsx:20— VersionCheckRowView has cyclomatic complexity 43 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function WebSettings (cyclomatic 41, cognitive 37) webui/src/components/settings/capabilities/WebSettings.tsx:77— WebSettings has cyclomatic complexity 41 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ChannelSetupSurfaceView (cyclomatic 41, cognitive 33) webui/src/components/settings/channels/ChannelSetupSurfaceView.tsx:51— ChannelSetupSurfaceView has cyclomatic complexity 41 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 submit (cyclomatic 40, cognitive 48) tui/src/app/app.ts:508— submit has cyclomatic complexity 40 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 MessageBlockMenuActions (cyclomatic 40, cognitive 35) webui/src/components/MessageBubble.tsx:151— MessageBlockMenuActions has cyclomatic complexity 40 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ModelPresetBadge (cyclomatic 40, cognitive 34) webui/src/components/thread/ModelPresetBadge.tsx:106— ModelPresetBadge has cyclomatic complexity 40 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 40, cognitive 33) webui/src/components/thread/ThreadMessages.tsx:200— (anonymous) has cyclomatic complexity 40 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 fetchHistory (cyclomatic 39, cognitive 59) tui/src/client/api.ts:181— fetchHistory has cyclomatic complexity 39 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function attachProjectedReasoning (cyclomatic 39, cognitive 48) webui/src/lib/thread-event-projection.ts:621— attachProjectedReasoning has cyclomatic complexity 39 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 onKeyDown (cyclomatic 39, cognitive 40) webui/src/components/thread/ThreadComposer.tsx:1787— onKeyDown has cyclomatic complexity 39 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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· webui/src/components/thread/ThreadComposer.tsx · ×1
webui/src/components/thread/ThreadComposer.tsx: 2778 lines of code webui/src/components/thread/ThreadComposer.tsx:1— webui/src/components/thread/ThreadComposer.tsx has 2778 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
webui/src/App.tsx: 2689 lines of code webui/src/App.tsx:1— webui/src/App.tsx has 2689 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
tui/src/app/app.ts: 2532 lines of code tui/src/app/app.ts:1— tui/src/app/app.ts has 2532 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· webui/src/components/ChatList.tsx · ×1
webui/src/components/ChatList.tsx: 1954 lines of code webui/src/components/ChatList.tsx:1— webui/src/components/ChatList.tsx has 1954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
webui/src/lib/api.ts: 1561 lines of code webui/src/lib/api.ts:1— webui/src/lib/api.ts has 1561 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· webui/src/components/thread/ThreadShell.tsx · ×1
webui/src/components/thread/ThreadShell.tsx: 1521 lines of code webui/src/components/thread/ThreadShell.tsx:1— webui/src/components/thread/ThreadShell.tsx has 1521 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· webui/src/components/settings/system/AppsSettings.tsx · ×1
webui/src/components/settings/system/AppsSettings.tsx: 1493 lines of code webui/src/components/settings/system/AppsSettings.tsx:1— webui/src/components/settings/system/AppsSettings.tsx has 1493 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· webui/src/components/thread/AgentActivityCluster.tsx · ×1
webui/src/components/thread/AgentActivityCluster.tsx: 1437 lines of code webui/src/components/thread/AgentActivityCluster.tsx:1— webui/src/components/thread/AgentActivityCluster.tsx has 1437 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· webui/src/components/thread/ThreadViewport.tsx · ×1
webui/src/components/thread/ThreadViewport.tsx: 1361 lines of code webui/src/components/thread/ThreadViewport.tsx:1— webui/src/components/thread/ThreadViewport.tsx has 1361 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· webui/src/lib/nanobot-client.ts · ×1
webui/src/lib/nanobot-client.ts: 1241 lines of code webui/src/lib/nanobot-client.ts:1— webui/src/lib/nanobot-client.ts has 1241 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· webui/src/lib/thread-event-projection.ts · ×1
webui/src/lib/thread-event-projection.ts: 1204 lines of code webui/src/lib/thread-event-projection.ts:1— webui/src/lib/thread-event-projection.ts has 1204 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· webui/src/components/settings/system/AutomationsSettings.tsx · ×1
webui/src/components/settings/system/AutomationsSettings.tsx: 1203 lines of code webui/src/components/settings/system/AutomationsSettings.tsx:1— webui/src/components/settings/system/AutomationsSettings.tsx has 1203 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· webui/src/components/settings/models/ProviderSettings.tsx · ×1
webui/src/components/settings/models/ProviderSettings.tsx: 1179 lines of code webui/src/components/settings/models/ProviderSettings.tsx:1— webui/src/components/settings/models/ProviderSettings.tsx has 1179 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· webui/src/components/thread/ThreadMessages.tsx · ×1
webui/src/components/thread/ThreadMessages.tsx: 1119 lines of code webui/src/components/thread/ThreadMessages.tsx:1— webui/src/components/thread/ThreadMessages.tsx has 1119 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· webui/src/components/settings/models/ModelsSettings.tsx · ×1
webui/src/components/settings/models/ModelsSettings.tsx: 1073 lines of code webui/src/components/settings/models/ModelsSettings.tsx:1— webui/src/components/settings/models/ModelsSettings.tsx has 1073 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· webui/src/hooks/useNanobotStream.ts · ×1
webui/src/hooks/useNanobotStream.ts: 1050 lines of code webui/src/hooks/useNanobotStream.ts:1— webui/src/hooks/useNanobotStream.ts has 1050 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· webui/src/lib/thread-transcript.ts · ×1
webui/src/lib/thread-transcript.ts: 951 lines of code webui/src/lib/thread-transcript.ts:1— webui/src/lib/thread-transcript.ts has 951 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: 840 lines of code REDACTED:1— REDACTED has 840 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· webui/src/components/workbench/PaneWorkbench.tsx · ×1
webui/src/components/workbench/PaneWorkbench.tsx: 806 lines of code webui/src/components/workbench/PaneWorkbench.tsx:1— webui/src/components/workbench/PaneWorkbench.tsx has 806 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· webui/src/components/MarkdownTextRenderer.tsx · ×1
webui/src/components/MarkdownTextRenderer.tsx: 797 lines of code webui/src/components/MarkdownTextRenderer.tsx:1— webui/src/components/MarkdownTextRenderer.tsx has 797 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· webui/src/components/settings/SettingsPage.tsx · ×1
webui/src/components/settings/SettingsPage.tsx: 796 lines of code webui/src/components/settings/SettingsPage.tsx:1— webui/src/components/settings/SettingsPage.tsx has 796 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· webui/src/components/MessageBubble.tsx · ×1
webui/src/components/MessageBubble.tsx: 764 lines of code webui/src/components/MessageBubble.tsx:1— webui/src/components/MessageBubble.tsx has 764 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· webui/src/components/thread/WorkspaceControls.tsx · ×1
webui/src/components/thread/WorkspaceControls.tsx: 759 lines of code webui/src/components/thread/WorkspaceControls.tsx:1— webui/src/components/thread/WorkspaceControls.tsx has 759 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· tui/src/rendering/transcript.ts · ×1
tui/src/rendering/transcript.ts: 752 lines of code tui/src/rendering/transcript.ts:1— tui/src/rendering/transcript.ts has 752 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· webui/src/components/settings/SkillsCatalogSettings.tsx · ×1
webui/src/components/settings/SkillsCatalogSettings.tsx: 743 lines of code webui/src/components/settings/SkillsCatalogSettings.tsx:1— webui/src/components/settings/SkillsCatalogSettings.tsx has 743 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· webui/src/components/settings/system/McpManagementDialog.tsx · ×1
webui/src/components/settings/system/McpManagementDialog.tsx: 725 lines of code webui/src/components/settings/system/McpManagementDialog.tsx:1— webui/src/components/settings/system/McpManagementDialog.tsx has 725 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· webui/src/components/settings/SkillsMarketplace.tsx · ×1
webui/src/components/settings/SkillsMarketplace.tsx: 705 lines of code webui/src/components/settings/SkillsMarketplace.tsx:1— webui/src/components/settings/SkillsMarketplace.tsx has 705 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· webui/src/components/settings/system/createSystemSettingsActions.ts · ×1
webui/src/components/settings/system/createSystemSettingsActions.ts: 657 lines of code webui/src/components/settings/system/createSystemSettingsActions.ts:1— webui/src/components/settings/system/createSystemSettingsActions.ts has 657 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· webui/src/components/settings/shared/ModelControls.tsx · ×1
webui/src/components/settings/shared/ModelControls.tsx: 651 lines of code webui/src/components/settings/shared/ModelControls.tsx:1— webui/src/components/settings/shared/ModelControls.tsx has 651 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· webui/src/components/thread/ModelPresetBadge.tsx · ×1
webui/src/components/thread/ModelPresetBadge.tsx: 650 lines of code webui/src/components/thread/ModelPresetBadge.tsx:1— webui/src/components/thread/ModelPresetBadge.tsx has 650 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· webui/src/components/settings/models/useModelSettingsActions.ts · ×1
webui/src/components/settings/models/useModelSettingsActions.ts: 631 lines of code webui/src/components/settings/models/useModelSettingsActions.ts:1— webui/src/components/settings/models/useModelSettingsActions.ts has 631 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· webui/src/components/remote/RemoteConnectionsPage.tsx · ×1
webui/src/components/remote/RemoteConnectionsPage.tsx: 534 lines of code webui/src/components/remote/RemoteConnectionsPage.tsx:1— webui/src/components/remote/RemoteConnectionsPage.tsx has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
tui/src/client/api.ts: 509 lines of code tui/src/client/api.ts:1— tui/src/client/api.ts has 509 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· webui/src/components/thread/thread-motion.ts · ×1
webui/src/components/thread/thread-motion.ts: 483 lines of code webui/src/components/thread/thread-motion.ts:1— webui/src/components/thread/thread-motion.ts has 483 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· webui/src/components/settings/channels/ChannelSetupPanel.tsx · ×1
webui/src/components/settings/channels/ChannelSetupPanel.tsx: 476 lines of code webui/src/components/settings/channels/ChannelSetupPanel.tsx:1— webui/src/components/settings/channels/ChannelSetupPanel.tsx has 476 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· webui/src/lib/client-run-ledger.ts · ×1
webui/src/lib/client-run-ledger.ts: 469 lines of code webui/src/lib/client-run-ledger.ts:1— webui/src/lib/client-run-ledger.ts has 469 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· webui/src/components/settings/useSettingsController.ts · ×1
webui/src/components/settings/useSettingsController.ts: 448 lines of code webui/src/components/settings/useSettingsController.ts:1— webui/src/components/settings/useSettingsController.ts has 448 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· webui/src/hooks/useVoiceRecorder.ts · ×1
webui/src/hooks/useVoiceRecorder.ts: 441 lines of code webui/src/hooks/useVoiceRecorder.ts:1— webui/src/hooks/useVoiceRecorder.ts has 441 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· webui/src/hooks/useAttachedImages.ts · ×1
webui/src/hooks/useAttachedImages.ts: 437 lines of code webui/src/hooks/useAttachedImages.ts:1— webui/src/hooks/useAttachedImages.ts has 437 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· tui/src/client/nanobot-client.ts · ×1
tui/src/client/nanobot-client.ts: 428 lines of code tui/src/client/nanobot-client.ts:1— tui/src/client/nanobot-client.ts has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
X14 · Bypassable address classification· IP classification is bypassable through an IPv4-in-IPv6 embedding · ×1
IP classification is bypassable through an IPv4-in-IPv6 embedding webui/src/components/thread/activity/web-url.ts:54— This function unwraps IPv4-MAPPED IPv6 (`::ffff:`, line 55) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 54 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright.
Duplicated predicate webui/src/components/thread/activity/generic-tool-model.ts:176— `!args || typeof args !== "object" || Array.isArray(args)` appears character-identically in 2 files — webui/src/components/thread/activity/generic-tool-model.ts, webui/src/components/thread/activity/mcp-activity-model.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 webui/src/components/thread/ThreadShell.tsx:309— `!cancelled && version === payloadVersion` appears character-identically in 2 files — webui/src/components/thread/ThreadShell.tsx, webui/src/hooks/useSkills.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 webui/src/components/settings/channels/ChannelSetupPanel.tsx:210— `!field.optional || requirementKeys.has(field.key)` appears character-identically in 2 files — webui/src/components/settings/channels/ChannelSetupPanel.tsx, webui/src/dev/gallery/channels.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 webui/src/components/thread/ModelPresetBadge.tsx:242— `!gesture || gesture.pointerId !== event.pointerId` appears character-identically in 2 files — webui/src/components/thread/ModelPresetBadge.tsx, webui/src/components/workbench/PaneWorkbench.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 tui/src/app/app.ts:1383— `!key.ctrl && !key.meta && (key.name === "up" || key.name === "down")` appears character-identically in 2 files — tui/src/app/app.ts, tui/src/views/runtime-controls.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 webui/src/components/settings/models/ReasoningEffortPicker.tsx:61— `!open && ["ArrowDown", "ArrowUp", "Enter"].includes(event.key)` appears character-identically in 2 files — webui/src/components/settings/models/ReasoningEffortPicker.tsx, webui/src/components/settings/shared/ModelControls.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 webui/src/components/workbench/workbench-model.ts:116— `!raw || typeof raw !== "object" || Array.isArray(raw)` appears character-identically in 2 files — webui/src/components/workbench/workbench-model.ts, webui/src/hooks/useSidebarState.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 tui/src/app/app.ts:2509— `!this.options.apiUrl || !this.options.apiToken` appears character-identically in 2 files — tui/src/app/app.ts, tui/src/views/runtime-controls.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 webui/src/components/remote/host-bridge.ts:16— `!value || typeof value !== "object" || Array.isArray(value)` appears character-identically in 3 files — webui/src/components/remote/host-bridge.ts, webui/src/components/thread/activity/web-search-model.ts, webui/src/hooks/useSidebarState.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 webui/src/components/ResponseSourceBadge.tsx:46— `brand?.logoLayout === "tile" && logoUrl === brand.logoUrl` appears character-identically in 5 files — webui/src/components/ResponseSourceBadge.tsx, webui/src/components/settings/overview/OverviewSettings.tsx, webui/src/components/settings/shared/ModelControls.tsx, webui/src/components/settings/shared/ProviderIcon.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 nanobot/channels/linear/webui/LinearPanel.tsx:97— `configuredFields.has(field.key) || Boolean(feature.config_values?.[field.key]?.trim())` appears character-identically in 2 files — nanobot/channels/linear/webui/LinearPanel.tsx, webui/src/dev/gallery/channels-linear.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 webui/src/components/FilePreviewPanel.tsx:56— `error.status === 404 && /API route not found/i.test(error.message)` appears character-identically in 2 files — webui/src/components/FilePreviewPanel.tsx, webui/src/components/thread/ThreadShell.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 webui/src/lib/canonical-run-snapshot.ts:19— `event.event === "user_message" && event.turn_id` appears character-identically in 2 files — webui/src/lib/canonical-run-snapshot.ts, webui/src/lib/thread-transcript.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 tui/src/client/api.ts:224— `event.kind === "tool_hint" || event.kind === "progress"` appears character-identically in 2 files — tui/src/client/api.ts, webui/src/lib/thread-event-projection.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 webui/src/components/thread/ModelPresetBadge.tsx:214— `event.pointerType === "mouse" && event.button !== 0` appears character-identically in 2 files — webui/src/components/thread/ModelPresetBadge.tsx, webui/src/hooks/useVoiceRecorder.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 tui/src/app/app.ts:811— `event.state === "recovered" || event.state === "cleared"` appears character-identically in 2 files — tui/src/app/app.ts, webui/src/lib/nanobot-client.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate nanobot/channels/linear/webui/LinearPanel.tsx:265— `feature.runtime_status === "running" && installations.length > 0` appears character-identically in 2 files — nanobot/channels/linear/webui/LinearPanel.tsx, webui/src/dev/gallery/channels-linear.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 nanobot/channels/linear/webui/LinearConnectFlow.tsx:28— `feature.runtime_status === "running" || feature.runtime_status === "failed"` appears character-identically in 2 files — nanobot/channels/linear/webui/LinearConnectFlow.tsx, webui/src/dev/gallery/channels-linear.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 webui/src/components/settings/shared/SettingsSectionSkeleton.tsx:76— `field.kind === "boolean" || field.kind === "toggle"` appears character-identically in 2 files — webui/src/components/settings/shared/SettingsSectionSkeleton.tsx, webui/src/components/settings/system/RuntimeConfigSettings.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 nanobot/channels/weixin/webui/presentation.ts:95— `field.kind === "enum" || field.kind === "bool"` appears character-identically in 2 files — nanobot/channels/weixin/webui/presentation.ts, webui/src/components/settings/channels/ChannelIdentity.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 nanobot/channels/linear/webui/LinearPanelView.tsx:87— `field.secret && configuredFields.has(field.key)` appears character-identically in 3 files — nanobot/channels/linear/webui/LinearPanelView.tsx, webui/src/components/settings/channels/ChannelSetupPanel.tsx, webui/src/dev/gallery/channels.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 webui/src/components/ChatList.tsx:802— `group.kind === "project" && Boolean(collapsedGroups[group.id])` appears character-identically in 2 files — webui/src/components/ChatList.tsx, webui/src/lib/chat-groups.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 webui/src/components/UpdateNotice.tsx:23— `installationMethod && installationMethod !== "managed"` appears character-identically in 2 files — webui/src/components/UpdateNotice.tsx, webui/src/components/settings/overview/VersionCheckRowView.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 nanobot/channels/feishu/webui/FeishuAssistantsPanelView.tsx:74— `instance.display_name?.trim() || instance.name.trim() || instance.id` appears character-identically in 2 files — nanobot/channels/feishu/webui/FeishuAssistantsPanelView.tsx, webui/src/dev/gallery/channels-feishu-whatsapp.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 webui/src/components/settings/system/AutomationsSettings.tsx:964— `job.kind === "local_trigger" || job.payload.kind === "local_trigger" || job.schedule.kind === "local"` appears character-identically in 2 files — webui/src/components/settings/system/AutomationsSettings.tsx, webui/src/components/thread/SessionInfoPopoverView.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.
Mock-dominated test: refreshes the bootstrap token before REST settings auth expires webui/src/tests/app-layout.test.tsx:4582— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: opens a conversation's existing actions from the row context menu webui/src/tests/chat-list.test.tsx:48— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: shows temporary chats separately and lets the user reopen or close them webui/src/tests/chat-list.test.tsx:1068— This test sets up 6 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: ignores late metadata from a previous session webui/src/tests/file-actions.test.tsx:87— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: bounds regular replay tails but retains temporary events until discard webui/src/tests/nanobot-client.test.ts:300— This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: uses the host socket bridge for native host URLs webui/src/tests/nanobot-client.test.ts:794— This test sets up 5 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: buffers transcript events independently of live observers webui/src/tests/nanobot-client.test.ts:826— This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 7 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: notifies run status subscribers and replays running chats webui/src/tests/nanobot-client.test.ts:2142— This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: buffers after unsubscribe until the chat is subscribed again webui/src/tests/nanobot-client.test.ts:2223— This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 7 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: keeps a retargeted pane surface in the same physical motion webui/src/tests/pane-workbench.test.tsx:339— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not start work when mounted only for the closing animation webui/src/tests/quick-pair.test.tsx:113— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: cleans up an invitation arriving during the closing animation webui/src/tests/quick-pair.test.tsx:129— This test sets up 6 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: cleans up an invitation returned after closing the dialog webui/src/tests/quick-pair.test.tsx:446— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: reviews a returned receipt without generating another key or connecting automatically webui/src/tests/quick-pair.test.tsx:459— This test sets up 7 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: renders an invitation from caller-owned state and delegates actions without claiming it webui/src/tests/star-prompt.test.tsx:38— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: focuses the original tab without reloading its connection or drafts webui/src/tests/sw.test.ts:208— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: opens the destination when the source closed, even if an older page is still open webui/src/tests/sw.test.ts:220— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: offers a follow-up action for text selected within one completed answer webui/src/tests/thread-messages.test.tsx:738— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Silent fallback default in catch nanobot/agent/tools/mcp.py:305— `_redact_url` swallows every exception into `return '<redacted-url>'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch nanobot/agent/tools/web.py:219— `_deepseek_error_detail` 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 nanobot/apps/cli/utils.py:49— `runtime_lines_for_request` 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 nanobot/config/timezone.py:15— `detect_system_timezone` swallows every exception into `return 'UTC'` — 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 nanobot/providers/base.py:172— `tool_arguments_object_for_replay` 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 tui/src/client/connection.ts:94— `connectionEndpoint` swallows every exception into `return "local gateway"` — 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 webui/src/components/thread/ThreadComposer.tsx:453— `readSlashRecents` 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 webui/src/components/thread/activity/exec-session-model.ts:34— `toolEventArguments` 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 webui/src/components/thread/activity/web-search-model.ts:262— `toolEventArguments` 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 webui/src/components/thread/activity/trace-activity-model.ts:166— `traceFieldFromArgs` 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 webui/src/hooks/useTheme.ts:26— `readStored` swallows every exception into `return "system"` — 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 webui/src/lib/bootstrap.ts:18— `loadSavedSecret` 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 webui/src/lib/browser-notifications.ts:69— `enableBrowserNotifications` swallows every exception into `return "permissionFailed"` — 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 webui/src/lib/browser-notifications.ts:113— `submitNotification` swallows every exception into `return "workerUnavailable"` — 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 webui/src/lib/remote-instances.ts:137— `readRecentRemotes` 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 on parse failure nanobot/agent/skills.py:370— `_parse_nanobot_metadata` returns `{}` when `(json.JSONDecodeError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure nanobot/agent/tools/web.py:185— `_redact_url_for_log` returns `'<redacted URL>'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure REDACTED:62— `_tencent_public_host` returns `''` when `(OSError, ValueError, http.client.HTTPException)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure nanobot/providers/transcription.py:437— `_text_from_chat_payload` returns `''` when `(KeyError, IndexError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure nanobot/providers/xai_grok_provider.py:506— `_xai_hosted_tool_arguments` returns `{}` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure nanobot/providers/xai_grok_provider.py:797— `_decode_access_token_claims` returns `{}` when `(ValueError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure nanobot/update_profiles.py:133— `_observe` returns `'unconfirmed'` when `(OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure nanobot/webui/session_list_index.py:95— `_timestamp` returns `0.0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure nanobot/webui/skills_api.py:194— `_nanobot_metadata` returns `{}` when `(json.JSONDecodeError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 87 significant file(s) lose their only recent owner: webui/src/lib/thread-event-projection.ts, nanobot/agent/tools/mcp_oauth.py, webui/src/components/settings/system/McpManagementDialog.tsx, nanobot/webui/recovery.py, REDACTED, nanobot/llm_usage/store.py, tui/src/client/api.ts, webui/src/dev/gallery/shell.tsx (+79 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 17 significant file(s) lose their only recent owner: nanobot/webui/skills_marketplace.py, nanobot/cli/desktop_target.py, nanobot/webui/remote_ssh.py, nanobot/webui/remote_pairing.py, nanobot/webui/remote_pair_server.py, scripts/build_tui_wheels.py, REDACTED, REDACTED (+9 more). Pair on, review, or document these before any departure.
No ADRs found pyproject.toml:127— No ADRs found. The recognised ADR directories in this tree were read — `webui/proposals` — and none of their files is a decision record (a README, index or template page does not count). What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `pyproject.toml` makes this repository a deployable product (line 127).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 3 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (133782 LoC, 1057 module-visible types across 35 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.
Pass-through layer tui/src/menus/mention-menu.ts:52— MentionMenu: all 6 public methods forward their arguments unchanged to picker and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call picker directly, or give the layer a job.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 1 of 650 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 650 of the 1038 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: nanobot/skills/skill-creator/scripts/init_skill.py. 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.
Orphaned file nanobot/skills/skill-creator/scripts/init_skill.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No src/ separation — Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (`hatch_build.py`).
No SAST REDACTED:7— No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 5 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.
No dependency-update automation tui/package.json:14— `tui/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
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 6/8 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Null assertions (`!`) override strict null checking — ~1.7 `!` null assertions per 1k TypeScript source lines — 167 assertion(s) across the 95815 source line(s) of the 512 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: webui/src/lib/thread-transcript.ts (40), webui/src/lib/thread-page-fragments.ts (29), webui/src/components/thread/activity/PierreFileDiff.tsx (9). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
X7 · Silent fallback defaults· Pending state with no failure state · ×1
Pending state with no failure state webui/src/components/settings/notifications/BrowserNotificationSettings.tsx:103— The view draws `<Loader2 class="h-4 w-4 animate-spin motion-reduce:animate-none" aria-hidden/>` under `busy`, but `busy` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Skipped (documented): (unnamed test) webui/src/tests/bun-react-runtime.test.ts:8— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tui/src/app/diagrams.test.ts:39— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) tui/src/app/diagrams.test.ts:130— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) tui/src/app/diagrams.test.ts:148— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) tui/src/app/diagrams.test.ts:196— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) tui/src/app/diagrams.test.ts:239— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) tui/src/app/diagrams.test.ts:276— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) scripts/check_client_import_boundaries.test.mjs:67— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
Skipped (documented): (unnamed test) scripts/check_client_import_boundaries.test.mjs:198— 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.
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 01a1d7b2-a1a5-73b5-9d79-55f9af867ad0 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 75 · Warnings: 1948 · Recommendations: 105 · Info: 9 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 01:36 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.