Public report — nanobot, published 26 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.15 (frozen) · verify this surveyFiledcd_0ae3eb7b2cf049828cd4c72d75fd141b
Filed 26 September 2026, 14:41 UTC
Public
Large · 180,628 LoC · rebuild ~2.7 person-years · weakest lens: Readiness (48%)
Findings by grade
30 critical1342 serious17 minor41 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 September 2026, 13:45 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
1370findings with an exact file:lineof 1389 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
54/127dimensions across the health lenses180628 LoC — wide & deep
⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.
Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.
The system holds a 58% health score, placing it at risk. While the underlying architecture is robust, the overall standing is fragile due to significant gaps in operational readiness and code maintainability. This score reflects a large, valuable asset that is currently carrying real risk to delivery speed and security exposure.
This is a substantial platform, comprising over 180,000 lines of production code with a rebuild cost of approximately €390,000. The value tied up here is significant, and the cost of changing it is high. However, the composition suggests a mature codebase with minimal boilerplate, indicating that the core logic is well-defined. The primary concern is not the size, but the efficiency with which the team can modify and secure this large investment.
The most critical theme is operational fragility. With a readiness score of 48%, the system lacks the testing, observability, and security gates needed for safe, rapid deployment. This weakness creates a high risk of outages and security regressions, directly threatening business reliability. The second theme is a velocity tax. Code quality signals indicate that changes in weaker areas cost 9–19% more effort than in clean code. This inefficiency compounds annually, draining engineering capacity and slowing feature delivery without adding visible value.
Despite these risks, the architecture is strong, scoring 86%, which means structural changes are less likely to cause widespread ripple effects. The codebase is also relatively mature, with a 76% score, suggesting that new teams can understand the system with reasonable effort. These strengths provide a solid foundation for remediation.
The highest-leverage action is to add a static security analysis step to the continuous integration pipeline. This single change pays for itself within one to two months by preventing security regressions and reducing the annual drag on engineering time. It is the fastest way to reduce risk and improve confidence. Focus here first because it addresses the most expensive and dangerous gap with minimal effort. The picture is partial, as domain modeling, event-driven patterns, and performance were not measured, but the current risks are clear enough to act.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
1360 finding(s) are new versus the previous scan (2026-08-07) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €130,000–€650,000
0.8× (at 58% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~2.7 person-years of build effort (about ~€390,000 to rebuild). Its weakest lens is Readiness at 48% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
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.
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 404.5–2427.3 engineer-days every year, paid as drag on the ~1,900,693 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 9–19% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 468,664 line(s) changed over a 90-day window ⇒ ~1,900,693/year · D1/D2/D4 code quality: averaging 4.6/10 ⇒ a 9–19% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Large asset (~2.7 person-years to rebuild), and its weakest lens is Readiness at 48%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: 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. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ 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.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 4.6/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 9–19% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 4.6/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
360 modules, 508 dependencies. Every dependency points down the layering — no cycles.
Showing the 40 most-connected modules; 320 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
nanobot.agent.tools.filesystem uses nanobot.agent.tools.context. Changing nanobot.agent.tools.context can break nanobot.agent.tools.filesystem, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
16→3 nanobot.agent.tools.filesystem depends on nanobot.config_base✕
Type pairs
1 distinct (type in nanobot.agent.tools.filesystem → type in nanobot.config_base) reference.
nanobot.agent.tools.filesystem uses nanobot.agent.tools.base. Changing nanobot.agent.tools.base can break nanobot.agent.tools.filesystem, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
17→10 nanobot.agent.tools.registry depends on nanobot.agent.tools.base✕
Type pairs
1 distinct (type in nanobot.agent.tools.registry → type in nanobot.agent.tools.base) reference.
webui.src.components.settings.system uses webui.src.lib.types. Changing webui.src.lib.types can break webui.src.components.settings.system, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
26→8 webui.src.components.thread depends on tui.src.protocol✕
Type pairs
1 distinct (type in webui.src.components.thread → type in tui.src.protocol) reference.
webui.src.components.thread.activity uses webui.src.lib.types. Changing webui.src.lib.types can break webui.src.components.thread.activity, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
webui.src.lib uses tui.src.protocol. Changing tui.src.protocol can break webui.src.lib, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
29→15 webui.src.lib depends on webui.src.lib.types✕
Type pairs
55 distinct (type in webui.src.lib → type in webui.src.lib.types) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
nanobot.webui.settings_routes uses nanobot.webui.settings_services. Changing nanobot.webui.settings_services can break nanobot.webui.settings_routes, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→11 nanobot.webui.ws_http depends on nanobot.bus.queue✕
Type pairs
1 distinct (type in nanobot.webui.ws_http → type in nanobot.bus.queue) reference.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2021 — Injection
26
High / Critical
A06:2021 — Vulnerable & Outdated Components
17
High / Critical
A05:2021 — Security Misconfiguration
3
Medium
A04:2021 — Insecure Design
1
Medium
Roadmap
First, integrate static security analysis into the CI pipeline to prevent security regressions from merging. Next, clean up dependencies by removing unused packages and explicitly declaring imports, while also updating outdated libraries to reduce technical debt. Additionally, maintain a changelog to track release changes and add tests for currently unreached production modules to improve code coverage.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
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.
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 30
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 — 1342
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 — 17
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 41
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 50 of 54 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 1.0 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 54 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, 1370 of 1389 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .py, .tsx, .ts, and our analyzer cannot run the .py, .tsx, .ts 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 91.5% — 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. In the meantime, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures and real coverage will be read. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then both halves are read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,828 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 434 test source file(s) (.py) that it cannot: it reads the test types the frontend declared, so a suite in any other language 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares 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.
D32 Data Compliance (PII/GDPR) — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. `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`, … (+16 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.
AX3 Project dependency cycles — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over which project references which. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj files only, and this repository commits none — so there was no graph to read, and re-running the same commit reads the same nothing. Its modules are declared as: npm/pnpm/yarn packages and workspaces (package.json, pnpm-workspace.yaml, lerna.json); Python distributions (pyproject.toml, setup.py, setup.cfg). A reader for that graph is the collector this check is missing. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
AX4 Dependency direction — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the direction each project reference points. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj files only, and this repository commits none — so there was no graph to read, and re-running the same commit reads the same nothing. Its modules are declared as: npm/pnpm/yarn packages and workspaces (package.json, pnpm-workspace.yaml, lerna.json); Python distributions (pyproject.toml, setup.py, setup.cfg). A reader for that graph is the collector this check is missing. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
AX8 Test isolation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over which projects are test projects, and what they reference. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj files only, and this repository commits none — so there was no graph to read, and re-running the same commit reads the same nothing. Its modules are declared as: npm/pnpm/yarn packages and workspaces (package.json, pnpm-workspace.yaml, lerna.json); Python distributions (pyproject.toml, setup.py, setup.cfg). A reader for that graph is the collector this check is missing. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization 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 authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit 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 audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention 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 retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights 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 data-subject rights controls.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 88 further occurrence(s) are not listed individually; the score already reflects all 128.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing 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
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs 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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
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.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (4): D19, D21, D22, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
309 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ThreadComposer.ThreadComposer at 396. A further 5 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 ThreadMessages.threadDisplayUnitPropsEqual at 30 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: webui/src/lib/composer-draft.ts (composer-draft.readDraft 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.
+ 304 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 ThreadComposer.ThreadComposer (cyclomatic 396) finding(s) in Cyclomatic Complexity — start with ThreadComposer.tsx. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 App.Shell (cyclomatic 284) finding(s) in Cyclomatic Complexity — start with App.tsx. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 ThreadShell.ThreadShell (cyclomatic 263) finding(s) in Cyclomatic Complexity — start with ThreadShell.tsx. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 432 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 ThreadComposer.ThreadComposer (cognitive 436) finding(s) in Cognitive Complexity — start with ThreadComposer.tsx. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 App.Shell (cognitive 295) finding(s) in Cognitive Complexity — start with App.tsx. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 ThreadShell.ThreadShell (cognitive 269) finding(s) in Cognitive Complexity — start with ThreadShell.tsx. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes6.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 86 FileTooLong finding(s) in God Classes — start with service.py (2), ThreadComposer.tsx, App.tsx. — One of this dimension's main actionable groups (86 warning-level).
Resolve the 82 FunctionTooLong finding(s) in God Classes — start with App.tsx (4), ThreadComposer.tsx (3), ProviderSettings.tsx (3). — One of this dimension's main actionable groups (82 warning-level).
Resolve the 15 ClassTooLong finding(s) in God Classes — start with app.ts, ThreadComposer.tsx, ThreadShell.tsx. — One of this dimension's main actionable groups (15 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
79 duplicated block group(s) detected. A further 4 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. Measured on part of this repository only: .tsx, .ts (39% 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.
+ 38 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 10 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with skills.py, web.py, commands.py. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 8 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with context.py, runner.py, schema.py. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 8 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with web.py, desktop_target.py, fallback_provider.py. — One of this dimension's main actionable groups (8 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
8705 test methods: 8663 unit, 42 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 1831 `it`/`test` case(s) across 150 test file(s) declaring at least one; its tier split is read from package names and paths only. The Python suite contributes 6874 test function(s) across 405 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1828 tests. Measured on the suite only — at least 434 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: keeps clipboard failures visible while an agent turn is activetui/src/app.test.ts:533
What to do
Resolve the 1 No assertions finding(s) in Test Quality — start with app.test.ts. — One of this dimension's main actionable groups (1 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ 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.
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 31 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` (25 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 (69×396=27324); webui/src/components/thread/ThreadShell.tsx (66×263=17358); webui/src/App.tsx (59×284=16756) Repeated repair below the complexity floor: REDACTED (17 of 22 changes were fixes); nanobot/agent/subagent.py (11 of 21 changes were fixes); REDACTED (11 of 15 changes were fixes)
Resolve the 164 Hotspot finding(s) in Churn × Complexity Hotspots — start with base.py (2), service.py (2), store.py (2). — One of this dimension's main actionable groups (164 warning-level).
Resolve the 24 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED, subagent.py, REDACTED. — One of this dimension's main actionable groups (24 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.7 / 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.
51 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is webui/src/components/settings/models/ProviderSettings.tsx. Counted over 412 of the 640 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.
2 deducted task-comment markers across 180628 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 2 TodoComment finding(s) in Explicit Debt — start with init_skill.py (2). — One of this dimension's main actionable groups (2 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README (nanobot) is a comprehensive multi-language overview with links to the docs/ directory. The webui/README documents its own directory (React/TypeScript source for the nanobot WebUI), while the docs/README and other subdirs document the full project: the docs/README covers installation, usage, troubleshooting, and guides; skills/, task-guides/, and websocket/ directories each add focused documentation. All visible documents are well-structured with headings, an overview, install/usage examples, and a complete outline. This project's documentation is excellent: the READMEs and architecture/Docs markdown are well written for a repository that is both a deploy tier (READMEs) and an open-source library (architecture docs), with each document clearly scoped. The Start Without Technical Background walkthrough is ideal for newcomers; Release checklist covers release packaging, CI checks, and documentation PR coordination; Release Archive lists milestones with hashes; Quick Start guides installation and configuration from scratch to the first reply; Nanobot Python SDK explains the SDK call stack and a 5-minute starter script; Providers and Models walks through setup questions and authorization flow; Provider Cookbook provides pasteable recipes for known setups; and an OpenAI-compatible API guide covers authentication, behavior, and file upload. The only unshown element is a dedicated Contribute or License section (the root README does not cover the library), but all visible documents are complete. This repository is a well-organized collection of README and architecture/Docs markdown files covering the tooling (nanobot), its runtime model (memory, image generation, multiple instances), configuration, development, deployment, and concepts. The root README gives an overview, installation, usage, and contribution guidance; each project's README states what it is for and how to use its contents.
Documentation: contradicts the codedocs/releasing.md
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyAdequate◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
5 API inconsistencies across a 400-member sample of 676 exposed types.
Duplicate method names with identical signatures and likely identical intent. 'prepare_messages_for_model' and 'prepare_for_model' appear to be redundant aliases or a copy-paste error.
Duplicate method names with identical signatures. 'resolve_preset' and 'select_preset' perform the same operation of resolving/setting a model preset.
Inconsistent naming for similar operations. 'set_session_model_preset' targets a specific session, while 'set_model_preset' appears to be global or default. The naming convention differs ('set_session_model_preset' vs 'set_model_preset') which is confusing when both exist.
Duplicate functionality exposed at different levels. 'AgentLoop' exposes 'pending_cron_job_ids_for_session' which likely delegates to 'CronTurnCoordinator.pending_job_ids_for_session'. This creates a redundant API surface where the caller can access the coordinator directly or go through the loop.
Inconsistent naming for similar query operations. 'AgentLoop' uses 'pending_local_trigger_ids_for_session' while 'CronTurnCoordinator' uses 'pending_job_ids_for_session'. The term 'job' vs 'trigger' is inconsistent for similar concepts.
What to do
Resolve the 1 Duplicate method names with identical signatures and likely identical… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Duplicate method names with identical signatures. 'resolve_preset' and… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Inconsistent naming for similar operations. 'set_session_model_preset'… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether 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).
26 finding(s): 0 critical, 15 high, 8 medium, 3 low. 15 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 26 file(s) — `REDACTED` (lines 27–81), `nanobot/channels/dingtalk/webui/index.ts` (line 20), `nanobot/channels/discord/webui/index.ts` (line 24), `nanobot/channels/email/webui/index.ts` (line 68), `nanobot/channels/feishu/webui/index.tsx` (line 39), … (+21 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.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
No action in Static Analysis (SAST) — all 15 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 (15 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/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, Go, Java and Kotlin via Maven/Gradle, 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.
Resolve the 7 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5), REDACTED (2). — One of this dimension's main actionable groups (7 issue-level).
Resolve the 5 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4), REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 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 Watchdog's 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 21 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`, … (+16 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.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 412 of the 640 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 5 Change coupling finding(s) in Change Coupling — start with REDACTED, index.ts, commands.py. — One of this dimension's main actionable groups (5 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. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 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 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 alternatives6.7 / 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:47
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels7.0 / 10Strong✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This <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/App.tsx:671
This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — 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. (×6) — webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:190, webui/src/components/settings/capabilities/TranscriptionSettings.tsx:158, webui/src/components/settings/capabilities/TranscriptionSettings.tsx:165, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: interactive elements plus elements the markup gives a click/key handler or the repo's own CSS styles `cursor: pointer`, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). 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 <span> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its only behaviour is bound to dragstart, pointer gestures a keyboard cannot produce, and there is no key handler. The tab stop leads nowhere. Bind the same behaviour to a key handler, or provide an equivalent control elsewhere. — webui/src/components/thread/ThreadComposer.tsx:2858
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 134 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
What to do
Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether 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 17178 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: 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.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Do you agree with this assessment?
R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
20 duplicated blocks under webui/src/components/settings/ have copies in at least two of the sibling directories capabilities, channels, models, overview, shared, system — 8 of them are reported below, and 12 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 20 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 20 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 20 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:435
12 duplicated blocks under the repository root have copies in at least two of the sibling directories nanobot, tui, webui — 7 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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. — nanobot/channels/linear/webui/LinearPanel.tsx:203
12 duplicated blocks under webui/src/components/ have copies in at least two of the sibling directories settings, thread, ui — 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:1358
10 duplicated blocks under webui/src/ have copies in at least two of the sibling directories channel-plugins, components, hooks, lib, workers — 7 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 10 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 10 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 10 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — webui/src/hooks/useAttachedImages.ts:177
webui/src/components/settings/SettingsPage.tsx:89 · webui/src/components/settings/useSettingsController.ts:494 — the 2 copies are spread across 2 files, 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/settings/SettingsPage.tsx:89
webui/src/components/CliAppMentionText.tsx:179 · webui/src/components/CliAppMentionText.tsx:250 — 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:179
webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:63 · webui/src/components/settings/capabilities/TranscriptionSettings.tsx:68 — the two spans are one implementation copied and then locally edited — 414 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:63
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:1002 · webui/src/components/thread/AgentActivityCluster.tsx:1105 — 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:1002
tui/src/mention-menu.ts:6 · tui/src/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/mention-menu.ts:6
webui/src/components/thread/AgentActivityCluster.tsx:1280 · webui/src/components/thread/AgentActivityCluster.tsx:1360 — 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:1280
nanobot/channels/linear/webui/LinearPanel.tsx:203 · webui/src/components/settings/channels/ChannelSetupPanel.tsx:261 — the two spans are one implementation copied and then locally edited — 251 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/LinearPanel.tsx:203
webui/src/components/thread/ThreadComposer.tsx:3042 · webui/src/components/thread/ThreadComposer.tsx:3195 — 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/thread/ThreadComposer.tsx:3042
webui/src/components/ChatList.tsx:1055 · webui/src/components/ChatList.tsx:1498 — 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:1055
webui/src/components/ChatList.tsx:210 · webui/src/components/Sidebar.tsx:45 — 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:210
webui/src/components/thread/activity/generic-tool-model.ts:346 · webui/src/components/thread/activity/trace-activity-model.ts:136 — the two spans are one implementation copied and then locally edited — 168 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:346
webui/src/App.tsx:1893 · webui/src/App.tsx:1960 — 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/App.tsx:1893
webui/src/components/settings/overview/OverviewSettings.tsx:435 · webui/src/components/settings/shared/ModelControls.tsx:593 — 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/overview/OverviewSettings.tsx:435
nanobot/channels/weixin/webui/WeixinPanel.tsx:265 · webui/src/components/settings/channels/ChannelSetupPanel.tsx:543 — 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/WeixinPanel.tsx:265
webui/src/components/ChatList.tsx:1303 · webui/src/components/ChatList.tsx:1795 — 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:1303
webui/src/components/settings/system/AppsSettings.tsx:1358 · webui/src/components/thread/ThreadComposer.tsx:3152 — 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:1358
webui/src/components/thread/AgentActivityCluster.tsx:1244 · webui/src/components/thread/AgentActivityCluster.tsx:1322 — 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:1244
webui/src/components/settings/channels/ChannelIdentity.tsx:172 · webui/src/components/settings/system/AppsSettings.tsx:1493 — 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:172
webui/src/components/thread/ThreadComposer.tsx:1413 · webui/src/components/thread/ThreadComposer.tsx:1434 — 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:1413
webui/src/components/thread/ThreadComposer.tsx:2136 · webui/src/components/thread/ThreadComposer.tsx:2160 — 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:2136
webui/src/components/MessageBubble.tsx:611 · webui/src/components/MessageBubble.tsx:644 — 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:611
webui/src/components/ui/dropdown-menu.tsx:30 · webui/src/components/ui/popover.tsx:22 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — webui/src/components/ui/dropdown-menu.tsx:30
webui/src/components/workbench/PaneWorkbench.tsx:467 · webui/src/components/workbench/PaneWorkbench.tsx:577 — 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:467
webui/src/components/ChatList.tsx:950 · webui/src/components/ChatList.tsx:1429 — 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:950
webui/src/components/settings/models/ProviderSettings.tsx:577 · webui/src/components/settings/models/ProviderSettings.tsx:594 · webui/src/components/settings/models/ProviderSettings.tsx:611 — 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/components/settings/models/ProviderSettings.tsx:577
webui/src/lib/api.ts:503 · webui/src/lib/api.ts:715 · webui/src/lib/api.ts:739 — 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:503
tui/src/protocol.ts:1346 · webui/src/lib/nanobot-client.ts:880 — the two spans are one implementation copied and then locally edited — 97 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/protocol.ts:1346
webui/src/components/CliAppMentionText.tsx:75 · webui/src/components/UserMessageText.tsx:25 — the two spans are one implementation copied and then locally edited — 145 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/CliAppMentionText.tsx:75
webui/src/components/settings/capabilities/WebSettings.tsx:198 · webui/src/components/settings/models/ProviderSettings.tsx:990 — 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:198
webui/src/components/thread/ThreadComposer.tsx:3013 · webui/src/components/thread/ThreadComposer.tsx:3179 — 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:3013
webui/src/components/ChatList.tsx:644 · webui/src/components/ChatList.tsx:659 — 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:644
webui/src/components/settings/models/ProviderSettings.tsx:519 · webui/src/components/settings/models/ProviderSettings.tsx:555 — 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:519
webui/src/components/thread/ThreadShell.tsx:1740 · webui/src/components/thread/ThreadShell.tsx:1794 — 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/ThreadShell.tsx:1740
webui/src/components/workbench/PaneWorkbench.tsx:451 · webui/src/components/workbench/PaneWorkbench.tsx:558 — 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:451
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 · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
webui/src/components/CodeBlock.tsx:53 imports react-syntax-highlighter/dist/esm/prism-async-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — webui/src/components/CodeBlock.tsx:53
webui/src/components/CodeBlock.tsx:54 imports react-syntax-highlighter/dist/esm/styles/prism/one-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — webui/src/components/CodeBlock.tsx:54
webui/src/components/CodeBlock.tsx:55 imports react-syntax-highlighter/dist/esm/styles/prism/one-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — webui/src/components/CodeBlock.tsx:55
webui/src/components/ViewportCodeRows.tsx:3 imports react-syntax-highlighter/dist/esm/create-element, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — webui/src/components/ViewportCodeRows.tsx:3
webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:39 imports react-syntax-highlighter/dist/esm/prism-async-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:39
webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:40 imports react-syntax-highlighter/dist/esm/create-element, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:40
webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:41 imports react-syntax-highlighter/dist/esm/styles/prism/one-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:41
webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:42 imports react-syntax-highlighter/dist/esm/styles/prism/one-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:42
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
ThreadComposer has cyclomatic complexity 128 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 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:900
(anonymous) has cyclomatic complexity 127 and cognitive complexity 172; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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.ts:1777
accept has cyclomatic complexity 104 and cognitive complexity 146; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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.ts:1143
ThreadShell has cyclomatic complexity 93 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:630
handle has cyclomatic complexity 84 and cognitive complexity 125; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:561
decodeInboundEvent has cyclomatic complexity 81 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/protocol.ts:470
ModelIdPicker has cyclomatic complexity 80 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:168
projectThreadEvent has cyclomatic complexity 78 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/lib/thread-event-projection.ts:756
Shell has cyclomatic complexity 67 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:1097
renderProviderRow has cyclomatic complexity 67 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/models/ProviderSettings.tsx:783
handleMessage has cyclomatic complexity 64 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:1081
LinearPanel has cyclomatic complexity 60 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — nanobot/channels/linear/webui/LinearPanel.tsx:59
McpAppsCatalogRow has cyclomatic complexity 57 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:493
RuntimeSettings has cyclomatic complexity 56 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/RuntimeSettings.tsx:21
(anonymous) has cyclomatic complexity 54 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/ChatList.tsx:772
ChannelSetupSurface 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/channels/ChannelSetupPanel.tsx:175
AutomationDetailPanel has cyclomatic complexity 50 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/system/AutomationsSettings.tsx:442
parseThreadProjectionEvent has cyclomatic complexity 49 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/api.ts:306
ChannelQrConnectFlow has cyclomatic complexity 45 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:40
WorkspaceProjectPicker has cyclomatic complexity 44 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/WorkspaceControls.tsx:46
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files3.8 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
45 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: webui/src/components/thread/ThreadComposer.tsx (3225), webui/src/App.tsx (2971), tui/src/app.ts (2923), webui/src/components/thread/ThreadShell.tsx (1884), webui/src/components/ChatList.tsx (1877), webui/src/lib/types.ts (1540) (+39 more).
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 Coverage7.1 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×15) — nanobot/channels/linear/webui/LinearPanel.tsx, nanobot/channels/weixin/webui/WeixinPanel.tsx, nanobot/channels/weixin/webui/WeixinConnectFlow.tsx, …
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.
36 outdated package(s); JS/npm CVEs scored in D30
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
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/index.tsx:1, nanobot/channels/feishu/webui/FeishuAssistantsPanel.tsx:1
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Break each cycle by extracting the shared piece into a module both sides can import.
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.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit 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 audit 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.
C4 Data Retention — Not assessed: these retention 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 retention 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.
C5 Data-Subject Rights — Not assessed: these data-subject rights 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 data-subject rights 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.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 69 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 — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
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 — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
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.
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.
C2 Access Controls — Not assessed: these authorization 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 authorization 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.
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.
D23 Boundary Type-Coupling — Production source is present (.py, .ts, .tsx) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. 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"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — symbol resolution incomplete — navigability not assessed
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
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.
D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a CS/VB/GO/SCALA/SWIFT/DART class graph, and this repository's production source is .py, .ts, .tsx, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
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): 157 value object(s); 26 domain event(s)
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
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# syntax, and none was loaded for this repository. 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.
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not assessed — schema-migration practice is read from 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
P9 Domain vs controller coverage — coverage data present for 218 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 — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
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.
X1 Async correctness — 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
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — 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
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X3 Exception handling — 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
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, 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
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AC2 · Forms & labels· <label> that labels no control · ×1
<label> that labels no control webui/src/App.tsx:671— 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.
Focusable <span> isn't keyboard-operable webui/src/components/thread/ThreadComposer.tsx:2858— This <span> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its only behaviour is bound to dragstart, pointer gestures a keyboard cannot produce, and there is no key handler. The tab stop leads nowhere. Bind the same behaviour to a key handler, or provide an equivalent control elsewhere.
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/index.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/FeishuAssistantsPanel.tsx:1— 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:900— webui/src/components/thread/ThreadComposer.tsx changed 69 times in last 90 days, max cyclomatic complexity 396 in ThreadComposer.ThreadComposer at line 900. 31 of those changes were fix/bug commits, and the other 38 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/components/thread/ThreadShell.tsx webui/src/components/thread/ThreadShell.tsx:630— webui/src/components/thread/ThreadShell.tsx changed 66 times in last 90 days, max cyclomatic complexity 263 in ThreadShell.ThreadShell at line 630. 30 of those changes were fix/bug commits, and the other 36 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/App.tsx webui/src/App.tsx:1097— webui/src/App.tsx changed 59 times in last 90 days, max cyclomatic complexity 284 in App.Shell at line 1097. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: tui/src/app.ts tui/src/app.ts:1777— tui/src/app.ts changed 72 times in last 90 days, max cyclomatic complexity 127 in NanobotTui.handleKey at line 1777. 34 of those changes were fix/bug commits, and the other 38 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- tui/src/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/hooks/useNanobotStream.ts webui/src/hooks/useNanobotStream.ts:134— webui/src/hooks/useNanobotStream.ts changed 35 times in last 90 days, max cyclomatic complexity 206 in useNanobotStream.useNanobotStream at line 134. 14 of those changes were fix/bug commits, and the other 21 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/ChatList.tsx webui/src/components/ChatList.tsx:253— webui/src/components/ChatList.tsx changed 37 times in last 90 days, max cyclomatic complexity 155 in ChatList.ChatList at line 253. 14 of those changes were fix/bug commits, and the other 23 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: webui/src/components/thread/ThreadViewport.tsx webui/src/components/thread/ThreadViewport.tsx:228— webui/src/components/thread/ThreadViewport.tsx changed 35 times in last 90 days, max cyclomatic complexity 146 in ThreadViewport.ThreadViewport at line 228. 22 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: nanobot/agent/loop.py nanobot/agent/loop.py:2301— nanobot/agent/loop.py changed 117 times in last 90 days, max cyclomatic complexity 41 in AgentLoop._save_turn at line 2301. 57 of those changes were fix/bug commits, and the other 60 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: tui/src/protocol.ts tui/src/protocol.ts:470— tui/src/protocol.ts changed 33 times in last 90 days, max cyclomatic complexity 81 in protocol.decodeInboundEvent at line 470. 10 of those changes were fix/bug commits, and the other 23 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- tui/src/protocol.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: nanobot/agent/runner.py nanobot/agent/runner.py:368— nanobot/agent/runner.py changed 54 times in last 90 days, max cyclomatic complexity 48 in AgentRunner._run_core at line 368. 28 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: webui/src/components/settings/models/ModelsSettings.tsx webui/src/components/settings/models/ModelsSettings.tsx:180— webui/src/components/settings/models/ModelsSettings.tsx changed 19 times in last 90 days, max cyclomatic complexity 127 in ModelsSettings.ModelsSettings at line 180. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: nanobot/session/manager.py nanobot/session/manager.py:240— nanobot/session/manager.py changed 52 times in last 90 days, max cyclomatic complexity 38 in Session.get_history at line 240. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/session/manager.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/api.ts webui/src/lib/api.ts:306— webui/src/lib/api.ts changed 38 times in last 90 days, max cyclomatic complexity 51 in api.parseThreadProjectionEvent at line 306. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: nanobot/webui/transcript.py nanobot/webui/transcript.py:2181— nanobot/webui/transcript.py changed 32 times in last 90 days, max cyclomatic complexity 56 in transcript._client_projection_event at line 2181. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: nanobot/config/schema.py nanobot/config/schema.py:495— nanobot/config/schema.py changed 38 times in last 90 days, max cyclomatic complexity 45 in Config._match_provider at line 495. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/config/schema.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/MessageBubble.tsx webui/src/components/MessageBubble.tsx:168— webui/src/components/MessageBubble.tsx changed 41 times in last 90 days, max cyclomatic complexity 40 in MessageBubble.MessageBlockMenuActions at line 168. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- webui/src/components/MessageBubble.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:1302— nanobot/webui/ws_http.py changed 55 times in last 90 days, max cyclomatic complexity 28 in GatewayHTTPHandler._handle_webui_automation_action at line 1302. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: nanobot/agent/memory.py nanobot/agent/memory.py:836— nanobot/agent/memory.py changed 58 times in last 90 days, max cyclomatic complexity 26 in MemoryArchiver.archive at line 836. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/agent/memory.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/nanobot-client.ts webui/src/lib/nanobot-client.ts:1081— webui/src/lib/nanobot-client.ts changed 24 times in last 90 days, max cyclomatic complexity 62 in NanobotClient.handleMessage at line 1081. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/thread/ThreadMessages.tsx webui/src/components/thread/ThreadMessages.tsx:77— webui/src/components/thread/ThreadMessages.tsx changed 33 times in last 90 days, max cyclomatic complexity 44 in ThreadMessages.ThreadMessages at line 77. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: REDACTED REDACTED:929— REDACTED changed 24 times in last 90 days, max cyclomatic complexity 57 in OpenAICompatProvider._build_kwargs at line 929. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/components/thread/ModelPresetBadge.tsx webui/src/components/thread/ModelPresetBadge.tsx:99— webui/src/components/thread/ModelPresetBadge.tsx changed 19 times in last 90 days, max cyclomatic complexity 70 in ModelPresetBadge.ModelPresetBadge at line 99. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/components/settings/models/ProviderSettings.tsx webui/src/components/settings/models/ProviderSettings.tsx:676— webui/src/components/settings/models/ProviderSettings.tsx changed 14 times in last 90 days, max cyclomatic complexity 88 in ProviderSettings.ProvidersSettings at line 676. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/channels/linear/webui/LinearPanel.tsx nanobot/channels/linear/webui/LinearPanel.tsx:59— nanobot/channels/linear/webui/LinearPanel.tsx changed 10 times in last 90 days, max cyclomatic complexity 118 in LinearPanel.LinearPanel at line 59. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/channels/linear/webui/LinearPanel.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/settings/SettingsPage.tsx webui/src/components/settings/SettingsPage.tsx:68— webui/src/components/settings/SettingsPage.tsx changed 16 times in last 90 days, max cyclomatic complexity 73 in SettingsPage.SettingsPage at line 68. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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.
FileTooLong: thread/ThreadComposer.tsx webui/src/components/thread/ThreadComposer.tsx— FileTooLong — 2841 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2341 over it, 5.68× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/App.tsx webui/src/App.tsx— FileTooLong — 2542 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: Shell (1097-3124). The bar is 500 significant lines; this is 2042 over it, 5.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/app.ts tui/src/app.ts— FileTooLong — 2455 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: NanobotTui (486-3062). The bar is 500 significant lines; this is 1955 over it, 4.91× 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 — 2101 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1601 over it, 4.20× 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/loop.py nanobot/agent/loop.py— FileTooLong — 2054 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1554 over it, 4.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1690 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1190 over it, 3.38× 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 — 1679 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1179 over it, 3.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: thread/ThreadShell.tsx webui/src/components/thread/ThreadShell.tsx— FileTooLong — 1619 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: ThreadShell (630-1978). The bar is 500 significant lines; this is 1119 over it, 3.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: providers/image_generation.py nanobot/providers/image_generation.py— FileTooLong — 1558 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1058 over it, 3.12× 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 — 1546 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1046 over it, 3.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: providers/base.py nanobot/providers/base.py— FileTooLong — 1545 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1045 over it, 3.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cli/onboard.py nanobot/cli/onboard.py— FileTooLong — 1537 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1037 over it, 3.07× 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 — 1527 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1027 over it, 3.05× 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: session/manager.py nanobot/session/manager.py— FileTooLong — 1476 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 976 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: webui/mcp_presets_api.py nanobot/webui/mcp_presets_api.py— FileTooLong — 1423 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 923 over it, 2.85× 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 — 1383 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 883 over it, 2.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tools/mcp.py nanobot/agent/tools/mcp.py— FileTooLong — 1332 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 832 over it, 2.66× 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 — 1330 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 830 over it, 2.66× 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 — 1297 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 797 over it, 2.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/protocol.ts tui/src/protocol.ts— FileTooLong — 1244 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 744 over it, 2.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: agent/runner.py nanobot/agent/runner.py— FileTooLong — 1155 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 655 over it, 2.31× 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 — 1122 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 622 over it, 2.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tools/web.py nanobot/agent/tools/web.py— FileTooLong — 1082 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 582 over it, 2.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: system/AutomationsSettings.tsx webui/src/components/settings/system/AutomationsSettings.tsx— FileTooLong — 1066 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 566 over it, 2.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: lib/nanobot-client.ts webui/src/lib/nanobot-client.ts— FileTooLong — 1045 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: NanobotClient (189-1539). The bar is 500 significant lines; this is 545 over it, 2.09× 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.
FunctionTooLong: App.Shell webui/src/App.tsx:1097— FunctionTooLong — Shell runs 1646 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1546 over it, 16.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ThreadComposer.ThreadComposer webui/src/components/thread/ThreadComposer.tsx:900— FunctionTooLong — ThreadComposer runs 1534 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1434 over it, 15.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ThreadShell.ThreadShell webui/src/components/thread/ThreadShell.tsx:630— FunctionTooLong — ThreadShell runs 1120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1020 over it, 11.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useNanobotStream.useNanobotStream webui/src/hooks/useNanobotStream.ts:134— FunctionTooLong — useNanobotStream runs 736 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 636 over it, 7.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SettingsPage.SettingsPage webui/src/components/settings/SettingsPage.tsx:68— FunctionTooLong — SettingsPage runs 687 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 587 over it, 6.87× 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:180— FunctionTooLong — ModelsSettings runs 628 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 528 over it, 6.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: PaneWorkbench.PaneWorkbench webui/src/components/workbench/PaneWorkbench.tsx:199— FunctionTooLong — PaneWorkbench runs 561 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 461 over it, 5.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ProviderSettings.ProvidersSettings webui/src/components/settings/models/ProviderSettings.tsx:676— FunctionTooLong — ProvidersSettings runs 549 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 449 over it, 5.49× 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:71— FunctionTooLong — useSettingsController runs 514 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 414 over it, 5.14× 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: LinearPanel.LinearPanel nanobot/channels/linear/webui/LinearPanel.tsx:59— FunctionTooLong — LinearPanel runs 502 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 402 over it, 5.02× 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:175— FunctionTooLong — ChannelSetupSurface runs 488 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 388 over it, 4.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: createSystemSettingsActions.createSystemSettingsActions webui/src/components/settings/system/createSystemSettingsActions.ts:81— FunctionTooLong — createSystemSettingsActions runs 487 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 387 over it, 4.87× 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:70— FunctionTooLong — useModelSettingsActions runs 451 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 351 over it, 4.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AppsSettings.McpAppsCatalogRow webui/src/components/settings/system/AppsSettings.tsx:493— FunctionTooLong — McpAppsCatalogRow runs 374 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 274 over it, 3.74× 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: RuntimeSettings.RuntimeSettings webui/src/components/settings/system/RuntimeSettings.tsx:21— FunctionTooLong — RuntimeSettings runs 356 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 256 over it, 3.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ModelControls.ModelIdPicker webui/src/components/settings/shared/ModelControls.tsx:168— FunctionTooLong — ModelIdPicker runs 340 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 240 over it, 3.40× 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: ComposerUsagePopover.ComposerUsagePopover webui/src/components/thread/ComposerUsagePopover.tsx:57— FunctionTooLong — ComposerUsagePopover runs 322 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 222 over it, 3.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AutomationsSettings.AutomationsSettings webui/src/components/settings/system/AutomationsSettings.tsx:57— FunctionTooLong — AutomationsSettings runs 297 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 197 over it, 2.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ModelPresetBadge.ModelPresetBadge webui/src/components/thread/ModelPresetBadge.tsx:99— FunctionTooLong — ModelPresetBadge runs 296 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 196 over it, 2.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ChannelQrConnectFlow.ChannelQrConnectFlow webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:40— FunctionTooLong — ChannelQrConnectFlow 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: AppsSettings.AppsCatalogSettings webui/src/components/settings/system/AppsSettings.tsx:97— FunctionTooLong — AppsCatalogSettings runs 283 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 183 over it, 2.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AppsSettings.McpCustomServerPanel webui/src/components/settings/system/AppsSettings.tsx:994— FunctionTooLong — McpCustomServerPanel runs 274 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 174 over it, 2.74× 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: useSessions.useSessionHistory webui/src/hooks/useSessions.ts:383— FunctionTooLong — useSessionHistory 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: SkillsMarketplace.SkillsMarketplace webui/src/components/settings/SkillsMarketplace.tsx:40— FunctionTooLong — SkillsMarketplace runs 251 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SkillsCatalogSettings.SkillDetailSheet webui/src/components/settings/SkillsCatalogSettings.tsx:266— FunctionTooLong — SkillDetailSheet runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.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.
Repeated repair: REDACTED REDACTED:336— REDACTED changed 22 times in last 90 days and 17 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is GatewayRuntime._claim_current_process at line 336), 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): recover degraded WebSocket listener (#5544)”; “fix(runtime): preserve interrupted turns on gateway exit”; “fix(gateway): allow Windows launcher PID handoff”; “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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/agent/subagent.py nanobot/agent/subagent.py:391— nanobot/agent/subagent.py changed 21 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 13 (its worst body is SubagentManager._run_admitted_subagent at line 391), 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): remove local context tail truncation (#5820)”; “fix: stream internal model calls with idle timeouts (#5730)”; “fix: queue concurrent subagents (#5566)”; “fix(agent): let subagents recover from tool errors”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/agent/subagent.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: REDACTED REDACTED:341— REDACTED changed 15 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 14 (its worst body is webui_support._ensure_local_webui_channel at line 341), 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): make headless login self-explanatory (#5735)”; “fix(cli): protect Windows browser credential handoff [skip ci]”; “fix(cli): keep macOS bootstrap URLs out of argv [skip ci]”; “fix(webui): resume incomplete model setup in the browser”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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:202— nanobot/process_runtime.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 10 (its worst body is ManagedProcessRuntime.status at line 202), 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: improve log reliability and correlation”; “fix(gateway): preserve runtime identity compatibility”; “fix(gateway): stabilize process identities”; “fix(runtime): preserve Windows process handles”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/sdk/clients.py nanobot/sdk/clients.py:101— nanobot/sdk/clients.py changed 15 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 11 (its worst body is SessionClient.restore at line 101), 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: use summary checkpoints for all compaction triggers (#5694)”; “fix(session): preserve complete transcripts”; “fix(session): clear file state at deletion boundary”; “fix(agent): bound per-session file state”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/sdk/clients.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:40— nanobot/cli/gateway.py changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is gateway._resolved_config_selector at line 40), 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: improve log reliability and correlation”; “fix(gateway): prevent lifecycle races”; “fix(gateway): preserve shared runtime identity”; “fix(gateway): serialize shared runtime lifecycle”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: nanobot/webui/workspaces.py nanobot/webui/workspaces.py:270— nanobot/webui/workspaces.py changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is WebUIWorkspaceController.scope_from_envelope at line 270), 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 remote project paths and honor picker capabilities (#5673)”; “fix(webui): delete unpersisted pane sessions (#5624)”; “fix(tui): preserve draft scope until first message”; “fix(tui): avoid saving empty sessions”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/webui/workspaces.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/triggers/local_types.py nanobot/triggers/local_types.py:71— nanobot/triggers/local_types.py changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is LocalTrigger.from_dict at line 71), 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): show actual local trigger messages (#5228)”; “fix(triggers): treat null runHistory as empty when loading triggers”; “fix(triggers): coerce string lastRunAtMs when loading local triggers”; “fix(triggers): rename coerce helper to _store_int”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/triggers/local_types.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/cron/types.py nanobot/cron/types.py:124— nanobot/cron/types.py 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 4 (its worst body is CronJobState.from_store_dict at line 124), 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): show per-run automation replies and simplify details”; “fix(cron): skip null runHistory elements when loading jobs.json”; “fix(cron): coerce string schedule/state ms fields from jobs.json”; “fix(cron): also coerce null createdAtMs/updatedAtMs on load”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/cron/types.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:100— nanobot/utils/document.py 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 document.extract_text at line 100), 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 universal newlines”; “fix(files): decode BOM-marked text correctly”; “fix(agent): read document attachments on demand (#5122)”; “fix(documents): bound nested DOCX table parsing”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/ui/sheet.tsx webui/src/components/ui/sheet.tsx:70— webui/src/components/ui/sheet.tsx changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is sheet.SheetContent at line 70), 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): 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”; “fix(webui): complete i18n audit”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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/webui/file_preview.py nanobot/webui/file_preview.py:128— nanobot/webui/file_preview.py 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 9 (its worst body is file_preview._resolve_preview_path at line 128), 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): restore session-scoped file previews”; “fix(webui): allow media directory access when restrictToWorkspace is enabled”; “fix(webui): validate inferred file paths before preview (#4935)”; “fix(webui): respect full access in file preview”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/webui/file_preview.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/webui/skills_api.py nanobot/webui/skills_api.py:203— nanobot/webui/skills_api.py 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 12 (its worst body is skills_api._install_options at line 203), 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(settings): serialize gateway configuration updates”; “fix(webui): satisfy strict skill marketplace typing”; “fix(webui): harden skill marketplace lifecycle”; “fix(webui): harden skill management”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/webui/skills_api.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/channels/linear/webui/index.tsx nanobot/channels/linear/webui/index.tsx:8— nanobot/channels/linear/webui/index.tsx changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is index.LinearPanel at line 8), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linear): clarify setup actions and MCP configuration”; “fix(webui): align channel logo presentation”; “fix(linear): refresh setup UI and preserve channel lifecycle state”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/channels/linear/webui/index.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: nanobot/providers/oauth_model_catalog.py nanobot/providers/oauth_model_catalog.py:116— nanobot/providers/oauth_model_catalog.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 OAuthModelCatalog.get at line 116), 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): surface OAuth model catalog authorization failures”; “fix(providers): harden OAuth model discovery”; “fix(providers): complete OAuth model discovery”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/providers/oauth_model_catalog.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/events.py nanobot/events.py:80— nanobot/events.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 3 (its worst body is EventSink.accepts at line 80), 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): keep the compaction outcome visible, gate only the start notice”; “fix(channels): make automatic compaction notices follow send_progress”; “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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: webui/public/sw.js webui/public/sw.js:93— webui/public/sw.js 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 sw.manifestedAssetPaths at line 93), 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 credentials out of service worker caches”; “fix(webui): restore session drag and review findings”; “fix(webui): harden PWA service worker caching and registration”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- webui/public/sw.js`: 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:87— 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 87), 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: nanobot/agent/tools/session_messages.py nanobot/agent/tools/session_messages.py:208— nanobot/agent/tools/session_messages.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 SendSessionMessageTool.enqueue at line 208), 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): observe session reply timeout task failures”; “fix(agent): bound session message rate-limit state”; “fix(webui): assign readable session handles”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/agent/tools/session_messages.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/plugins.py nanobot/agent/plugins.py:280— nanobot/agent/plugins.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 14 (its worst body is plugins._plugin_logo at line 280), 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(plugins): verify content at skill read boundary”; “fix(plugins): revalidate cached skill roots”; “fix(plugins): harden activation boundaries”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- nanobot/agent/plugins.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/thread/ModelFallbackNotice.tsx webui/src/components/thread/ModelFallbackNotice.tsx:8— webui/src/components/thread/ModelFallbackNotice.tsx changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is ModelFallbackNotice.ModelFallbackNotice at line 8), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +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: webui/src/components/thread/thread-camera.ts webui/src/components/thread/thread-camera.ts:86— webui/src/components/thread/thread-camera.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is ThreadCameraController.moveTo at line 86), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): bound explicit scroll navigation duration”; “fix(webui): open threads at latest message (#5142)”; “fix(webui): keep streaming tail visible (#5140)”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- webui/src/components/thread/thread-camera.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/hooks/useSkills.ts webui/src/hooks/useSkills.ts:7— webui/src/hooks/useSkills.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is useSkills.useSkills at line 7), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(webui): retain skill refreshes queued during pending requests”; “fix(webui): refresh skill suggestions when opening the picker”; “fix(webui): prevent redundant thread and media reloads (#5164)”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- webui/src/hooks/useSkills.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/lib/temporary-chat.ts webui/src/lib/temporary-chat.ts:5— webui/src/lib/temporary-chat.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is temporary-chat.deriveTemporaryChatTitle at line 5), 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 temporary chats from first message”; “fix(webui): derive temporary chats from session policy”; “fix(webui): complete temporary chat mode”. 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-06-28..2026-09-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-28 20:52:14 +08:00' --until='2026-09-26 20:52:14 +08:00' --full-history --no-merges -- webui/src/lib/temporary-chat.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
ClassTooLong: NanobotTui tui/src/app.ts:486— ClassTooLong — 2063 significant lines (blank, comment-only and punctuation-only lines excluded), 106 methods. The bar is 400 significant lines; this is 1663 over it, 5.16× 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 — 1534 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 1134 over it, 3.84× 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 — 1120 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 720 over it, 2.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NanobotClient webui/src/lib/nanobot-client.ts:189— ClassTooLong — 930 significant lines (blank, comment-only and punctuation-only lines excluded), 73 methods. The bar is 400 significant lines; this is 530 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ChatList webui/src/components/ChatList.tsx:1— ClassTooLong — 805 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 405 over it, 2.01× 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 — 736 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 336 over it, 1.84× 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 — 687 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 287 over it, 1.72× 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 — 636 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 236 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModelsSettings webui/src/components/settings/models/ModelsSettings.tsx:1— ClassTooLong — 628 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 228 over it, 1.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.
ClassTooLong: PaneWorkbench webui/src/components/workbench/PaneWorkbench.tsx:1— ClassTooLong — 561 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 161 over it, 1.40× 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/transcript.ts:109— ClassTooLong — 517 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 117 over it, 1.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: useSettingsController webui/src/components/settings/useSettingsController.ts:1— ClassTooLong — 514 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 114 over it, 1.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LinearPanel nanobot/channels/linear/webui/LinearPanel.tsx:1— ClassTooLong — 502 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 102 over it, 1.26× 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 — 487 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 87 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: useModelSettingsActions webui/src/components/settings/models/useModelSettingsActions.ts:1— ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 51 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
R4 · Test Coverage· No test reaches this file · ×15
No test reaches this file nanobot/channels/linear/webui/LinearPanel.tsx— 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— 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/WeixinConnectFlow.tsx— 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— 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/linear/webui/LinearConnectFlow.tsx— 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/FeishuAssistantsPanel.tsx— 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/whatsapp/webui/WhatsAppConnectFlow.tsx— 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/build.ts— 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/linear/webui/index.tsx— 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/prepare-target.ts— 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— 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— 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/presentation.ts— 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/linear/webui/LinearHelpContent.tsx— 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/websocket/webui/WebSocketIcon.tsx— 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.
TooManyMethods: NanobotTui tui/src/app.ts:486— TooManyMethods — 106 methods. The bar is 30 methods; this is 76 over it, 3.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NanobotClient webui/src/lib/nanobot-client.ts:189— TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.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: AgentLoop nanobot/agent/loop.py:191— TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.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: GatewayHTTPHandler nanobot/webui/ws_http.py:327— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CliAppManager nanobot/apps/cli/service.py:417— 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:59— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: JsonlSessionStore nanobot/session/manager.py:445— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LLMProvider nanobot/providers/base.py:636— 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: OpenAICompatProvider REDACTED:510— 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/transcript.ts:109— 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: 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: SessionManager nanobot/session/manager.py:1517— 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: WebUISettingsRouter nanobot/webui/settings_routes.py:215— 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: CronService nanobot/cron/service.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.
Duplicated block (5 lines × 2) nanobot/agent/skills.py:331— nanobot/agent/skills.py:331-335 | nanobot/webui/skills_api.py:195-199 — 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/tools/web.py:430— nanobot/agent/tools/web.py:430-434 | nanobot/agent/tools/web.py:448-453 — 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/agent/tools/web.py:448` 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 × 2) nanobot/cli/commands.py:619— nanobot/cli/commands.py:619-624 | nanobot/cli/commands.py:643-647 — 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:619` 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:259— nanobot/cli/gateway.py:259-263 | nanobot/cli/gateway.py:276-280 — 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:259` 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:426— nanobot/providers/image_generation.py:426-430 | nanobot/providers/image_generation.py:841-845 — 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/helpers.py:788— nanobot/utils/helpers.py:788-792 | nanobot/utils/helpers.py:844-848 — 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/webui/transcript.py:1390— nanobot/webui/transcript.py:1390-1394 | nanobot/webui/transcript.py:1401-1405 — 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/agent/cron_turns.py:49— nanobot/agent/cron_turns.py:49-53 | nanobot/triggers/local_turns.py:47-51 — 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/cron/session_turns.py:58— nanobot/cron/session_turns.py:58-62 | nanobot/triggers/local_session_turns.py:47-51 — 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/providers/bedrock_provider.py:557— nanobot/providers/bedrock_provider.py:557-561 | nanobot/providers/bedrock_provider.py:571-575 — 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:180— nanobot/agent/context.py:180-192 | nanobot/agent/context_governance.py:267-279 — 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/runner.py:725— nanobot/agent/runner.py:725-737 | nanobot/agent/runner.py:745-757 — 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/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:363— nanobot/cli/gateway.py:363-375 | nanobot/cli/gateway.py:386-398 — 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:176— nanobot/cli/provider.py:176-188 | nanobot/cli/provider.py:205-217 — 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/image_generation.py:1340— nanobot/providers/image_generation.py:1340-1352 | nanobot/providers/image_generation.py:1456-1468 — 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:1340` 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 (13 lines × 2) nanobot/providers/openai_codex_provider.py:859— nanobot/providers/openai_codex_provider.py:859-871 | nanobot/providers/xai_grok_provider.py:852-864 — 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/session/manager.py:989— nanobot/session/manager.py:989-1001 | nanobot/session/manager.py:1079-1091 — 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 (11 lines × 2) nanobot/agent/tools/web.py:592— nanobot/agent/tools/web.py:592-602 | nanobot/agent/tools/web.py:823-833 — 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 (11 lines × 2) nanobot/cli/desktop_target.py:282— nanobot/cli/desktop_target.py:282-292 | nanobot/cli/desktop_target.py:324-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `nanobot/cli/desktop_target.py:335` calls `get` and `nanobot/cli/desktop_target.py:293` 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 (11 lines × 2) nanobot/providers/fallback_provider.py:325— nanobot/providers/fallback_provider.py:325-335 | nanobot/providers/fallback_provider.py:441-451 — 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:325` 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:398— nanobot/providers/github_copilot_provider.py:398-408 | nanobot/providers/xai_grok_provider.py:700-710 — 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/session/manager.py:940— nanobot/session/manager.py:940-950 | nanobot/session/manager.py:1017-1027 — 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 (11 lines × 2) nanobot/utils/document.py:199— nanobot/utils/document.py:199-209 | nanobot/utils/document.py:468-478 — 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 (11 lines × 2) tui/scripts/conpty_smoke.py:122— tui/scripts/conpty_smoke.py:122-132 | tui/scripts/pty_smoke.py:145-155 — 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 lines × 2) nanobot/providers/openai_codex_provider.py:707— nanobot/providers/openai_codex_provider.py:707-717 | nanobot/providers/xai_grok_provider.py:651-661 — 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.
Boundary violation [package:third-party-deep-import] webui/src/components/CodeBlock.tsx:53— webui/src/components/CodeBlock.tsx:53 imports react-syntax-highlighter/dist/esm/prism-async-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] webui/src/components/CodeBlock.tsx:54— webui/src/components/CodeBlock.tsx:54 imports react-syntax-highlighter/dist/esm/styles/prism/one-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] webui/src/components/CodeBlock.tsx:55— webui/src/components/CodeBlock.tsx:55 imports react-syntax-highlighter/dist/esm/styles/prism/one-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] webui/src/components/ViewportCodeRows.tsx:3— webui/src/components/ViewportCodeRows.tsx:3 imports react-syntax-highlighter/dist/esm/create-element, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:39— webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:39 imports react-syntax-highlighter/dist/esm/prism-async-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:40— webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:40 imports react-syntax-highlighter/dist/esm/create-element, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:41— webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:41 imports react-syntax-highlighter/dist/esm/styles/prism/one-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:42— webui/src/components/thread/activity/DiffSyntaxHighlight.tsx:42 imports react-syntax-highlighter/dist/esm/styles/prism/one-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
AC2 · Forms & labels· <NumberInput> field component without a label · ×6
<NumberInput> field component without a label webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:190— This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — 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:158— This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — 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:165— This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — 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:248— This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — 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:256— This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — 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/system/RuntimeSettings.tsx:285— This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — 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.
Change coupling: REDACTED ↔ index.ts REDACTED— `REDACTED` and `tui/src/index.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 `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: index.ts ↔ protocol.ts tui/src/index.ts— `tui/src/index.ts` and `tui/src/protocol.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) 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 `48e7c4f6` feat(cli): attach terminal clients to the selected Desktop [skip ci]; `3a62b0b7` fix(tui): surface chat connection failures (#5543); `c615aee2` feat(tui): start fresh chats in launch workspace — run `git show` on any of them.
Change coupling: commands.py ↔ stream.py nanobot/cli/commands.py— `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— `nanobot/webui/settings_routes.py` and `webui/src/lib/types.ts` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 7 shared commits counted here, the most recent 3 are `2ac802b2` feat(usage): add unified provider usage backend; `d5e0df69` feat(plugins): integrate portable Agent Plugins; `5d733b1c` fix(webui): move mutations to authenticated websocket requests — run `git show` on any of them.
Change coupling: settings_models.py ↔ types.ts nanobot/webui/settings_models.py— `nanobot/webui/settings_models.py` and `webui/src/lib/types.ts` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 6 shared commits counted here, the most recent 3 are `a44f28e6` fix(webui): complete Copilot device sign-in in the browser; `024fe8f6` fix(webui): surface OAuth model catalog authorization failures; `0274c11b` fix(webui): keep schema defaults out of model presets — run `git show` on any of them.
Duplicated block (9 lines × 2) nanobot/cli/terminal.py:281— nanobot/cli/terminal.py:281-289 | nanobot/cli/terminal.py:326-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 (9 lines × 2) nanobot/providers/openai_responses/parsing.py:366— nanobot/providers/openai_responses/parsing.py:366-374 | nanobot/providers/openai_responses/parsing.py:681-689 — 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 (9 lines × 2) nanobot/session/recovery.py:665— nanobot/session/recovery.py:665-673 | nanobot/session/recovery.py:703-711 — 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 (9 lines × 2) nanobot/webui/sidebar_state.py:247— nanobot/webui/sidebar_state.py:247-255 | nanobot/webui/workspaces.py:87-95 — 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 (9 lines × 2) nanobot/webui/settings_capabilities.py:796— nanobot/webui/settings_capabilities.py:796-804 | nanobot/webui/settings_system.py:928-936 — 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 (8 lines × 2) nanobot/agent/tools/sandbox.py:22— nanobot/agent/tools/sandbox.py:22-29 | nanobot/agent/tools/shell.py:1138-1145 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `paths` to `Iterable[str] | None` in one and `list[str] | None` 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 (8 lines × 2) nanobot/agent/tools/web.py:634— nanobot/agent/tools/web.py:634-641 | nanobot/agent/tools/web.py:744-751 — 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/agent/tools/web.py:634` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) REDACTED:669— REDACTED:669-676 | nanobot/process_runtime.py:494-501 — 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:669` 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:687— nanobot/optional_features.py:687-694 | nanobot/optional_features.py:764-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 (8 lines × 2) nanobot/session/recovery.py:569— nanobot/session/recovery.py:569-576 | nanobot/session/recovery.py:703-710 — 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/ChatList.tsx:644— webui/src/components/ChatList.tsx:644 · webui/src/components/ChatList.tsx:659 — 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/settings/models/ProviderSettings.tsx:519— webui/src/components/settings/models/ProviderSettings.tsx:519 · webui/src/components/settings/models/ProviderSettings.tsx:555 — 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/thread/ThreadShell.tsx:1740— webui/src/components/thread/ThreadShell.tsx:1740 · webui/src/components/thread/ThreadShell.tsx:1794 — 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 (15 lines × 2 locations) webui/src/components/workbench/PaneWorkbench.tsx:451— webui/src/components/workbench/PaneWorkbench.tsx:451 · webui/src/components/workbench/PaneWorkbench.tsx:558 — 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.
MethodTooLong: NanobotTui.accept tui/src/app.ts:1143— MethodTooLong — accept runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× 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.ts:1777— MethodTooLong — handleKey runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NanobotClient.handleMessage webui/src/lib/nanobot-client.ts:1081— MethodTooLong — handleMessage runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (6 lines × 2) nanobot/process_runtime.py:455— nanobot/process_runtime.py:455-460 | nanobot/process_runtime.py:541-546 — 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:397— nanobot/providers/github_copilot_provider.py:397-402 | nanobot/providers/openai_codex_provider.py:784-789 — 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/agent/tools/web.py:617— nanobot/agent/tools/web.py:617-622 | nanobot/agent/tools/web.py:756-761 — 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 × 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/providers/github_copilot_provider.py:472— nanobot/providers/github_copilot_provider.py:472-476 | nanobot/providers/openai_codex_provider.py:843-847 | nanobot/providers/xai_grok_provider.py:827-831 — 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:467` calls `_catalog_mapping`, `cast`, `isinstance` and `nanobot/providers/openai_codex_provider.py:839` 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:480— nanobot/providers/github_copilot_provider.py:480-484 | nanobot/providers/openai_codex_provider.py:851-855 | nanobot/providers/xai_grok_provider.py:835-839 — 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.
Duplicated block (23 lines × 2 locations) webui/src/components/ChatList.tsx:1303— webui/src/components/ChatList.tsx:1303 · webui/src/components/ChatList.tsx:1795 — 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.
Duplicated block (23 lines × 2 locations) webui/src/components/settings/system/AppsSettings.tsx:1358— webui/src/components/settings/system/AppsSettings.tsx:1358 · webui/src/components/thread/ThreadComposer.tsx:3152 — 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:1244— webui/src/components/thread/AgentActivityCluster.tsx:1244 · webui/src/components/thread/AgentActivityCluster.tsx:1322 — 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.
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.
Duplicated block (20 lines × 2) nanobot/agent/tools/exec_session.py:385— nanobot/agent/tools/exec_session.py:385-404 | nanobot/agent/tools/exec_session.py:413-432 — 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 (20 lines × 2) REDACTED:144— REDACTED:144-163 | REDACTED:1870-1889 — 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:554— nanobot/command/builtin.py:554-571 | nanobot/command/builtin.py:604-621 — 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 (18 lines × 2) REDACTED:1993— REDACTED:1993-2010 | REDACTED:2104-2121 — 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/agent/tools/web.py:842— nanobot/agent/tools/web.py:842-858 | nanobot/agent/tools/web.py:886-902 — 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:258— nanobot/webui/sidebar_state.py:258-274 | nanobot/webui/workspaces.py:98-114 — 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 (12 lines × 2) nanobot/providers/image_generation.py:1058— nanobot/providers/image_generation.py:1058-1069 | nanobot/providers/image_generation.py:1874-1885 — 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:214— nanobot/webui/skills_marketplace.py:214-225 | nanobot/webui/skills_marketplace.py:252-263 — 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: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.
Duplicated block (7 lines × 2) nanobot/agent/tools/web.py:428— nanobot/agent/tools/web.py:428-434 | nanobot/agent/tools/web.py:437-443 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `nanobot/agent/tools/web.py:435` calls `get`, `strip` and `nanobot/agent/tools/web.py:444` 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 (7 lines × 2) nanobot/sdk/clients.py:50— nanobot/sdk/clients.py:50-56 | nanobot/sdk/clients.py:119-125 — 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/sdk/clients.py:50` 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.
Duplication concentrated across 3 sibling directories (12 clone groups) nanobot/channels/linear/webui/LinearPanel.tsx:203— 12 duplicated blocks under the repository root have copies in at least two of the sibling directories nanobot, tui, webui — 7 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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 3 sibling directories (12 clone groups) webui/src/components/settings/system/AppsSettings.tsx:1358— 12 duplicated blocks under webui/src/components/ have copies in at least two of the sibling directories settings, thread, ui — 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.
R10 · Code Duplication· Duplicated block with local edits (40 matched lines × 2 locations) · ×2
Duplicated block with local edits (40 matched lines × 2 locations) nanobot/channels/linear/webui/LinearPanel.tsx:203— nanobot/channels/linear/webui/LinearPanel.tsx:203 · webui/src/components/settings/channels/ChannelSetupPanel.tsx:261 — the two spans are one implementation copied and then locally edited — 251 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 (40 matched lines × 2 locations) webui/src/components/thread/ThreadComposer.tsx:3042— webui/src/components/thread/ThreadComposer.tsx:3042 · webui/src/components/thread/ThreadComposer.tsx:3195 — 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.
R10 · Code Duplication· Duplicated block with local edits (32 matched lines × 2 locations) · ×2
Duplicated block with local edits (32 matched lines × 2 locations) webui/src/components/ChatList.tsx:210— webui/src/components/ChatList.tsx:210 · webui/src/components/Sidebar.tsx:45 — 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 with local edits (32 matched lines × 2 locations) webui/src/components/thread/activity/generic-tool-model.ts:346— webui/src/components/thread/activity/generic-tool-model.ts:346 · webui/src/components/thread/activity/trace-activity-model.ts:136 — the two spans are one implementation copied and then locally edited — 168 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 (18 lines × 2 locations) webui/src/components/ui/dropdown-menu.tsx:30— webui/src/components/ui/dropdown-menu.tsx:30 · webui/src/components/ui/popover.tsx:22 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (18 lines × 2 locations) webui/src/components/workbench/PaneWorkbench.tsx:467— webui/src/components/workbench/PaneWorkbench.tsx:467 · webui/src/components/workbench/PaneWorkbench.tsx:577 — 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 (17 lines × 3 locations) webui/src/components/settings/models/ProviderSettings.tsx:577— webui/src/components/settings/models/ProviderSettings.tsx:577 · webui/src/components/settings/models/ProviderSettings.tsx:594 · webui/src/components/settings/models/ProviderSettings.tsx:611 — 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.
Duplicated block (17 lines × 3 locations) webui/src/lib/api.ts:503— webui/src/lib/api.ts:503 · webui/src/lib/api.ts:715 · webui/src/lib/api.ts:739 — 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.
R10 · Code Duplication· Duplicated block with local edits (16 matched lines × 2 locations) · ×2
Duplicated block with local edits (16 matched lines × 2 locations) tui/src/protocol.ts:1346— tui/src/protocol.ts:1346 · webui/src/lib/nanobot-client.ts:880 — the two spans are one implementation copied and then locally edited — 97 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 (16 matched lines × 2 locations) webui/src/components/CliAppMentionText.tsx:75— webui/src/components/CliAppMentionText.tsx:75 · webui/src/components/UserMessageText.tsx:25 — the two spans are one implementation copied and then locally edited — 145 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 (16 lines × 2 locations) webui/src/components/settings/capabilities/WebSettings.tsx:198— webui/src/components/settings/capabilities/WebSettings.tsx:198 · webui/src/components/settings/models/ProviderSettings.tsx:990 — 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/thread/ThreadComposer.tsx:3013— webui/src/components/thread/ThreadComposer.tsx:3013 · webui/src/components/thread/ThreadComposer.tsx:3179 — 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.
AC1 · Text alternatives· <video> without a captions track · ×1
<video> without a captions track webui/src/components/AttachmentTile.tsx:47— 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).
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 134 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
ThreadComposer.ThreadComposer (cyclomatic 396) webui/src/components/thread/ThreadComposer.tsx:900— ThreadComposer.ThreadComposer has cyclomatic complexity 396 (threshold 15). Of this number, 122 points are the body's own statements and 274 belong to 85 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
App.Shell (cyclomatic 284) webui/src/App.tsx:1097— App.Shell has cyclomatic complexity 284 (threshold 15). Of this number, 57 points are the body's own statements and 227 belong to 100 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.
ThreadShell.ThreadShell (cyclomatic 263) webui/src/components/thread/ThreadShell.tsx:630— ThreadShell.ThreadShell has cyclomatic complexity 263 (threshold 15). Of this number, 81 points are the body's own statements and 182 belong to 66 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.
useNanobotStream.useNanobotStream (cyclomatic 206) webui/src/hooks/useNanobotStream.ts:134— useNanobotStream.useNanobotStream has cyclomatic complexity 206 (threshold 15). Most of this is not in the body itself: 4 of the 206 points are its own statements and the rest belongs to 31 function literals inside it that branch (lines 561, 929, 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.
ChatList.ChatList (cyclomatic 155) webui/src/components/ChatList.tsx:253— ChatList.ChatList has cyclomatic complexity 155 (threshold 15). Most of this is not in the body itself: 11 of the 155 points are its own statements and the rest belongs to 39 function literals inside it that branch (lines 772, 709, 514, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.ThreadViewport (cyclomatic 146) webui/src/components/thread/ThreadViewport.tsx:228— ThreadViewport.ThreadViewport has cyclomatic complexity 146 (threshold 15). Of this number, 28 points are the body's own statements and 118 belong to 35 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.
NanobotTui.handleKey (cyclomatic 127) tui/src/app.ts:1777— NanobotTui.handleKey has cyclomatic complexity 127 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModelsSettings.ModelsSettings (cyclomatic 127) webui/src/components/settings/models/ModelsSettings.tsx:180— ModelsSettings.ModelsSettings has cyclomatic complexity 127 (threshold 15). Of this number, 23 points are the body's own statements and 104 belong to 21 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 (cyclomatic 120) webui/src/components/settings/models/useModelSettingsActions.ts:70— useModelSettingsActions.useModelSettingsActions has cyclomatic complexity 120 (threshold 15). Most of this is not in the body itself: 1 of the 120 points is its own statement and the rest belongs to 18 function literals inside it that branch (lines 157, 380, 476, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
LinearPanel.LinearPanel (cyclomatic 118) nanobot/channels/linear/webui/LinearPanel.tsx:59— LinearPanel.LinearPanel has cyclomatic complexity 118 (threshold 15). Of this number, 56 points are the body's own statements and 62 belong to 23 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.
PaneWorkbench.PaneWorkbench (cyclomatic 114) webui/src/components/workbench/PaneWorkbench.tsx:199— PaneWorkbench.PaneWorkbench has cyclomatic complexity 114 (threshold 15). Most of this is not in the body itself: 13 of the 114 points are its own statements and the rest belongs to 31 function literals inside it that branch (lines 714, 304, 592, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.accept (cyclomatic 106) tui/src/app.ts:1143— NanobotTui.accept has cyclomatic complexity 106 (threshold 15). Of this number, 104 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.
ModelControls.ModelIdPicker (cyclomatic 104) webui/src/components/settings/shared/ModelControls.tsx:168— ModelControls.ModelIdPicker has cyclomatic complexity 104 (threshold 15). Of this number, 77 points are the body's own statements and 27 belong to 11 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
createSystemSettingsActions.createSystemSettingsActions (cyclomatic 100) webui/src/components/settings/system/createSystemSettingsActions.ts:81— createSystemSettingsActions.createSystemSettingsActions has cyclomatic complexity 100 (threshold 15). Most of this is not in the body itself: 1 of the 100 points is its own statement and the rest belongs to 22 function literals inside it that branch (lines 219, 417, 371, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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_sse_with_reasoning (cyclomatic 89) nanobot/providers/openai_responses/parsing.py:358— parsing.consume_sse_with_reasoning has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelSetupPanel.ChannelSetupSurface (cyclomatic 88) webui/src/components/settings/channels/ChannelSetupPanel.tsx:175— ChannelSetupPanel.ChannelSetupSurface has cyclomatic complexity 88 (threshold 15). Of this number, 41 points are the body's own statements and 47 belong to 21 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.
ProviderSettings.ProvidersSettings (cyclomatic 88) webui/src/components/settings/models/ProviderSettings.tsx:676— ProviderSettings.ProvidersSettings has cyclomatic complexity 88 (threshold 15). Of this number, 16 points are the body's own statements and 72 belong to 9 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
protocol.decodeInboundEvent (cyclomatic 81) tui/src/protocol.ts:470— protocol.decodeInboundEvent has cyclomatic complexity 81 (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.projectThreadEvent (cyclomatic 79) webui/src/lib/thread-event-projection.ts:756— thread-event-projection.projectThreadEvent has cyclomatic complexity 79 (threshold 15). Of this number, 78 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.
parsing.consume_sdk_stream (cyclomatic 77) nanobot/providers/openai_responses/parsing.py:674— parsing.consume_sdk_stream 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.
SettingsPage.SettingsPage (cyclomatic 73) webui/src/components/settings/SettingsPage.tsx:68— SettingsPage.SettingsPage has cyclomatic complexity 73 (threshold 15). Of this number, 24 points are the body's own statements and 49 belong to 11 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModelPresetBadge.ModelPresetBadge (cyclomatic 70) webui/src/components/thread/ModelPresetBadge.tsx:99— ModelPresetBadge.ModelPresetBadge has cyclomatic complexity 70 (threshold 15). Of this number, 32 points are the body's own statements and 38 belong to 18 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChannelQrConnectFlow.ChannelQrConnectFlow (cyclomatic 67) webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:40— ChannelQrConnectFlow.ChannelQrConnectFlow has cyclomatic complexity 67 (threshold 15). Of this number, 38 points are the body's own statements and 29 belong to 11 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useSettingsController.useSettingsController (cyclomatic 66) webui/src/components/settings/useSettingsController.ts:71— useSettingsController.useSettingsController has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 7 of the 66 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 288, 206, 305, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AppsSettings.McpAppsCatalogRow (cyclomatic 64) webui/src/components/settings/system/AppsSettings.tsx:493— AppsSettings.McpAppsCatalogRow has cyclomatic complexity 64 (threshold 15). Of this number, 56 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NanobotClient.handleMessage (cyclomatic 62) webui/src/lib/nanobot-client.ts:1081— NanobotClient.handleMessage 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.
WebUICommandRouter._dispatch_message (cyclomatic 60) nanobot/webui/inbound_commands.py:482— WebUICommandRouter._dispatch_message 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.
WorkspaceControls.WorkspaceProjectPicker (cyclomatic 59) webui/src/components/thread/WorkspaceControls.tsx:46— WorkspaceControls.WorkspaceProjectPicker has cyclomatic complexity 59 (threshold 15). Of this number, 41 points are the body's own statements and 18 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GrepTool._execute_sync (cyclomatic 57) nanobot/agent/tools/search.py:681— 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.
OpenAICompatProvider._build_kwargs (cyclomatic 57) REDACTED:929— OpenAICompatProvider._build_kwargs 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.
RuntimeSettings.RuntimeSettings (cyclomatic 57) webui/src/components/settings/system/RuntimeSettings.tsx:21— RuntimeSettings.RuntimeSettings has cyclomatic complexity 57 (threshold 15). Of this number, 49 points are the body's own statements and 8 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.
transcript._client_projection_event (cyclomatic 56) nanobot/webui/transcript.py:2181— transcript._client_projection_event has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComposerUsagePopover.ComposerUsagePopover (cyclomatic 54) webui/src/components/thread/ComposerUsagePopover.tsx:57— ComposerUsagePopover.ComposerUsagePopover has cyclomatic complexity 54 (threshold 15). Of this number, 36 points are the body's own statements and 18 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.
useSessions.useSessionHistory (cyclomatic 54) webui/src/hooks/useSessions.ts:383— useSessions.useSessionHistory has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 3 of the 54 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 478, 561, 453, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AutomationsSettings.AutomationDetailPanel (cyclomatic 52) webui/src/components/settings/system/AutomationsSettings.tsx:442— AutomationsSettings.AutomationDetailPanel has cyclomatic complexity 52 (threshold 15). Of this number, 50 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.
api.parseThreadProjectionEvent (cyclomatic 51) webui/src/lib/api.ts:306— api.parseThreadProjectionEvent has cyclomatic complexity 51 (threshold 15). Of this number, 50 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent 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._parse (cyclomatic 49) REDACTED:1546— OpenAICompatProvider._parse 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.
AgentRunner._run_core (cyclomatic 48) nanobot/agent/runner.py:368— AgentRunner._run_core 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.
EditFileTool.execute (cyclomatic 48) nanobot/agent/tools/filesystem.py:913— EditFileTool.execute has cyclomatic complexity 48 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useSystemSettingsEffects.useSystemSettingsEffects (cyclomatic 48) webui/src/components/settings/system/useSystemSettingsEffects.ts:26— useSystemSettingsEffects.useSystemSettingsEffects has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to 22 function literals inside it that branch (lines 94, 205, 58, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useCapabilitySettingsActions.useCapabilitySettingsActions (cyclomatic 46) webui/src/components/settings/capabilities/useCapabilitySettingsActions.ts:40— useCapabilitySettingsActions.useCapabilitySettingsActions has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 139, 74, 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.
Schema.validate_json_schema_value (cyclomatic 45) nanobot/agent/tools/base.py:51— Schema.validate_json_schema_value 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.
Config._match_provider (cyclomatic 45) nanobot/config/schema.py:495— 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.
RuntimeConfigSettings.RuntimeConfigSettings (cyclomatic 45) webui/src/components/settings/system/RuntimeConfigSettings.tsx:132— RuntimeConfigSettings.RuntimeConfigSettings has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 6 of the 45 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 171, 156, 205, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ApplyPatchTool.execute (cyclomatic 44) nanobot/agent/tools/apply_patch.py:97— 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.
AgentActivityCluster.FoldedAgentActivity (cyclomatic 44) webui/src/components/thread/AgentActivityCluster.tsx:234— AgentActivityCluster.FoldedAgentActivity has cyclomatic complexity 44 (threshold 15). Of this number, 31 points are the body's own statements and 13 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.
ThreadMessages.ThreadMessages (cyclomatic 44) webui/src/components/thread/ThreadMessages.tsx:77— ThreadMessages.ThreadMessages has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 10 of the 44 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 174, 144, 154, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UsagePanel.render (cyclomatic 43) tui/src/usage-panel.ts:110— UsagePanel.render has cyclomatic complexity 43 (threshold 15). Of this number, 33 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AutomationsSettings.AutomationsSettings (cyclomatic 43) webui/src/components/settings/system/AutomationsSettings.tsx:57— AutomationsSettings.AutomationsSettings has cyclomatic complexity 43 (threshold 15). Of this number, 25 points are the body's own statements and 18 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.
ThreadMessages.ThreadDisplayUnit (cyclomatic 43) webui/src/components/thread/ThreadMessages.tsx:542— ThreadMessages.ThreadDisplayUnit has cyclomatic complexity 43 (threshold 15). Of this number, 30 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.
useComposerMentionInput.useComposerMentionInput (cyclomatic 43) webui/src/hooks/useComposerMentionInput.ts:10— useComposerMentionInput.useComposerMentionInput has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 2 of the 43 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 84, 149, 57, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
FallbackProvider._try_with_fallback (cyclomatic 42) nanobot/providers/fallback_provider.py:458— FallbackProvider._try_with_fallback 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 42) nanobot/providers/openai_codex_provider.py:89— OpenAICodexProvider._call_codex 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.
AgentLoop._save_turn (cyclomatic 41) nanobot/agent/loop.py:2301— AgentLoop._save_turn 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.
LLMProvider._run_with_retry (cyclomatic 41) nanobot/providers/base.py:1792— LLMProvider._run_with_retry 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.
OpenAICompatProvider._parse_chunks (cyclomatic 41) REDACTED:1693— OpenAICompatProvider._parse_chunks 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.
useVoiceRecorder.useVoiceRecorder (cyclomatic 41) webui/src/hooks/useVoiceRecorder.ts:49— useVoiceRecorder.useVoiceRecorder has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 2 of the 41 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 164, 243, 279, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MessageBubble.MessageBlockMenuActions (cyclomatic 40) webui/src/components/MessageBubble.tsx:168— MessageBubble.MessageBlockMenuActions has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
onboard._configure_pydantic_model (cyclomatic 39) nanobot/cli/onboard.py:926— 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.
webui.webui (cyclomatic 38) nanobot/cli/webui.py:74— webui.webui 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.
Session.get_history (cyclomatic 38) nanobot/session/manager.py:240— Session.get_history 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.
NanobotTui.submit (cyclomatic 38) tui/src/app.ts:947— NanobotTui.submit has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppsSettings.AppsCatalogSettings (cyclomatic 38) webui/src/components/settings/system/AppsSettings.tsx:97— AppsSettings.AppsCatalogSettings has cyclomatic complexity 38 (threshold 15). Of this number, 29 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReadFileTool.execute (cyclomatic 37) nanobot/agent/tools/filesystem.py:294— ReadFileTool.execute 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.
OpenAICompatProvider.chat_stream (cyclomatic 37) REDACTED:2019— OpenAICompatProvider.chat_stream 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.
settings_runtime.update_runtime_config (cyclomatic 36) nanobot/webui/settings_runtime.py:80— settings_runtime.update_runtime_config 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.
ChannelInstancesPanel.ChannelInstancesPanel (cyclomatic 36) webui/src/components/settings/channels/ChannelInstancesPanel.tsx:49— ChannelInstancesPanel.ChannelInstancesPanel has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 3 of the 36 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 152, 120, 104, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RuntimeConfigSettings.useRuntimeConfigSettings (cyclomatic 36) webui/src/components/settings/system/RuntimeConfigSettings.tsx:24— RuntimeConfigSettings.useRuntimeConfigSettings has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 3 of the 36 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 62, 39, 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.
WebSearchTool._effective_provider (cyclomatic 35) nanobot/agent/tools/web.py:422— 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.
WebUIOutboundProjector.send (cyclomatic 35) nanobot/webui/outbound_projection.py:138— WebUIOutboundProjector.send 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:256— 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.
MarkdownTextRenderer.MarkdownTextRenderer (cyclomatic 35) webui/src/components/MarkdownTextRenderer.tsx:528— MarkdownTextRenderer.MarkdownTextRenderer has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 4 of the 35 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 551, 538, 547, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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_agent_loop (cyclomatic 34) nanobot/agent/loop.py:959— AgentLoop._run_agent_loop has cyclomatic complexity 34 (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.
MessageBubble.MessageBubble (cyclomatic 34) webui/src/components/MessageBubble.tsx:441— MessageBubble.MessageBubble 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.
McpManagementDialog.McpManagementDialog (cyclomatic 34) webui/src/components/settings/system/McpManagementDialog.tsx:47— McpManagementDialog.McpManagementDialog has cyclomatic complexity 34 (threshold 15). Of this number, 22 points are the body's own statements and 12 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.
LatexParser.command (cyclomatic 33) tui/src/latex.ts: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.
SkillsMarketplace.SkillsMarketplace (cyclomatic 33) webui/src/components/settings/SkillsMarketplace.tsx:40— SkillsMarketplace.SkillsMarketplace has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 13 of the 33 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 98, 136, 158, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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.
ThreadComposer.GoalStateStrip (cyclomatic 33) webui/src/components/thread/ThreadComposer.tsx:693— ThreadComposer.GoalStateStrip has cyclomatic complexity 33 (threshold 15). Of this number, 20 points are the body's own statements and 13 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useAttachedImages.useAttachedImages (cyclomatic 33) webui/src/hooks/useAttachedImages.ts:265— useAttachedImages.useAttachedImages 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 10 function literals inside it that branch (lines 296, 367, 401, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MessageTool.execute (cyclomatic 32) nanobot/agent/tools/message.py:151— MessageTool.execute 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.
onboard._configure_quick_start_provider (cyclomatic 32) nanobot/cli/onboard.py:1784— 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.
OpenAICompatProvider._build_responses_body (cyclomatic 32) REDACTED:1261— OpenAICompatProvider._build_responses_body 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.
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 literals inside it that branch (lines 83, 157, 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.
ChannelsSettings.ChannelsSettings (cyclomatic 32) webui/src/components/settings/system/ChannelsSettings.tsx:19— ChannelsSettings.ChannelsSettings has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 128, 56, 61, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
thread-display-projection.projectWebuiThreadMessages (cyclomatic 32) webui/src/lib/thread-display-projection.ts:30— thread-display-projection.projectWebuiThreadMessages 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.
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 literals inside it that branch (lines 33, 50, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
protocol.fetchHistory (cyclomatic 31) tui/src/protocol.ts:665— protocol.fetchHistory 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.
CredentialForm.CredentialForm (cyclomatic 31) webui/src/components/settings/channels/CredentialForm.tsx:80— CredentialForm.CredentialForm has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 99, 149). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
imageEncode.worker.sniffImageMime (cyclomatic 31) webui/src/workers/imageEncode.worker.ts:83— 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:905— 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.
settings_capabilities.update_image_generation_settings (cyclomatic 30) nanobot/webui/settings_capabilities.py:398— settings_capabilities.update_image_generation_settings 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.
WeixinPanel.WeixinPanel (cyclomatic 30) nanobot/channels/weixin/webui/WeixinPanel.tsx:41— WeixinPanel.WeixinPanel has cyclomatic complexity 30 (threshold 15). Of this number, 16 points are the body's own statements and 14 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChatList.ActivePaneRows (cyclomatic 30) webui/src/components/ChatList.tsx:1342— ChatList.ActivePaneRows has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 1408, 1451, 1459). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CodeBlock.CodeBlock (cyclomatic 30) webui/src/components/CodeBlock.tsx:196— CodeBlock.CodeBlock has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SettingsControls.RestartSettingsFooter (cyclomatic 30) webui/src/components/settings/shared/SettingsControls.tsx:247— 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.
segmented-control.SegmentedControl (cyclomatic 30) webui/src/components/ui/segmented-control.tsx:46— segmented-control.SegmentedControl has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 153, 109, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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._build_turn (cyclomatic 29) nanobot/agent/loop.py:2027— AgentLoop._build_turn 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.
MyTool._format_value (cyclomatic 29) nanobot/agent/tools/self.py:296— MyTool._format_value 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:547— 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.
factory._resolve_provider_setup (cyclomatic 29) nanobot/providers/factory.py:76— factory._resolve_provider_setup 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.
SessionSearchDialog.SessionSearchDialog (cyclomatic 29) webui/src/components/SessionSearchDialog.tsx:27— SessionSearchDialog.SessionSearchDialog 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 9 function literals inside it that branch (lines 188, 85, 106, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentLoop._dispatch_one (cyclomatic 28) nanobot/agent/loop.py:1504— AgentLoop._dispatch_one 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:769— 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.
parsing._hosted_web_search_event (cyclomatic 28) nanobot/providers/openai_responses/parsing.py:95— 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.
WebUISettingsRouter.dispatch (cyclomatic 28) nanobot/webui/settings_routes.py:265— WebUISettingsRouter.dispatch 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.
GatewayHTTPHandler._handle_webui_automation_action (cyclomatic 28) nanobot/webui/ws_http.py:1302— GatewayHTTPHandler._handle_webui_automation_action 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.
LinearMemberAccess.LinearMemberAccess (cyclomatic 28) nanobot/channels/linear/webui/LinearMemberAccess.tsx:18— LinearMemberAccess.LinearMemberAccess has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 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.
App.readShellRoute (cyclomatic 28) webui/src/App.tsx:244— App.readShellRoute 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.
SkillsCatalogSettings.SkillDetailSheet (cyclomatic 28) webui/src/components/settings/SkillsCatalogSettings.tsx:266— SkillsCatalogSettings.SkillDetailSheet has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 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.
AutomationRunDialog.AutomationRunDialog (cyclomatic 28) webui/src/components/settings/system/AutomationRunDialog.tsx:14— AutomationRunDialog.AutomationRunDialog has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ThreadMessages.MessageBlockMenu (cyclomatic 28) webui/src/components/thread/ThreadMessages.tsx:384— ThreadMessages.MessageBlockMenu has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 belong to 9 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ThreadMessages.threadDisplayUnitPropsEqual (cyclomatic 30) 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.
ExecTool._guard_command (cyclomatic 27) nanobot/agent/tools/shell.py:807— ExecTool._guard_command 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.
ExecTool._extract_posix_paths_from_token (cyclomatic 27) nanobot/agent/tools/shell.py:1031— 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:104— 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.
mcp_presets_api._mcp_server_config (cyclomatic 27) nanobot/webui/mcp_presets_api.py:1369— mcp_presets_api._mcp_server_config 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.
settings_capabilities.update_web_search_settings (cyclomatic 27) nanobot/webui/settings_capabilities.py:277— 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.
protocol.fetchMentionCandidates (cyclomatic 27) tui/src/protocol.ts:926— protocol.fetchMentionCandidates has cyclomatic complexity 27 (threshold 15). Of this number, 25 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.
NanobotTui.constructor (cyclomatic 27) tui/src/app.ts:585— NanobotTui.constructor has cyclomatic complexity 27 (threshold 15). Of this number, 18 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
App.App (cyclomatic 27) webui/src/App.tsx:891— 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 literals inside it that branch (lines 932, 1055, 897, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.Sidebar (cyclomatic 27) webui/src/components/Sidebar.tsx:109— Sidebar.Sidebar 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.
AutomationsSettings.formatCronScheduleSummary (cyclomatic 27) webui/src/components/settings/system/AutomationsSettings.tsx:1146— 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.
generic-tool-model.activityLabel (cyclomatic 27) webui/src/components/thread/activity/generic-tool-model.ts:195— generic-tool-model.activityLabel 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.
MemoryArchiver.archive (cyclomatic 26) nanobot/agent/memory.py:836— 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.
factory._make_provider_core (cyclomatic 26) nanobot/providers/factory.py:150— factory._make_provider_core 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:103— 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.
JsonlSessionStore._list_sessions_unlocked (cyclomatic 26) nanobot/session/manager.py:1416— JsonlSessionStore._list_sessions_unlocked 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.
session_list_index._scan_transcript_row (cyclomatic 26) nanobot/webui/session_list_index.py:538— session_list_index._scan_transcript_row 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.
session_list_index._scan_session_row (cyclomatic 26) nanobot/webui/session_list_index.py:625— session_list_index._scan_session_row 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:500— 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.
LinearResetConnection.LinearResetConnection (cyclomatic 26) nanobot/channels/linear/webui/LinearResetConnection.tsx:21— LinearResetConnection.LinearResetConnection has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 41, 105, 77, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
protocol.fetchSessionUsage (cyclomatic 26) tui/src/protocol.ts:622— protocol.fetchSessionUsage 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.
DiffViewer.render (cyclomatic 26) tui/src/diff-viewer.ts:249— 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.
PreviewPane.PreviewPane (cyclomatic 26) webui/src/components/PreviewPane.tsx:15— PreviewPane.PreviewPane has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 73, 82, 36, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AppsSettings.McpCustomServerPanel (cyclomatic 26) webui/src/components/settings/system/AppsSettings.tsx:994— AppsSettings.McpCustomServerPanel 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.
attachment_ingress.store_inbound_attachments (cyclomatic 25) nanobot/webui/attachment_ingress.py:79— attachment_ingress.store_inbound_attachments 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.
settings_models.provider_models_payload (cyclomatic 25) nanobot/webui/settings_models.py:619— settings_models.provider_models_payload 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.
protocol.fetchSessions (cyclomatic 25) tui/src/protocol.ts:862— protocol.fetchSessions has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 886). 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.
FileActions.FileActions (cyclomatic 25) webui/src/components/FileActions.tsx:27— 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 literals inside it that branch (lines 60, 54, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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.
api.hasValidProjectionMetadata (cyclomatic 25) webui/src/lib/api.ts:265— api.hasValidProjectionMetadata has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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._cast_value (cyclomatic 24) nanobot/agent/tools/base.py:263— Tool._cast_value 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.
server.handle_chat_completions (cyclomatic 24) nanobot/api/server.py:273— server.handle_chat_completions 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.
recovery.restore_runtime_checkpoint (cyclomatic 24) nanobot/session/recovery.py:276— recovery.restore_runtime_checkpoint 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.
session_list_index._reconcile_index (cyclomatic 24) nanobot/webui/session_list_index.py:81— session_list_index._reconcile_index 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.
settings_models.update_model_configuration (cyclomatic 24) nanobot/webui/settings_models.py:1227— settings_models.update_model_configuration 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.
NanobotClient.handleMessage (cyclomatic 24) tui/src/protocol.ts:1392— NanobotClient.handleMessage 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.
FileReferenceChip.FileReferenceChip (cyclomatic 24) webui/src/components/FileReferenceChip.tsx:42— FileReferenceChip.FileReferenceChip 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 28) 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.
ChannelValidationProgress.ChannelValidationProgress (cyclomatic 24) webui/src/components/settings/channels/ChannelValidationProgress.tsx:69— ChannelValidationProgress.ChannelValidationProgress 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, separate the cases: extract each independent 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:251— 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.
McpManagementDialog.ConnectionPanel (cyclomatic 24) webui/src/components/settings/system/McpManagementDialog.tsx:489— McpManagementDialog.ConnectionPanel 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, separate the cases: extract each independent 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.
combobox.useComboboxNavigation (cyclomatic 24) webui/src/components/ui/combobox.tsx:17— combobox.useComboboxNavigation has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 56, 32, 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.
ansi.applySgrParams (cyclomatic 24) webui/src/lib/ansi.ts:124— 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.
parsing.parse_response_output (cyclomatic 23) nanobot/providers/openai_responses/parsing.py:592— parsing.parse_response_output 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.
RecoveryCoordinator._recover_session (cyclomatic 23) nanobot/session/recovery.py:644— 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.
quick_validate.validate_skill (cyclomatic 23) nanobot/skills/skill-creator/scripts/quick_validate.py:132— 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.
helpers.split_message (cyclomatic 23) nanobot/utils/helpers.py:672— 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.
WebUICommandRouter.dispatch (cyclomatic 23) nanobot/webui/inbound_commands.py:291— WebUICommandRouter.dispatch 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.
GatewayHTTPHandler._handle_webui_thread_get (cyclomatic 23) nanobot/webui/ws_http.py:961— GatewayHTTPHandler._handle_webui_thread_get 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.
latex.mathSpanAt (cyclomatic 23) tui/src/latex.ts: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.
AttachmentTile.AttachmentTile (cyclomatic 23) webui/src/components/AttachmentTile.tsx:18— AttachmentTile.AttachmentTile has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CliAppMentionText.splitCapabilityMentionSegments (cyclomatic 23) webui/src/components/CliAppMentionText.tsx:49— CliAppMentionText.splitCapabilityMentionSegments 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.
ThinkingReasoningShell.ThinkingReasoningShell (cyclomatic 23) webui/src/components/thread/activity/ThinkingReasoningShell.tsx:19— ThinkingReasoningShell.ThinkingReasoningShell 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.
trace-activity-model.describeTraceLine (cyclomatic 23) webui/src/components/thread/activity/trace-activity-model.ts:17— 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.
ExecTool._resolve_shell (cyclomatic 22) nanobot/agent/tools/shell.py:630— 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.
agent.agent (cyclomatic 22) nanobot/cli/agent.py:54— agent.agent 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:400— 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:1106— 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.
LLMUsageStore.usage_payload (cyclomatic 22) nanobot/llm_usage/store.py:402— LLMUsageStore.usage_payload 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.
optional_features.with_channel_runtime_status (cyclomatic 22) nanobot/optional_features.py:536— 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:82— 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.
OpenAICompatProvider._sanitize_messages (cyclomatic 22) REDACTED:701— OpenAICompatProvider._sanitize_messages 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.
WebUICommandRouter.start_webui_request (cyclomatic 22) nanobot/webui/inbound_commands.py:743— WebUICommandRouter.start_webui_request 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.
transcript._select_transcript_page (cyclomatic 22) nanobot/webui/transcript.py:929— transcript._select_transcript_page 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:1260— 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.
NanobotClient.open (cyclomatic 22) tui/src/protocol.ts:1184— NanobotClient.open has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
protocol.sanitizeConnectionFailure (cyclomatic 22) tui/src/protocol.ts:1095— protocol.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 literal inside it that branches (line 1098). 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.
FilePreviewPanel.FilePreviewPanel (cyclomatic 22) webui/src/components/FilePreviewPanel.tsx:24— FilePreviewPanel.FilePreviewPanel has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 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.
ThreadComposer.normalizeQueuedPrompt (cyclomatic 22) webui/src/components/thread/ThreadComposer.tsx:470— ThreadComposer.normalizeQueuedPrompt has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileEditRow.FileUnifiedDiff (cyclomatic 22) webui/src/components/thread/activity/FileEditRow.tsx:170— FileEditRow.FileUnifiedDiff has cyclomatic complexity 22 (threshold 15). Of this number, 12 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.
ThreadMotionCoordinator.flushGeometry (cyclomatic 22) webui/src/components/thread/thread-motion.ts:432— ThreadMotionCoordinator.flushGeometry 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:434— 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:912— 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.
TurnDelivery._publish_event (cyclomatic 21) nanobot/agent/turn_delivery.py:401— TurnDelivery._publish_event 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:425— 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.
LLMProvider._sanitize_empty_content (cyclomatic 21) nanobot/providers/base.py:831— 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:1141— 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:711— 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.
transcription._post_stepfun_asr_with_retry (cyclomatic 21) nanobot/providers/transcription.py:318— transcription._post_stepfun_asr_with_retry 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.
JsonlSessionStore._repair_unlocked (cyclomatic 21) nanobot/session/manager.py:1015— JsonlSessionStore._repair_unlocked 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.
helpers._estimate_prompt_tokens_with_source (cyclomatic 21) nanobot/utils/helpers.py:776— helpers._estimate_prompt_tokens_with_source has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mcp_presets_api.mcp_presets_settings_action (cyclomatic 21) nanobot/webui/mcp_presets_api.py:1632— mcp_presets_api.mcp_presets_settings_action 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.
settings_models.oauth_provider_status (cyclomatic 21) nanobot/webui/settings_models.py:295— 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:783— 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.
ZoomableImage.ZoomableImage (cyclomatic 21) webui/src/components/ZoomableImage.tsx:16— ZoomableImage.ZoomableImage has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 52, 74, 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.
TokenUsageCard.TokenUsageCard (cyclomatic 21) webui/src/components/settings/TokenUsageCard.tsx:45— TokenUsageCard.TokenUsageCard has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 139, 161, 119, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ChannelCatalogRow.ChannelCatalogRow (cyclomatic 21) webui/src/components/settings/channels/ChannelCatalogRow.tsx:18— ChannelCatalogRow.ChannelCatalogRow has cyclomatic complexity 21 (threshold 15). Of this number, 16 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.
ThreadMessages.completedMessageBlocks (cyclomatic 21) webui/src/components/thread/ThreadMessages.tsx:971— ThreadMessages.completedMessageBlocks has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 987, 998, 990). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 30) 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.
ThreadShell.recentComposerRoundUsage (cyclomatic 21) webui/src/components/thread/ThreadShell.tsx:139— ThreadShell.recentComposerRoundUsage 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.
generic-tool-model.activityDetail (cyclomatic 21) webui/src/components/thread/activity/generic-tool-model.ts:283— generic-tool-model.activityDetail has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CronTool._add_job (cyclomatic 20) nanobot/agent/tools/cron.py:150— CronTool._add_job 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.
ExecTool._prepare_command (cyclomatic 20) nanobot/agent/tools/shell.py:400— ExecTool._prepare_command 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:823— 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.
AssemblyAITranscriptionProvider.transcribe (cyclomatic 20) nanobot/providers/transcription.py:546— 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:692— 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.
JsonlSessionStore._migrate_from_workspace (cyclomatic 20) nanobot/session/manager.py:805— JsonlSessionStore._migrate_from_workspace 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:300— 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.
McpOAuthManager._payload (cyclomatic 20) nanobot/webui/mcp_oauth_api.py:355— 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.
ImageGenerationSettings.ImageGenerationSettings (cyclomatic 20) webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:43— ImageGenerationSettings.ImageGenerationSettings has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AutomationCalendar.AutomationCalendar (cyclomatic 20) webui/src/components/settings/system/AutomationCalendar.tsx:220— AutomationCalendar.AutomationCalendar has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 277, 254, 356, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AutomationsSettings.AutomationEditDialog (cyclomatic 20) webui/src/components/settings/system/AutomationsSettings.tsx:677— 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 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.
ComposerUsagePopover.UsagePanel (cyclomatic 20) webui/src/components/thread/ComposerUsagePopover.tsx:426— ComposerUsagePopover.UsagePanel has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 493, 485, 478, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RecoveryNotice.RecoveryNotice (cyclomatic 20) webui/src/components/thread/RecoveryNotice.tsx:15— RecoveryNotice.RecoveryNotice has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AgentLoop.__init__ (cyclomatic 19) nanobot/agent/loop.py:258— AgentLoop.__init__ 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.
AgentLoop.run (cyclomatic 19) nanobot/agent/loop.py:1310— AgentLoop.run 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.
AgentLoop._restore_turn (cyclomatic 19) nanobot/agent/loop.py:1910— AgentLoop._restore_turn 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:1142— 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.
UpdateGoalTool.execute (cyclomatic 19) nanobot/agent/tools/long_task.py:301— 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.
MCPPromptWrapper.execute (cyclomatic 19) nanobot/agent/tools/mcp.py:917— MCPPromptWrapper.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:1252— 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.
AnthropicProvider._handle_error (cyclomatic 19) REDACTED:123— 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.
automation_results.cron_run_response (cyclomatic 19) nanobot/webui/automation_results.py:27— automation_results.cron_run_response 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:1103— 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.
GatewayHTTPHandler._dispatch_misc_routes (cyclomatic 19) nanobot/webui/ws_http.py:1430— GatewayHTTPHandler._dispatch_misc_routes 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.
pty_smoke.main (cyclomatic 19) tui/scripts/pty_smoke.py:75— pty_smoke.main has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AutomationCalendar.CalendarEntryRow (cyclomatic 19) webui/src/components/settings/system/AutomationCalendar.tsx:98— 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.
useSessions.useSessions (cyclomatic 19) webui/src/hooks/useSessions.ts:201— useSessions.useSessions 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 8 function literals inside it that branch (lines 234, 351, 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.
useSidebarState.useSidebarState (cyclomatic 19) webui/src/hooks/useSidebarState.ts:137— useSidebarState.useSidebarState has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 162, 181, 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.
thread-event-projection.projectToolActivity (cyclomatic 19) webui/src/lib/thread-event-projection.ts:628— thread-event-projection.projectToolActivity 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.
ContextGovernor._merge_adjacent_user_messages_for_model (cyclomatic 18) nanobot/agent/context_governance.py:282— 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.
MCPProvider.reload (cyclomatic 18) nanobot/agent/tools/mcp.py:1489— MCPProvider.reload 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.
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:529— 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.
AnthropicProvider._build_kwargs (cyclomatic 18) REDACTED:577— AnthropicProvider._build_kwargs 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.
BedrockProvider._content_blocks (cyclomatic 18) nanobot/providers/bedrock_provider.py:138— 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:372— 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.
image_generation._parse_codex_sse_images (cyclomatic 18) nanobot/providers/image_generation.py:1575— image_generation._parse_codex_sse_images 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:624— 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.
xai_grok_provider._xai_hosted_tool_event (cyclomatic 18) nanobot/providers/xai_grok_provider.py:453— 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.
network.resolve_url_target (cyclomatic 18) nanobot/security/network.py:78— 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.
helpers.estimate_message_tokens (cyclomatic 18) nanobot/utils/helpers.py:840— helpers.estimate_message_tokens 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.
ModelSettingsHandler.handle (cyclomatic 18) nanobot/webui/settings_models.py:1765— ModelSettingsHandler.handle 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.
settings_models.update_provider_settings (cyclomatic 18) nanobot/webui/settings_models.py:1463— settings_models.update_provider_settings 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.login_oauth_provider (cyclomatic 18) nanobot/webui/settings_models.py:1522— settings_models.login_oauth_provider has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SystemSettingsHandler.handle (cyclomatic 18) nanobot/webui/settings_system.py:409— SystemSettingsHandler.handle 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.
transcript.write_session_messages_as_transcript (cyclomatic 18) nanobot/webui/transcript.py:1374— transcript.write_session_messages_as_transcript 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.
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.
footer-hints.hintsFor (cyclomatic 18) tui/src/footer-hints.ts:71— 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, 73, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MessageBubble.mergeMcpMentionPresets (cyclomatic 18) webui/src/components/MessageBubble.tsx:614— 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.
StarPrompt.StarPrompt (cyclomatic 18) webui/src/components/StarPrompt.tsx:42— StarPrompt.StarPrompt 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 6 function literals inside it that branch (lines 70, 65, 62, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SettingsSidebar.SettingsSidebar (cyclomatic 18) webui/src/components/settings/SettingsSidebar.tsx:66— SettingsSidebar.SettingsSidebar has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SessionInfoPopover.SessionInfoPopover (cyclomatic 18) webui/src/components/thread/SessionInfoPopover.tsx:52— SessionInfoPopover.SessionInfoPopover 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 7 function literals inside it that branch (lines 85, 103, 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.
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:103— 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.sendMessage (cyclomatic 18) webui/src/lib/nanobot-client.ts:970— NanobotClient.sendMessage 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.
thread-event-projection.attachProjectedReasoning (cyclomatic 18) webui/src/lib/thread-event-projection.ts:532— thread-event-projection.attachProjectedReasoning 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.
AgentRunner._try_drain_injections (cyclomatic 17) nanobot/agent/runner.py:155— AgentRunner._try_drain_injections 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.
ContentPage._append_match (cyclomatic 17) nanobot/agent/tools/_search_content.py:95— 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.
execution._execute_tool_call (cyclomatic 17) nanobot/agent/tools/execution.py:115— execution._execute_tool_call 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.
gateway_runtime._run_gateway (cyclomatic 17) REDACTED:344— gateway_runtime._run_gateway 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.
onboard._format_value (cyclomatic 17) nanobot/cli/onboard.py:354— 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.
terminal._maybe_print_interactive_progress (cyclomatic 17) nanobot/cli/terminal.py:364— terminal._maybe_print_interactive_progress 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.
store._handle_pairing_subcommand (cyclomatic 17) nanobot/pairing/store.py:316— 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:298— 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:659— 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:783— 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.
OpenAICompatProvider._should_use_responses_api (cyclomatic 17) REDACTED:1110— OpenAICompatProvider._should_use_responses_api 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.
converters.convert_messages (cyclomatic 17) nanobot/providers/openai_responses/converters.py:15— 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.
webui_turns.maybe_generate_webui_title (cyclomatic 17) nanobot/session/webui_turns.py:198— webui_turns.maybe_generate_webui_title 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.
settings_models.update_agent_model_settings (cyclomatic 17) nanobot/webui/settings_models.py:1113— settings_models.update_agent_model_settings 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.create_model_configuration (cyclomatic 17) nanobot/webui/settings_models.py:1163— settings_models.create_model_configuration 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.
settings_models.complete_oauth_provider (cyclomatic 17) nanobot/webui/settings_models.py:1638— settings_models.complete_oauth_provider 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.
Transcript.prependHistory (cyclomatic 17) tui/src/transcript.ts:269— 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.
ModelPresetBadge.PresetPill (cyclomatic 17) webui/src/components/thread/ModelPresetBadge.tsx:492— 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.
PromptRail.PromptRail (cyclomatic 17) webui/src/components/thread/PromptRail.tsx:54— PromptRail.PromptRail has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 152, 102, 68, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ThreadMessages.pendingTurnProjection (cyclomatic 17) webui/src/components/thread/ThreadMessages.tsx:292— ThreadMessages.pendingTurnProjection has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ThreadMessages.threadDisplayUnitPropsEqual (cyclomatic 30) 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.
activity-timeline.projectOrderedTurn (cyclomatic 17) webui/src/lib/activity-timeline.ts:121— activity-timeline.projectOrderedTurn has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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.
NanobotClient.reconcileCanonicalCompletion (cyclomatic 17) webui/src/lib/nanobot-client.ts:466— NanobotClient.reconcileCanonicalCompletion has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
remark-tex-math.tokenizeMathFlow (cyclomatic 17) webui/src/lib/remark-tex-math.ts:224— remark-tex-math.tokenizeMathFlow 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.
(anonymous) (cyclomatic 17) webui/public/sw.js:172— (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:893— 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._process_message (cyclomatic 16) nanobot/agent/loop.py:1706— AgentLoop._process_message 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:637— 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:464— 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:393— 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.
ExecTool.execute (cyclomatic 16) nanobot/agent/tools/shell.py:274— ExecTool.execute 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.
TurnDelivery.complete (cyclomatic 16) nanobot/agent/turn_delivery.py:318— TurnDelivery.complete 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:544— 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.
onboard._input_text (cyclomatic 16) nanobot/cli/onboard.py:554— 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.
loader._resolve_in_place (cyclomatic 16) nanobot/config/loader.py:244— loader._resolve_in_place 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.
AzureOpenAIProvider._build_body (cyclomatic 16) nanobot/providers/azure_openai_provider.py:182— AzureOpenAIProvider._build_body 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:679— 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.
image_generation._download_image_data_url (cyclomatic 16) nanobot/providers/image_generation.py:154— image_generation._download_image_data_url 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:39— 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.
local_runner.run_local_trigger_queue (cyclomatic 16) nanobot/triggers/local_runner.py:20— local_runner.run_local_trigger_queue 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.
McpOAuthManager.submit_callback_url (cyclomatic 16) nanobot/webui/mcp_oauth_api.py:191— 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.
session_access._visible_projection_events (cyclomatic 16) nanobot/webui/session_access.py:90— session_access._visible_projection_events 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.
skills_marketplace._install_skillhub_skill (cyclomatic 16) nanobot/webui/skills_marketplace.py:438— skills_marketplace._install_skillhub_skill 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._serve_static (cyclomatic 16) nanobot/webui/ws_http.py:1724— 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.
desktop.desktopConnectionSource (cyclomatic 16) tui/src/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.
CliAppMentionText.CliAppMentionToken (cyclomatic 16) webui/src/components/CliAppMentionText.tsx:179— CliAppMentionText.CliAppMentionToken has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (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 (cyclomatic 16) webui/src/components/CliAppMentionText.tsx:250— CliAppMentionText.McpPresetMentionToken has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (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.
AgentActivityCluster.CliRunRow (cyclomatic 16) webui/src/components/thread/AgentActivityCluster.tsx:1268— AgentActivityCluster.CliRunRow 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:554— 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 572, 595, 566, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
No assertions: keeps clipboard failures visible while an agent turn is active tui/src/app.test.ts:533— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
ThreadComposer.ThreadComposer (cognitive 436) webui/src/components/thread/ThreadComposer.tsx:900— ThreadComposer.ThreadComposer has cognitive complexity 436 (threshold 15). Drivers by points: if/else 147 (175 pts), ternaries 100 (160 pts), boolean chains 100, loops 1 (nesting depth added 88). Of this number, 128 points are the body's own statements and 308 belong to 85 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.Shell (cognitive 295) webui/src/App.tsx:1097— App.Shell has cognitive complexity 295 (threshold 15). Drivers by points: if/else 124 (140 pts), ternaries 59 (72 pts), boolean chains 64, error handling 13, loops 6 (nesting depth added 29). Of this number, 58 points are the body's own statements and 237 belong to 100 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.
ThreadShell.ThreadShell (cognitive 269) webui/src/components/thread/ThreadShell.tsx:630— ThreadShell.ThreadShell has cognitive complexity 269 (threshold 15). Drivers by points: if/else 105 (124 pts), ternaries 59 (75 pts), boolean chains 65, loops 3, error handling 2 (nesting depth added 35). Of this number, 80 points are the body's own statements and 189 belong to 66 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.
useNanobotStream.useNanobotStream (cognitive 248) webui/src/hooks/useNanobotStream.ts:134— useNanobotStream.useNanobotStream has cognitive complexity 248 (threshold 15). Drivers by points: if/else 91 (125 pts), ternaries 42 (77 pts), boolean chains 42, loops 3 (4 pts) (nesting depth added 70). Most of this is not in the body itself: 2 of the 248 points are its own statements and the rest belongs to 31 function literals inside it that branch (lines 561, 929, 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.
ChatList.ChatList (cognitive 235) webui/src/components/ChatList.tsx:253— ChatList.ChatList has cognitive complexity 235 (threshold 15). Drivers by points: ternaries 54 (114 pts), if/else 47 (67 pts), boolean chains 41, loops 10 (13 pts) (nesting depth added 83). Most of this is not in the body itself: 9 of the 235 points are its own statements and the rest belongs to 39 function literals inside it that branch (lines 772, 709, 599, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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_sse_with_reasoning (cognitive 175) nanobot/providers/openai_responses/parsing.py:358— parsing.consume_sse_with_reasoning has cognitive complexity 175 (threshold 15). Drivers by points: if/else 38 (128 pts), boolean chains 34, ternaries 3 (12 pts), loops 1 (nesting depth added 99). 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 167) tui/src/app.ts:1777— NanobotTui.handleKey has cognitive complexity 167 (threshold 15). Drivers by points: if/else 58 (97 pts), boolean chains 36, 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 167) webui/src/components/settings/shared/ModelControls.tsx:168— ModelControls.ModelIdPicker has cognitive complexity 167 (threshold 15). Drivers by points: ternaries 37 (118 pts), boolean chains 42, if/else 7 (nesting depth added 81). Of this number, 141 points are the body's own statements and 26 belong to 11 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.
parsing.consume_sdk_stream (cognitive 146) nanobot/providers/openai_responses/parsing.py:674— parsing.consume_sdk_stream has cognitive complexity 146 (threshold 15). Drivers by points: if/else 32 (105 pts), boolean chains 31, ternaries 2 (9 pts), loops 1 (nesting depth added 80). 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.
ModelsSettings.ModelsSettings (cognitive 145) webui/src/components/settings/models/ModelsSettings.tsx:180— ModelsSettings.ModelsSettings has cognitive complexity 145 (threshold 15). Drivers by points: ternaries 34 (56 pts), boolean chains 46, if/else 27 (43 pts) (nesting depth added 38). Of this number, 23 points are the body's own statements and 122 belong to 21 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.
NanobotTui.accept (cognitive 135) tui/src/app.ts:1143— NanobotTui.accept has cognitive complexity 135 (threshold 15). Drivers by points: if/else 46 (97 pts), boolean chains 23, ternaries 6 (14 pts), match/switch 1 (nesting depth added 59). Of this number, 131 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.
ThreadViewport.ThreadViewport (cognitive 135) webui/src/components/thread/ThreadViewport.tsx:228— ThreadViewport.ThreadViewport has cognitive complexity 135 (threshold 15). Drivers by points: if/else 60 (66 pts), boolean chains 37, ternaries 27 (32 pts) (nesting depth added 11). Of this number, 28 points are the body's own statements and 107 belong to 35 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.
PaneWorkbench.PaneWorkbench (cognitive 135) webui/src/components/workbench/PaneWorkbench.tsx:199— PaneWorkbench.PaneWorkbench has cognitive complexity 135 (threshold 15). Drivers by points: if/else 42 (65 pts), ternaries 31 (43 pts), boolean chains 20, loops 5 (6 pts), match/switch 1 (nesting depth added 36). Most of this is not in the body itself: 10 of the 135 points are its own statements and the rest belongs to 31 function literals inside it that branch (lines 304, 714, 592, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 (cognitive 121) webui/src/components/settings/models/useModelSettingsActions.ts:70— useModelSettingsActions.useModelSettingsActions has cognitive complexity 121 (threshold 15). Drivers by points: if/else 46 (64 pts), boolean chains 27, ternaries 13 (15 pts), error handling 11 (14 pts), loops 1 (nesting depth added 23). Most of this is not in the body itself: 0 of the 121 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 157, 380, 476, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 121) webui/src/components/settings/system/AppsSettings.tsx:493— AppsSettings.McpAppsCatalogRow has cognitive complexity 121 (threshold 15). Drivers by points: ternaries 28 (89 pts), boolean chains 20, if/else 5 (12 pts) (nesting depth added 68). Of this number, 106 points are the body's own statements and 15 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.
UsagePanel.render (cognitive 117) tui/src/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 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.
LinearPanel.LinearPanel (cognitive 110) nanobot/channels/linear/webui/LinearPanel.tsx:59— LinearPanel.LinearPanel has cognitive complexity 110 (threshold 15). Drivers by points: boolean chains 43, ternaries 26 (40 pts), if/else 20 (22 pts), error handling 3 (5 pts) (nesting depth added 18). Of this number, 47 points are the body's own statements and 63 belong to 23 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.
createSystemSettingsActions.createSystemSettingsActions (cognitive 110) webui/src/components/settings/system/createSystemSettingsActions.ts:81— createSystemSettingsActions.createSystemSettingsActions has cognitive complexity 110 (threshold 15). Drivers by points: if/else 43 (52 pts), error handling 20 (25 pts), boolean chains 18, ternaries 11 (13 pts), loops 2 (nesting depth added 16). Most of this is not in the body itself: 0 of the 110 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 417, 371, 219, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProviderSettings.ProvidersSettings (cognitive 106) webui/src/components/settings/models/ProviderSettings.tsx:676— ProviderSettings.ProvidersSettings has cognitive complexity 106 (threshold 15). Drivers by points: ternaries 35 (69 pts), boolean chains 27, if/else 10 (nesting depth added 34). Of this number, 19 points are the body's own statements and 87 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.
transcript._client_projection_event (cognitive 104) nanobot/webui/transcript.py:2181— transcript._client_projection_event has cognitive complexity 104 (threshold 15). Drivers by points: if/else 37 (79 pts), ternaries 6 (12 pts), boolean chains 11, loops 1 (2 pts) (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.
thread-event-projection.projectThreadEvent (cognitive 103) webui/src/lib/thread-event-projection.ts:756— thread-event-projection.projectThreadEvent has cognitive complexity 103 (threshold 15). Drivers by points: if/else 37 (63 pts), ternaries 13 (25 pts), boolean chains 15 (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.
AgentRunner._run_core (cognitive 93) nanobot/agent/runner.py:368— AgentRunner._run_core has cognitive complexity 93 (threshold 15). Drivers by points: if/else 31 (69 pts), boolean chains 17, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent 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 93) webui/src/components/settings/channels/ChannelSetupPanel.tsx:175— ChannelSetupPanel.ChannelSetupSurface has cognitive complexity 93 (threshold 15). Drivers by points: ternaries 27 (43 pts), if/else 25 (26 pts), boolean chains 18, error handling 5, loops 1 (nesting depth added 17). Of this number, 47 points are the body's own statements and 46 belong to 21 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.
RuntimeSettings.RuntimeSettings (cognitive 92) webui/src/components/settings/system/RuntimeSettings.tsx:21— RuntimeSettings.RuntimeSettings has cognitive complexity 92 (threshold 15). Drivers by points: ternaries 47 (85 pts), boolean chains 4, if/else 2, error handling 1 (nesting depth added 38). Of this number, 81 points are the body's own statements and 11 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApplyPatchTool.execute (cognitive 91) nanobot/agent/tools/apply_patch.py:97— 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.
GrepTool._execute_sync (cognitive 90) nanobot/agent/tools/search.py:681— 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.
ModelPresetBadge.ModelPresetBadge (cognitive 90) webui/src/components/thread/ModelPresetBadge.tsx:99— ModelPresetBadge.ModelPresetBadge has cognitive complexity 90 (threshold 15). Drivers by points: ternaries 22 (42 pts), if/else 22 (30 pts), boolean chains 18 (nesting depth added 28). Of this number, 44 points are the body's own statements and 46 belong to 18 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LLMProvider._run_with_retry (cognitive 87) nanobot/providers/base.py:1792— LLMProvider._run_with_retry has cognitive complexity 87 (threshold 15). Drivers by points: if/else 22 (58 pts), boolean chains 14, ternaries 6 (14 pts), loops 1 (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.
AutomationsSettings.AutomationsSettings (cognitive 82) webui/src/components/settings/system/AutomationsSettings.tsx:57— AutomationsSettings.AutomationsSettings has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 26 (67 pts), if/else 7 (8 pts), boolean chains 7 (nesting depth added 42). Of this number, 36 points are the body's own statements and 46 belong to 6 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.
OpenAICompatProvider.chat_stream (cognitive 81) REDACTED:2019— OpenAICompatProvider.chat_stream has cognitive complexity 81 (threshold 15). Drivers by points: if/else 16 (44 pts), ternaries 3 (15 pts), boolean chains 11, error handling 4 (6 pts), loops 2 (5 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NanobotClient.handleMessage (cognitive 81) webui/src/lib/nanobot-client.ts:1081— NanobotClient.handleMessage has cognitive complexity 81 (threshold 15). Drivers by points: if/else 36 (49 pts), boolean chains 17, ternaries 6 (14 pts), error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAICompatProvider._parse_chunks (cognitive 78) REDACTED:1693— OpenAICompatProvider._parse_chunks has cognitive complexity 78 (threshold 15). Drivers by points: if/else 21 (55 pts), boolean chains 14, loops 4 (7 pts), ternaries 1 (2 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.
onboard._configure_pydantic_model (cognitive 77) nanobot/cli/onboard.py:926— 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.
FallbackProvider._try_with_fallback (cognitive 77) nanobot/providers/fallback_provider.py:458— FallbackProvider._try_with_fallback has cognitive complexity 77 (threshold 15). Drivers by points: if/else 25 (48 pts), boolean chains 15, ternaries 4 (11 pts), error handling 1 (2 pts), loops 1 (nesting depth added 31). 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 77) REDACTED:929— OpenAICompatProvider._build_kwargs has cognitive complexity 77 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 24, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuntimeConfigSettings.RuntimeConfigSettings (cognitive 77) webui/src/components/settings/system/RuntimeConfigSettings.tsx:132— RuntimeConfigSettings.RuntimeConfigSettings has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 18 (54 pts), boolean chains 19, if/else 4 (nesting depth added 36). Most of this is not in the body itself: 5 of the 77 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 171, 156, 205, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
JsonlSessionStore._list_sessions_unlocked (cognitive 76) nanobot/session/manager.py:1416— JsonlSessionStore._list_sessions_unlocked has cognitive complexity 76 (threshold 15). Drivers by points: if/else 12 (49 pts), ternaries 3 (12 pts), boolean chains 6, loops 2 (5 pts), error handling 2 (4 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent 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 76) webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:40— ChannelQrConnectFlow.ChannelQrConnectFlow has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 18 (35 pts), boolean chains 21, if/else 15 (16 pts), error handling 4 (nesting depth added 18). Of this number, 48 points are the body's own statements and 28 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.get_history (cognitive 75) nanobot/session/manager.py:240— Session.get_history has cognitive complexity 75 (threshold 15). Drivers by points: if/else 23 (52 pts), boolean chains 10, loops 5 (9 pts), ternaries 1 (4 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 (cognitive 75) nanobot/webui/inbound_commands.py:482— WebUICommandRouter._dispatch_message has cognitive complexity 75 (threshold 15). Drivers by points: if/else 29 (38 pts), boolean chains 19, ternaries 9 (15 pts), loops 1 (2 pts), error handling 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.
SettingsPage.SettingsPage (cognitive 75) webui/src/components/settings/SettingsPage.tsx:68— SettingsPage.SettingsPage has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 22 (43 pts), boolean chains 19, if/else 11 (12 pts), match/switch 1 (nesting depth added 22). Of this number, 34 points are the body's own statements and 41 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config._match_provider (cognitive 74) nanobot/config/schema.py:495— 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.
OpenAICompatProvider._parse (cognitive 74) REDACTED:1546— OpenAICompatProvider._parse has cognitive complexity 74 (threshold 15). Drivers by points: if/else 20 (43 pts), boolean chains 23, loops 4 (6 pts), ternaries 1 (2 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.
AgentLoop._save_turn (cognitive 71) nanobot/agent/loop.py:2301— AgentLoop._save_turn has cognitive complexity 71 (threshold 15). Drivers by points: if/else 23 (49 pts), ternaries 5 (11 pts), boolean chains 10, 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.
ComposerUsagePopover.ComposerUsagePopover (cognitive 70) webui/src/components/thread/ComposerUsagePopover.tsx:57— ComposerUsagePopover.ComposerUsagePopover has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 34 (55 pts), boolean chains 14, if/else 1 (nesting depth added 21). Of this number, 39 points are the body's own statements and 31 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.
converters.convert_tool_output (cognitive 68) nanobot/providers/openai_responses/converters.py:103— 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.
AutomationsSettings.AutomationDetailPanel (cognitive 68) webui/src/components/settings/system/AutomationsSettings.tsx:442— AutomationsSettings.AutomationDetailPanel has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 30 (49 pts), boolean chains 16, if/else 1 (3 pts) (nesting depth added 21). Of this number, 63 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.
protocol.decodeInboundEvent (cognitive 64) tui/src/protocol.ts:470— protocol.decodeInboundEvent has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 38, if/else 20, 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.
useSessions.useSessionHistory (cognitive 63) webui/src/hooks/useSessions.ts:383— useSessions.useSessionHistory has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 20 (28 pts), if/else 19 (22 pts), boolean chains 11, error handling 2 (nesting depth added 11). Most of this is not in the body itself: 2 of the 63 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 453, 561, 478, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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_quick_start_provider (cognitive 62) nanobot/cli/onboard.py:1784— 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.
AppsSettings.AppsCatalogSettings (cognitive 61) webui/src/components/settings/system/AppsSettings.tsx:97— AppsSettings.AppsCatalogSettings has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 22 (49 pts), boolean chains 9, if/else 3 (nesting depth added 27). Of this number, 47 points are the body's own statements and 14 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.
ThreadMessages.ThreadDisplayUnit (cognitive 61) webui/src/components/thread/ThreadMessages.tsx:542— 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.
useAttachedImages.useAttachedImages (cognitive 61) webui/src/hooks/useAttachedImages.ts:265— useAttachedImages.useAttachedImages has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 7 (17 pts), error handling 4 (11 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 29). Most of this is not in the body itself: 0 of the 61 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 296, 367, 423, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Schema.validate_json_schema_value (cognitive 60) nanobot/agent/tools/base.py:51— Schema.validate_json_schema_value has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 17, loops 3 (7 pts), ternaries 2 (5 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.
settings_system.coerce_channel_value (cognitive 59) nanobot/webui/settings_system.py:256— 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.
WorkspaceControls.WorkspaceProjectPicker (cognitive 59) webui/src/components/thread/WorkspaceControls.tsx:46— WorkspaceControls.WorkspaceProjectPicker has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 20 (26 pts), boolean chains 22, if/else 10, error handling 1 (nesting depth added 6). Of this number, 42 points are the body's own statements and 17 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EditFileTool.execute (cognitive 56) nanobot/agent/tools/filesystem.py:913— EditFileTool.execute has cognitive complexity 56 (threshold 15). Drivers by points: if/else 29 (38 pts), boolean chains 12, error handling 3, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
image_generation._parse_codex_sse_images (cognitive 56) nanobot/providers/image_generation.py:1575— image_generation._parse_codex_sse_images has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (42 pts), error handling 2 (8 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 39). 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.updateMeta (cognitive 56) tui/src/app.ts:2112— 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.
webui.webui (cognitive 55) nanobot/cli/webui.py:74— webui.webui has cognitive complexity 55 (threshold 15). Drivers by points: if/else 25 (38 pts), boolean chains 8, error handling 5 (7 pts), ternaries 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_runtime.update_runtime_config (cognitive 55) nanobot/webui/settings_runtime.py:80— settings_runtime.update_runtime_config has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (29 pts), error handling 4 (10 pts), loops 6 (9 pts), boolean chains 7 (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.
ContextGovernor._merge_adjacent_user_messages_for_model (cognitive 53) nanobot/agent/context_governance.py:282— 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.
OpenAICodexProvider._call_codex (cognitive 53) nanobot/providers/openai_codex_provider.py:89— OpenAICodexProvider._call_codex has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 14, ternaries 8 (10 pts), error handling 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadFileTool.execute (cognitive 52) nanobot/agent/tools/filesystem.py:294— ReadFileTool.execute has cognitive complexity 52 (threshold 15). Drivers by points: if/else 25 (35 pts), boolean chains 8, error handling 3 (4 pts), ternaries 1 (3 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.
session_list_index._scan_transcript_row (cognitive 52) nanobot/webui/session_list_index.py:538— session_list_index._scan_transcript_row has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (38 pts), boolean chains 7, error handling 2 (4 pts), loops 2 (3 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.
api.parseThreadProjectionEvent (cognitive 52) webui/src/lib/api.ts:306— api.parseThreadProjectionEvent has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 21, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenAICompatProvider._build_responses_body (cognitive 51) REDACTED:1261— OpenAICompatProvider._build_responses_body has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (35 pts), boolean chains 11, loops 1 (3 pts), ternaries 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.
useSettingsController.useSettingsController (cognitive 51) webui/src/components/settings/useSettingsController.ts:71— useSettingsController.useSettingsController has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23, boolean chains 21, error handling 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 2). Most of this is not in the body itself: 6 of the 51 points are its own statements and the rest belongs to 19 function literals inside it that branch (lines 206, 151, 349, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MyTool._format_value (cognitive 50) nanobot/agent/tools/self.py:296— MyTool._format_value has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (24 pts), ternaries 9 (21 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
protocol.fetchHistory (cognitive 49) tui/src/protocol.ts:665— protocol.fetchHistory has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 11 (26 pts), if/else 7 (15 pts), boolean chains 7, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useSystemSettingsEffects.useSystemSettingsEffects (cognitive 49) webui/src/components/settings/system/useSystemSettingsEffects.ts:26— useSystemSettingsEffects.useSystemSettingsEffects has cognitive complexity 49 (threshold 15). Drivers by points: if/else 33 (35 pts), boolean chains 10, error handling 3, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 0 of the 49 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 94, 205, 58, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MCPPromptWrapper.execute (cognitive 48) nanobot/agent/tools/mcp.py:917— MCPPromptWrapper.execute has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (26 pts), error handling 4 (8 pts), loops 3 (7 pts), ternaries 2 (6 pts), boolean chains 1 (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.
ExecTool._extract_posix_paths_from_token (cognitive 48) nanobot/agent/tools/shell.py:1031— 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:1106— 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.
WebUIOutboundProjector.send (cognitive 48) nanobot/webui/outbound_projection.py:138— WebUIOutboundProjector.send has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 7 (14 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.
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.
LLMProvider._sanitize_empty_content (cognitive 47) nanobot/providers/base.py:831— 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.
BedrockProvider._parse_stream_event (cognitive 47) nanobot/providers/bedrock_provider.py:547— 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.
MessageBubble.MessageBlockMenuActions (cognitive 47) webui/src/components/MessageBubble.tsx:168— MessageBubble.MessageBlockMenuActions has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 17 (30 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.
AgentActivityCluster.FoldedAgentActivity (cognitive 47) webui/src/components/thread/AgentActivityCluster.tsx:234— AgentActivityCluster.FoldedAgentActivity has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 12 (24 pts), boolean chains 14, if/else 8, error handling 1 (nesting depth added 12). Of this number, 35 points are the body's own statements and 12 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.
ExecTool._guard_command (cognitive 46) nanobot/agent/tools/shell.py:807— ExecTool._guard_command has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 7, loops 2 (4 pts), error handling 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_capabilities.update_image_generation_settings (cognitive 46) nanobot/webui/settings_capabilities.py:398— settings_capabilities.update_image_generation_settings has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (39 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NanobotTui.submit (cognitive 46) tui/src/app.ts:947— NanobotTui.submit has cognitive complexity 46 (threshold 15). Drivers by points: if/else 32 (39 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.
MessageBubble.MessageBubble (cognitive 46) webui/src/components/MessageBubble.tsx:441— MessageBubble.MessageBubble has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 16 (32 pts), boolean chains 10, if/else 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.
useComposerMentionInput.useComposerMentionInput (cognitive 45) webui/src/hooks/useComposerMentionInput.ts:10— useComposerMentionInput.useComposerMentionInput has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 11, ternaries 5 (nesting depth added 7). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 57, 84, 149, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WebSearchTool._effective_provider (cognitive 44) nanobot/agent/tools/web.py:422— 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:536— 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.
SkillsCatalogSettings.SkillDetailSheet (cognitive 44) webui/src/components/settings/SkillsCatalogSettings.tsx:266— SkillsCatalogSettings.SkillDetailSheet has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 16 (33 pts), if/else 6, boolean chains 3, error handling 2 (nesting depth added 17). Of this number, 30 points are the body's own statements and 14 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parsing._hosted_web_search_event (cognitive 43) nanobot/providers/openai_responses/parsing.py:95— 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.
session_list_index._scan_session_row (cognitive 43) nanobot/webui/session_list_index.py:625— session_list_index._scan_session_row has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChannelsSettings.ChannelsSettings (cognitive 43) webui/src/components/settings/system/ChannelsSettings.tsx:19— ChannelsSettings.ChannelsSettings has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 15 (28 pts), boolean chains 10, if/else 5 (nesting depth added 13). Most of this is not in the body itself: 15 of the 43 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 128, 56, 61, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
transcription._post_stepfun_asr_with_retry (cognitive 42) nanobot/providers/transcription.py:318— transcription._post_stepfun_asr_with_retry has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (25 pts), error handling 4 (8 pts), ternaries 2 (4 pts), loops 2 (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.
LatexParser.command (cognitive 42) tui/src/latex.ts: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.
AppsSettings.McpCustomServerPanel (cognitive 42) webui/src/components/settings/system/AppsSettings.tsx:994— AppsSettings.McpCustomServerPanel has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 19 (37 pts), boolean chains 5 (nesting depth added 18). Of this number, 40 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent 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 41) REDACTED:701— OpenAICompatProvider._sanitize_messages has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (26 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.
protocol.fetchMentionCandidates (cognitive 41) tui/src/protocol.ts:926— protocol.fetchMentionCandidates has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 5 (9 pts), boolean chains 8, loops 4 (6 pts) (nesting depth added 18). Of this number, 39 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.
useCapabilitySettingsActions.useCapabilitySettingsActions (cognitive 41) webui/src/components/settings/capabilities/useCapabilitySettingsActions.ts:40— useCapabilitySettingsActions.useCapabilitySettingsActions has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 17, if/else 17, error handling 4, ternaries 2 (3 pts) (nesting depth added 1). Most of this is not in the body itself: 0 of the 41 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 139, 74, 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.
WebUISettingsRouter.dispatch (cognitive 40) nanobot/webui/settings_routes.py:265— WebUISettingsRouter.dispatch has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 2 (6 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionSearchDialog.SessionSearchDialog (cognitive 40) webui/src/components/SessionSearchDialog.tsx:27— SessionSearchDialog.SessionSearchDialog has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 12 (14 pts), boolean chains 4 (nesting depth added 13). Most of this is not in the body itself: 7 of the 40 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 188, 85, 106, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentLoop._dispatch_one (cognitive 39) nanobot/agent/loop.py:1504— AgentLoop._dispatch_one has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 9, error handling 5 (7 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._validate_field_constraint (cognitive 39) nanobot/cli/onboard.py:400— 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.
helpers._estimate_prompt_tokens_with_source (cognitive 39) nanobot/utils/helpers.py:776— helpers._estimate_prompt_tokens_with_source has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (18 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.
attachment_ingress.store_inbound_attachments (cognitive 39) nanobot/webui/attachment_ingress.py:79— attachment_ingress.store_inbound_attachments has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 4 (8 pts), error handling 3 (7 pts), boolean chains 2, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 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.
ChannelInstancesPanel.ChannelInstancesPanel (cognitive 39) webui/src/components/settings/channels/ChannelInstancesPanel.tsx:49— ChannelInstancesPanel.ChannelInstancesPanel has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 14 (20 pts), boolean chains 13, if/else 4, error handling 2 (nesting depth added 6). Most of this is not in the body itself: 2 of the 39 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 152, 104, 120, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ContextGovernor.backfill_missing_tool_results (cognitive 38) nanobot/agent/context_governance.py:893— 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.
MemoryArchiver.archive (cognitive 38) nanobot/agent/memory.py:836— 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.
settings_capabilities.update_transcription_settings (cognitive 38) nanobot/webui/settings_capabilities.py:500— 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.
onboard._handle_fallback_models_field (cognitive 37) nanobot/cli/onboard.py:823— 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:769— 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.
factory._make_provider_core (cognitive 37) nanobot/providers/factory.py:150— factory._make_provider_core has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (30 pts), if/else 3 (4 pts), boolean chains 3 (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.
XAIGrokProvider._call_xai (cognitive 37) nanobot/providers/xai_grok_provider.py:104— 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.
helpers.split_message (cognitive 37) nanobot/utils/helpers.py:672— 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.
automation_results.cron_run_response (cognitive 37) nanobot/webui/automation_results.py:27— automation_results.cron_run_response has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 4, 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.
FilePreviewPanel.FilePreviewPanel (cognitive 37) webui/src/components/FilePreviewPanel.tsx:24— FilePreviewPanel.FilePreviewPanel has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (31 pts), boolean chains 4, if/else 2 (nesting depth added 16). Of this number, 25 points are the body's own statements and 12 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkillsMarketplace.SkillsMarketplace (cognitive 37) webui/src/components/settings/SkillsMarketplace.tsx:40— SkillsMarketplace.SkillsMarketplace has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 17 (23 pts), if/else 11, boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 21 belong to 17 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.
AgentLoop._run_agent_loop (cognitive 36) nanobot/agent/loop.py:959— AgentLoop._run_agent_loop has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 18, ternaries 9 (12 pts), if/else 4 (5 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
optional_features.optional_features_payload (cognitive 36) nanobot/optional_features.py:425— 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.
parsing.parse_response_output (cognitive 36) nanobot/providers/openai_responses/parsing.py:592— parsing.parse_response_output has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 8, loops 2 (4 pts), ternaries 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_capabilities.update_web_search_settings (cognitive 36) nanobot/webui/settings_capabilities.py:277— 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.
transcript._select_transcript_page (cognitive 36) nanobot/webui/transcript.py:929— transcript._select_transcript_page has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 6, loops 2 (3 pts), ternaries 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChatList.ActivePaneRows (cognitive 36) webui/src/components/ChatList.tsx:1342— ChatList.ActivePaneRows has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 8, if/else 2 (nesting depth added 9). Most of this is not in the body itself: 0 of the 36 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1408, 1451, 1459). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AutomationRunDialog.AutomationRunDialog (cognitive 36) webui/src/components/settings/system/AutomationRunDialog.tsx:14— AutomationRunDialog.AutomationRunDialog has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 16 (26 pts), boolean chains 6, if/else 4 (nesting depth added 10). Of this number, 32 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreadComposer.GoalStateStrip (cognitive 36) webui/src/components/thread/ThreadComposer.tsx:693— ThreadComposer.GoalStateStrip has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 12 (18 pts), if/else 12, boolean chains 6 (nesting depth added 6). Of this number, 23 points are the body's own statements and 13 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.
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.
AgentLoop._build_turn (cognitive 35) nanobot/agent/loop.py:2027— AgentLoop._build_turn has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 10, 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.
ListDirTool.execute (cognitive 35) nanobot/agent/tools/filesystem.py:1142— 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.
MessageTool.execute (cognitive 35) nanobot/agent/tools/message.py:151— MessageTool.execute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 10, ternaries 8 (9 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.
LLMProvider._enforce_role_alternation (cognitive 35) nanobot/providers/base.py:1141— 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.
transcript.write_session_messages_as_transcript (cognitive 35) nanobot/webui/transcript.py:1374— transcript.write_session_messages_as_transcript has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 6, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
ThreadMessages.ThreadMessages (cognitive 35) webui/src/components/thread/ThreadMessages.tsx:77— ThreadMessages.ThreadMessages has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 17, ternaries 13 (14 pts), if/else 4 (nesting depth added 1). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 174, 144, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WebSearchTool._search_volcengine (cognitive 34) nanobot/agent/tools/web.py:905— 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.
TurnDelivery._publish_event (cognitive 34) nanobot/agent/turn_delivery.py:401— TurnDelivery._publish_event has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
converters.convert_messages (cognitive 34) nanobot/providers/openai_responses/converters.py:15— 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.
WebUICommandRouter.dispatch (cognitive 34) nanobot/webui/inbound_commands.py:291— WebUICommandRouter.dispatch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (24 pts), error handling 5 (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.
GatewayHTTPHandler._handle_webui_automation_action (cognitive 34) nanobot/webui/ws_http.py:1302— GatewayHTTPHandler._handle_webui_automation_action has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkdownTextRenderer.MarkdownTextRenderer (cognitive 34) webui/src/components/MarkdownTextRenderer.tsx:528— MarkdownTextRenderer.MarkdownTextRenderer has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16, boolean chains 9, ternaries 9. Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 551, 538, 547, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProviderSettings.ProviderOAuthLoginDialog (cognitive 34) webui/src/components/settings/models/ProviderSettings.tsx:251— 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.
ThinkingReasoningShell.ThinkingReasoningShell (cognitive 34) webui/src/components/thread/activity/ThinkingReasoningShell.tsx:19— ThinkingReasoningShell.ThinkingReasoningShell has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 13 (25 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.
segmented-control.SegmentedControl (cognitive 34) webui/src/components/ui/segmented-control.tsx:46— segmented-control.SegmentedControl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 11 (14 pts), boolean chains 6 (nesting depth added 5). Most of this is not in the body itself: 7 of the 34 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 153, 109, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
JsonlSessionStore._repair_unlocked (cognitive 33) nanobot/session/manager.py:1015— JsonlSessionStore._repair_unlocked has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 5, error handling 2 (3 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App.App (cognitive 33) webui/src/App.tsx:891— 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 literals inside it that branch (lines 932, 897, 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.
useVoiceRecorder.useVoiceRecorder (cognitive 33) webui/src/hooks/useVoiceRecorder.ts:49— useVoiceRecorder.useVoiceRecorder has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21, boolean chains 9, error handling 3. Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 164, 243, 155, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.drop_orphan_tool_results (cognitive 32) nanobot/agent/context_governance.py:862— 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.
AgentLoop.run (cognitive 32) nanobot/agent/loop.py:1310— AgentLoop.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 3 (6 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.
ExecTool._split_shell_segments (cognitive 32) nanobot/agent/tools/shell.py:912— 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.
server.handle_chat_completions (cognitive 32) nanobot/api/server.py:273— server.handle_chat_completions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 7 (8 pts), boolean chains 4, loops 1 (2 pts), ternaries 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.
CliAppManager.catalog (cognitive 32) nanobot/apps/cli/service.py:544— 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.
agent.agent (cognitive 32) nanobot/cli/agent.py:54— agent.agent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (21 pts), error handling 4 (6 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session_list_index._reconcile_index (cognitive 32) nanobot/webui/session_list_index.py:81— session_list_index._reconcile_index has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7, ternaries 3 (6 pts), loops 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.
ExecTool._resolve_shell (cognitive 31) nanobot/agent/tools/shell.py:630— 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:657— 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.
factory._resolve_provider_setup (cognitive 31) nanobot/providers/factory.py:76— factory._resolve_provider_setup has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, if/else 8 (11 pts), ternaries 3 (5 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.
image_generation._download_image_data_url (cognitive 31) nanobot/providers/image_generation.py:154— image_generation._download_image_data_url has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 4 (7 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_grok_provider._parse_xai_grok_models (cognitive 31) nanobot/providers/xai_grok_provider.py:692— 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.
recovery.restore_runtime_checkpoint (cognitive 31) nanobot/session/recovery.py:276— recovery.restore_runtime_checkpoint has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 5 (7 pts), boolean chains 6, loops 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.
local_runner.run_local_trigger_queue (cognitive 31) nanobot/triggers/local_runner.py:20— local_runner.run_local_trigger_queue has cognitive complexity 31 (threshold 15). Drivers by points: error handling 4 (12 pts), ternaries 2 (8 pts), boolean chains 4, if/else 3 (4 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp_presets_api.mcp_presets_settings_action (cognitive 31) nanobot/webui/mcp_presets_api.py:1632— mcp_presets_api.mcp_presets_settings_action has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 7 (13 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuntimeConfigSettings.useRuntimeConfigSettings (cognitive 31) webui/src/components/settings/system/RuntimeConfigSettings.tsx:24— RuntimeConfigSettings.useRuntimeConfigSettings has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 13, error handling 1, loops 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 62, 39, 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.
ThreadMessages.MessageBlockMenu (cognitive 31) webui/src/components/thread/ThreadMessages.tsx:384— ThreadMessages.MessageBlockMenu has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 8 (11 pts), boolean chains 7 (nesting depth added 6). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 404, 508, 520, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Tool._cast_value (cognitive 30) nanobot/agent/tools/base.py:263— Tool._cast_value has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 7, ternaries 3 (6 pts), error handling 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.
MCPToolWrapper.execute (cognitive 30) nanobot/agent/tools/mcp.py:629— MCPToolWrapper.execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 4 (8 pts), ternaries 2 (6 pts), 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.
MCPResourceWrapper.execute (cognitive 30) nanobot/agent/tools/mcp.py:799— MCPResourceWrapper.execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (17 pts), error handling 3 (6 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BedrockProvider._content_blocks (cognitive 30) nanobot/providers/bedrock_provider.py:138— 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.
GatewayHTTPHandler._handle_webui_automation_result (cognitive 30) nanobot/webui/ws_http.py:1260— 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.
CredentialForm.CredentialForm (cognitive 30) webui/src/components/settings/channels/CredentialForm.tsx:80— CredentialForm.CredentialForm has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 15 (20 pts), boolean chains 8, if/else 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 99, 149). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
McpManagementDialog.ConnectionPanel (cognitive 30) webui/src/components/settings/system/McpManagementDialog.tsx:489— McpManagementDialog.ConnectionPanel has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 17 (24 pts), boolean chains 6 (nesting depth added 7). Of this number, 24 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.
FindFilesTool._execute_sync (cognitive 29) nanobot/agent/tools/search.py:434— 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.
JsonlSessionStore._migrate_from_workspace (cognitive 29) nanobot/session/manager.py:805— JsonlSessionStore._migrate_from_workspace has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebUICommandRouter.start_webui_request (cognitive 29) nanobot/webui/inbound_commands.py:743— WebUICommandRouter.start_webui_request has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 6, error handling 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.
session_access._visible_projection_events (cognitive 29) nanobot/webui/session_access.py:90— session_access._visible_projection_events has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), ternaries 1 (5 pts), boolean chains 1, loops 1 (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.
settings_models.oauth_provider_status (cognitive 29) nanobot/webui/settings_models.py:295— 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.
AutomationsSettings.AutomationEditDialog (cognitive 29) webui/src/components/settings/system/AutomationsSettings.tsx:677— 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 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.
ExecSessionTool._wait (cognitive 28) nanobot/agent/tools/exec_session.py:637— ExecSessionTool._wait has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 4 (10 pts), boolean chains 4, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecTool._prepare_command (cognitive 28) nanobot/agent/tools/shell.py:400— ExecTool._prepare_command has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 5, ternaries 3 (4 pts), error handling 1 (2 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, 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.run_onboard (cognitive 28) nanobot/cli/onboard.py:2081— 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:298— 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.
transcription._request_json_with_retry (cognitive 28) nanobot/providers/transcription.py:113— transcription._request_json_with_retry has cognitive complexity 28 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 5 (10 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mcp_presets_api._mcp_server_config (cognitive 28) nanobot/webui/mcp_presets_api.py:1369— mcp_presets_api._mcp_server_config has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (13 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.
settings_models.update_model_configuration (cognitive 28) nanobot/webui/settings_models.py:1227— settings_models.update_model_configuration has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 9 (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.
WeixinPanel.WeixinPanel (cognitive 28) nanobot/channels/weixin/webui/WeixinPanel.tsx:41— WeixinPanel.WeixinPanel has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 7 (8 pts), boolean chains 5, loops 2, error handling 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 13 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NanobotClient.handleMessage (cognitive 28) tui/src/protocol.ts:1392— 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/diff-viewer.ts:249— 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/transcript.ts:269— 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:98— 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.
ThreadShell.recentComposerRoundUsage (cognitive 28) webui/src/components/thread/ThreadShell.tsx:139— ThreadShell.recentComposerRoundUsage has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 4 (12 pts), boolean chains 8, if/else 2 (5 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextGovernor.strip_malformed_tool_calls (cognitive 27) nanobot/agent/context_governance.py:807— 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.
commands.onboard (cognitive 27) nanobot/cli/commands.py:138— 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.
windows_browser.launch_browser (cognitive 27) nanobot/cli/windows_browser.py:45— windows_browser.launch_browser has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (9 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
loader._resolve_in_place (cognitive 27) nanobot/config/loader.py:244— loader._resolve_in_place has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 4 (8 pts), loops 1 (2 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.
AnthropicProvider._convert_messages (cognitive 27) REDACTED:188— 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:82— 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.
RecoveryCoordinator._recover_session (cognitive 27) nanobot/session/recovery.py:644— 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.
settings_models.provider_models_payload (cognitive 27) nanobot/webui/settings_models.py:619— settings_models.provider_models_payload has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 10, 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.
LinearMemberAccess.LinearMemberAccess (cognitive 27) nanobot/channels/linear/webui/LinearMemberAccess.tsx:18— LinearMemberAccess.LinearMemberAccess has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13 (15 pts), boolean chains 7, if/else 3 (4 pts), loops 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 11 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.
protocol.fetchSessionUsage (cognitive 27) tui/src/protocol.ts:622— protocol.fetchSessionUsage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 6, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sidebar.Sidebar (cognitive 27) webui/src/components/Sidebar.tsx:109— Sidebar.Sidebar has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 16 (18 pts), boolean chains 9 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AutomationCalendar.AutomationCalendar (cognitive 27) webui/src/components/settings/system/AutomationCalendar.tsx:220— AutomationCalendar.AutomationCalendar has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (18 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 8). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 277, 254, 356, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
McpManagementDialog.McpManagementDialog (cognitive 27) webui/src/components/settings/system/McpManagementDialog.tsx:47— McpManagementDialog.McpManagementDialog has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 8, if/else 5 (nesting depth added 3). Of this number, 18 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ThreadComposer.normalizeQueuedPrompt (cognitive 27) webui/src/components/thread/ThreadComposer.tsx:470— ThreadComposer.normalizeQueuedPrompt has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 7, if/else 5 (7 pts) (nesting depth added 6). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 476). 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.
activity-timeline.projectOrderedTurn (cognitive 27) webui/src/lib/activity-timeline.ts:121— activity-timeline.projectOrderedTurn has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2, boolean chains 1 (nesting depth added 10). Of this number, 22 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.
AgentLoop._restore_turn (cognitive 26) nanobot/agent/loop.py:1910— AgentLoop._restore_turn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, loops 1 (2 pts), 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.
AgentRunner._try_drain_injections (cognitive 26) nanobot/agent/runner.py:155— AgentRunner._try_drain_injections has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadFileTool._read_office_doc (cognitive 26) nanobot/agent/tools/filesystem.py:464— 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.
ToolLoader.load (cognitive 26) nanobot/agent/tools/loader.py:92— ToolLoader.load has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (19 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._format_value (cognitive 26) nanobot/cli/onboard.py:354— 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.
parsing._extract_reasoning_summary_from_output (cognitive 26) nanobot/providers/openai_responses/parsing.py:568— 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.
GitStore.summarize_working_tree (cognitive 26) nanobot/utils/gitstore.py:300— 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.
WebuiSessionAccess._messages (cognitive 26) nanobot/webui/session_access.py:185— WebuiSessionAccess._messages has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 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.
skills_marketplace._load_weekly_installs (cognitive 26) nanobot/webui/skills_marketplace.py:838— 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:2013— 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.
install_channel_dependencies.ensure_repository_channel_dependencies (cognitive 26) scripts/install_channel_dependencies.py:20— install_channel_dependencies.ensure_repository_channel_dependencies has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 3 (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.
protocol.fetchSessions (cognitive 26) tui/src/protocol.ts:862— protocol.fetchSessions has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 12 (13 pts), if/else 6 (7 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 886). 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.
PreviewPane.PreviewPane (cognitive 26) webui/src/components/PreviewPane.tsx:15— PreviewPane.PreviewPane has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10, ternaries 10, boolean chains 6. Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 73, 82, 36, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ZoomableImage.ZoomableImage (cognitive 26) webui/src/components/ZoomableImage.tsx:16— ZoomableImage.ZoomableImage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 6 (10 pts), boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 52, 74, 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.
ChannelCatalogRow.ChannelCatalogRow (cognitive 26) webui/src/components/settings/channels/ChannelCatalogRow.tsx:18— ChannelCatalogRow.ChannelCatalogRow has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 7, if/else 3 (4 pts) (nesting depth added 7). Of this number, 16 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.
McpManagementDialog.ToolsPanel (cognitive 26) webui/src/components/settings/system/McpManagementDialog.tsx:338— McpManagementDialog.ToolsPanel has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (24 pts), boolean chains 1, if/else 1 (nesting depth added 13). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposerUsagePopover.UsagePanel (cognitive 26) webui/src/components/thread/ComposerUsagePopover.tsx:426— ComposerUsagePopover.UsagePanel has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 493, 485, 478, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
useSessions.useSessions (cognitive 26) webui/src/hooks/useSessions.ts:201— useSessions.useSessions has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (7 pts), boolean chains 6, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 0 of the 26 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 234, 351, 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.
CronTool._add_job (cognitive 25) nanobot/agent/tools/cron.py:150— CronTool._add_job has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, error handling 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.
CliAppManager._iter_artifact_candidates (cognitive 25) nanobot/apps/cli/service.py:1350— 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:1262— 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:316— 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:546— 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._post_with_retry (cognitive 25) nanobot/providers/transcription.py:433— transcription._post_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.
quick_validate._parse_simple_frontmatter (cognitive 25) nanobot/skills/skill-creator/scripts/quick_validate.py:39— 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:132— 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.
helpers.estimate_message_tokens (cognitive 25) nanobot/utils/helpers.py:840— helpers.estimate_message_tokens has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 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.
settings_models.update_provider_settings (cognitive 25) nanobot/webui/settings_models.py:1463— settings_models.update_provider_settings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 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.
settings_models.login_oauth_provider (cognitive 25) nanobot/webui/settings_models.py:1522— settings_models.login_oauth_provider has cognitive complexity 25 (threshold 15). Drivers by points: error handling 7 (14 pts), if/else 5, boolean chains 4, 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.
LinearResetConnection.LinearResetConnection (cognitive 25) nanobot/channels/linear/webui/LinearResetConnection.tsx:21— LinearResetConnection.LinearResetConnection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 5 (6 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 41, 105, 77, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PickerMenu.render (cognitive 25) tui/src/picker-menu.ts:141— PickerMenu.render has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 12). Of this number, 21 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.
footer-hints.hintsFor (cognitive 25) tui/src/footer-hints.ts:71— 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.
App.readShellRoute (cognitive 25) webui/src/App.tsx:244— App.readShellRoute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9, ternaries 5 (7 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CliAppMentionText.splitCapabilityMentionSegments (cognitive 25) webui/src/components/CliAppMentionText.tsx:49— CliAppMentionText.splitCapabilityMentionSegments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (7 pts), boolean chains 6, loops 1 (nesting depth added 6). 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.
ChannelValidationProgress.ChannelValidationProgress (cognitive 25) webui/src/components/settings/channels/ChannelValidationProgress.tsx:69— ChannelValidationProgress.ChannelValidationProgress has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 6, 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 129, 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:247— 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.
generic-tool-model.activityLabel (cognitive 25) webui/src/components/thread/activity/generic-tool-model.ts:195— generic-tool-model.activityLabel has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 7 (9 pts), boolean chains 1, match/switch 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.
NanobotClient.reconcileCanonicalCompletion (cognitive 25) webui/src/lib/nanobot-client.ts:466— NanobotClient.reconcileCanonicalCompletion has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 21 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.
SkillsLoader.build_skills_summary (cognitive 24) nanobot/agent/skills.py:204— SkillsLoader.build_skills_summary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (7 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.
OpenRouterImageGenerationClient.generate (cognitive 24) nanobot/providers/image_generation.py:372— 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:794— 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.
transcript._recover_incomplete_turns (cognitive 24) nanobot/webui/transcript.py:1815— transcript._recover_incomplete_turns has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 2 (3 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.
NanobotClient.open (cognitive 24) tui/src/protocol.ts:1184— NanobotClient.open has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 2, error handling 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 9 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.
protocol.sanitizeConnectionFailure (cognitive 24) tui/src/protocol.ts:1095— protocol.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 literal inside it that branches (line 1098). 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.
latex.renderLatexAsUnicode (cognitive 24) tui/src/latex.ts: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.
TokenUsageCard.TokenUsageCard (cognitive 24) webui/src/components/settings/TokenUsageCard.tsx:45— TokenUsageCard.TokenUsageCard has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 7, loops 2 (3 pts), if/else 1 (2 pts) (nesting depth added 7). Of this number, 13 points are the body's own statements and 11 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutomationsSettings.formatCronScheduleSummary (cognitive 24) webui/src/components/settings/system/AutomationsSettings.tsx:1146— 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.
ThreadMotionCoordinator.flushGeometry (cognitive 24) webui/src/components/thread/thread-motion.ts:432— ThreadMotionCoordinator.flushGeometry has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
combobox.useComboboxNavigation (cognitive 24) webui/src/components/ui/combobox.tsx:17— combobox.useComboboxNavigation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 7 (8 pts), boolean chains 3, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 56, 32, 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.
ansi.applySgrParams (cognitive 24) webui/src/lib/ansi.ts:124— 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:85— 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.
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:393— 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.
ExecTool._spawn (cognitive 23) nanobot/agent/tools/shell.py:519— ExecTool._spawn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server._parse_json_content (cognitive 23) nanobot/api/server.py:172— server._parse_json_content has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CliAppManager.uninstall (cognitive 23) nanobot/apps/cli/service.py:1252— 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:554— 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.
openai_codex_provider._parse_openai_codex_models (cognitive 23) nanobot/providers/openai_codex_provider.py:783— 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:1415— 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.
network.resolve_url_target (cognitive 23) nanobot/security/network.py:78— 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.
JsonlSessionStore._claim_workspace_namespace (cognitive 23) nanobot/session/manager.py:610— JsonlSessionStore._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.
JsonlSessionStore._load_unlocked (cognitive 23) nanobot/session/manager.py:939— JsonlSessionStore._load_unlocked has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (8 pts), boolean chains 4, 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.
JsonlSessionStore._read_unlocked (cognitive 23) nanobot/session/manager.py:1306— JsonlSessionStore._read_unlocked has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 5 (8 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recovery._checkpoint_tool_call_ids (cognitive 23) nanobot/session/recovery.py:182— 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.
RotatingTextOutput.write (cognitive 23) nanobot/utils/rotating_output.py:54— 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.
settings_models.update_agent_model_settings (cognitive 23) nanobot/webui/settings_models.py:1113— settings_models.update_agent_model_settings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, 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.
GatewayHTTPHandler._handle_webui_thread_get (cognitive 23) nanobot/webui/ws_http.py:961— GatewayHTTPHandler._handle_webui_thread_get has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, ternaries 7, boolean chains 4, 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.
tool-renderers.toolLabel (cognitive 23) tui/src/tool-renderers.ts:38— tool-renderers.toolLabel has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 8 (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.
CodeBlock.CodeBlock (cognitive 23) webui/src/components/CodeBlock.tsx:196— CodeBlock.CodeBlock has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 8, if/else 6 (nesting depth added 2). Of this number, 14 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FileActions.FileActions (cognitive 23) webui/src/components/FileActions.tsx:27— 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 literals inside it that branch (lines 60, 70, 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.
FileReferenceChip.FileReferenceChip (cognitive 23) webui/src/components/FileReferenceChip.tsx:42— FileReferenceChip.FileReferenceChip has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 8, if/else 2 (nesting depth added 1). Of this number, 20 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FileEditRow.FileUnifiedDiff (cognitive 23) webui/src/components/thread/activity/FileEditRow.tsx:170— FileEditRow.FileUnifiedDiff has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 8, if/else 3 (nesting depth added 2). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 231, 236, 198, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
trace-activity-model.describeTraceLine (cognitive 23) webui/src/components/thread/activity/trace-activity-model.ts:17— 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.
thread-event-projection.attachProjectedReasoning (cognitive 23) webui/src/lib/thread-event-projection.ts:532— thread-event-projection.attachProjectedReasoning has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, ternaries 2 (3 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.
execution._execute_tool_call (cognitive 22) nanobot/agent/tools/execution.py:115— execution._execute_tool_call has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 2, ternaries 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.
UpdateGoalTool.execute (cognitive 22) nanobot/agent/tools/long_task.py:301— 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.
_RefreshingOAuthClientProvider._handle_refresh_response (cognitive 22) nanobot/agent/tools/mcp_oauth.py:652— _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:44— 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.
gateway_runtime._run_gateway (cognitive 22) REDACTED:344— gateway_runtime._run_gateway has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 3, error handling 1 (2 pts), 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.
LLMUsageStore.usage_payload (cognitive 22) nanobot/llm_usage/store.py:402— LLMUsageStore.usage_payload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8, ternaries 6 (7 pts), boolean chains 5, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnthropicProvider._handle_error (cognitive 22) REDACTED:123— 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:659— 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.
mcp_presets_api.mcp_presets_action (cognitive 22) nanobot/webui/mcp_presets_api.py:1543— mcp_presets_api.mcp_presets_action has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (3 pts), ternaries 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.
WebuiSessionAccess.search (cognitive 22) nanobot/webui/session_access.py:250— WebuiSessionAccess.search has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (8 pts), loops 3, 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.
pty_smoke.main (cognitive 22) tui/scripts/pty_smoke.py:75— pty_smoke.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 3, boolean chains 2, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
latex.mathSpanAt (cognitive 22) tui/src/latex.ts: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.
AttachmentTile.AttachmentTile (cognitive 22) webui/src/components/AttachmentTile.tsx:18— AttachmentTile.AttachmentTile has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 9, 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.
SettingsSidebar.SettingsSidebar (cognitive 22) webui/src/components/settings/SettingsSidebar.tsx:66— SettingsSidebar.SettingsSidebar has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 13 (18 pts), boolean chains 3, if/else 1 (nesting depth added 5). 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 into named stages: move each independent 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.ActivityTraceRow (cognitive 22) webui/src/components/thread/AgentActivityCluster.tsx:793— AgentActivityCluster.ActivityTraceRow has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (18 pts), boolean chains 3, if/else 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RecoveryNotice.RecoveryNotice (cognitive 22) webui/src/components/thread/RecoveryNotice.tsx:15— RecoveryNotice.RecoveryNotice has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 4, if/else 4 (nesting depth added 3). Of this number, 17 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ContextGovernor.normalize_tool_result (cognitive 21) nanobot/agent/context_governance.py:716— 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.
AgentRunner._drain_injections (cognitive 21) nanobot/agent/runner.py:238— AgentRunner._drain_injections has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (3 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.
gateway_runtime._pick_heartbeat_target_from_sessions (cognitive 21) REDACTED:204— gateway_runtime._pick_heartbeat_target_from_sessions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 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.
BedrockProvider._merge_consecutive (cognitive 21) nanobot/providers/bedrock_provider.py:266— 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:819— 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:453— 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.
webui_turns.maybe_generate_webui_title (cognitive 21) nanobot/session/webui_turns.py:198— webui_turns.maybe_generate_webui_title has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, 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, 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.
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:521— 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.
skills_marketplace._skillhub_skill (cognitive 21) nanobot/webui/skills_marketplace.py:783— 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_misc_routes (cognitive 21) nanobot/webui/ws_http.py:1430— GatewayHTTPHandler._dispatch_misc_routes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 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.
latex.fencedCodeEnd (cognitive 21) tui/src/latex.ts: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.
ImageGenerationSettings.ImageGenerationSettings (cognitive 21) webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:43— ImageGenerationSettings.ImageGenerationSettings has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 7 (nesting depth added 5). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProviderSettings.ProviderIcon (cognitive 21) webui/src/components/settings/models/ProviderSettings.tsx:1419— ProviderSettings.ProviderIcon has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (17 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.
SessionInfoPopover.SessionInfoPopover (cognitive 21) webui/src/components/thread/SessionInfoPopover.tsx:52— SessionInfoPopover.SessionInfoPopover has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 7, boolean chains 2, error handling 2 (nesting depth added 5). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 85, 103, 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.
ThreadMessages.completedMessageBlocks (cognitive 21) webui/src/components/thread/ThreadMessages.tsx:971— ThreadMessages.completedMessageBlocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 4 (nesting depth added 4). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 987, 998, 990). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PaneWorkbench.paneInDirection (cognitive 21) webui/src/components/workbench/PaneWorkbench.tsx:132— 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:103— 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.
(anonymous) (cognitive 21) webui/public/sw.js:172— (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 220, 196, 198, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentLoop.__init__ (cognitive 20) nanobot/agent/loop.py:258— AgentLoop.__init__ has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 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.
AgentLoop._run_session_queue (cognitive 20) nanobot/agent/loop.py:1442— 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.
mcp._normalize_nullable_schema (cognitive 20) nanobot/agent/tools/mcp.py:447— 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:179— 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.
terminal._maybe_print_interactive_progress (cognitive 20) nanobot/cli/terminal.py:364— terminal._maybe_print_interactive_progress has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 6 (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.
AnthropicProvider._merge_consecutive (cognitive 20) REDACTED:428— 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:711— 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.
WebuiTurnRoutePolicy.__call__ (cognitive 20) nanobot/session/webui_turns.py:453— WebuiTurnRoutePolicy.__call__ has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, 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.
helpers.sanitize_surrogates_deep (cognitive 20) nanobot/utils/helpers.py:68— 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:479— 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:1103— 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.
ModelSettingsHandler.handle (cognitive 20) nanobot/webui/settings_models.py:1765— ModelSettingsHandler.handle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 3 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
sidebar_state._clean_workbench (cognitive 20) nanobot/webui/sidebar_state.py:154— 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.
transcript._compact_completed_stream_deltas (cognitive 20) nanobot/webui/transcript.py:325— transcript._compact_completed_stream_deltas has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ws_http._parse_automation_update (cognitive 20) nanobot/webui/ws_http.py:1790— 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.
AgentActivityCluster.CliRunRow (cognitive 20) webui/src/components/thread/AgentActivityCluster.tsx:1268— AgentActivityCluster.CliRunRow has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (16 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.
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.
NanobotClient.sendMessage (cognitive 20) webui/src/lib/nanobot-client.ts:970— NanobotClient.sendMessage has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
imageEncode.worker.sniffImageMime (cognitive 20) webui/src/workers/imageEncode.worker.ts:83— 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._persist_user_message_early (cognitive 19) nanobot/agent/loop.py:662— AgentLoop._persist_user_message_early has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebSearchTool._search_olostep (cognitive 19) nanobot/agent/tools/web.py:529— 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:765— 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.
tui_launcher.launch_tui (cognitive 19) REDACTED:78— 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.
CronService._execute_job (cognitive 19) nanobot/cron/service.py:601— CronService._execute_job has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 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.
optional_features.install_extra (cognitive 19) nanobot/optional_features.py:220— optional_features.install_extra has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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.
BedrockProvider._assistant_blocks (cognitive 19) nanobot/providers/bedrock_provider.py:230— 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:507— 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.
SessionManager.rename_model_preset (cognitive 19) nanobot/session/manager.py:1679— SessionManager.rename_model_preset has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemSettingsHandler.handle (cognitive 19) nanobot/webui/settings_system.py:409— SystemSettingsHandler.handle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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._client_projection_events (cognitive 19) nanobot/webui/transcript.py:2403— transcript._client_projection_events has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 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.
GatewayHTTPHandler._serve_static (cognitive 19) nanobot/webui/ws_http.py:1724— 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.
MessageBubble.MessageMedia (cognitive 19) webui/src/components/MessageBubble.tsx:677— MessageBubble.MessageMedia has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 literals inside it that branch (lines 157, 74, 67, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentActivityCluster.McpRunRow (cognitive 19) webui/src/components/thread/AgentActivityCluster.tsx:1346— AgentActivityCluster.McpRunRow has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (15 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.
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.
ThreadMotionCoordinator.observeScroll (cognitive 19) webui/src/components/thread/thread-motion.ts:335— 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.
thread-event-projection.projectToolActivity (cognitive 19) webui/src/lib/thread-event-projection.ts:628— thread-event-projection.projectToolActivity has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (15 pts), boolean chains 2, if/else 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContentPage.scan (cognitive 18) nanobot/agent/tools/_search_content.py:72— 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:95— 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.
MCPProvider.reload (cognitive 18) nanobot/agent/tools/mcp.py:1489— MCPProvider.reload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, 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.
_RefreshingOAuthClientProvider.async_auth_flow (cognitive 18) nanobot/agent/tools/mcp_oauth.py:775— _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.
TurnDelivery.complete (cognitive 18) nanobot/agent/turn_delivery.py:318— TurnDelivery.complete has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboard._get_field_type_info (cognitive 18) nanobot/cli/onboard.py:280— 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.
LLMProvider._strip_image_content (cognitive 18) nanobot/providers/base.py:1216— LLMProvider._strip_image_content has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openai_codex_provider._codex_error_response (cognitive 18) nanobot/providers/openai_codex_provider.py:624— 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.
OpenAICompatProvider._extract_error_metadata (cognitive 18) REDACTED:1853— 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_text_tool_calls (cognitive 18) REDACTED:246— openai_compat_provider._extract_text_tool_calls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 1 (2 pts), 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.
openai_compat_provider._extract_tc_extras (cognitive 18) REDACTED:320— 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.
JsonlSessionStore._read_metadata_unlocked (cognitive 18) nanobot/session/manager.py:1366— JsonlSessionStore._read_metadata_unlocked has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (7 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecoveryCoordinator.scan (cognitive 18) nanobot/session/recovery.py:484— 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.
McpOAuthManager._payload (cognitive 18) nanobot/webui/mcp_oauth_api.py:355— 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.
settings_capabilities.update_api_settings (cognitive 18) nanobot/webui/settings_capabilities.py:359— settings_capabilities.update_api_settings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings_models.complete_oauth_provider (cognitive 18) nanobot/webui/settings_models.py:1638— settings_models.complete_oauth_provider has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, error handling 3 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
star_prompt.update_star_prompt (cognitive 18) nanobot/webui/star_prompt.py:27— 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:1719— 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._handle_session_delete (cognitive 18) nanobot/webui/ws_http.py:1159— GatewayHTTPHandler._handle_session_delete has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 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._handle_local_trigger_action (cognitive 18) nanobot/webui/ws_http.py:1367— 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:1845— 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.
NanobotTui.prepareChat (cognitive 18) tui/src/app.ts:1383— NanobotTui.prepareChat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, 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.
AgentActivityCluster.countActivity (cognitive 18) webui/src/components/thread/AgentActivityCluster.tsx:108— 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.
ModelPresetBadge.PresetPill (cognitive 18) webui/src/components/thread/ModelPresetBadge.tsx:492— 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.
ThreadMessages.currentActivityClusterIndices (cognitive 18) webui/src/components/thread/ThreadMessages.tsx:873— ThreadMessages.currentActivityClusterIndices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 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.
ContextBuilder._load_bootstrap_files (cognitive 17) nanobot/agent/context.py:194— 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.summarize_provider_compaction (cognitive 17) nanobot/agent/context_governance.py:457— ContextGovernor.summarize_provider_compaction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextGovernor.strip_placeholder_assistant_messages (cognitive 17) nanobot/agent/context_governance.py:769— 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:1641— AgentLoop._aclose_unlocked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 2 (3 pts), loops 3, 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.
SkillsLoader.list_skills (cognitive 17) nanobot/agent/skills.py:90— SkillsLoader.list_skills has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyTool._validate_json_safe (cognitive 17) nanobot/agent/tools/self.py:606— 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.execute (cognitive 17) nanobot/agent/tools/shell.py:274— ExecTool.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 3, boolean chains 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ExecTool._extract_absolute_paths (cognitive 17) nanobot/agent/tools/shell.py:999— 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.
loader._migrate_config (cognitive 17) nanobot/config/loader.py:347— 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.
converters.convert_user_message (cognitive 17) nanobot/providers/openai_responses/converters.py:77— 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:201— 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.
SessionHandleResolver._ensure_all (cognitive 17) nanobot/session/session_handles.py:152— SessionHandleResolver._ensure_all has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (6 pts), error handling 1 (2 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.
webui_turns._title_inputs (cognitive 17) nanobot/session/webui_turns.py:147— 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. This shape REPEATS in the file: one other method here (webui_turns._latest_title_inputs) 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.
webui_turns._latest_title_inputs (cognitive 17) nanobot/session/webui_turns.py:172— webui_turns._latest_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. This shape REPEATS in the file: one other method here (webui_turns._title_inputs) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
file_edit_events._resolve_single_path (cognitive 17) nanobot/utils/file_edit_events.py:418— file_edit_events._resolve_single_path has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build.iter_webui_source_files (cognitive 17) nanobot/webui/build.py:81— 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:58— 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.
settings_capabilities._image_generation_provider_rows (cognitive 17) nanobot/webui/settings_capabilities.py:91— settings_capabilities._image_generation_provider_rows has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 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.
ChatList.WorkbenchTabHeader (cognitive 17) webui/src/components/ChatList.tsx:1190— 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.
CliAppMentionText.CliAppMentionToken (cognitive 17) webui/src/components/CliAppMentionText.tsx:179— CliAppMentionText.CliAppMentionToken has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. 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 17) webui/src/components/CliAppMentionText.tsx:250— CliAppMentionText.McpPresetMentionToken has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. 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.
AgentActivityCluster.AgentActivityCluster (cognitive 17) webui/src/components/thread/AgentActivityCluster.tsx:175— 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 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.
PromptRail.PromptRail (cognitive 17) webui/src/components/thread/PromptRail.tsx:54— PromptRail.PromptRail has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 7 (8 pts), boolean chains 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 152, 102, 68, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ThreadViewport.visibleHistoryUnit (cognitive 17) webui/src/components/thread/ThreadViewport.tsx:99— 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.
web-search-model.textCandidates (cognitive 17) webui/src/components/thread/activity/web-search-model.ts:172— 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.
useSidebarState.useSidebarState (cognitive 17) webui/src/hooks/useSidebarState.ts:137— useSidebarState.useSidebarState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 162, 181, 220, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
NanobotClient.handleClose (cognitive 17) webui/src/lib/nanobot-client.ts:1313— NanobotClient.handleClose has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (4 pts), boolean chains 2, 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.
AgentLoop._process_message (cognitive 16) nanobot/agent/loop.py:1706— AgentLoop._process_message has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 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.
plugins._stdio_cwd (cognitive 16) nanobot/agent/plugins.py:373— 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._request_model (cognitive 16) nanobot/agent/runner.py:871— AgentRunner._request_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, loops 1 (2 pts), error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MCPProvider.connect (cognitive 16) nanobot/agent/tools/mcp.py:1425— 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:459— 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:288— 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.
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:1539— 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:253— 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:286— 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.
AnthropicProvider._build_kwargs (cognitive 16) REDACTED:577— AnthropicProvider._build_kwargs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
github_copilot_provider._parse_github_copilot_models (cognitive 16) nanobot/providers/github_copilot_provider.py:396— github_copilot_provider._parse_github_copilot_models has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 3 (5 pts), boolean chains 3, 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.
manager._text_preview (cognitive 16) nanobot/session/manager.py:117— 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.
file_edit_events._limit_unified_diff_lines (cognitive 16) nanobot/utils/file_edit_events.py:225— file_edit_events._limit_unified_diff_lines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, loops 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.
RotatingTextOutput._rotate (cognitive 16) nanobot/utils/rotating_output.py:146— 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:91— 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:37— 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.
settings_models._validated_provider_config (cognitive 16) nanobot/webui/settings_models.py:223— settings_models._validated_provider_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_settings_rows (cognitive 16) nanobot/webui/settings_models.py:490— 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.create_model_configuration (cognitive 16) nanobot/webui/settings_models.py:1163— settings_models.create_model_configuration has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, 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.
settings_system.update_agent_system_settings (cognitive 16) nanobot/webui/settings_system.py:149— 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:1433— 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.
build_tui_wheels._base_files (cognitive 16) scripts/build_tui_wheels.py:76— build_tui_wheels._base_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, loops 2, 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.
latex.validMathStructure (cognitive 16) tui/src/latex.ts: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/transcript.ts:646— 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 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.
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, 73, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AgentActivityCluster.collectCliRuns (cognitive 16) webui/src/components/thread/AgentActivityCluster.tsx:1037— 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:1140— 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.
ThreadComposer.SlashCommandPalette (cognitive 16) webui/src/components/thread/ThreadComposer.tsx:3182— ThreadComposer.SlashCommandPalette has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 4 (nesting depth added 4). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 3209). 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.
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.
remark-tex-math.tokenizeMathFlow (cognitive 16) webui/src/lib/remark-tex-math.ts:224— remark-tex-math.tokenizeMathFlow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
manifestedAssetPaths (cognitive 16) webui/public/sw.js:93— 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.
D22 · Internal API Consistency· Duplicate method names with identical signatures and likely identical intent. 'prepare_messages_for_model' and 'prepare_for_model' appear to be redundant aliases or a copy-paste error. · ×1
Duplicate method names with identical signatures and likely identical intent. 'prepare_messages_for_model' and 'prepare_for_model' appear to be redundant aliases or a copy-paste error. — Remove one of the methods (likely 'prepare_for_model' if 'prepare_messages_for_model' is the more descriptive name, or vice versa) and update all internal callers to use the single canonical name. (signatures: ContextGovernor.prepare_messages_for_model(self, config: ContextGovernanceConfig, messages: list[dict[str, Any]]): list[dict[str, Any]] | ContextGovernor.prepare_for_model(self, config: ContextGovernanceConfig, messages: list[dict[str, Any]]): list[dict[str, Any]])
D22 · Internal API Consistency· Duplicate method names with identical signatures. 'resolve_preset' and 'select_preset' perform the same operation of resolving/setting a model preset. · ×1
Duplicate method names with identical signatures. 'resolve_preset' and 'select_preset' perform the same operation of resolving/setting a model preset. — Unify to a single method name, such as 'select_preset' or 'resolve_preset', depending on whether the action is primarily a lookup or a state change. (signatures: ModelRuntimeResolver.resolve_preset(self, name: str | None): LLMRuntime | ModelRuntimeResolver.select_preset(self, name: str | None): LLMRuntime)
D22 · Internal API Consistency· Inconsistent naming for similar operations. 'set_session_model_preset' targets a specific session, while 'set_model_preset' appears to be global or default. The naming convention differs ('set_session_model_preset' vs 'set_model_preset') which is confusing when both exist. · ×1
Inconsistent naming for similar operations. 'set_session_model_preset' targets a specific session, while 'set_model_preset' appears to be global or default. The naming convention differs ('set_session_model_preset' vs 'set_model_preset') which is confusing when both exist. — Standardize naming. For example, use 'set_model_preset' for global and 'set_session_model_preset' for session-specific, OR use 'set_default_model_preset' and 'set_session_model_preset' to clearly distinguish scope. (signatures: AgentLoop.set_session_model_preset(self, session_key: str, name: str): LLMRuntime | AgentLoop.set_model_preset(self, name: str | None, publish_update: bool): LLMRuntime)
D22 · Internal API Consistency· Duplicate functionality exposed at different levels. 'AgentLoop' exposes 'pending_cron_job_ids_for_session' which likely delegates to 'CronTurnCoordinator.pending_job_ids_for_session'. This creates a redundant API surface where the caller can access the coordinator directly or go through the loop. · ×1
Duplicate functionality exposed at different levels. 'AgentLoop' exposes 'pending_cron_job_ids_for_session' which likely delegates to 'CronTurnCoordinator.pending_job_ids_for_session'. This creates a redundant API surface where the caller can access the coordinator directly or go through the loop. — Remove the delegation method from 'AgentLoop' if 'CronTurnCoordinator' is part of the public API, or remove 'CronTurnCoordinator' from the public API if 'AgentLoop' is the intended single entry point. (signatures: AgentLoop.pending_cron_job_ids_for_session(self, session_key: str): set[str] | CronTurnCoordinator.pending_job_ids_for_session(self, session_key: str): set[str])
D22 · Internal API Consistency· Inconsistent naming for similar query operations. 'AgentLoop' uses 'pending_local_trigger_ids_for_session' while 'CronTurnCoordinator' uses 'pending_job_ids_for_session'. The term 'job' vs 'trigger' is inconsistent for similar concepts. · ×1
Inconsistent naming for similar query operations. 'AgentLoop' uses 'pending_local_trigger_ids_for_session' while 'CronTurnCoordinator' uses 'pending_job_ids_for_session'. The term 'job' vs 'trigger' is inconsistent for similar concepts. — Standardize the terminology. If both are 'jobs', use 'pending_job_ids_for_session' for both. If they are distinct concepts, ensure the naming clearly reflects that distinction (e.g., 'pending_trigger_ids' vs 'pending_job_ids'). (signatures: AgentLoop.pending_local_trigger_ids_for_session(self, session_key: str): set[str] | CronTurnCoordinator.pending_job_ids_for_session(self, session_key: str): set[str])
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.
Near-duplicate member pair (33 shared lines) nanobot/session/manager.py:940— nanobot/session/manager.py:940-1009 | nanobot/session/manager.py:1016-1092 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) nanobot/webui/settings_models.py:1119— nanobot/webui/settings_models.py:1119-1160 | nanobot/webui/settings_models.py:1233-1299 — These two members are one piece of code written twice and then edited apart: 29 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) nanobot/agent/tools/web.py:652— nanobot/agent/tools/web.py:652-687 | nanobot/agent/tools/web.py:766-819 | nanobot/agent/tools/web.py:822-859 | nanobot/agent/tools/web.py:862-903 | nanobot/agent/tools/web.py:914-1022 — These 5 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 5 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 5 times.
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-157 | nanobot/webui/skills_marketplace.py:210-239 | nanobot/webui/skills_marketplace.py:248-275 | nanobot/webui/skills_marketplace.py:283-310 — 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.
Duplicated block (33 lines × 2) nanobot/agent/tools/mcp.py:820— nanobot/agent/tools/mcp.py:820-852 | nanobot/agent/tools/mcp.py:954-986 — 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 (29 lines × 2) nanobot/webui/settings_models.py:1131— nanobot/webui/settings_models.py:1131-1159 | nanobot/webui/settings_models.py:1249-1277 — 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 (27 lines × 2) nanobot/providers/azure_openai_provider.py:209— nanobot/providers/azure_openai_provider.py:209-235 | REDACTED:1298-1324 — 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 `nanobot/providers/azure_openai_provider.py:209` 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 (26–27 lines × 2) nanobot/providers/image_generation.py:758— nanobot/providers/image_generation.py:758-783 | nanobot/providers/image_generation.py:816-842 — 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 (23–24 lines × 3) nanobot/agent/tools/mcp.py:652— nanobot/agent/tools/mcp.py:652-675 | nanobot/agent/tools/mcp.py:820-842 | nanobot/agent/tools/mcp.py:954-976 — 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. 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 (19–22 lines × 3) nanobot/cron/service.py:447— nanobot/cron/service.py:447-468 | nanobot/triggers/local_store.py:414-432 | nanobot/utils/run_records.py:40-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
Duplicated block (22 lines × 2) nanobot/providers/transcription.py:150— nanobot/providers/transcription.py:150-171 | nanobot/providers/transcription.py:464-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 (20–21 lines × 2) nanobot/agent/subagent.py:248— nanobot/agent/subagent.py:248-268 | nanobot/agent/subagent.py:312-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `nanobot/agent/subagent.py:332` calls `info` and `nanobot/agent/subagent.py:270` does not — after which the two agree again for 4 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 (16–21 lines × 2) nanobot/agent/tools/long_task.py:216— nanobot/agent/tools/long_task.py:216-231 | nanobot/agent/tools/long_task.py:326-346 — 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 (19–21 lines × 2) nanobot/providers/factory.py:333— nanobot/providers/factory.py:333-351 | nanobot/providers/factory.py:352-372 — 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/factory.py:333` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–19 lines × 2) nanobot/session/manager.py:952— nanobot/session/manager.py:952-970 | nanobot/session/manager.py:1316-1332 — 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 (19 lines × 2) nanobot/session/webui_turns.py:151— nanobot/session/webui_turns.py:151-169 | nanobot/session/webui_turns.py:177-195 — 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:645— nanobot/providers/transcription.py:645-659 | nanobot/providers/transcription.py:695-711 — 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) nanobot/agent/tools/filesystem.py:706— nanobot/agent/tools/filesystem.py:706-721 | nanobot/agent/tools/filesystem.py:775-790 — 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/azure_openai_provider.py:193— nanobot/providers/azure_openai_provider.py:193-208 | nanobot/providers/openai_codex_provider.py:102-115 — 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 `nanobot/providers/azure_openai_provider.py:193` 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 (15–16 lines × 2) nanobot/providers/azure_openai_provider.py:415— nanobot/providers/azure_openai_provider.py:415-430 | REDACTED:2077-2091 — 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 `nanobot/providers/azure_openai_provider.py:415` 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:1259— nanobot/providers/image_generation.py:1259-1273 | nanobot/providers/image_generation.py:1343-1357 — 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:1259` 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:1848— nanobot/providers/image_generation.py:1848-1862 | nanobot/providers/image_generation.py:2006-2019 — 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:124— REDACTED:124-137 | REDACTED:1854-1867 — 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:125— nanobot/webui/skills_marketplace.py:125-135 | nanobot/webui/skills_marketplace.py:215-226 | nanobot/webui/skills_marketplace.py:286-296 — 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:215` 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:136` calls `set` and `nanobot/webui/skills_marketplace.py:297` 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:528— nanobot/providers/image_generation.py:528-538 | nanobot/providers/image_generation.py:1058-1067 | nanobot/providers/image_generation.py:1874-1883 — 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:528` 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 (11 lines × 3) nanobot/providers/image_generation.py:1259— nanobot/providers/image_generation.py:1259-1269 | nanobot/providers/image_generation.py:1343-1353 | nanobot/providers/image_generation.py:1459-1469 — 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:1259` 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 × 3) nanobot/session/manager.py:961— nanobot/session/manager.py:961-969 | nanobot/session/manager.py:1045-1053 | nanobot/session/manager.py:1323-1331 — 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 (7 lines × 3) nanobot/agent/tools/web.py:680— nanobot/agent/tools/web.py:680-686 | nanobot/agent/tools/web.py:852-858 | nanobot/agent/tools/web.py:896-902 — 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:680` 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 (6 lines × 5) nanobot/agent/tools/web.py:682— nanobot/agent/tools/web.py:682-687 | nanobot/agent/tools/web.py:814-819 | nanobot/agent/tools/web.py:854-859 | nanobot/agent/tools/web.py:898-903 | nanobot/agent/tools/web.py:958-963 — all 5 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. 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:145— nanobot/cli/gateway.py:145-146 | nanobot/cli/gateway.py:288-293 | nanobot/cli/gateway.py:339-344 — 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:288` 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 (6 lines × 3) nanobot/webui/cli_apps_api.py:50— nanobot/webui/cli_apps_api.py:50-55 | nanobot/webui/mcp_presets_api.py:513-518 | nanobot/webui/sidebar_state.py:63-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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.
Duplication concentrated across 6 sibling directories (20 clone groups) webui/src/components/settings/overview/OverviewSettings.tsx:435— 20 duplicated blocks under webui/src/components/settings/ have copies in at least two of the sibling directories capabilities, channels, models, overview, shared, system — 8 of them are reported below, and 12 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 20 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 20 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 20 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 5 sibling directories (10 clone groups) webui/src/hooks/useAttachedImages.ts:177— 10 duplicated blocks under webui/src/ have copies in at least two of the sibling directories channel-plugins, components, hooks, lib, workers — 7 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 10 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 10 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 10 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplicated block (151 lines × 2 locations) webui/src/components/settings/SettingsPage.tsx:89— webui/src/components/settings/SettingsPage.tsx:89 · webui/src/components/settings/useSettingsController.ts:494 — the 2 copies are spread across 2 files, 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 (70 lines × 2 locations) webui/src/components/CliAppMentionText.tsx:179— webui/src/components/CliAppMentionText.tsx:179 · webui/src/components/CliAppMentionText.tsx:250 — 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 (57 matched lines × 2 locations) · ×1
Duplicated block with local edits (57 matched lines × 2 locations) webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:63— webui/src/components/settings/capabilities/ImageGenerationSettings.tsx:63 · webui/src/components/settings/capabilities/TranscriptionSettings.tsx:68 — the two spans are one implementation copied and then locally edited — 414 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 (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:1002— webui/src/components/thread/AgentActivityCluster.tsx:1002 · webui/src/components/thread/AgentActivityCluster.tsx:1105 — 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 (44 matched lines × 2 locations) · ×1
Duplicated block with local edits (44 matched lines × 2 locations) tui/src/mention-menu.ts:6— tui/src/mention-menu.ts:6 · tui/src/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.
Duplicated block (41 lines × 2 locations) webui/src/components/thread/AgentActivityCluster.tsx:1280— webui/src/components/thread/AgentActivityCluster.tsx:1280 · webui/src/components/thread/AgentActivityCluster.tsx:1360 — 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 (33 lines × 2 locations) webui/src/components/ChatList.tsx:1055— webui/src/components/ChatList.tsx:1055 · webui/src/components/ChatList.tsx:1498 — 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.
Duplicated block (31 lines × 2 locations) webui/src/App.tsx:1893— webui/src/App.tsx:1893 · webui/src/App.tsx:1960 — 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 (28 lines × 2 locations) webui/src/components/settings/overview/OverviewSettings.tsx:435— webui/src/components/settings/overview/OverviewSettings.tsx:435 · webui/src/components/settings/shared/ModelControls.tsx:593 — 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 (25 lines × 2 locations) nanobot/channels/weixin/webui/WeixinPanel.tsx:265— nanobot/channels/weixin/webui/WeixinPanel.tsx:265 · webui/src/components/settings/channels/ChannelSetupPanel.tsx:543 — 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 (21 matched lines × 2 locations) · ×1
Duplicated block with local edits (21 matched lines × 2 locations) webui/src/components/settings/channels/ChannelIdentity.tsx:172— webui/src/components/settings/channels/ChannelIdentity.tsx:172 · webui/src/components/settings/system/AppsSettings.tsx:1493 — 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 (21 lines × 2 locations) webui/src/components/thread/ThreadComposer.tsx:1413— webui/src/components/thread/ThreadComposer.tsx:1413 · webui/src/components/thread/ThreadComposer.tsx:1434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2 locations) webui/src/components/thread/ThreadComposer.tsx:2136— webui/src/components/thread/ThreadComposer.tsx:2136 · webui/src/components/thread/ThreadComposer.tsx:2160 — 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 (19 lines × 2 locations) webui/src/components/MessageBubble.tsx:611— webui/src/components/MessageBubble.tsx:611 · webui/src/components/MessageBubble.tsx:644 — 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/ChatList.tsx:950— webui/src/components/ChatList.tsx:950 · webui/src/components/ChatList.tsx:1429 — 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.
Complex function ThreadComposer (cyclomatic 128, cognitive 101) webui/src/components/thread/ThreadComposer.tsx:900— ThreadComposer has cyclomatic complexity 128 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 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 127, cognitive 172) tui/src/app.ts:1777— (anonymous) has cyclomatic complexity 127 and cognitive complexity 172; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 accept (cyclomatic 104, cognitive 146) tui/src/app.ts:1143— accept has cyclomatic complexity 104 and cognitive complexity 146; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ThreadShell (cyclomatic 93, cognitive 82) webui/src/components/thread/ThreadShell.tsx:630— ThreadShell has cyclomatic complexity 93 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 handle (cyclomatic 84, cognitive 125) webui/src/hooks/useNanobotStream.ts:561— handle has cyclomatic complexity 84 and cognitive complexity 125; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 decodeInboundEvent (cyclomatic 81, cognitive 76) tui/src/protocol.ts:470— decodeInboundEvent has cyclomatic complexity 81 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ModelIdPicker (cyclomatic 80, cognitive 64) webui/src/components/settings/shared/ModelControls.tsx:168— ModelIdPicker has cyclomatic complexity 80 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 projectThreadEvent (cyclomatic 78, cognitive 138) webui/src/lib/thread-event-projection.ts:756— projectThreadEvent has cyclomatic complexity 78 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function Shell (cyclomatic 67, cognitive 61) webui/src/App.tsx:1097— Shell has cyclomatic complexity 67 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 renderProviderRow (cyclomatic 67, cognitive 52) webui/src/components/settings/models/ProviderSettings.tsx:783— renderProviderRow has cyclomatic complexity 67 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleMessage (cyclomatic 64, cognitive 84) webui/src/lib/nanobot-client.ts:1081— handleMessage has cyclomatic complexity 64 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 LinearPanel (cyclomatic 60, cognitive 44) nanobot/channels/linear/webui/LinearPanel.tsx:59— LinearPanel has cyclomatic complexity 60 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function McpAppsCatalogRow (cyclomatic 57, cognitive 46) webui/src/components/settings/system/AppsSettings.tsx:493— McpAppsCatalogRow has cyclomatic complexity 57 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 RuntimeSettings (cyclomatic 56, cognitive 54) webui/src/components/settings/system/RuntimeSettings.tsx:21— RuntimeSettings has cyclomatic complexity 56 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 54, cognitive 56) webui/src/components/ChatList.tsx:772— (anonymous) has cyclomatic complexity 54 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ChannelSetupSurface (cyclomatic 52, cognitive 43) webui/src/components/settings/channels/ChannelSetupPanel.tsx:175— ChannelSetupSurface 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 AutomationDetailPanel (cyclomatic 50, cognitive 45) webui/src/components/settings/system/AutomationsSettings.tsx:442— AutomationDetailPanel has cyclomatic complexity 50 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseThreadProjectionEvent (cyclomatic 49, cognitive 53) webui/src/lib/api.ts:306— parseThreadProjectionEvent has cyclomatic complexity 49 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ChannelQrConnectFlow (cyclomatic 45, cognitive 39) webui/src/components/settings/channels/ChannelQrConnectFlow.tsx:40— ChannelQrConnectFlow has cyclomatic complexity 45 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function WorkspaceProjectPicker (cyclomatic 44, cognitive 45) webui/src/components/thread/WorkspaceControls.tsx:46— WorkspaceProjectPicker has cyclomatic complexity 44 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 37 significant file(s) lose their only recent owner: nanobot/webui/settings_system.py, nanobot/agent/tools/mcp_oauth.py, nanobot/webui/settings_capabilities.py, tui/src/latex.ts, nanobot/webui/mcp_oauth_api.py, webui/src/components/thread/thread-motion.ts, nanobot/cli/terminal.py, nanobot/providers/conversation_state.py (+29 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 14 significant file(s) lose their only recent owner: webui/src/components/settings/models/ProviderSettings.tsx, nanobot/webui/skills_marketplace.py, nanobot/process_runtime.py, webui/src/components/settings/SettingsSidebar.tsx, tui/src/diff-viewer.ts, tui/src/session-menu.ts, nanobot/webui/skills_api.py, webui/src/components/ImageLightbox.tsx (+6 more). Pair on, review, or document these before any departure.
Documentation: contradicts the code docs/releasing.md— The release checklist references the CONTRIBUTORS.md release-packaging contract, which no longer exists and is not shown in this document. Update to point to the current CONTRIBUTING.md or remove the outdated reference.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. 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/`.
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 — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
No SAST — 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 17178 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 changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
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 01a0ddf6-d0ce-73e3-9093-a777332cd1f8 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 30 · Warnings: 1342 · Recommendations: 17 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-09-2026 @ 13:45 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.