Public report — 9router, published 1 Oct 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.18 (frozen) · verify this surveyFiledcd_0cccf0732ad84d948637daa0933aa51e
Filed 1 October 2026, 17:00 UTC
Public
Large · 137,554 LoC · 3 projects · rebuild ~1.1 person-years · weakest lens: Readiness (16%)
Findings by grade
110 critical1503 serious120 minor33 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
1 October 2026, 16:41 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 ▸
1707findings with an exact file:lineof 1733 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
52/131dimensions across the health lenses137554 LoC · 3 projects — wide & deep
Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.
This system is a large, valuable asset carrying significant operational risk. With an overall health score of 32%, the platform is fragile. While the underlying logic is substantial, the weak operational readiness means the business faces high exposure to outages and security incidents. The cost to rebuild core logic is moderate, but the cost of inaction is far higher due to the compounding drag on development velocity.
The most critical issue is operational fragility. The system’s readiness score is extremely low, indicating that changes are risky and recovery from failure is not guaranteed. This lack of resilience threatens service continuity and increases the cost of every deployment. Without robust testing, observability, and disaster recovery procedures, the business cannot reliably scale or respond to incidents, turning minor bugs into major outages.
A secondary risk is the hidden tax on development speed. Code quality issues create a velocity drag, making every change slower and more error-prone. This inefficiency compounds over time, consuming engineering resources that could otherwise drive new features. The financial impact of this drag is significant, effectively costing the business thousands of engineer-days annually in reduced productivity and increased defect rates.
However, there are genuine strengths. The architecture is reasonably sound, and the team has achieved good maturity in documentation and process. These foundations provide a stable base for improvement. The codebase is not a mess, but rather a well-structured system with operational gaps. This balance means that targeted fixes can yield rapid improvements without requiring a complete rewrite.
The first action must be to resolve the 17 leaked secrets. This is a high-priority security risk that can be fixed quickly and pays for itself within months by reducing future security debt. Following this, the team should implement automated security scanning in the CI pipeline to prevent regressions. These steps address the most immediate threats and establish a baseline for safer, faster development.
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.
261 finding(s) are new versus the previous scan (2026-09-16) — 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.
0.7× (at 32% 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 ~1.1 person-years of build effort (about ~€150,000 to rebuild). Its weakest lens is Readiness at 16% — 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.7× 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
Resolve the 17 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED (3), REDACTED (2).
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~1.1 person-years to rebuild), and its weakest lens is Readiness at 16%. 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.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 52.4–314.5 engineer-days every year, paid as drag on the ~419,328 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 5–11% 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: 103,396 line(s) changed over a 90-day window ⇒ ~419,328/year · D1/D2/D4/D6 code quality: averaging 6.0/10 ⇒ a 5–11% 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.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Resolve the 17 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED (3), REDACTED (2). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 17 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED (3), REDACTED (2).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.0/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–11% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 6.0/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.)
338 modules, 34 dependencies. Every dependency points down the layering — no cycles.
Showing the 40 most-connected modules; 298 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.
open-sse.executors.antigravity uses open-sse.executors.base. Changing open-sse.executors.base can break open-sse.executors.antigravity, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
8→5 open-sse.executors.codex depends on open-sse.executors.base✕
Type pairs
1 distinct (type in open-sse.executors.codex → type in open-sse.executors.base) reference.
open-sse.executors.commandcode uses open-sse.executors.base. Changing open-sse.executors.base can break open-sse.executors.commandcode, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
10→5 open-sse.executors.cursor depends on open-sse.executors.base✕
Type pairs
1 distinct (type in open-sse.executors.cursor → type in open-sse.executors.base) reference.
open-sse.executors.perplexity-web uses open-sse.executors.base. Changing open-sse.executors.base can break open-sse.executors.perplexity-web, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→5 open-sse.executors.qoder depends on open-sse.executors.base✕
Type pairs
1 distinct (type in open-sse.executors.qoder → type in open-sse.executors.base) reference.
src.lib.oauth.services.claude uses src.lib.oauth.services.oauth. Changing src.lib.oauth.services.oauth can break src.lib.oauth.services.claude, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→6 src.lib.oauth.services.codex depends on src.lib.oauth.services.oauth✕
Type pairs
1 distinct (type in src.lib.oauth.services.codex → type in src.lib.oauth.services.oauth) reference.
src.lib.oauth.services.codex uses src.lib.oauth.services.oauth. Changing src.lib.oauth.services.oauth can break src.lib.oauth.services.codex, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
29→6 src.lib.oauth.services.github depends on src.lib.oauth.services.oauth✕
Type pairs
1 distinct (type in src.lib.oauth.services.github → type in src.lib.oauth.services.oauth) reference.
src.lib.oauth.services.github uses src.lib.oauth.services.oauth. Changing src.lib.oauth.services.oauth can break src.lib.oauth.services.github, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
30→6 src.lib.oauth.services.openai depends on src.lib.oauth.services.oauth✕
Type pairs
1 distinct (type in src.lib.oauth.services.openai → type in src.lib.oauth.services.oauth) reference.
src.lib.oauth.services.openai uses src.lib.oauth.services.oauth. Changing src.lib.oauth.services.oauth can break src.lib.oauth.services.openai, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→6 src.lib.oauth.services.xai depends on src.lib.oauth.services.oauth✕
Type pairs
1 distinct (type in src.lib.oauth.services.xai → type in src.lib.oauth.services.oauth) reference.
src.lib.oauth.services.xai uses src.lib.oauth.services.oauth. Changing src.lib.oauth.services.oauth can break src.lib.oauth.services.xai, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→11 open-sse.executors.azure depends on open-sse.executors.default✕
Type pairs
1 distinct (type in open-sse.executors.azure → type in open-sse.executors.default) reference.
open-sse.executors.codebuddy-cn uses open-sse.executors.default. Changing open-sse.executors.default can break open-sse.executors.codebuddy-cn, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→11 open-sse.executors.codebuddy-intl depends on open-sse.executors.default✕
Type pairs
1 distinct (type in open-sse.executors.codebuddy-intl → type in open-sse.executors.default) reference.
open-sse.executors.codebuddy-intl uses open-sse.executors.default. Changing open-sse.executors.default can break open-sse.executors.codebuddy-intl, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
35→11 open-sse.executors.kimchi depends on open-sse.executors.default✕
Type pairs
1 distinct (type in open-sse.executors.kimchi → type in open-sse.executors.default) reference.
open-sse.executors.ollama-local uses open-sse.executors.default. Changing open-sse.executors.default can break open-sse.executors.ollama-local, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→11 open-sse.executors.opencode-go depends on open-sse.executors.default✕
Type pairs
1 distinct (type in open-sse.executors.opencode-go → type in open-sse.executors.default) reference.
open-sse.executors.opencode-go uses open-sse.executors.default. Changing open-sse.executors.default can break open-sse.executors.opencode-go, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→11 open-sse.executors.opencode-zen depends on open-sse.executors.default✕
Type pairs
1 distinct (type in open-sse.executors.opencode-zen → type in open-sse.executors.default) reference.
open-sse.executors.opencode-zen uses open-sse.executors.default. Changing open-sse.executors.default can break open-sse.executors.opencode-zen, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
39→11 open-sse.executors.xiaomi-mimo depends on open-sse.executors.default✕
Type pairs
1 distinct (type in open-sse.executors.xiaomi-mimo → type in open-sse.executors.default) reference.
open-sse.executors.xiaomi-mimo uses open-sse.executors.default. Changing open-sse.executors.default can break open-sse.executors.xiaomi-mimo, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→11 open-sse.executors.xiaomi-tokenplan depends on open-sse.executors.default✕
Type pairs
1 distinct (type in open-sse.executors.xiaomi-tokenplan → type in open-sse.executors.default) reference.
open-sse.executors.xiaomi-tokenplan uses open-sse.executors.default. Changing open-sse.executors.default can break open-sse.executors.xiaomi-tokenplan, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
At a glance — Code Health · 34% · Weak · gated by D1, D2, D3, R1, R2 ·
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
89
High / Critical
A02:2021 — Cryptographic Failures
36
High / Critical
A05:2021 — Security Misconfiguration
6
High / Critical
A06:2021 — Vulnerable & Outdated Components
2
Medium
Roadmap
Immediately resolve the 17 leaked secrets in shared, antigravity, and windsurf files, then integrate a SAST step into CI to prevent future security regressions. Strengthen operational resilience by codifying backup and disaster recovery procedures in infrastructure-as-code, while cleaning up unused dependencies and explicitly declaring imports. Finally, enforce strict timeouts, retries, and circuit breakers on all outbound HTTP calls to prevent unbounded failures.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 17 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED (3), REDACTED (2).
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Per-file score 0–10 — a quality signature. Of 362 files carrying findings, judged against the Preview bar: 2% slop · 12% mixed · 86% near-clean.
File
Score
Band
Worst signal
REDACTED
0.0
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
0.6
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
0.9
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
1.4
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.6
Slop
Secrets (history): REDACTED: REDACTED
REDACTED
2.3
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
2.5
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.8
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.9
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
3.0
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
3.0
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
3.0
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
3.0
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
3.2
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
3.4
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
3.5
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.2
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.4
Mixed
Static Analysis (SAST): High: REDACTED
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 110
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 — 1503
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 — 120
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 33
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. 49 of 52 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.8 — 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 — 52 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, 1707 of 1733 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for tests/ failed in the analyzer sandbox (npm error Cannot read properties of null (reading 'edgesOut')), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in tests/ was NOT MEASURED: the dependency install for tests/ failed in the analyzer sandbox (npm error Cannot read properties of null (reading 'edgesOut')), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D12 Dependency Hygiene — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. This repository's 4 package.json manifest(s) WERE read and their pinning discipline assessed; what went unanswered is the currency half, because answering it needs a lockfile resolved to CONCRETE versions and this repository commits none — a package.json states version RANGES, and a range names no particular release to be behind. So registry.npmjs.org was never asked, and there was nothing here for it to grade. This is a true statement about the repository and NOT a gap on our side: no lockfile reader we could write would find anything here to read, so there is no capability behind this row to build.
D14 License Compliance — 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 — this repository declares package.json manifests but commits no lockfile this pass can resolve (npm, pnpm, yarn and bun each write a different one, and `bun.lockb` is a binary format with no published shape), so the set of packages it actually ships is not resolvable from the checkout: its declarations carry version RANGES, and grading whichever release happens to be newest today would be a verdict about a dependency graph this repository has not pinned. Commit the lock and this dimension grades its production dependencies against registry.npmjs.org. NOT a finding that this repository's licences are compliant: this dimension asserts nothing about its licensing in either direction.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (cli/package.json), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
D30 Dependency Vulnerabilities — measured, with a gap in what it reached — 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. The scanner produced no output at all, so no dependency was actually scanned. 1 of 2 declared ecosystem(s) (npm) WERE scanned and every vulnerability they reported is included in this result; REDACTED was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that REDACTED is free of known-vulnerable dependencies.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `open-sse/shared/clineAuth.js`, `src/app/api/version/route.js`, `src/shared/constants/config.js` 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.
D43 Malicious Dependencies — measured, with a gap in what it reached — 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. The scanner produced no output at all, so no dependency was actually scanned. 1 of 2 declared ecosystem(s) (npm) WERE scanned and every vulnerability they reported is included in this result; REDACTED was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that REDACTED is free of known-vulnerable dependencies.
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.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'better-sqlite3' is imported (src/app/api/cli-tools/omp-settings/route.js:129), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
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.
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. 636 further occurrence(s) are not listed individually; the score already reflects all 676.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 283 further occurrence(s) are not listed individually; the score already reflects all 323.
R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 211 further occurrence(s) are not listed individually; the score already reflects all 251.
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.
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 reads C# syntax, and Java and Rust source only, and no C# was loaded and no Java or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
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.
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.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (3): D19, D21, 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.
697 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was page.ProviderDetailPage at 364. A further 3 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 ToolDetailClient::renderToolCard at 20 — they are counted neither in the figure above nor in this dimension's score. 3 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.js (ToolDetailClient::renderToolCard at 20), open-sse/translator/concerns/modality.js (modality.stripUnsupportedModalities at 19), src/app/api/translator/console-logs/stream/route.js (route.GET at 17). 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.
+ 433 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 ProfilePage finding(s) in Cyclomatic Complexity — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 route.POST (cyclomatic 16) finding(s) in Cyclomatic Complexity — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
Resolve the 2 createSSEStream finding(s) in Cyclomatic Complexity — start with stream.js (2). — One of this dimension's main actionable groups (2 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.
+ 507 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 APIPageClient finding(s) in Cognitive Complexity — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 4 ProfilePage finding(s) in Cognitive Complexity — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 3 createSSEStream finding(s) in Cognitive Complexity — start with stream.js (3). — One of this dimension's main actionable groups (3 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 Classes0.0 / 10Critical✓ 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 107 FunctionTooLong finding(s) in God Classes — start with REDACTED (15), REDACTED (5), ConnectionsCard.js (2). — One of this dimension's main actionable groups (107 warning-level).
Resolve the 23 FileTooLong finding(s) in God Classes — start with REDACTED (5), REDACTED, REDACTED. — One of this dimension's main actionable groups (23 warning-level).
Resolve the 12 ClassTooLong finding(s) in God Classes — start with TokenSaverClient.js, kiro.js, OAuthModal.js. — One of this dimension's main actionable groups (12 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.
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
3 production modules (npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations, and main-sequence distance (abstractness) is not computed for these modules yet.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
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.
2733 test methods: 2724 unit, 0 integration, 0 BDD, 9 e2e. The JavaScript/TypeScript suite contributes 2733 `it`/`test` case(s) across 329 test file(s) declaring at least one; its tier split is read from package names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 5 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
18 skipped (18 with a documented reason), 5 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2732 tests.
No assertions: INSERT ${N_ITEMS} provider connections · ×5tests/unit/db-benchmark.test.js:53
Skipped (documented): does not inject Claude Code system prompt for compatible providers · ×18tests/translator/bugs-toClaude-context.test.js:15
What to do
Resolve the 5 No assertions finding(s) in Test Quality — start with db-benchmark.test.js (5). — One of this dimension's main actionable groups (5 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 17 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (17 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: 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: src/app/(dashboard)/dashboard/providers/[id]/page.js (18×364=6552); open-sse/handlers/chatCore.js (24×166=3984); src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js (16×158=2528) Repeated repair below the complexity floor: open-sse/config/appConstants.js (8 of 10 changes were fixes); REDACTED (5 of 9 changes were fixes); open-sse/utils/claudeCloaking.js (4 of 5 changes were fixes)
Resolve the 108 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (8), REDACTED (5), REDACTED (4). — One of this dimension's main actionable groups (108 warning-level).
Resolve the 4 Repeated repair finding(s) in Churn × Complexity Hotspots — start with appConstants.js, REDACTED, claudeCloaking.js. — One of this dimension's main actionable groups (4 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.6 / 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.
78 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is open-sse/executors/devin-cli.js. Counted over 550 of the 976 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
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_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 is a clear, well-written overview of the project (why it exists, its main value proposition, and links to the roadmap), while the cli/README.md and docs/superpowers/plans/* files are focused on the CLI tool itself and an implementation plan. The architecture doc is excellent: it explains what 9Router does, scopes in/out scope, gives a high-level system context diagram, and covers every core capability (provider auth, translation, fallback, cloud sync) with test coverage. All visible documents are complete per their own directory — the root README says nothing about installation/usage/contributing but is otherwise excellent; cli/README.md documents its own directory rather than the repository as a whole.
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: 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.
1 of 3 build units (npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
18 finding(s): 0 critical, 18 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 18 REDACTED finding(s) in Secrets (history) — start with REDACTED (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (18 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
89 finding(s): 0 critical, 59 high, 30 medium, 0 low. 18 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 3 file(s) — `open-sse/shared/clineAuth.js` (line 1), `src/app/api/version/route.js` (line 2), `src/shared/constants/config.js` (line 1) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 7 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 30 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8), REDACTED (6), REDACTED (3). — One of this dimension's main actionable groups (30 issue-level).
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED. — One of this dimension's main actionable groups (5 issue-level).
No action in Static Analysis (SAST) — all 18 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 (18 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over REDACTED.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
No known-vulnerable dependencies in the 1 ecosystem(s) that were scanned (npm). Partial dependency scan: 1 of 2 declared ecosystem(s) were scanned (npm), and the findings above are real and complete for them. REDACTED was not scanned (REDACTED: the scanner produced no output at all, so no dependency was actually scanned), so this is not the whole dependency surface and the result is reported at reduced confidence.
REDACTED
✓ On the Gold path — maintain.
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 High IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
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.
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.
9 of 550 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/lib/oauth/services/xai.js. Counted over 550 of the 976 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned files with no living knowledge
✓ On the Gold path — maintain.
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 7 Boundary-crossing change coupling finding(s) in Change Coupling — start with providerModels.js (2), config.js, REDACTED. — One of this dimension's main actionable groups (7 issue-level).
Resolve the 9 Change coupling finding(s) in Change Coupling — start with REDACTED (3), providerModels.js, ClaudeToolCard.js. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with REDACTED, requestDetailsDb.js. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
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.
No known-vulnerable dependencies in the 1 ecosystem(s) that were scanned (npm). Partial dependency scan: 1 of 2 declared ecosystem(s) were scanned (npm), and the findings above are real and complete for them. REDACTED was not scanned (REDACTED: the scanner produced no output at all, so no dependency was actually scanned), so this is not the whole dependency surface and the result is reported at reduced confidence.
REDACTED
✓ On the Gold path — maintain.
Detailed fixes: d43_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 33 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
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.
Add a README to the 1 of 2 project(s) that lack one — worth up to 1 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
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 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.
Only 1/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `cli`, `gitbook`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add OpenTelemetry tracing/metrics (@opentelemetry/sdk-node) so requests are traceable across the system, not just health-probable.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 25749 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
What to do
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. 82 of the 108 files that make outbound calls are unbounded; the first 10 are listed. — open-sse/executors/gemini-cli.js:60
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×9) — open-sse/executors/vertex.js:38, open-sse/handlers/embeddingsCore.js:99, open-sse/handlers/imageGenerationCore.js:110, …
What to do
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`downloadToFile` is async and calls unlinkSync, renameSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/xaiVideo.js:178
`run` is async and calls unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/xaiVideo.js:209
`run` is async and calls readdirSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/scripts/buildMitm.js:56
`createSqlJsAdapter` is async and calls existsSync, readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/db/adapters/sqljsAdapter.js:13
`runMigrationOnce` is async and calls existsSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/db/migrate.js:216
`execute` is async and calls mkdtempSync, mkdirSync, writeFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/executors/devin-cli.js:322
`readDesktopAccountCookies` is async and calls existsSync, copyFileSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/shared/mimoAccount.js:75
`createLogSession` is async and calls existsSync, mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/utils/requestLogger.js:37
`createRequestLogger` is async and calls appendFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/utils/requestLogger.js:117
`translateToLanguage` is async and calls existsSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/translate-readme.js:40
`main` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/translate-readme.js:141
`GET` is async and calls readFileSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/app/api/models/catalog-sync/route.js:7
`GET` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/app/api/translator/load/route.js:5
`POST` is async and calls existsSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/app/api/translator/save/route.js:5
`killAppProcesses` is async and calls execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:139
`startHeadroomProxy` is async and calls openSync, closeSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/headroom/process.js:55
`installHeadroomExtras` is async and calls openSync, closeSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/headroom/process.js:166
`uninstallHeadroomExtras` is async and calls openSync, closeSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/headroom/process.js:213
`runInstall` is async and calls existsSync, writeFileSync, openSync, writeSync, closeSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/pxpipe/install.js:74
`_ensureCloudflared` is async and calls existsSync, mkdirSync, unlinkSync, chmodSync, execSync, renameSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:145
`spawnQuickTunnel` is async and calls mkdtempSync, writeFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:275
`installTailscaleMac` is async and calls execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:294
`installTailscaleLinux` is async and calls writeFileSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:369
`installTailscaleWindows` is async and calls unlinkSync, existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:420
`ensureUserOwnedDir` is async and calls existsSync, mkdirSync, statSync, readdirSync, execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:477
`startDaemonWithPassword` is async and calls execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:533
`startFunnel` is async and calls execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:741
`provisionCert` is async and calls mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:819
`stopDaemon` is async and calls execSync, existsSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:845
`addDNSEntry` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/mitm/dns/dnsConfig.js:146
`removeDNSEntry` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/mitm/dns/dnsConfig.js:185
`installCert` is async and calls existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:86
`killLeftoverMitm` is async and calls existsSync, readFileSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:315
`getMitmStatus` is async and calls existsSync, readFileSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:375
`killPort443Owner` is async and calls execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:452
`startServer` is async and calls existsSync, readFileSync, unlinkSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:471
`stopServer` is async and calls readFileSync, writeFileSync, execSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:746
`trustCert` is async and calls existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:846
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ 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.
0 typed · 1323 plain JS — the untyped files are REDACTED, cli/hooks/postinstall.js, cli/hooks/sqliteRuntime.js, cli/hooks/trayRuntime.js, cli/scripts/build-cli.js, cli/scripts/buildMitm.js (+1317 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
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.
52 duplicated blocks under src/ have copies in at least two of the sibling directories app, i18n, lib, mitm, shared, sse — 37 of them are reported below, and 15 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 52 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 52 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 52 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. — src/app/(dashboard)/dashboard/combos/page.js:977
36 duplicated blocks under src/app/(dashboard)/dashboard/ have copies in at least two of the sibling directories basic-chat, cli-tools, combos, endpoint, media-providers, mitm (+6 more sibling(s) not listed) — 20 of them are reported below, and 16 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 36 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 36 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 36 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. — src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js:141
31 duplicated blocks under src/app/api/cli-tools/ have copies in at least two of the sibling directories antigravity-mitm, claude-settings, cline-settings, codewhale-settings, codex-settings, copilot-settings (+14 more sibling(s) not listed) — 21 of them are reported below, and 10 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 31 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 31 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 31 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. — src/app/api/cli-tools/crush-settings/route.js:15
30 duplicated blocks under src/app/api/ have copies in at least two of the sibling directories auth, cli-tools, combos, headroom, keys, mcp (+13 more sibling(s) not listed) — 19 of them are reported below, and 11 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 30 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 30 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 30 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. — src/app/api/providers/[id]/models/route.js:484
28 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, gitbook, open-sse, src — 26 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 28 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 28 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 28 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. — cli/src/cli/api/client.js:46
19 duplicated blocks under src/app/(dashboard)/dashboard/providers/ have copies in at least two of the sibling directories [id], components — 16 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 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 19 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:11
16 duplicated blocks under open-sse/ have copies in at least two of the sibling directories executors, services, shared, transformer, translator, utils — 13 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 16 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 16 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 16 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — open-sse/executors/cursor.js:401
11 duplicated blocks under src/lib/oauth/ have copies in at least two of the sibling directories providers, services — 10 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 11 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 11 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 11 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. — src/lib/oauth/providers/xai.js:11
10 duplicated blocks under src/app/api/oauth/ have copies in at least two of the sibling directories [provider], codex, cursor, gitlab, grok-cli, iflow (+3 more sibling(s) not listed) — 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. — src/app/api/oauth/codex/bulk-import/route.js:19
8 duplicated blocks under src/app/ have copies in at least two of the sibling directories (dashboard), api, callback, dashboard, login — 2 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 8 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.js:204
6 duplicated blocks under open-sse/translator/ have copies in at least two of the sibling directories concerns, formats, request — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — open-sse/translator/formats/responsesApi.js:84
6 duplicated blocks under src/app/api/v1/ have copies in at least two of the sibling directories api, audio, chat, embeddings, images, messages (+6 more sibling(s) not listed) — 4 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/app/api/v1/chat/completions/route.js:4
5 duplicated blocks under src/app/api/media-providers/tts/ have copies in at least two of the sibling directories deepgram, elevenlabs, inworld, minimax, voices — 4 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/app/api/media-providers/tts/deepgram/voices/route.js:4
src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js:26 · src/app/(dashboard)/dashboard/cli-tools/components/OpenClawToolCard.js:27 — the two spans are one implementation copied and then locally edited — 1564 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. — src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js:26
open-sse/translator/request/claude-to-kiro.js:46 · open-sse/translator/request/openai-to-kiro.js:44 — the two spans are one implementation copied and then locally edited — 1476 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. — open-sse/translator/request/claude-to-kiro.js:46
src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js:45 · src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:49 — the two spans are one implementation copied and then locally edited — 1331 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. — src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js:45
src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:22 · src/app/(dashboard)/dashboard/cli-tools/components/OpenCodeToolCard.js:27 — the two spans are one implementation copied and then locally edited — 1303 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. — src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:22
src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.js:3 · src/app/(dashboard)/dashboard/cli-tools/components/KiloToolCard.js:3 — these 2 files are line-for-line copies of one another — 166 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.js:3
src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:181 · src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js:107 — the two spans are one implementation copied and then locally edited — 925 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. — src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:181
src/lib/oauth/services/antigravity.js:12 · src/lib/oauth/services/gemini.js:12 — the two spans are one implementation copied and then locally edited — 806 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. — src/lib/oauth/services/antigravity.js:12
src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:11 · src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:36 — the two spans are one implementation copied and then locally edited — 1191 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. — src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:11
src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:131 · src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js:162 — the two spans are one implementation copied and then locally edited — 902 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:131
src/app/(dashboard)/dashboard/providers/[id]/CompatibleModelsSection.js:7 · src/app/(dashboard)/dashboard/providers/[id]/PassthroughModelsSection.js:8 — the two spans are one implementation copied and then locally edited — 664 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/app/(dashboard)/dashboard/providers/[id]/CompatibleModelsSection.js:7
open-sse/translator/response/kiro-to-claude.js:19 · open-sse/translator/response/openai-to-claude.js:50 — the two spans are one implementation copied and then locally edited — 798 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. — open-sse/translator/response/kiro-to-claude.js:19
src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:240 · src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:106 — the two spans are one implementation copied and then locally edited — 606 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. — src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:240
src/app/(dashboard)/dashboard/combos/page.js:977 · src/shared/components/ComboFormModal.js:34 — the two spans are one implementation copied and then locally edited — 1011 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. — src/app/(dashboard)/dashboard/combos/page.js:977
src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:31 · src/shared/components/EditConnectionModal.js:15 — the two spans are one implementation copied and then locally edited — 614 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. — src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:31
src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:15 · src/app/(dashboard)/dashboard/media-providers/web/page.js:10 — the two spans are one implementation copied and then locally edited — 964 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. — src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:15
src/app/api/cli-tools/crush-settings/route.js:15 · src/app/api/cli-tools/pi-settings/route.js:15 — the two spans are one implementation copied and then locally edited — 743 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. — src/app/api/cli-tools/crush-settings/route.js:15
src/sse/handlers/fetch.js:37 · src/sse/handlers/search.js:34 — the two spans are one implementation copied and then locally edited — 725 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. — src/sse/handlers/fetch.js:37
open-sse/executors/opencode-go.js:67 · open-sse/executors/opencode-zen.js:183 — the two spans are one implementation copied and then locally edited — 864 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. — open-sse/executors/opencode-go.js:67
src/sse/handlers/embeddings.js:32 · src/sse/handlers/systemone.js:23 — the two spans are one implementation copied and then locally edited — 707 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/sse/handlers/embeddings.js:32
src/app/api/cli-tools/droid-settings/route.js:10 · src/app/api/cli-tools/openclaw-settings/route.js:19 — the two spans are one implementation copied and then locally edited — 585 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. — src/app/api/cli-tools/droid-settings/route.js:10
open-sse/translator/request/antigravity-to-openai.js:39 · open-sse/translator/request/gemini-to-openai.js:27 — the two spans are one implementation copied and then locally edited — 596 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. — open-sse/translator/request/antigravity-to-openai.js:39
src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js:23 · REDACTED:52 — the two spans are one implementation copied and then locally edited — 549 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. — src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js:23
src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.js:87 · src/shared/components/AddCustomEmbeddingModal.js:63 — the two spans are one implementation copied and then locally edited — 507 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. — src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.js:87
open-sse/services/usage/opencode-go.js:25 · open-sse/services/usage/opencode-zen.js:25 — 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. — open-sse/services/usage/opencode-go.js:25
src/lib/db/repos/nodesRepo.js:5 · src/lib/db/repos/proxyPoolsRepo.js:5 — the two spans are one implementation copied and then locally edited — 539 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. — src/lib/db/repos/nodesRepo.js:5
src/app/api/cli-tools/codewhale-settings/route.js:3 · src/app/api/cli-tools/forge-settings/route.js:3 — these 2 files are line-for-line copies of one another — 74 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — src/app/api/cli-tools/codewhale-settings/route.js:3
open-sse/translator/formats/responsesApi.js:84 · open-sse/translator/request/openai-responses.js:22 — the two spans are one implementation copied and then locally edited — 499 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. — open-sse/translator/formats/responsesApi.js:84
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.
custom-server.js:135 imports next/dist/bin/next, 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. — custom-server.js:135
src/shared/components/UsageStats.js:15 imports src/app/(dashboard)/dashboard/usage/components/OverviewCards.js against the feature-sliced rules. — src/shared/components/UsageStats.js:15
src/shared/components/UsageStats.js:16 imports src/app/(dashboard)/dashboard/usage/components/UsageTable.js against the feature-sliced rules. — src/shared/components/UsageStats.js:16
src/shared/components/UsageStats.js:19 imports src/app/(dashboard)/dashboard/usage/components/ProviderTopology.js against the feature-sliced rules. — src/shared/components/UsageStats.js:19
src/shared/components/UsageStats.js:20 imports src/app/(dashboard)/dashboard/usage/components/UsageChart.js against the feature-sliced rules. — src/shared/components/UsageStats.js:20
src/shared/components/UsageStats.js:21 imports src/app/(dashboard)/dashboard/usage/components/ProviderBarChart.js against the feature-sliced rules. — src/shared/components/UsageStats.js:21
src/shared/components/UsageStats.js:22 imports src/app/(dashboard)/dashboard/usage/components/TopModelsChart.js against the feature-sliced rules. — src/shared/components/UsageStats.js:22
src/shared/components/layouts/DashboardLayout.js:44 imports src/app/(dashboard)/dashboard/usage/components/UsageChart.js against the feature-sliced rules. — src/shared/components/layouts/DashboardLayout.js:44
src/shared/components/layouts/DashboardLayout.js:45 imports src/app/(dashboard)/dashboard/usage/components/ProviderBarChart.js against the feature-sliced rules. — src/shared/components/layouts/DashboardLayout.js:45
src/shared/components/layouts/DashboardLayout.js:46 imports src/app/(dashboard)/dashboard/usage/components/TopModelsChart.js against the feature-sliced rules. — src/shared/components/layouts/DashboardLayout.js:46
src/shared/services/quotaAutoPing.js:11 imports src/app/api/usage/[connectionId]/route.js against the feature-sliced rules. — src/shared/services/quotaAutoPing.js:11
What to do
Fix the listed violations: respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (10 rows); import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (1 row).
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.
handleChatCore has cyclomatic complexity 165 and cognitive complexity 203; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — open-sse/handlers/chatCore.js:63
getUsageStats has cyclomatic complexity 148 and cognitive complexity 257; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — src/lib/db/repos/usageRepo.js:347
testApiKeyConnection has cyclomatic complexity 142 and cognitive complexity 147; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/app/api/providers/[id]/test/testUtils.js:496
POST has cyclomatic complexity 134 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — src/app/api/providers/validate/route.js:85
transform has cyclomatic complexity 94 and cognitive complexity 201; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — open-sse/utils/stream.js:137
ProfilePage has cyclomatic complexity 80 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:22
applyFormat has cyclomatic complexity 79 and cognitive complexity 103; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — open-sse/translator/concerns/thinkingUnified.js:254
pingModelByKind has cyclomatic complexity 78 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/app/api/models/test/ping.js:55
buildModelsList has cyclomatic complexity 76 and cognitive complexity 160; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — src/app/api/v1/models/route.js:319
(anonymous) has cyclomatic complexity 74 and cognitive complexity 112; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — open-sse/executors/devin-cli.js:600
openaiResponsesToOpenAIResponse has cyclomatic complexity 74 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — open-sse/translator/response/openai-responses.js:510
translateNonStreamingResponse has cyclomatic complexity 70 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — open-sse/handlers/chatCore/nonStreamingHandler.js:147
parseGrokCliBilling has cyclomatic complexity 70 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 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. — open-sse/services/usage/grok-cli.js:141
startServer has cyclomatic complexity 69 and cognitive complexity 119; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:471
processEvent has cyclomatic complexity 69 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — open-sse/executors/kiro.js:792
handleForcedSSEToJson has cyclomatic complexity 69 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — open-sse/handlers/chatCore/sseToJsonHandler.js:183
ConnectionRow has cyclomatic complexity 68 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. — src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:9
openaiToGeminiBase has cyclomatic complexity 67 and cognitive complexity 175; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — open-sse/translator/request/openai-to-gemini.js:40
POST has cyclomatic complexity 67 and cognitive complexity 113; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/app/api/oauth/[provider]/[action]/route.js:296
APIPageClient has cyclomatic complexity 62 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. — REDACTED:21
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files7.2 / 10Strong✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
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 Coverage6.0 / 10Adequate✓ 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.
tests/unit/embeddings.cloud.test.js:65 imports '../../cloud/src/services/storage.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tests/unit/embeddings.cloud.test.js
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. (×39) — src/app/(dashboard)/dashboard/providers/[id]/page.js, REDACTED, REDACTED, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling3.4 / 10Weak✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
This repository declares test tooling, and the ✓ above records that declaration — but tests/unit/embeddings.cloud.test.js cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — tests/unit/embeddings.cloud.test.js
What to do
Add eslint and type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code6.4 / 10Adequate✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 247 application, 11 tooling and 349 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/lib/oauth/services/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×7) — src/lib/oauth/services/antigravity.js, src/lib/oauth/services/gemini.js, src/lib/oauth/services/github.js, …
no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×30) — scripts/migrate-registry.mjs, src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js, REDACTED, …
no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaProgressBar.js
no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/shared/constants/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — src/shared/constants/colors.js
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json. — open-sse/utils/proxyFetch.js:20
Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×3) — REDACTED:167, REDACTED:165, tests/unit/claude-header-forwarding.test.js:286
Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
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.
open-sse/translator/index.js → open-sse/translator/request/antigravity-to-openai.js → open-sse/translator/index.js (one verified cycle inside a mutually-dependent group of 23 files) — open-sse/translator/index.js
src/shared/components/AddCustomEmbeddingModal.js → src/shared/components/index.js → src/shared/components/AddCustomEmbeddingModal.js (one verified cycle inside a mutually-dependent group of 11 files) — src/shared/components/AddCustomEmbeddingModal.js
What to do
Break each cycle by extracting the shared piece into a module both sides can import.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 5 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 29 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 32 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: 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.
Not included — 71 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.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — Not applicable: TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
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 — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 14 — a file the compose project references is missing) — env file .env not found: stat .env: no such file or directory; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: this repository stores data through 'better-sqlite3' (src/app/api/cli-tools/omp-settings/route.js:129) but declares no persisted model this check reads (TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entities, Mongoose schemas, Sequelize or Drizzle tables, Knex migrations, Prisma models). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
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.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D12 Dependency Hygiene — Dependency currency not established — this repository commits no lockfile to resolve
D14 License Compliance — npm licences not graded — this npm repository commits no lockfile this pass can resolve
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — 3 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — tests/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
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
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not applicable: TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
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.
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.
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X27 Collection changed while being enumerated — not 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
X28 Index access outside its own emptiness guard — 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
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 — 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
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
Boundary-crossing change coupling: config.js ↔ cliTools.js src/mitm/config.js— `src/mitm/config.js` (context mitm) and `src/shared/constants/cliTools.js` (context shared) sit in DIFFERENT parts of the tree yet change together 92% of the time (12 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `70f15aa5` feat(antigravity,gemini): add Gemini 3.8 Flash support and bump IDE f…; `86694ed8` feat(antigravity): add Gemini 3.7 Flash models (#3286, #3281); `5b417f9b` fix(kiro): intercept chat via x-amz-target and prepend initial-respon… — run `git show` on any of them.
Boundary-crossing change coupling: REDACTED ↔ REDACTED REDACTED— `REDACTED` (context (dashboard)) and `REDACTED` (context mitm) sit in DIFFERENT parts of the tree yet change together 75% of the time (9 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `b39eb61c` chore: release v0.4.27; `4ba546af` Enhance token refresh logic and improve MITM server handling; `e40f7ffb` fix(mitm): gate sudo prompts on server platform (#822) — run `git show` on any of them.
Boundary-crossing change coupling: model.js ↔ REDACTED open-sse/services/model.js— `open-sse/services/model.js` (context open-sse) and `src/shared/constants/providers.js` (context shared) sit in DIFFERENT parts of the tree yet change together 65% of the time (15 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `a6fd8469` feat(qoder): port Kiro-style provider integration with COSY signing; `93265894` Add Vercel AI Gateway provider support (#1183); `d26db17f` Add xiaomi token plan provider — run `git show` on any of them.
Boundary-crossing change coupling: MitmToolCard.js ↔ REDACTED src/app/(dashboard)/dashboard/cli-tools/components/MitmToolCard.js— `src/app/(dashboard)/dashboard/cli-tools/components/MitmToolCard.js` (context (dashboard)) and `REDACTED` (context mitm) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `4ba546af` Enhance token refresh logic and improve MITM server handling; `e40f7ffb` fix(mitm): gate sudo prompts on server platform (#822); `c8d24974` refactor: update MitmServerCard and MitmToolCard to use modalError in… — run `git show` on any of them.
Boundary-crossing change coupling: providerModels.js ↔ REDACTED open-sse/config/providerModels.js— `open-sse/config/providerModels.js` (context open-sse) and `src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js` (context (dashboard)) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `787d2480` Add Cloudflare Workers AI image generation (#973); `512e3de3` Update version to 0.4.9, enhance README with Trendshift badge, and ad…; `1bb62131` Add Cloudflare AI provider support and enhance connection management — run `git show` on any of them.
Boundary-crossing change coupling: REDACTED ↔ REDACTED REDACTED— `REDACTED` (context open-sse) and `src/shared/constants/providers.js` (context shared) sit in DIFFERENT parts of the tree yet change together 52% of the time (21 of the 40 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 21 shared commits counted here, the most recent 3 are `b33cbb02` feat(vercel-ai-gateway): support embeddings, images and credit usage; `b40e96d0` feat(provider): add MiMo Free no-auth provider; `a6fd8469` feat(qoder): port Kiro-style provider integration with COSY signing — run `git show` on any of them.
Boundary-crossing change coupling: providerModels.js ↔ config.js open-sse/config/providerModels.js— `open-sse/config/providerModels.js` (context open-sse) and `src/shared/constants/config.js` (context shared) sit in DIFFERENT parts of the tree yet change together 50% of the time (11 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `14ff69bf` - Added BytePlus Provider; `f2e7a98c` feat: add built-in Volcengine Ark provider support (#741); `abb04c53` feat: add support for Grok Web and Perplexity Web providers — run `git show` on any of them.
Unlisted import 'got-scraping' tests/unit/claude-header-forwarding.test.js:286— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Hotspot: src/app/(dashboard)/dashboard/providers/[id]/page.js src/app/(dashboard)/dashboard/providers/[id]/page.js:39— src/app/(dashboard)/dashboard/providers/[id]/page.js changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 364 in page.ProviderDetailPage at line 39. 7 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/(dashboard)/dashboard/providers/[id]/page.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.
Hotspot: open-sse/handlers/chatCore.js open-sse/handlers/chatCore.js:63— open-sse/handlers/chatCore.js changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 166 in chatCore.handleChatCore at line 63. 13 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/handlers/chatCore.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.
Hotspot: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:356— src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 158 in utils.parseQuotaData at line 356. 4 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.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.
Hotspot: REDACTED REDACTED:154— REDACTED changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 224 in index.ProviderLimits at line 154. 4 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07: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: src/app/api/providers/[id]/test/testUtils.js src/app/api/providers/[id]/test/testUtils.js:496— src/app/api/providers/[id]/test/testUtils.js changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 142 in testApiKeyConnection at line 496. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/api/providers/[id]/test/testUtils.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.
Hotspot: src/shared/components/OAuthModal.js src/shared/components/OAuthModal.js:38— src/shared/components/OAuthModal.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 205 in OAuthModal.OAuthModal at line 38. 3 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/shared/components/OAuthModal.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.
Hotspot: open-sse/utils/stream.js open-sse/utils/stream.js:44— open-sse/utils/stream.js changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 148 in stream.createSSEStream at line 44. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/utils/stream.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.
Hotspot: src/app/api/v1/models/route.js src/app/api/v1/models/route.js:319— src/app/api/v1/models/route.js changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in route.buildModelsList at line 319. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/api/v1/models/route.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.
Hotspot: open-sse/translator/concerns/thinkingUnified.js open-sse/translator/concerns/thinkingUnified.js:254— open-sse/translator/concerns/thinkingUnified.js changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in thinkingUnified.applyFormat at line 254. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/translator/concerns/thinkingUnified.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.
Hotspot: open-sse/executors/kiro.js open-sse/executors/kiro.js:629— open-sse/executors/kiro.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 172 in KiroExecutor.transformEventStreamToSSE at line 629. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/executors/kiro.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.
Hotspot: src/lib/db/repos/usageRepo.js src/lib/db/repos/usageRepo.js:347— src/lib/db/repos/usageRepo.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 162 in usageRepo.getUsageStats at line 347. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/lib/db/repos/usageRepo.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.
Hotspot: open-sse/translator/formats/claude.js open-sse/translator/formats/claude.js:485— open-sse/translator/formats/claude.js changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in claude.prepareClaudeRequest at line 485. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/translator/formats/claude.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.
Hotspot: open-sse/translator/request/openai-to-kiro.js open-sse/translator/request/openai-to-kiro.js:43— open-sse/translator/request/openai-to-kiro.js changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in openai-to-kiro.convertMessages at line 43. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/translator/request/openai-to-kiro.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.
Hotspot: src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13— src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 120 in TokenSaverClient.TokenSaverClient at line 13. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.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.
Hotspot: src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:37— src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 141 in GenericExampleCard.GenericExampleCard at line 37. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.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.
Hotspot: open-sse/translator/request/claude-to-kiro.js open-sse/translator/request/claude-to-kiro.js:45— open-sse/translator/request/claude-to-kiro.js changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in claude-to-kiro.convertClaudeMessagesToKiro at line 45. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/translator/request/claude-to-kiro.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.
Hotspot: src/app/api/providers/validate/route.js src/app/api/providers/validate/route.js:85— src/app/api/providers/validate/route.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 138 in route.POST at line 85. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/api/providers/validate/route.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.
Hotspot: src/app/api/oauth/[provider]/[action]/route.js src/app/api/oauth/[provider]/[action]/route.js:296— src/app/api/oauth/[provider]/[action]/route.js changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in route.POST at line 296. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/api/oauth/[provider]/[action]/route.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.
Hotspot: open-sse/providers/capabilities.js open-sse/providers/capabilities.js:623— open-sse/providers/capabilities.js changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in capabilities.getCapabilitiesForModel at line 623. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/providers/capabilities.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.
Hotspot: REDACTED REDACTED:99— REDACTED changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in page.ProvidersPage 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-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07: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: src/app/(dashboard)/dashboard/combos/page.js src/app/(dashboard)/dashboard/combos/page.js:55— src/app/(dashboard)/dashboard/combos/page.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in page.CombosPage at line 55. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/app/(dashboard)/dashboard/combos/page.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.
Hotspot: open-sse/translator/request/openai-responses.js open-sse/translator/request/openai-responses.js:22— open-sse/translator/request/openai-responses.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in openai-responses.openaiResponsesToOpenAIRequest at line 22. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/translator/request/openai-responses.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.
Hotspot: open-sse/handlers/chatCore/sseToJsonHandler.js open-sse/handlers/chatCore/sseToJsonHandler.js:183— open-sse/handlers/chatCore/sseToJsonHandler.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in sseToJsonHandler.handleForcedSSEToJson at line 183. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/handlers/chatCore/sseToJsonHandler.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.
Hotspot: src/sse/handlers/chat.js src/sse/handlers/chat.js:167— src/sse/handlers/chat.js changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in chat.handleSingleModelChat at line 167. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/sse/handlers/chat.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.
Hotspot: src/sse/services/auth.js src/sse/services/auth.js:28— src/sse/services/auth.js changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in auth.getProviderCredentials at line 28. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- src/sse/services/auth.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.
FunctionTooLong: page.ProviderDetailPage src/app/(dashboard)/dashboard/providers/[id]/page.js:39— FunctionTooLong — ProviderDetailPage runs 1524 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1424 over it, 15.24× 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: page.ProfilePage REDACTED:22— FunctionTooLong — ProfilePage runs 1397 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1297 over it, 13.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: index.ProviderLimits REDACTED:154— FunctionTooLong — ProviderLimits runs 1216 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1116 over it, 12.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: EndpointPageClient.APIPageClient REDACTED:21— FunctionTooLong — APIPageClient runs 1043 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 943 over it, 10.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: TokenSaverClient.TokenSaverClient src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13— FunctionTooLong — TokenSaverClient runs 888 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 788 over it, 8.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: page.ProxyPoolsPage src/app/(dashboard)/dashboard/proxy-pools/page.js:30— FunctionTooLong — ProxyPoolsPage runs 858 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 758 over it, 8.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: OAuthModal.OAuthModal src/shared/components/OAuthModal.js:38— FunctionTooLong — OAuthModal runs 697 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 597 over it, 6.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: BasicChatPageClient.BasicChatPageClient src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:169— FunctionTooLong — BasicChatPageClient runs 633 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 533 over it, 6.33× 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: CodexToolCard.CodexToolCard src/app/(dashboard)/dashboard/cli-tools/components/CodexToolCard.js:13— FunctionTooLong — CodexToolCard runs 526 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 426 over it, 5.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: GenericCliToolCard.GenericCliToolCard src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:12— FunctionTooLong — GenericCliToolCard runs 503 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 403 over it, 5.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.ProvidersPage REDACTED:99— FunctionTooLong — ProvidersPage runs 491 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 391 over it, 4.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: TtsExampleCard.TtsExampleCard src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:21— FunctionTooLong — TtsExampleCard runs 490 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 390 over it, 4.90× 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: CoworkToolCard.CoworkToolCard src/app/(dashboard)/dashboard/cli-tools/components/CoworkToolCard.js:19— FunctionTooLong — CoworkToolCard runs 485 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 385 over it, 4.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: GenericExampleCard.GenericExampleCard src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:37— FunctionTooLong — GenericExampleCard runs 475 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 375 over it, 4.75× 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: KiroAuthModal.KiroAuthModal src/shared/components/KiroAuthModal.js:11— FunctionTooLong — KiroAuthModal runs 473 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 373 over it, 4.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ModelSelectModal.ModelSelectModal REDACTED:73— FunctionTooLong — ModelSelectModal runs 418 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 318 over it, 4.18× 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: route.POST src/app/api/providers/validate/route.js:85— FunctionTooLong — POST runs 412 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 312 over it, 4.12× 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: OpenCodeToolCard.OpenCodeToolCard src/app/(dashboard)/dashboard/cli-tools/components/OpenCodeToolCard.js:11— FunctionTooLong — OpenCodeToolCard runs 403 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 303 over it, 4.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.CombosPage src/app/(dashboard)/dashboard/combos/page.js:55— FunctionTooLong — CombosPage runs 401 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 301 over it, 4.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.
FunctionTooLong: AntigravityToolCard.AntigravityToolCard src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.js:7— FunctionTooLong — AntigravityToolCard runs 378 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 278 over it, 3.78× 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: ClaudeToolCard.ClaudeToolCard src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:29— FunctionTooLong — ClaudeToolCard runs 364 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 264 over it, 3.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: RequestDetailsTab.RequestDetailsTab src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js:102— FunctionTooLong — RequestDetailsTab runs 357 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 257 over it, 3.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: DroidToolCard.DroidToolCard src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js:13— FunctionTooLong — DroidToolCard runs 328 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 228 over it, 3.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: AddApiKeyModal.AddApiKeyModal src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:11— FunctionTooLong — AddApiKeyModal runs 328 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 228 over it, 3.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: HermesToolCard.HermesToolCard src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:15— FunctionTooLong — HermesToolCard runs 313 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 213 over it, 3.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
+ 82 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×39
No test reaches this file src/app/(dashboard)/dashboard/providers/[id]/page.js— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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 src/app/(dashboard)/dashboard/combos/page.js— 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 src/app/(dashboard)/dashboard/proxy-pools/page.js— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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 src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js— 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 src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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 src/app/api/providers/validate/route.js— 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 src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js— 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 src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js— 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 src/app/(dashboard)/dashboard/cli-tools/components/CoworkToolCard.js— 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 src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js— 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 src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js— 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 src/app/(dashboard)/dashboard/cli-tools/components/OpenCodeToolCard.js— 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 src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js— 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 src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js— 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 src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.js— 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 src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js— 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 src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js— 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 src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED— 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 src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js— 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.
Sync-over-async blocking cli/src/cli/commands/xaiVideo.js:178— `downloadToFile` is async and calls unlinkSync, renameSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking cli/src/cli/commands/xaiVideo.js:209— `run` is async and calls unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking cli/scripts/buildMitm.js:56— `run` is async and calls readdirSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/lib/db/adapters/sqljsAdapter.js:13— `createSqlJsAdapter` is async and calls existsSync, readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/lib/db/migrate.js:216— `runMigrationOnce` is async and calls existsSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking open-sse/executors/devin-cli.js:322— `execute` is async and calls mkdtempSync, mkdirSync, writeFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking open-sse/shared/mimoAccount.js:75— `readDesktopAccountCookies` is async and calls existsSync, copyFileSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking open-sse/utils/requestLogger.js:37— `createLogSession` is async and calls existsSync, mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking open-sse/utils/requestLogger.js:117— `createRequestLogger` is async and calls appendFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/translate-readme.js:40— `translateToLanguage` is async and calls existsSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/translate-readme.js:141— `main` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/app/api/models/catalog-sync/route.js:7— `GET` is async and calls readFileSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/app/api/translator/load/route.js:5— `GET` is async and calls existsSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/app/api/translator/save/route.js:5— `POST` is async and calls existsSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:139— `killAppProcesses` is async and calls execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/lib/headroom/process.js:55— `startHeadroomProxy` is async and calls openSync, closeSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/lib/headroom/process.js:166— `installHeadroomExtras` is async and calls openSync, closeSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/lib/headroom/process.js:213— `uninstallHeadroomExtras` is async and calls openSync, closeSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/lib/pxpipe/install.js:74— `runInstall` is async and calls existsSync, writeFileSync, openSync, writeSync, closeSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:145— `_ensureCloudflared` is async and calls existsSync, mkdirSync, unlinkSync, chmodSync, execSync, renameSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:275— `spawnQuickTunnel` is async and calls mkdtempSync, writeFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:294— `installTailscaleMac` is async and calls execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:369— `installTailscaleLinux` is async and calls writeFileSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:420— `installTailscaleWindows` is async and calls unlinkSync, existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:477— `ensureUserOwnedDir` is async and calls existsSync, mkdirSync, statSync, readdirSync, execSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
FileTooLong: [id]/page.js src/app/(dashboard)/dashboard/providers/[id]/page.js— FileTooLong — 1555 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 98% of them inside a single declaration: ProviderDetailPage (39-1969). The bar is 1500 significant lines; this is 55 over it, 1.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1414 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ProfilePage (22-1702). The bar is 500 significant lines; this is 914 over it, 2.83× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1330 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 91% of them inside a single declaration: ProviderLimits (154-1653). The bar is 500 significant lines; this is 830 over it, 2.66× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1064 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: APIPageClient (21-1297). The bar is 500 significant lines; this is 564 over it, 2.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: combos/page.js src/app/(dashboard)/dashboard/combos/page.js— FileTooLong — 988 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 488 over it, 1.98× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: executors/kiro.js open-sse/executors/kiro.js— FileTooLong — 957 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 75% of them inside a single declaration: KiroExecutor (230-1210). The bar is 500 significant lines; this is 457 over it, 1.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: token-saver/TokenSaverClient.js src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js— FileTooLong — 898 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: TokenSaverClient (13-1036). The bar is 500 significant lines; this is 398 over it, 1.80× 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: proxy-pools/page.js src/app/(dashboard)/dashboard/proxy-pools/page.js— FileTooLong — 878 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ProxyPoolsPage (30-1063). The bar is 500 significant lines; this is 378 over it, 1.76× 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: executors/cursor.js open-sse/executors/cursor.js— FileTooLong — 872 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 372 over it, 1.74× 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 — 863 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 363 over it, 1.73× 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: basic-chat/BasicChatPageClient.js src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js— FileTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 85% of them inside a single declaration: BasicChatPageClient (169-967). The bar is 500 significant lines; this is 249 over it, 1.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: components/OAuthModal.js src/shared/components/OAuthModal.js— FileTooLong — 728 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: OAuthModal (38-991). The bar is 500 significant lines; this is 228 over it, 1.46× 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: utils/cursorProtobuf.js open-sse/utils/cursorProtobuf.js— FileTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 195 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: utils/server.js src/lib/oauth/utils/server.js— FileTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 146 over it, 1.29× 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 — 614 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 114 over it, 1.23× 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: repos/usageRepo.js src/lib/db/repos/usageRepo.js— FileTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 95 over it, 1.19× 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 — 575 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 75 over it, 1.15× 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 — 570 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 70 over it, 1.14× 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: menus/providers.js cli/src/cli/menus/providers.js— FileTooLong — 551 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 51 over it, 1.10× 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/CodexToolCard.js src/app/(dashboard)/dashboard/cli-tools/components/CodexToolCard.js— FileTooLong — 536 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: CodexToolCard (13-651). The bar is 500 significant lines; this is 36 over it, 1.07× 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: executors/devin-cli.js open-sse/executors/devin-cli.js— FileTooLong — 521 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 64% of them inside a single declaration: DevinCliExecutor (305-823). The bar is 500 significant lines; this is 21 over it, 1.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: components/GenericCliToolCard.js src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js— FileTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: GenericCliToolCard (12-636). The bar is 500 significant lines; this is 12 over it, 1.02× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: components/TtsExampleCard.js src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js— FileTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: TtsExampleCard (21-612). The bar is 500 significant lines; this is 5 over it, 1.01× 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.
ClassTooLong: TokenSaverClient src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:1— ClassTooLong — 888 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 488 over it, 2.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: KiroExecutor open-sse/executors/kiro.js:230— ClassTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 318 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OAuthModal src/shared/components/OAuthModal.js:1— ClassTooLong — 697 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 297 over it, 1.74× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BasicChatPageClient src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:1— ClassTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 233 over it, 1.58× 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: CodexToolCard src/app/(dashboard)/dashboard/cli-tools/components/CodexToolCard.js:1— ClassTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 126 over it, 1.32× 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: GenericCliToolCard src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:1— ClassTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 103 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: TtsExampleCard src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:1— ClassTooLong — 490 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 90 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CoworkToolCard src/app/(dashboard)/dashboard/cli-tools/components/CoworkToolCard.js:1— ClassTooLong — 485 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 85 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GenericExampleCard src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:1— ClassTooLong — 475 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 75 over it, 1.19× 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: KiroAuthModal src/shared/components/KiroAuthModal.js:1— ClassTooLong — 473 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 73 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ModelSelectModal REDACTED:1— ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 18 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OpenCodeToolCard src/app/(dashboard)/dashboard/cli-tools/components/OpenCodeToolCard.js:1— ClassTooLong — 403 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 3 over it, 1.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.
Outbound HTTP without resilience open-sse/executors/gemini-cli.js:60— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. 82 of the 108 files that make outbound calls are unbounded; the first 10 are listed.
Outbound HTTP without resilience open-sse/executors/vertex.js:38— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience open-sse/handlers/embeddingsCore.js:99— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience open-sse/handlers/imageGenerationCore.js:110— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience open-sse/handlers/imageProviders/_base.js:23— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience open-sse/handlers/imageProviders/blackForestLabs.js:31— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience open-sse/handlers/imageProviders/falAi.js:25— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience open-sse/handlers/imageProviders/nanobanana.js:46— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience open-sse/handlers/imageProviders/runwayml.js:36— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience open-sse/handlers/sttCore.js:48— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Change coupling: REDACTED ↔ OAuthModal.js src/app/api/oauth/[provider]/[action]/route.js— `src/app/api/oauth/[provider]/[action]/route.js` and `src/shared/components/OAuthModal.js` change together 80% of the time (16 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `068ce87d` feat(glm): add Z.ai OAuth login to GLM Coding (dual-auth); `28809807` feat(muse): add Meta Muse provider with OAuth login and model catalog; `402745dc` feat(providers): add qoder-cn support for Qoder CN (qoder.com.cn) — run `git show` on any of them.
Change coupling: providerModels.js ↔ model.js open-sse/config/providerModels.js— `open-sse/config/providerModels.js` and `open-sse/services/model.js` change together 61% of the time (14 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `7134dd71` refactor(open-sse): P2 alias single-source — derive OAuth alias→id fr…; `a6fd8469` feat(qoder): port Kiro-style provider integration with COSY signing; `d26db17f` Add xiaomi token plan provider — run `git show` on any of them.
Change coupling: ClaudeToolCard.js ↔ CodexToolCard.js src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js— `src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js` and `src/app/(dashboard)/dashboard/cli-tools/components/CodexToolCard.js` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `f08fa5f7` Fix input fields in tool cards; `6ab9927a` fix: update backoff configuration and improve CLI detection messages …; `9003675b` - Updated CLI tool components to accept initial status as a prop, imp… — run `git show` on any of them.
Change coupling: chatCore.js ↔ usageTracking.js open-sse/handlers/chatCore.js— `open-sse/handlers/chatCore.js` and `open-sse/utils/usageTracking.js` 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 — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `a625ea9f` refactor(log): unify request lifecycle logging with session-colored tags; `1ae4e311` feat: add GLM Coding (China) provider and Usage by API Keys statistics; `85b7a0b1` Feature/ai observability dashboard (#79) — run `git show` on any of them.
Change coupling: REDACTED ↔ model.js REDACTED— `REDACTED` and `open-sse/services/model.js` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `a6fd8469` feat(qoder): port Kiro-style provider integration with COSY signing; `93265894` Add Vercel AI Gateway provider support (#1183); `75904b8c` feat(open-sse): add blackbox provider with bb alias (#1143) — run `git show` on any of them.
Change coupling: REDACTED ↔ config.js src/app/api/providers/validate/route.js— `src/app/api/providers/validate/route.js` and `src/shared/constants/config.js` change together 50% of the time (11 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `93265894` Add Vercel AI Gateway provider support (#1183); `14ff69bf` - Added BytePlus Provider; `f2e7a98c` feat: add built-in Volcengine Ark provider support (#741) — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED REDACTED— `REDACTED` and `src/app/login/page.js` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `65197ad1` feat(auth): add native SAML 2.0 SSO integration; `6e9c7bf4` fix(auth): avoid stale redirects after auth changes; `7648c341` fix(auth): real client IP rate-limiting + remote default-password guard — run `git show` on any of them.
Change coupling: REDACTED ↔ MitmToolCard.js REDACTED— `REDACTED` and `src/app/(dashboard)/dashboard/cli-tools/components/MitmToolCard.js` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 5 shared commits counted here, the most recent 3 are `4ba546af` Enhance token refresh logic and improve MITM server handling; `e40f7ffb` fix(mitm): gate sudo prompts on server platform (#822); `c8d24974` refactor: update MitmServerCard and MitmToolCard to use modalError in… — run `git show` on any of them.
Change coupling: opencode-go.js ↔ opencode-go.js open-sse/executors/opencode-go.js— `open-sse/executors/opencode-go.js` and `open-sse/providers/registry/opencode-go.js` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `2aa99d9f` feat(opencode-go): complete Go catalog (40 models) with auto-fetch + …; `11222eff` feat(opencode-go): muse-spark-1.2 and Responses tool fixes (#3820); `e74db4d0` feat(opencode-go): add muse-spark-1.3-contributor and fix parallel to… — run `git show` on any of them.
No assertions: INSERT ${N_ITEMS} provider connections tests/unit/db-benchmark.test.js:53— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: READ ${N_QUERIES} filtered queries tests/unit/db-benchmark.test.js:80— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: READ ${N_QUERIES} by id (point lookup) tests/unit/db-benchmark.test.js:100— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: saveRequestUsage ${N_ITEMS} entries tests/unit/db-benchmark.test.js:122— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: getUsageStats(24h) repeat 50x tests/unit/db-benchmark.test.js:151— 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.
MethodTooLong: KiroExecutor.transformEventStreamToSSE open-sse/executors/kiro.js:629— MethodTooLong — transformEventStreamToSSE runs 443 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 343 over it, 4.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DevinCliExecutor.execute open-sse/executors/devin-cli.js:322— MethodTooLong — execute 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.
MethodTooLong: TraeExecutor.execute open-sse/executors/trae.js:176— MethodTooLong — execute runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WindsurfExecutor.transformToSSE open-sse/executors/windsurf.js:435— MethodTooLong — transformToSSE runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AntigravityExecutor.transformRequest open-sse/executors/antigravity.js:137— MethodTooLong — transformRequest runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Repeated repair: open-sse/config/appConstants.js open-sse/config/appConstants.js:219— open-sse/config/appConstants.js changed 10 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is appConstants.buildKimiHeaders at line 219), 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(antigravity): rewrite all Hermes identity variants, not just the legacy sentence”; “fix(antigravity): strip Claude Code billing header from system prompts”; “fix(antigravity): sanitize Hermes system identity”; “fix(codex): restore Version header and single-source the CLI version”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/config/appConstants.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: REDACTED REDACTED:4— REDACTED 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 5 (its worst body is shared.mapStainlessOs at line 4), 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(translator): keep tool-result images, restore Kiro tool names, preserve thinking display”; “fix(claude): support Fable 5.1”; “fix(claude): bump CC fingerprint to 2.1.258 for new-model access”; “fix(claude): remove global header cache, gate anthropic-beta by model”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07: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: open-sse/utils/claudeCloaking.js open-sse/utils/claudeCloaking.js:56— open-sse/utils/claudeCloaking.js 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 11 (its worst body is claudeCloaking.cloakClaudeTools at line 56), 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(claude): decloak tool names when toolNameMap misses (#4342)”; “fix(claude): support Fable 5.1”; “fix(claude): bump CC fingerprint to 2.1.258 for new-model access”; “fix(claude): decloak tool names in same-format streaming passthrough”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/utils/claudeCloaking.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: open-sse/services/model.js open-sse/services/model.js:61— open-sse/services/model.js changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is model.resolveModelAliasFromMap at line 61), 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(codex): remove ghost models, add gpt-daybreak/reserve, route gpt-5.x/6.x bare slugs to codex (#4418)”; “fix(codex): route bare codex-auto-review to the Codex provider (#4135)”; “fix(grok-cli): align Grok Build with current subscription protocol (#2590)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-03..2026-10-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-03 10:45:29 +07:00' --until='2026-10-01 10:45:29 +07:00' --full-history --no-merges -- open-sse/services/model.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.
APIPageClient::handleConnectTailscale (cognitive 40) REDACTED:488— APIPageClient::handleConnectTailscale has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 9, ternaries 2 (8 pts), error handling 2 (4 pts), loops 1 (2 pts) (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.
APIPageClient::handleInstallTailscale (cognitive 32) REDACTED:408— APIPageClient::handleInstallTailscale has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 2 (6 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
APIPageClient::(anonymous)::probeBoth (cognitive 26) REDACTED:128— APIPageClient::(anonymous)::probeBoth has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
APIPageClient::pingTunnelHealth (cognitive 17) REDACTED:279— APIPageClient::pingTunnelHealth has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfilePage::testOidcConnection (cognitive 22) REDACTED:415— ProfilePage::testOidcConnection has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 3 (5 pts), if/else 4, error handling 3 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProfilePage::saveOidcSettings (cognitive 20) REDACTED:350— ProfilePage::saveOidcSettings has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 2 (4 pts), error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProfilePage::saveSamlSettings (cognitive 19) REDACTED:555— ProfilePage::saveSamlSettings has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, ternaries 2 (4 pts), if/else 2, error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProfilePage::handleIdpMetadataUpload::onload (cognitive 16) REDACTED:494— ProfilePage::handleIdpMetadataUpload::onload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, ternaries 3, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfilePage::testOidcConnection (cyclomatic 22) REDACTED:415— ProfilePage::testOidcConnection has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProfilePage::saveOidcSettings (cyclomatic 21) REDACTED:350— ProfilePage::saveOidcSettings has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProfilePage::saveSamlSettings (cyclomatic 17) REDACTED:555— ProfilePage::saveSamlSettings 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.
route.POST (cyclomatic 16) src/app/api/cli-tools/antigravity-mitm/route.js:94— route.POST 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.
route.POST (cyclomatic 16) src/app/api/oauth/iflow/cookie/route.js:9— route.POST 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.
route.POST (cyclomatic 16) src/app/api/oauth/kiro/import/route.js:11— route.POST 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.
createSSEStream::transform (cognitive 201) open-sse/utils/stream.js:137— createSSEStream::transform has cognitive complexity 201 (threshold 15). Drivers by points: if/else 51 (150 pts), boolean chains 25, loops 6 (20 pts), error handling 1 (4 pts), ternaries 1 (2 pts) (nesting depth added 117). 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.
createSSEStream::flush (cognitive 57) open-sse/utils/stream.js:424— createSSEStream::flush has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 4 (12 pts), boolean chains 11, error handling 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
createSSEStream::finalizeStream (cognitive 18) open-sse/utils/stream.js:95— createSSEStream::finalizeStream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (5 pts), 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, 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.
transformEventStreamToSSE::processEvent (cognitive 101) open-sse/executors/kiro.js:792— transformEventStreamToSSE::processEvent has cognitive complexity 101 (threshold 15). Drivers by points: if/else 34 (62 pts), boolean chains 22, ternaries 6 (13 pts), loops 1 (2 pts), other 2 (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.
transformEventStreamToSSE::finish (cognitive 40) open-sse/executors/kiro.js:996— transformEventStreamToSSE::finish has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 12, if/else 9, 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.
transformEventStreamToSSE::processBytes (cognitive 21) open-sse/executors/kiro.js:925— transformEventStreamToSSE::processBytes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (4 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.
normalizeResponsesTools (cognitive 34) open-sse/executors/opencode.js:310— normalizeResponsesTools has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (11 pts), ternaries 8 (10 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 313). 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.
normalizeResponsesTools (cognitive 34) open-sse/executors/opencode-zen.js:168— normalizeResponsesTools has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (11 pts), ternaries 8 (10 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 171). 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.
normalizeResponsesTools (cognitive 34) open-sse/executors/opencode-go.js:52— normalizeResponsesTools has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (11 pts), ternaries 8 (10 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 55). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
route.POST (cognitive 16) REDACTED:188— route.POST has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 4, ternaries 3 (4 pts), error handling 1, loops 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
route.POST (cognitive 16) src/app/api/proxy-pools/deno-deploy/route.js:47— route.POST has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.POST (cognitive 16) src/app/api/tunnel/tailscale-install/route.js:17— route.POST has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, error handling 3 (4 pts), if/else 3, ternaries 1 (2 pts) (nesting depth added 2). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dead file (~77 LoC) open-sse/providers/registry/minimax-cn.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~77 LoC) open-sse/providers/registry/openrouter.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~77 LoC) src/shared/constants/colors.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/shared/constants/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
createSSEStream::transform (cyclomatic 94) open-sse/utils/stream.js:137— createSSEStream::transform has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
createSSEStream::flush (cyclomatic 35) open-sse/utils/stream.js:424— createSSEStream::flush 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.
transformEventStreamToSSE::processEvent (cyclomatic 69) open-sse/executors/kiro.js:792— transformEventStreamToSSE::processEvent has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
transformEventStreamToSSE::finish (cyclomatic 42) open-sse/executors/kiro.js:996— transformEventStreamToSSE::finish 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.
OAuthModal::startOAuthFlow (cyclomatic 50) src/shared/components/OAuthModal.js:270— OAuthModal::startOAuthFlow has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OAuthModal::handleManualSubmit (cyclomatic 30) src/shared/components/OAuthModal.js:651— OAuthModal::handleManualSubmit 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.
route.POST (cyclomatic 37) src/app/api/oauth/codex/bulk-import/route.js:19— route.POST 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.
route.POST (cyclomatic 37) src/app/api/oauth/grok-cli/bulk-import/route.js:21— route.POST has cyclomatic complexity 37 (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.
route.GET (cyclomatic 24) src/app/api/auth/status/route.js:8— route.GET 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.
route.GET (cyclomatic 24) src/app/api/oauth/kiro/auto-import/route.js:12— route.GET has cyclomatic complexity 24 (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.
detectRequiredCapabilities::scanMessage (cyclomatic 23) open-sse/services/combo.js:141— detectRequiredCapabilities::scanMessage 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.
detectRequiredCapabilities::scanBlock (cyclomatic 21) open-sse/services/combo.js:117— detectRequiredCapabilities::scanBlock 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.
route.POST (cyclomatic 21) REDACTED:21— route.POST 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.
route.POST (cyclomatic 21) src/app/api/cli-tools/openclaw-settings/route.js:138— route.POST has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
route.POST (cyclomatic 18) src/app/api/cli-tools/droid-settings/route.js:85— route.POST has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
route.POST (cyclomatic 18) src/app/api/oauth/xiaomi-mimo/login/start/route.js:71— route.POST 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.
route.GET (cyclomatic 17) src/app/api/media-providers/tts/elevenlabs/voices/route.js:12— route.GET has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, 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.
route.GET (cyclomatic 17) src/app/api/v1/audio/voices/route.js:20— route.GET has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
OAuthModal::startOAuthFlow (cognitive 69) src/shared/components/OAuthModal.js:270— OAuthModal::startOAuthFlow has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (38 pts), boolean chains 15, ternaries 6 (11 pts), error handling 3 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OAuthModal::handleManualSubmit (cognitive 32) src/shared/components/OAuthModal.js:651— OAuthModal::handleManualSubmit has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (10 pts), boolean chains 8, 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.
wrapQoderSSE::start (cognitive 31) open-sse/executors/qoder.js:523— wrapQoderSSE::start has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 6 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
wrapQoderSSE::processLine (cognitive 16) open-sse/executors/qoder.js:458— wrapQoderSSE::processLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 3, error handling 2 (3 pts), ternaries 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
extractAnswer (cognitive 31) open-sse/handlers/search/chatSearch.js:125— extractAnswer has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 14, if/else 5 (11 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). Of this number, 24 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
extractAnswer (cognitive 31) open-sse/handlers/search/chatSearch.js:214— extractAnswer has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 4 (10 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
detectRequiredCapabilities::scanMessage (cognitive 27) open-sse/services/combo.js:141— detectRequiredCapabilities::scanMessage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, 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.
detectRequiredCapabilities::scanBlock (cognitive 19) open-sse/services/combo.js:117— detectRequiredCapabilities::scanBlock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
buildStreamingResponse::start (cognitive 20) open-sse/executors/perplexity-web.js:297— buildStreamingResponse::start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildStreamingResponse::start (cognitive 17) open-sse/executors/grok-web.js:138— buildStreamingResponse::start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.GET (cognitive 19) src/app/api/auth/status/route.js:8— route.GET has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 15, ternaries 2 (3 pts), error handling 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.
route.GET (cognitive 19) src/app/api/oauth/cursor/auto-import/route.js:177— route.GET has cognitive complexity 19 (threshold 15). Drivers by points: error handling 6 (10 pts), if/else 5 (6 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.POST (cognitive 17) src/app/api/cli-tools/pi-settings/route.js:102— route.POST has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4, error handling 3, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.POST (cognitive 17) src/app/api/provider-nodes/route.js:32— route.POST has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, 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.
route.GET (cognitive 16) src/app/api/media-providers/tts/minimax/voices/route.js:65— route.GET has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5, error handling 2 (3 pts), ternaries 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.GET (cognitive 16) src/app/api/usage/request-details/route.js:8— route.GET has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 2, ternaries 2, error handling 1, loops 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Change-coupling hub: REDACTED → REDACTED, MitmToolCard.js, REDACTED src/app/api/cli-tools/antigravity-mitm/route.js— `src/app/api/cli-tools/antigravity-mitm/route.js` changes together with 3 other files — `REDACTED`, `src/app/(dashboard)/dashboard/cli-tools/components/MitmToolCard.js`, `REDACTED` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: requestDetailsDb.js → REDACTED, localDb.js, usageDb.js src/lib/requestDetailsDb.js— `src/lib/requestDetailsDb.js` changes together with 3 other files — `REDACTED`, `src/lib/localDb.js`, `src/lib/usageDb.js` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
R10 · Code Duplication· Duplicated block with local edits (128 matched lines × 2 locations) · ×2
Duplicated block with local edits (128 matched lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:131— src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:131 · src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js:162 — the two spans are one implementation copied and then locally edited — 902 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (128 matched lines × 2 locations) src/app/(dashboard)/dashboard/providers/[id]/CompatibleModelsSection.js:7— src/app/(dashboard)/dashboard/providers/[id]/CompatibleModelsSection.js:7 · src/app/(dashboard)/dashboard/providers/[id]/PassthroughModelsSection.js:8 — the two spans are one implementation copied and then locally edited — 664 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (100 matched lines × 2 locations) · ×2
Duplicated block with local edits (100 matched lines × 2 locations) open-sse/executors/opencode-go.js:67— open-sse/executors/opencode-go.js:67 · open-sse/executors/opencode-zen.js:183 — the two spans are one implementation copied and then locally edited — 864 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 (100 matched lines × 2 locations) src/sse/handlers/embeddings.js:32— src/sse/handlers/embeddings.js:32 · src/sse/handlers/systemone.js:23 — the two spans are one implementation copied and then locally edited — 707 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Dead file (~135 LoC) open-sse/providers/registry/opencode-zen.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~135 LoC) src/lib/oauth/services/claude.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/lib/oauth/services/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~98 LoC) open-sse/handlers/responsesHandler.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~98 LoC) open-sse/providers/REGISTRY_TEMPLATE.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~92 LoC) open-sse/providers/registry/kimi.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~92 LoC) open-sse/providers/registry/opencode-go.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~70 LoC) open-sse/providers/registry/zed.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~70 LoC) open-sse/services/compact.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~63 LoC) open-sse/providers/registry/devin-cli.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~63 LoC) open-sse/providers/registry/xiaomi-tokenplan.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
page.ProviderDetailPage (cyclomatic 364) src/app/(dashboard)/dashboard/providers/[id]/page.js:39— page.ProviderDetailPage has cyclomatic complexity 364 (threshold 15). Of this number, 106 points are the body's own statements and 258 belong to 74 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.
page.ProfilePage (cyclomatic 245) REDACTED:22— page.ProfilePage has cyclomatic complexity 245 (threshold 15). Of this number, 78 points are the body's own statements and 167 belong to 31 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.
ProviderLimits (cyclomatic 237) REDACTED:154— ProviderLimits has cyclomatic complexity 237 (threshold 15). Of this number, 49 points are the body's own statements and 188 belong to 118 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EndpointPageClient.APIPageClient (cyclomatic 223) REDACTED:21— EndpointPageClient.APIPageClient has cyclomatic complexity 223 (threshold 15). Of this number, 62 points are the body's own statements and 161 belong to 41 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.
OAuthModal.OAuthModal (cyclomatic 205) src/shared/components/OAuthModal.js:38— OAuthModal.OAuthModal has cyclomatic complexity 205 (threshold 15). Of this number, 45 points are the body's own statements and 160 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.
KiroExecutor.transformEventStreamToSSE (cyclomatic 172) open-sse/executors/kiro.js:629— KiroExecutor.transformEventStreamToSSE has cyclomatic complexity 172 (threshold 15). Most of this is not in the body itself: 3 of the 172 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 792, 996, 925, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
handleChatCore (cyclomatic 172) open-sse/handlers/chatCore.js:63— handleChatCore has cyclomatic complexity 172 (threshold 15). Of this number, 165 points are the body's own statements and 7 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
parseQuotaData (cyclomatic 169) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:356— parseQuotaData has cyclomatic complexity 169 (threshold 15). Of this number, 60 points are the body's own statements and 109 belong to 34 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.
BasicChatPageClient.BasicChatPageClient (cyclomatic 168) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:169— BasicChatPageClient.BasicChatPageClient has cyclomatic complexity 168 (threshold 15). Of this number, 18 points are the body's own statements and 150 belong to 37 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.
usageRepo.getUsageStats (cyclomatic 162) src/lib/db/repos/usageRepo.js:347— usageRepo.getUsageStats has cyclomatic complexity 162 (threshold 15). Of this number, 149 points are the body's own statements and 13 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.
stream.createSSEStream (cyclomatic 148) open-sse/utils/stream.js:44— stream.createSSEStream has cyclomatic complexity 148 (threshold 15). Of this number, 131 points are the body's own statements and 17 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.
GenericExampleCard.GenericExampleCard (cyclomatic 141) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:37— GenericExampleCard.GenericExampleCard has cyclomatic complexity 141 (threshold 15). Of this number, 81 points are the body's own statements and 60 belong to 14 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.
route.POST (cyclomatic 138) src/app/api/providers/validate/route.js:85— route.POST has cyclomatic complexity 138 (threshold 15). Of this number, 134 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
page.ProxyPoolsPage (cyclomatic 135) src/app/(dashboard)/dashboard/proxy-pools/page.js:30— page.ProxyPoolsPage has cyclomatic complexity 135 (threshold 15). Of this number, 35 points are the body's own statements and 100 belong to 30 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.
TokenSaverClient (cyclomatic 133) src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13— TokenSaverClient has cyclomatic complexity 133 (threshold 15). Of this number, 59 points are the body's own statements and 74 belong to 84 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TtsExampleCard.TtsExampleCard (cyclomatic 123) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:21— TtsExampleCard.TtsExampleCard has cyclomatic complexity 123 (threshold 15). Of this number, 54 points are the body's own statements and 69 belong to 18 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.
ProvidersPage (cyclomatic 116) REDACTED:99— ProvidersPage has cyclomatic complexity 116 (threshold 15). Of this number, 30 points are the body's own statements and 86 belong to 68 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
execute (cyclomatic 113) open-sse/executors/devin-cli.js:322— execute has cyclomatic complexity 113 (threshold 15). Most of this is not in the body itself: 13 of the 113 points are its own statements and the rest belongs to 15 function items inside it that branch (start::(anonymous), start, start::finish, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
GenericCliToolCard (cyclomatic 110) src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:12— GenericCliToolCard has cyclomatic complexity 110 (threshold 15). Of this number, 36 points are the body's own statements and 74 belong to 44 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModelSelectModal.ModelSelectModal (cyclomatic 108) REDACTED:73— ModelSelectModal.ModelSelectModal has cyclomatic complexity 108 (threshold 15). Most of this is not in the body itself: 5 of the 108 points are its own statements and the rest belongs to 33 function literals inside it that branch (lines 232, 583, 449, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddApiKeyModal.AddApiKeyModal (cyclomatic 102) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:11— AddApiKeyModal.AddApiKeyModal has cyclomatic complexity 102 (threshold 15). Of this number, 70 points are the body's own statements and 32 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.
route.buildModelsList (cyclomatic 100) src/app/api/v1/models/route.js:319— route.buildModelsList has cyclomatic complexity 100 (threshold 15). Of this number, 77 points are the body's own statements and 23 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.
CodexToolCard.CodexToolCard (cyclomatic 94) src/app/(dashboard)/dashboard/cli-tools/components/CodexToolCard.js:13— CodexToolCard.CodexToolCard has cyclomatic complexity 94 (threshold 15). Of this number, 40 points are the body's own statements and 54 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.
CoworkToolCard.CoworkToolCard (cyclomatic 93) src/app/(dashboard)/dashboard/cli-tools/components/CoworkToolCard.js:19— CoworkToolCard.CoworkToolCard has cyclomatic complexity 93 (threshold 15). Of this number, 36 points are the body's own statements and 57 belong to 22 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.
OpenCodeToolCard.OpenCodeToolCard (cyclomatic 89) src/app/(dashboard)/dashboard/cli-tools/components/OpenCodeToolCard.js:11— OpenCodeToolCard.OpenCodeToolCard has cyclomatic complexity 89 (threshold 15). Of this number, 34 points are the body's own statements and 55 belong to 18 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.
ConnectionRow (cyclomatic 87) src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:9— ConnectionRow has cyclomatic complexity 87 (threshold 15). Of this number, 68 points are the body's own statements and 19 belong to 23 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
auth.getProviderCredentials (cyclomatic 86) src/sse/services/auth.js:28— auth.getProviderCredentials has cyclomatic complexity 86 (threshold 15). Of this number, 53 points are the body's own statements and 33 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ZedAuthModal (cyclomatic 86) src/shared/components/ZedAuthModal.js:14— ZedAuthModal has cyclomatic complexity 86 (threshold 15). Of this number, 19 points are the body's own statements and 67 belong to 21 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
page.ComboDetailPage (cyclomatic 84) src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:47— page.ComboDetailPage has cyclomatic complexity 84 (threshold 15). Of this number, 29 points are the body's own statements and 55 belong to 12 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
startServer (cyclomatic 82) REDACTED:471— startServer has cyclomatic complexity 82 (threshold 15). Of this number, 69 points are the body's own statements and 13 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.
applyFormat (cyclomatic 79) open-sse/translator/concerns/thinkingUnified.js:254— applyFormat has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClaudeToolCard.ClaudeToolCard (cyclomatic 78) src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:29— ClaudeToolCard.ClaudeToolCard has cyclomatic complexity 78 (threshold 15). Of this number, 26 points are the body's own statements and 52 belong to 22 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.
CombosPage (cyclomatic 78) src/app/(dashboard)/dashboard/combos/page.js:55— CombosPage has cyclomatic complexity 78 (threshold 15). Most of this is not in the body itself: 11 of the 78 points are its own statements and the rest belongs to 63 function items inside it that branch (handleGeneratePresets, fetchData, handleBulkSetStrategy, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
openaiResponsesToOpenAIResponse (cyclomatic 74) open-sse/translator/response/openai-responses.js:510— openaiResponsesToOpenAIResponse has cyclomatic complexity 74 (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.
parseGrokCliBilling (cyclomatic 74) open-sse/services/usage/grok-cli.js:141— parseGrokCliBilling has cyclomatic complexity 74 (threshold 15). Of this number, 70 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
handleForcedSSEToJson (cyclomatic 72) open-sse/handlers/chatCore/sseToJsonHandler.js:183— handleForcedSSEToJson has cyclomatic complexity 72 (threshold 15). Of this number, 69 points are the body's own statements and 3 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.
openai-to-kiro.convertMessages (cyclomatic 71) open-sse/translator/request/openai-to-kiro.js:43— openai-to-kiro.convertMessages has cyclomatic complexity 71 (threshold 15). Of this number, 56 points are the body's own statements and 15 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.
DroidToolCard.DroidToolCard (cyclomatic 71) src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js:13— DroidToolCard.DroidToolCard has cyclomatic complexity 71 (threshold 15). Of this number, 26 points are the body's own statements and 45 belong to 16 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.
OpenClawToolCard.OpenClawToolCard (cyclomatic 71) src/app/(dashboard)/dashboard/cli-tools/components/OpenClawToolCard.js:11— OpenClawToolCard.OpenClawToolCard has cyclomatic complexity 71 (threshold 15). Of this number, 28 points are the body's own statements and 43 belong to 16 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.
GrokBuildToolCard.GrokBuildToolCard (cyclomatic 71) src/app/(dashboard)/dashboard/cli-tools/components/GrokBuildToolCard.js:63— GrokBuildToolCard.GrokBuildToolCard has cyclomatic complexity 71 (threshold 15). Of this number, 34 points are the body's own statements and 37 belong to 12 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JcodeToolCard.JcodeToolCard (cyclomatic 70) src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js:11— JcodeToolCard.JcodeToolCard has cyclomatic complexity 70 (threshold 15). Of this number, 26 points are the body's own statements and 44 belong to 14 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.
EditConnectionModal.EditConnectionModal (cyclomatic 70) src/shared/components/EditConnectionModal.js:12— EditConnectionModal.EditConnectionModal has cyclomatic complexity 70 (threshold 15). Of this number, 26 points are the body's own statements and 44 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.
translateNonStreamingResponse (cyclomatic 70) open-sse/handlers/chatCore/nonStreamingHandler.js:147— translateNonStreamingResponse has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HermesToolCard.HermesToolCard (cyclomatic 69) src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:15— HermesToolCard.HermesToolCard has cyclomatic complexity 69 (threshold 15). Of this number, 28 points are the body's own statements and 41 belong to 15 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.
openaiResponsesToOpenAIRequest (cyclomatic 68) open-sse/translator/request/openai-responses.js:22— openaiResponsesToOpenAIRequest has cyclomatic complexity 68 (threshold 15). Of this number, 47 points are the body's own statements and 21 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
claude.prepareClaudeRequest (cyclomatic 67) open-sse/translator/formats/claude.js:485— claude.prepareClaudeRequest has cyclomatic complexity 67 (threshold 15). Of this number, 61 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openai-to-gemini.openaiToGeminiBase (cyclomatic 67) open-sse/translator/request/openai-to-gemini.js:40— openai-to-gemini.openaiToGeminiBase has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
route.POST (cyclomatic 67) src/app/api/oauth/[provider]/[action]/route.js:296— route.POST has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AntigravityToolCard.AntigravityToolCard (cyclomatic 65) src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.js:7— AntigravityToolCard.AntigravityToolCard has cyclomatic complexity 65 (threshold 15). Of this number, 25 points are the body's own statements and 40 belong to 16 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.
UsageStats (cyclomatic 64) src/shared/components/UsageStats.js:206— UsageStats has cyclomatic complexity 64 (threshold 15). Of this number, 23 points are the body's own statements and 41 belong to 37 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
page.MediaProviderDetailPage (cyclomatic 63) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js:18— page.MediaProviderDetailPage has cyclomatic complexity 63 (threshold 15). Of this number, 54 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
executeAgent (cyclomatic 63) open-sse/executors/cursor.js:551— executeAgent has cyclomatic complexity 63 (threshold 15). Of this number, 19 points are the body's own statements and 44 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SttExampleCard.SttExampleCard (cyclomatic 62) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:11— SttExampleCard.SttExampleCard has cyclomatic complexity 62 (threshold 15). Of this number, 37 points are the body's own statements and 25 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DeepSeekTuiToolCard.DeepSeekTuiToolCard (cyclomatic 61) src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js:13— DeepSeekTuiToolCard.DeepSeekTuiToolCard has cyclomatic complexity 61 (threshold 15). Of this number, 25 points are the body's own statements and 36 belong to 13 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.
route.GET (cyclomatic 61) src/app/api/oauth/[provider]/[action]/route.js:93— route.GET has cyclomatic complexity 61 (threshold 15). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClineToolCard.ClineToolCard (cyclomatic 60) src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.js:11— ClineToolCard.ClineToolCard has cyclomatic complexity 60 (threshold 15). Of this number, 28 points are the body's own statements and 32 belong to 12 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
claude-to-kiro.convertClaudeMessagesToKiro (cyclomatic 58) open-sse/translator/request/claude-to-kiro.js:45— claude-to-kiro.convertClaudeMessagesToKiro has cyclomatic complexity 58 (threshold 15). Of this number, 48 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
route.POST (cyclomatic 58) src/app/api/oauth/xiaomi-mimo/api-key/route.js:11— route.POST has cyclomatic complexity 58 (threshold 15). Of this number, 48 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
claude-to-openai.claudeToOpenAIResponse (cyclomatic 57) open-sse/translator/response/claude-to-openai.js:19— claude-to-openai.claudeToOpenAIResponse 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.
CodexExecutor.transformRequest (cyclomatic 56) open-sse/executors/codex.js:412— CodexExecutor.transformRequest has cyclomatic complexity 56 (threshold 15). Of this number, 54 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
combo.detectRequiredCapabilities (cyclomatic 56) open-sse/services/combo.js:105— combo.detectRequiredCapabilities has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 7 of the 56 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 141, 117, 109, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CopilotToolCard.CopilotToolCard (cyclomatic 56) src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:11— CopilotToolCard.CopilotToolCard has cyclomatic complexity 56 (threshold 15). Of this number, 17 points are the body's own statements and 39 belong to 14 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.
ConnectionsCard.ConnectionRow (cyclomatic 56) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:33— ConnectionsCard.ConnectionRow has cyclomatic complexity 56 (threshold 15). Of this number, 47 points are the body's own statements and 9 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ToolDetailClient.ToolDetailClient (cyclomatic 54) src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.js:17— ToolDetailClient.ToolDetailClient 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 8 function literals inside it that branch (lines 129, 31, 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.
XiaomiMimoAuthModal.XiaomiMimoAuthModal (cyclomatic 54) src/shared/components/XiaomiMimoAuthModal.js:28— XiaomiMimoAuthModal.XiaomiMimoAuthModal has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 15 of the 54 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 131, 102, 148, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MitmServerCard (cyclomatic 54) REDACTED:12— MitmServerCard has cyclomatic complexity 54 (threshold 15). Of this number, 27 points are the body's own statements and 27 belong to 20 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
importLegacyMain (cyclomatic 54) src/lib/db/migrate.js:112— importLegacyMain has cyclomatic complexity 54 (threshold 15). Of this number, 20 points are the body's own statements and 34 belong to 10 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.
McpMarketplaceModal (cyclomatic 54) REDACTED:9— McpMarketplaceModal has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 5 of the 54 points are its own statements and the rest belongs to 34 function items inside it that branch ((anonymous), (anonymous)::(anonymous), fetchTools, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
openai-to-cursor.convertMessages (cyclomatic 53) open-sse/translator/request/openai-to-cursor.js:52— openai-to-cursor.convertMessages has cyclomatic complexity 53 (threshold 15). Of this number, 46 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KiloToolCard.KiloToolCard (cyclomatic 52) src/app/(dashboard)/dashboard/cli-tools/components/KiloToolCard.js:11— KiloToolCard.KiloToolCard has cyclomatic complexity 52 (threshold 15). Of this number, 25 points are the body's own statements and 27 belong to 11 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
page.LoginPage (cyclomatic 52) src/app/login/page.js:6— page.LoginPage has cyclomatic complexity 52 (threshold 15). Of this number, 32 points are the body's own statements and 20 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.
AntigravityExecutor.transformRequest (cyclomatic 51) open-sse/executors/antigravity.js:137— AntigravityExecutor.transformRequest has cyclomatic complexity 51 (threshold 15). Of this number, 34 points are the body's own statements and 17 belong to 3 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
attachments.rewriteBlock (cyclomatic 51) open-sse/shared/qoder/attachments.js:158— attachments.rewriteBlock has cyclomatic complexity 51 (threshold 15). Of this number, 49 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.
kiro-to-openai.kiroToOpenAIResponse (cyclomatic 50) open-sse/translator/response/kiro-to-openai.js:31— kiro-to-openai.kiroToOpenAIResponse has cyclomatic complexity 50 (threshold 15). Of this number, 48 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.
responsesTransformer.createResponsesApiTransformStream (cyclomatic 50) open-sse/transformer/responsesTransformer.js:54— responsesTransformer.createResponsesApiTransformStream has cyclomatic complexity 50 (threshold 15). Of this number, 38 points are the body's own statements and 12 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.
index.importDb (cyclomatic 49) src/lib/db/index.js:96— index.importDb has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 4 of the 49 points are its own statements and the rest belongs to one function literal inside it that branches (line 102). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
normalizeClaudePassthrough (cyclomatic 49) open-sse/translator/formats/claude.js:215— normalizeClaudePassthrough has cyclomatic complexity 49 (threshold 15). Of this number, 40 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.
openai.filterToOpenAIFormat (cyclomatic 48) open-sse/translator/formats/openai.js:10— openai.filterToOpenAIFormat has cyclomatic complexity 48 (threshold 15). Of this number, 30 points are the body's own statements and 18 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.
openai-responses.openaiToOpenAIResponsesRequest (cyclomatic 48) open-sse/translator/request/openai-responses.js:321— openai-responses.openaiToOpenAIResponsesRequest has cyclomatic complexity 48 (threshold 15). Of this number, 37 points are the body's own statements and 11 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.
commandcode-to-openai.commandCodeToOpenAIResponse (cyclomatic 48) open-sse/translator/response/commandcode-to-openai.js:52— commandcode-to-openai.commandCodeToOpenAIResponse 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.
imageGenerationCore.handleImageGenerationCore (cyclomatic 48) open-sse/handlers/imageGenerationCore.js:29— imageGenerationCore.handleImageGenerationCore 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.
KiroAuthModal (cyclomatic 48) src/shared/components/KiroAuthModal.js:11— KiroAuthModal has cyclomatic complexity 48 (threshold 15). Of this number, 26 points are the body's own statements and 22 belong to 24 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
openai-to-gemini.wrapInCloudCodeEnvelopeForClaude (cyclomatic 47) open-sse/translator/request/openai-to-gemini.js:301— openai-to-gemini.wrapInCloudCodeEnvelopeForClaude has cyclomatic complexity 47 (threshold 15). Of this number, 46 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.
geminiLiveStt.transcribeGeminiLive (cyclomatic 47) open-sse/handlers/geminiLiveStt.js:94— geminiLiveStt.transcribeGeminiLive has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 6 of the 47 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 218, 127, 179, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
normalizeGrokCliTools (cyclomatic 47) open-sse/executors/grok-cli.js:243— normalizeGrokCliTools has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 15 of the 47 points are its own statements and the rest belongs to one function literal inside it that branches (line 251). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
modelSelector.selectModelFromList (cyclomatic 46) cli/src/cli/utils/modelSelector.js:114— modelSelector.selectModelFromList has cyclomatic complexity 46 (threshold 15). Of this number, 43 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
extractContent (cyclomatic 46) open-sse/executors/perplexity-web.js:211— extractContent has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DefaultToolCard.DefaultToolCard (cyclomatic 44) src/app/(dashboard)/dashboard/cli-tools/components/DefaultToolCard.js:10— DefaultToolCard.DefaultToolCard has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 4 of the 44 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 147, 106, 20, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EmbeddingExampleCard.EmbeddingExampleCard (cyclomatic 44) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/EmbeddingExampleCard.js:21— EmbeddingExampleCard.EmbeddingExampleCard has cyclomatic complexity 44 (threshold 15). Of this number, 24 points are the body's own statements and 20 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MitmToolCard (cyclomatic 44) src/app/(dashboard)/dashboard/cli-tools/components/MitmToolCard.js:14— MitmToolCard has cyclomatic complexity 44 (threshold 15). Of this number, 20 points are the body's own statements and 24 belong to 22 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ConnectionsCard.ConnectionsCard (cyclomatic 43) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:298— ConnectionsCard.ConnectionsCard has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 5 of the 43 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 309, 330, 410, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
sendMessage (cyclomatic 43) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:573— sendMessage has cyclomatic complexity 43 (threshold 15). Of this number, 33 points are the body's own statements and 10 belong to 17 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.
handleSingleModelChat (cyclomatic 43) src/sse/handlers/chat.js:167— handleSingleModelChat has cyclomatic complexity 43 (threshold 15). Of this number, 40 points are the body's own statements and 3 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codex.normalizeCodexTools (cyclomatic 42) open-sse/executors/codex.js:78— codex.normalizeCodexTools has cyclomatic complexity 42 (threshold 15). Of this number, 16 points are the body's own statements and 26 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.
handleNonStreamingResponse (cyclomatic 42) open-sse/handlers/chatCore/nonStreamingHandler.js:287— handleNonStreamingResponse has cyclomatic complexity 42 (threshold 15). Of this number, 41 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
createProviderConnection (cyclomatic 42) src/lib/db/repos/connectionsRepo.js:135— createProviderConnection has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 140, 161, 192). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
buildOutput.buildOutput (cyclomatic 41) open-sse/rtk/filters/buildOutput.js:9— buildOutput.buildOutput 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.
RequestDetailsTab.RequestDetailsTab (cyclomatic 41) src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js:102— RequestDetailsTab.RequestDetailsTab has cyclomatic complexity 41 (threshold 15). Of this number, 29 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
openaiToClaudeRequest (cyclomatic 41) open-sse/translator/request/openai-to-claude.js:16— openaiToClaudeRequest has cyclomatic complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
kiroToClaudeResponse (cyclomatic 41) open-sse/translator/response/kiro-to-claude.js:57— kiroToClaudeResponse 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.
PxpipeClient.PxpipeClient (cyclomatic 40) src/app/(dashboard)/dashboard/pxpipe/PxpipeClient.js:61— PxpipeClient.PxpipeClient has cyclomatic complexity 40 (threshold 15). Of this number, 25 points are the body's own statements and 15 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.
openaiToClaudeResponse (cyclomatic 40) open-sse/translator/response/openai-to-claude.js:71— openaiToClaudeResponse 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.
QuotaTable.QuotaTable (cyclomatic 39) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js:87— QuotaTable.QuotaTable has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 11 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 152). 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.
usageTracking.extractUsage (cyclomatic 38) open-sse/utils/usageTracking.js:239— usageTracking.extractUsage has cyclomatic complexity 38 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
qoder.wrapQoderSSE (cyclomatic 38) open-sse/executors/qoder.js:426— qoder.wrapQoderSSE has cyclomatic complexity 38 (threshold 15). Of this number, 23 points are the body's own statements and 15 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.
page.TranslatorPage (cyclomatic 38) src/app/(dashboard)/dashboard/translator/page.js:30— page.TranslatorPage has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 2 of the 38 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 136, 232, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
startServer (cyclomatic 38) REDACTED:610— startServer has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 4 of the 38 points are its own statements and the rest belongs to 26 function items inside it that branch ((anonymous), tryRestart, cleanup, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
gemini-to-openai.geminiToOpenAIResponse (cyclomatic 37) open-sse/translator/response/gemini-to-openai.js:41— gemini-to-openai.geminiToOpenAIResponse 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.
openai-to-antigravity.openaiToAntigravityResponse (cyclomatic 37) open-sse/translator/response/openai-to-antigravity.js:9— openai-to-antigravity.openaiToAntigravityResponse 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.
config.normalizeLocale (cyclomatic 37) src/i18n/config.js:79— config.normalizeLocale has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
usageRepo.getChartData (cyclomatic 37) src/lib/db/repos/usageRepo.js:671— usageRepo.getChartData has cyclomatic complexity 37 (threshold 15). Of this number, 23 points are the body's own statements and 14 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.
createResponsesApiTransformStream::transform (cyclomatic 37) open-sse/transformer/responsesTransformer.js:243— createResponsesApiTransformStream::transform 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.
getAntigravityUsage (cyclomatic 37) open-sse/services/usage/google.js:120— getAntigravityUsage has cyclomatic complexity 37 (threshold 15). Of this number, 28 points are the body's own statements and 9 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.
gitStatus.gitStatus (cyclomatic 36) open-sse/rtk/filters/gitStatus.js:13— gitStatus.gitStatus 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.
parseSSEToOpenAIResponse (cyclomatic 36) open-sse/handlers/chatCore/sseToJsonHandler.js:113— parseSSEToOpenAIResponse 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.
openai-to-claude.getContentBlocksFromMessage (cyclomatic 35) open-sse/translator/request/openai-to-claude.js:201— openai-to-claude.getContentBlocksFromMessage 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.
antigravity-to-openai.convertContent (cyclomatic 35) open-sse/translator/request/antigravity-to-openai.js:120— antigravity-to-openai.convertContent 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.
sse.createQoderSseCoalescer (cyclomatic 35) open-sse/shared/qoder/sse.js:105— sse.createQoderSseCoalescer has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 149, 127, 141, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TraeExecutor.execute (cyclomatic 35) open-sse/executors/trae.js:176— TraeExecutor.execute has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 216, 201, 226, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.compressMessages (cyclomatic 35) open-sse/rtk/index.js:8— index.compressMessages 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.
route.POST (cyclomatic 35) src/app/api/providers/route.js:87— route.POST has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
checkAndRefreshToken (cyclomatic 35) src/sse/services/tokenRefresh.js:224— checkAndRefreshToken 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.
provider.detectFormat (cyclomatic 34) open-sse/services/provider.js:34— provider.detectFormat has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
headroom.compressWithHeadroom (cyclomatic 34) open-sse/rtk/headroom.js:248— headroom.compressWithHeadroom 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.
combo.handleComboChat (cyclomatic 34) open-sse/services/combo.js:280— combo.handleComboChat 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.
handleRun (cyclomatic 34) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:148— handleRun 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.
extractThinking (cyclomatic 34) open-sse/translator/concerns/thinkingUnified.js:50— extractThinking 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.
parseCommandCodeError (cyclomatic 34) open-sse/executors/commandcode.js:80— parseCommandCodeError has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
paramSupport.stripUnsupportedParams (cyclomatic 33) open-sse/translator/concerns/paramSupport.js:48— paramSupport.stripUnsupportedParams has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
qoder.normalizeContent (cyclomatic 33) open-sse/executors/qoder.js:86— qoder.normalizeContent has cyclomatic complexity 33 (threshold 15). Of this number, 26 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
nonStreamingHandler.openAICompletionToResponses (cyclomatic 33) open-sse/handlers/chatCore/nonStreamingHandler.js:83— nonStreamingHandler.openAICompletionToResponses has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BulkImportGrokCliModal.BulkImportGrokCliModal (cyclomatic 33) REDACTED:55— BulkImportGrokCliModal.BulkImportGrokCliModal has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 11 of the 33 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 136, 74, 78, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
transformRequest (cyclomatic 33) open-sse/executors/grok-cli.js:419— transformRequest has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
claude-to-openai.convertClaudeMessage (cyclomatic 32) open-sse/translator/request/claude-to-openai.js:144— claude-to-openai.convertClaudeMessage 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.
CursorExecutor.transformProtobufToSSE (cyclomatic 32) open-sse/executors/cursor.js:1055— CursorExecutor.transformProtobufToSSE 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.
antigravity-weekly.parseWeeklyQuotaSummary (cyclomatic 32) open-sse/services/usage/antigravity-weekly.js:49— antigravity-weekly.parseWeeklyQuotaSummary 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.
kimi.getKimiUsage (cyclomatic 32) open-sse/services/usage/kimi.js:103— kimi.getKimiUsage 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.
BaseUrlSelect.BaseUrlSelect (cyclomatic 32) src/app/(dashboard)/dashboard/cli-tools/components/BaseUrlSelect.js:42— BaseUrlSelect.BaseUrlSelect has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 90, 118, 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.
CompatibleModelsSection.CompatibleModelsSection (cyclomatic 32) src/app/(dashboard)/dashboard/providers/[id]/CompatibleModelsSection.js:74— CompatibleModelsSection.CompatibleModelsSection has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 9 of the 32 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 125, 106, 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.
EditCompatibleNodeModal.EditCompatibleNodeModal (cyclomatic 32) src/app/(dashboard)/dashboard/providers/[id]/EditCompatibleNodeModal.js:7— EditCompatibleNodeModal.EditCompatibleNodeModal has cyclomatic complexity 32 (threshold 15). Of this number, 18 points are the body's own statements and 14 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.
AddCustomEmbeddingModal.AddCustomEmbeddingModal (cyclomatic 32) src/shared/components/AddCustomEmbeddingModal.js:10— AddCustomEmbeddingModal.AddCustomEmbeddingModal has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 12 of the 32 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 39, 23, 91, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
buildPromptText (cyclomatic 32) open-sse/executors/devin-cli.js:252— buildPromptText has cyclomatic complexity 32 (threshold 15). Of this number, 27 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
convertOpenAIToKiro (cyclomatic 32) src/mitm/handlers/kiro.js:365— convertOpenAIToKiro 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.
handleVideoProxyCore (cyclomatic 32) open-sse/handlers/videoCore.js:77— handleVideoProxyCore has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
claude-to-kiro.claudeToKiroRequest (cyclomatic 31) open-sse/translator/request/claude-to-kiro.js:231— claude-to-kiro.claudeToKiroRequest has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
prefetch.collectImageRefs (cyclomatic 31) open-sse/translator/concerns/prefetch.js:19— prefetch.collectImageRefs has cyclomatic complexity 31 (threshold 15). Of this number, 18 points are the body's own statements and 13 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.
getMiniMaxUsage (cyclomatic 31) open-sse/services/usage/minimax.js:133— getMiniMaxUsage 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.
DefaultExecutor.buildHeaders (cyclomatic 30) open-sse/executors/default.js:153— DefaultExecutor.buildHeaders has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
responsesApi.convertResponsesApiFormat (cyclomatic 30) open-sse/translator/formats/responsesApi.js:84— responsesApi.convertResponsesApiFormat has cyclomatic complexity 30 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
opencode.normalizeResponsesTools (cyclomatic 30) open-sse/executors/opencode.js:310— opencode.normalizeResponsesTools has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 313). 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.
opencode-go.normalizeResponsesTools (cyclomatic 30) open-sse/executors/opencode-go.js:52— opencode-go.normalizeResponsesTools has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 55). 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.
opencode-zen.normalizeResponsesTools (cyclomatic 30) open-sse/executors/opencode-zen.js:168— opencode-zen.normalizeResponsesTools has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 171). 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.
sseToJsonHandler.chatCompletionToResponses (cyclomatic 30) open-sse/handlers/chatCore/sseToJsonHandler.js:53— sseToJsonHandler.chatCompletionToResponses has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sync.build (cyclomatic 30) src/lib/modelCatalog/sync.js:80— sync.build 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.
server.passthroughHttp2 (cyclomatic 30) REDACTED:178— server.passthroughHttp2 has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 212, 230, 200, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
readIntegrityAttempt (cyclomatic 30) open-sse/executors/kiro.js:543— readIntegrityAttempt 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.
Sidebar (cyclomatic 30) src/shared/components/Sidebar.js:43— Sidebar has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 13 of the 30 points are its own statements and the rest belongs to 27 function items inside it that branch ((anonymous), isActive, handleCopyAndShutdown::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
acquireViaDesktopPhases (cyclomatic 30) open-sse/shared/mimoAccount.js:166— acquireViaDesktopPhases 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.
opencodeFingerprint.restoreToolNames (cyclomatic 29) open-sse/utils/opencodeFingerprint.js:168— opencodeFingerprint.restoreToolNames has cyclomatic complexity 29 (threshold 15). Of this number, 15 points are the body's own statements and 14 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.
openai-to-kiro.openaiToKiroRequest (cyclomatic 29) open-sse/translator/request/openai-to-kiro.js:308— openai-to-kiro.openaiToKiroRequest 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.
finishReason.toOpenAIFinish (cyclomatic 29) open-sse/translator/concerns/finishReason.js:6— finishReason.toOpenAIFinish has cyclomatic complexity 29 (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.
ProviderLimitCard.ProviderLimitCard (cyclomatic 29) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js:17— ProviderLimitCard.ProviderLimitCard has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.GET (cyclomatic 29) src/app/api/providers/[id]/models/route.js:533— route.GET 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.
mimoLoginSession.proxyAccountRequest (cyclomatic 29) src/lib/mimoLoginSession.js:547— mimoLoginSession.proxyAccountRequest has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComboFormModal.ComboFormModal (cyclomatic 29) src/shared/components/ComboFormModal.js:53— ComboFormModal.ComboFormModal has cyclomatic complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 belong to 9 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.
Header.getPageInfo (cyclomatic 29) src/shared/components/Header.js:18— Header.getPageInfo has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli.killAllAppProcesses (cyclomatic 28) REDACTED:265— cli.killAllAppProcesses has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 290, 316, 266, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
toolCall.ensureToolCallIds (cyclomatic 28) open-sse/translator/concerns/toolCall.js:27— toolCall.ensureToolCallIds 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.
commandcode.inspectAndWrapCommandCodeResponse (cyclomatic 28) open-sse/executors/commandcode.js:140— commandcode.inspectAndWrapCommandCodeResponse 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.
cursorProtobuf.encodeRequest (cyclomatic 28) open-sse/utils/cursorProtobuf.js:456— cursorProtobuf.encodeRequest 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.
kimchiModels.normalizeKimchiModel (cyclomatic 28) open-sse/services/kimchiModels.js:49— kimchiModels.normalizeKimchiModel has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
WindsurfExecutor.transformToSSE (cyclomatic 28) open-sse/executors/windsurf.js:435— WindsurfExecutor.transformToSSE has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 455, 495). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
streamHandler.createDisconnectAwareStream (cyclomatic 28) open-sse/utils/streamHandler.js:102— streamHandler.createDisconnectAwareStream has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
systemone.handleSystemone (cyclomatic 28) src/sse/handlers/systemone.js:23— systemone.handleSystemone 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.
runConnect (cyclomatic 28) REDACTED:179— runConnect has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity· POST (cyclomatic 28) · ×1
POST (cyclomatic 28) src/app/api/provider-nodes/validate/route.js:55— POST 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.
xaiVideo.run (cyclomatic 27) cli/src/cli/commands/xaiVideo.js:209— xaiVideo.run has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
opencode.bodyHasSessionHints (cyclomatic 27) open-sse/executors/opencode.js:218— opencode.bodyHasSessionHints 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.
kiroModels.resolveKiroModels (cyclomatic 27) open-sse/services/kiroModels.js:236— kiroModels.resolveKiroModels 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.
ApiKeySelect.ApiKeySelect (cyclomatic 27) src/app/(dashboard)/dashboard/cli-tools/components/ApiKeySelect.js:9— ApiKeySelect.ApiKeySelect has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 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.
CustomConfigCard.CustomConfigCard (cyclomatic 27) src/app/(dashboard)/dashboard/providers/[id]/CustomConfigCard.js:12— CustomConfigCard.CustomConfigCard has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 42, 24, 111, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelsCard.ModelsCard (cyclomatic 27) src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:111— ModelsCard.ModelsCard has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 123, 182, 138, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
dashboardGuard.proxy (cyclomatic 27) src/dashboardGuard.js:207— dashboardGuard.proxy 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.
(anonymous) (cyclomatic 27) src/app/(dashboard)/dashboard/providers/[id]/page.js:305— (anonymous) 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.
extractClientToolResults (cyclomatic 27) open-sse/executors/devin-cli.js:152— extractClientToolResults 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.
flattenToolHistory (cyclomatic 27) open-sse/services/combo.js:21— flattenToolHistory has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 24, 30, 23, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MediaProviderKindPage (cyclomatic 27) src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:140— MediaProviderKindPage has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 28 function items inside it that branch ((anonymous), handleCreateCombo, (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
thoughtSignatureStore.getGeminiThoughtSignature (cyclomatic 26) open-sse/services/thoughtSignatureStore.js:123— thoughtSignatureStore.getGeminiThoughtSignature has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
openai-responses.openaiToOpenAIResponsesResponse (cyclomatic 26) open-sse/translator/response/openai-responses.js:50— openai-responses.openaiToOpenAIResponsesResponse 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.
kiro.parseEventFrame (cyclomatic 26) open-sse/executors/kiro.js:1216— kiro.parseEventFrame has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
bypassHandler.handleBypassRequest (cyclomatic 26) open-sse/utils/bypassHandler.js:11— bypassHandler.handleBypassRequest has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gitDiff.gitDiff (cyclomatic 26) open-sse/rtk/filters/gitDiff.js:5— gitDiff.gitDiff 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.
zed.parseZedAuthenticatedUserUsage (cyclomatic 26) open-sse/services/usage/zed.js:116— zed.parseZedAuthenticatedUserUsage has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.probeMediaProvider (cyclomatic 26) src/app/api/providers/validate/route.js:47— route.probeMediaProvider has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.forwardGeminiNativeRequest (cyclomatic 26) src/app/api/v1beta/models/[...path]/route.js:238— route.forwardGeminiNativeRequest 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.
zedCredentials.readLinuxCredentials (cyclomatic 26) src/lib/oauth/utils/zedCredentials.js:153— zedCredentials.readLinuxCredentials 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
stt.handleStt (cyclomatic 26) src/sse/handlers/stt.js:37— stt.handleStt 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.
normalizeGrokCliInputItem (cyclomatic 26) open-sse/executors/grok-cli.js:161— normalizeGrokCliInputItem 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.
kiroExternalIdp.normalizeKiroExternalIdpAuth (cyclomatic 25) src/lib/oauth/kiroExternalIdp.js:77— kiroExternalIdp.normalizeKiroExternalIdpAuth has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CursorExecutor.transformProtobufToJSON (cyclomatic 25) open-sse/executors/cursor.js:902— CursorExecutor.transformProtobufToJSON 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.
page.ComboFormModal (cyclomatic 25) src/app/(dashboard)/dashboard/combos/page.js:1009— page.ComboFormModal has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 1026, 1037, 1052, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddCompatibleModal.AddCompatibleModal (cyclomatic 25) src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.js:37— AddCompatibleModal.AddCompatibleModal has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 64, 115, 54, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.GET (cyclomatic 25) src/app/api/cli-tools/cowork-settings/route.js:244— route.GET 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 5 function literals inside it that branch (lines 284, 271, 284, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
appUpdater.collectAppPids (cyclomatic 25) REDACTED:41— appUpdater.collectAppPids has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 79, 50, 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.
usageRepo.saveRequestUsage (cyclomatic 25) src/lib/db/repos/usageRepo.js:242— usageRepo.saveRequestUsage has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 257). 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.
Header.Header (cyclomatic 25) src/shared/components/Header.js:182— Header.Header has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 192, 247, 218). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
videoGeneration.handleVideoCreate (cyclomatic 25) src/sse/handlers/videoGeneration.js:109— videoGeneration.handleVideoCreate 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.
renderModelsSection (cyclomatic 25) src/app/(dashboard)/dashboard/providers/[id]/page.js:1151— renderModelsSection has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 belong to 28 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.
socksFetch (cyclomatic 25) src/lib/mimoLoginSession.js:445— socksFetch has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
extractAnswer (cyclomatic 25) open-sse/handlers/search/chatSearch.js:302— extractAnswer 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.
createDisconnectAwareStream::pull (cyclomatic 25) open-sse/utils/streamHandler.js:118— createDisconnectAwareStream::pull has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tryDedicatedProvider (cyclomatic 25) open-sse/handlers/search/index.js:65— tryDedicatedProvider has cyclomatic complexity 25 (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.
xaiVideo.parseArgs (cyclomatic 24) cli/src/cli/commands/xaiVideo.js:50— xaiVideo.parseArgs 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.
BaseExecutor.execute (cyclomatic 24) open-sse/executors/base.js:100— BaseExecutor.execute has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
claude.anchorClaudeCache (cyclomatic 24) open-sse/translator/formats/claude.js:385— claude.anchorClaudeCache has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
antigravity-to-openai.antigravityToOpenAIRequest (cyclomatic 24) open-sse/translator/request/antigravity-to-openai.js:11— antigravity-to-openai.antigravityToOpenAIRequest 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.
openai-to-ollama.normalizeMessages (cyclomatic 24) open-sse/translator/request/openai-to-ollama.js:65— openai-to-ollama.normalizeMessages has cyclomatic complexity 24 (threshold 15). Of this number, 19 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.
devin-cli.resolveWorkspaceCwd (cyclomatic 24) open-sse/executors/devin-cli.js:197— devin-cli.resolveWorkspaceCwd 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 3 function literals inside it that branch (lines 213, 199, 209). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
commandcode.getCommandCodeUsage (cyclomatic 24) open-sse/services/usage/commandcode.js:58— commandcode.getCommandCodeUsage 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.
page.getConnectionErrorTag (cyclomatic 24) REDACTED:55— page.getConnectionErrorTag 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.
route.transformOpenAISSEToGeminiSSE (cyclomatic 24) src/app/api/v1beta/models/[...path]/route.js:427— route.transformOpenAISSEToGeminiSSE 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.
cloudflared.spawnQuickTunnel (cyclomatic 24) REDACTED:275— cloudflared.spawnQuickTunnel has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 374, 338, 308, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
embeddings.handleEmbeddings (cyclomatic 24) src/sse/handlers/embeddings.js:32— embeddings.handleEmbeddings 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.
extractAnswer (cyclomatic 24) open-sse/handlers/search/chatSearch.js:125— extractAnswer has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
pipeTransformedSSE (cyclomatic 24) REDACTED:78— pipeTransformedSSE 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.
image.isPrivateIp (cyclomatic 23) open-sse/translator/concerns/image.js:20— image.isPrivateIp 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.
openai-to-commandcode.convertMessages (cyclomatic 23) open-sse/translator/request/openai-to-commandcode.js:106— openai-to-commandcode.convertMessages 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.
qoder.buildQoderRequestBody (cyclomatic 23) open-sse/executors/qoder.js:210— qoder.buildQoderRequestBody has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
KiroExecutor.runIntegrityRecovery (cyclomatic 23) open-sse/executors/kiro.js:437— KiroExecutor.runIntegrityRecovery 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.
PerplexityWebExecutor.execute (cyclomatic 23) open-sse/executors/perplexity-web.js:396— PerplexityWebExecutor.execute 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.
nonStreamingHandler.openAICompletionToClaudeMessage (cyclomatic 23) open-sse/handlers/chatCore/nonStreamingHandler.js:27— nonStreamingHandler.openAICompletionToClaudeMessage 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.
NoAuthProxyCard.NoAuthProxyCard (cyclomatic 23) src/shared/components/NoAuthProxyCard.js:16— NoAuthProxyCard.NoAuthProxyCard has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 38, 28, 26, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
chat.handleChat (cyclomatic 23) src/sse/handlers/chat.js:34— chat.handleChat has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fetch.handleSingleProviderFetch (cyclomatic 23) src/sse/handlers/fetch.js:113— fetch.handleSingleProviderFetch 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.
search.handleSingleProviderSearch (cyclomatic 23) src/sse/handlers/search.js:93— search.handleSingleProviderSearch 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.
handleSttCore (cyclomatic 23) open-sse/handlers/sttCore.js:186— handleSttCore has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
gemini.convertOpenAIContentToParts (cyclomatic 22) open-sse/translator/formats/gemini.js:55— gemini.convertOpenAIContentToParts 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.
kiroConversation.reconcileToolPair (cyclomatic 22) open-sse/translator/concerns/kiroConversation.js:261— kiroConversation.reconcileToolPair has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ollama-to-openai.ollamaToOpenAIResponse (cyclomatic 22) open-sse/translator/response/ollama-to-openai.js:20— ollama-to-openai.ollamaToOpenAIResponse 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.
index.translateRequest (cyclomatic 22) open-sse/translator/index.js:68— index.translateRequest 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.
OpenCodeExecutor.transformRequest (cyclomatic 22) open-sse/executors/opencode.js:412— OpenCodeExecutor.transformRequest 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.
headroom.collectKiroHeadroomMessages (cyclomatic 22) open-sse/rtk/headroom.js:100— headroom.collectKiroHeadroomMessages has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 126, 113, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pxpipe.compressWithPxpipe (cyclomatic 22) open-sse/rtk/pxpipe.js:32— pxpipe.compressWithPxpipe 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.
embeddingsCore.handleEmbeddingsCore (cyclomatic 22) open-sse/handlers/embeddingsCore.js:13— embeddingsCore.handleEmbeddingsCore 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.
codex.parseStream (cyclomatic 22) open-sse/handlers/imageProviders/codex.js:63— codex.parseStream 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.
chatSearch.handleChatSearch (cyclomatic 22) open-sse/handlers/search/chatSearch.js:430— chatSearch.handleChatSearch has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
kiro.getKiroUsage (cyclomatic 22) open-sse/services/usage/kiro.js:51— kiro.getKiroUsage has cyclomatic complexity 22 (threshold 15). Of this number, 20 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.
codebuddy-cn.getCodeBuddyUsage (cyclomatic 22) open-sse/services/usage/codebuddy-cn.js:46— codebuddy-cn.getCodeBuddyUsage has cyclomatic complexity 22 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
xiaomi-mimo.getXiaomiMimoUsage (cyclomatic 22) open-sse/services/usage/xiaomi-mimo.js:22— xiaomi-mimo.getXiaomiMimoUsage 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.
migrate-registry.migrateEntry (cyclomatic 22) scripts/migrate-registry.mjs:46— migrate-registry.migrateEntry has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
page.CapacityAdapterCap (cyclomatic 22) src/app/(dashboard)/dashboard/combos/page.js:733— page.CapacityAdapterCap has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 826, 739, 745, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ConnectionsCard.AddApiKeyModal (cyclomatic 22) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:197— ConnectionsCard.AddApiKeyModal has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 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.
route.fetchAll (cyclomatic 22) src/app/api/cli-tools/cowork-mcp-registry/route.js:24— route.fetchAll has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
route.POST (cyclomatic 22) src/app/api/oauth/codex/import-token/route.js:12— route.POST 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.
route.PATCH (cyclomatic 22) src/app/api/settings/route.js:38— route.PATCH 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.
route.refreshAndUpdateCredentials (cyclomatic 22) src/app/api/usage/[connectionId]/route.js:24— route.refreshAndUpdateCredentials 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.
usageRepo.aggregateEntryToDay (cyclomatic 22) src/lib/db/repos/usageRepo.js:64— usageRepo.aggregateEntryToDay has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
requestDetailsRepo.getObservabilityConfig (cyclomatic 22) src/lib/db/repos/requestDetailsRepo.js:13— requestDetailsRepo.getObservabilityConfig has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CursorAuthModal.CursorAuthModal (cyclomatic 22) src/shared/components/CursorAuthModal.js:11— CursorAuthModal.CursorAuthModal has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
APIPageClient::handleConnectTailscale (cyclomatic 22) REDACTED:488— APIPageClient::handleConnectTailscale 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.
transformOpenAISSEToGeminiSSE::transform (cyclomatic 22) src/app/api/v1beta/models/[...path]/route.js:436— transformOpenAISSEToGeminiSSE::transform 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.
proxyAwareFetch (cyclomatic 22) open-sse/utils/proxyFetch.js:332— proxyAwareFetch 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.
fetchQoderCatalogRaw (cyclomatic 22) open-sse/services/qoderModels.js:204— fetchQoderCatalogRaw 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.
getOllamaUsage (cyclomatic 22) open-sse/services/usage/misc.js:66— getOllamaUsage has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pipeTransformedEventStream (cyclomatic 22) REDACTED:157— pipeTransformedEventStream 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.
custom-server.http.createServer (cyclomatic 21) custom-server.js:52— custom-server.http.createServer has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 56, 81, 94, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
oauthCredentialManager.mergeRefreshedCredentials (cyclomatic 21) open-sse/services/oauthCredentialManager.js:70— oauthCredentialManager.mergeRefreshedCredentials 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.
gemini.cleanJSONSchemaForAntigravity (cyclomatic 21) open-sse/translator/formats/gemini.js:352— gemini.cleanJSONSchemaForAntigravity 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.
migrate.importLegacyUsage (cyclomatic 21) src/lib/db/migrate.js:172— migrate.importLegacyUsage has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
GrokCliExecutor.buildHeaders (cyclomatic 21) open-sse/executors/grok-cli.js:362— GrokCliExecutor.buildHeaders has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
clientDetector.detectClientTool (cyclomatic 21) open-sse/utils/clientDetector.js:20— clientDetector.detectClientTool has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
gitLog.gitLog (cyclomatic 21) open-sse/rtk/filters/gitLog.js:6— gitLog.gitLog 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.
kimi.formatKimiUsageError (cyclomatic 21) open-sse/services/usage/kimi.js:33— kimi.formatKimiUsageError has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ollamaTransform.transformToOllama (cyclomatic 21) open-sse/utils/ollamaTransform.js:2— ollamaTransform.transformToOllama has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AddCustomModelModal.AddCustomModelModal (cyclomatic 21) src/app/(dashboard)/dashboard/providers/[id]/AddCustomModelModal.js:10— AddCustomModelModal.AddCustomModelModal 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 6 function literals inside it that branch (lines 30, 50, 20, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelAvailabilityBadge.ModelAvailabilityBadge (cyclomatic 21) src/app/(dashboard)/dashboard/providers/components/ModelAvailabilityBadge.js:21— ModelAvailabilityBadge.ModelAvailabilityBadge 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 6 function literals inside it that branch (lines 87, 29, 51, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.GET (cyclomatic 21) src/app/api/media-providers/tts/deepgram/voices/route.js:11— route.GET has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
route.PUT (cyclomatic 21) src/app/api/providers/[id]/route.js:87— route.PUT 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.
(anonymous)::loadData (cyclomatic 21) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:216— (anonymous)::loadData has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 21) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:69— (anonymous) has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 13 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.
extractAnswer (cyclomatic 21) open-sse/handlers/search/chatSearch.js:382— extractAnswer 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.
pollToken (cyclomatic 21) src/lib/oauth/providers/glm.js:57— pollToken has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
fetchClaudeUsageRaw (cyclomatic 21) open-sse/services/usage/claude.js:62— fetchClaudeUsageRaw has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input.selectMenu (cyclomatic 20) cli/src/cli/utils/input.js:92— input.selectMenu has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 135, 100, 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.
build-cli.buildCliPackage (cyclomatic 20) cli/scripts/build-cli.js:151— build-cli.buildCliPackage 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.
server.startZedProxy (cyclomatic 20) src/lib/oauth/utils/server.js:671— server.startZedProxy has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 681, 672, 759). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AntigravityExecutor.cloakTools (cyclomatic 20) open-sse/executors/antigravity.js:454— AntigravityExecutor.cloakTools has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
claude-to-openai.claudeToOpenAIRequest (cyclomatic 20) open-sse/translator/request/claude-to-openai.js:14— claude-to-openai.claudeToOpenAIRequest has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
openai-responses.buildReasoningInputItem (cyclomatic 20) open-sse/translator/request/openai-responses.js:286— openai-responses.buildReasoningInputItem has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
attachments.rewriteQoderMessageAttachments (cyclomatic 20) open-sse/shared/qoder/attachments.js:287— attachments.rewriteQoderMessageAttachments 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.
combo.handleFusionChat (cyclomatic 20) open-sse/services/combo.js:547— combo.handleFusionChat 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.
BulkImportCodexModal.BulkImportCodexModal (cyclomatic 20) src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js:26— BulkImportCodexModal.BulkImportCodexModal has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 40, 32). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.POST (cyclomatic 20) src/app/api/cli-tools/pi-settings/route.js:102— route.POST has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.GET (cyclomatic 20) src/app/api/media-providers/tts/minimax/voices/route.js:65— route.GET has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tailscale.startDaemonWithPassword (cyclomatic 20) REDACTED:533— tailscale.startDaemonWithPassword 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.
kiro.convertUserInputMessage (cyclomatic 20) src/mitm/handlers/kiro.js:211— kiro.convertUserInputMessage has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tts.handleSingleModelTts (cyclomatic 20) src/sse/handlers/tts.js:68— tts.handleSingleModelTts 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.
renderServerLogin (cyclomatic 20) src/shared/components/XiaomiMimoAuthModal.js:192— renderServerLogin has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
renderGuideSteps (cyclomatic 20) src/app/(dashboard)/dashboard/cli-tools/components/DefaultToolCard.js:147— renderGuideSteps has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
kiroToClaudeNonStreaming (cyclomatic 20) open-sse/translator/response/kiro-to-claude.js:235— kiroToClaudeNonStreaming has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
getQoderUsage (cyclomatic 20) open-sse/services/usage/misc.js:230— getQoderUsage has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
handleStreamingResponse (cyclomatic 20) open-sse/handlers/chatCore/streamingHandler.js:48— handleStreamingResponse has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
providers.refreshTraeToken (cyclomatic 19) open-sse/services/tokenRefresh/providers.js:619— providers.refreshTraeToken has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 628). 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.
gemini.mergeAllOf (cyclomatic 19) open-sse/translator/formats/gemini.js:206— gemini.mergeAllOf 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.
codexToolSchema.stripNode (cyclomatic 19) open-sse/utils/codexToolSchema.js:37— codexToolSchema.stripNode has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CursorExecutor.openAgentHttp2Stream (cyclomatic 19) open-sse/executors/cursor.js:457— CursorExecutor.openAgentHttp2Stream has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 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.
QoderExecutor.execute (cyclomatic 19) open-sse/executors/qoder.js:614— QoderExecutor.execute has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
opencode.lastUserText (cyclomatic 19) open-sse/executors/opencode.js:163— opencode.lastUserText has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
perplexity-web.readPplxSseEvents (cyclomatic 19) open-sse/executors/perplexity-web.js:92— perplexity-web.readPplxSseEvents 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.
ls.ls (cyclomatic 19) open-sse/rtk/filters/ls.js:34— ls.ls 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.
autodetect.autoDetectFilter (cyclomatic 19) open-sse/rtk/autodetect.js:28— autodetect.autoDetectFilter 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.
normalizers.normalizeXquik (cyclomatic 19) open-sse/handlers/search/normalizers.js:215— normalizers.normalizeXquik has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 218). 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.
systemoneCore.handleSystemoneCore (cyclomatic 19) open-sse/handlers/systemoneCore.js:13— systemoneCore.handleSystemoneCore has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
accountFallback.checkFallbackError (cyclomatic 19) open-sse/services/accountFallback.js:23— accountFallback.checkFallbackError 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.
copilotModels.resolveCopilotModels (cyclomatic 19) open-sse/services/copilotModels.js:94— copilotModels.resolveCopilotModels 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.
migrate-registry.formatEntry (cyclomatic 19) scripts/migrate-registry.mjs:164— migrate-registry.formatEntry 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.
page.MediaProviderCard (cyclomatic 19) src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:22— page.MediaProviderCard has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 38, 28, 27, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelRow.ModelRow (cyclomatic 19) src/app/(dashboard)/dashboard/providers/[id]/ModelRow.js:4— ModelRow.ModelRow 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.
route.POST (cyclomatic 19) src/app/api/cli-tools/opencode-settings/route.js:92— route.POST 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.
route.GET (cyclomatic 19) src/app/api/media-providers/tts/voices/route.js:22— route.GET has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
usageRepo.getActiveRequests (cyclomatic 19) src/lib/db/repos/usageRepo.js:197— usageRepo.getActiveRequests has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 219, 228). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
mimoLoginSession.parseSetCookie (cyclomatic 19) src/lib/mimoLoginSession.js:205— mimoLoginSession.parseSetCookie 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.
providers.buildProviderEntry (cyclomatic 19) src/shared/constants/providers.js:13— providers.buildProviderEntry 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.
manager.stopServer (cyclomatic 19) REDACTED:746— manager.stopServer has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GitLabAuthModal.GitLabAuthModal (cyclomatic 19) src/shared/components/GitLabAuthModal.js:21— GitLabAuthModal.GitLabAuthModal has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
KiroSocialOAuthModal.KiroSocialOAuthModal (cyclomatic 19) src/shared/components/KiroSocialOAuthModal.js:12— KiroSocialOAuthModal.KiroSocialOAuthModal has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 60, 30, 27, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tokenRefresh.updateProviderCredentials (cyclomatic 19) src/sse/services/tokenRefresh.js:163— tokenRefresh.updateProviderCredentials 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.
imageGeneration.handleSingleModelImage (cyclomatic 19) src/sse/handlers/imageGeneration.js:70— imageGeneration.handleSingleModelImage 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.
(anonymous) (cyclomatic 19) src/app/(dashboard)/dashboard/providers/[id]/page.js:477— (anonymous) has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 495, 507, 494, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
extractAnswer (cyclomatic 19) open-sse/handlers/search/chatSearch.js:255— extractAnswer has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
getGrokCliUsage (cyclomatic 19) open-sse/services/usage/grok-cli.js:349— getGrokCliUsage 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.
handleRun (cyclomatic 19) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:73— handleRun has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
handleFetchCore (cyclomatic 19) open-sse/handlers/fetch/index.js:93— handleFetchCore has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
gemini.normalizeGeminiContents (cyclomatic 18) open-sse/translator/formats/gemini.js:443— gemini.normalizeGeminiContents has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
claude.capCacheControlBlocks (cyclomatic 18) open-sse/translator/formats/claude.js:91— claude.capCacheControlBlocks has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gemini-to-openai.geminiToOpenAIRequest (cyclomatic 18) open-sse/translator/request/gemini-to-openai.js:9— gemini-to-openai.geminiToOpenAIRequest 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.
gemini-to-openai.convertGeminiContent (cyclomatic 18) open-sse/translator/request/gemini-to-openai.js:75— gemini-to-openai.convertGeminiContent 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.
kiroConversation.normalizeTurns (cyclomatic 18) open-sse/translator/concerns/kiroConversation.js:158— kiroConversation.normalizeTurns 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.
streamHelpers.hasValuableContent (cyclomatic 18) open-sse/utils/streamHelpers.js:41— streamHelpers.hasValuableContent 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.
GrokWebExecutor.execute (cyclomatic 18) open-sse/executors/grok-web.js:226— GrokWebExecutor.execute 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.
zed.wrapZedCompletionStream (cyclomatic 18) open-sse/executors/zed.js:148— zed.wrapZedCompletionStream has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 165, 157). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
claude.parseClaudeResetGrants (cyclomatic 18) open-sse/services/usage/claude.js:158— claude.parseClaudeResetGrants has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
codex.getCodexReviewRateLimit (cyclomatic 18) open-sse/services/usage/codex.js:73— codex.getCodexReviewRateLimit has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MitmPageClient.MitmPageClient (cyclomatic 18) src/app/(dashboard)/dashboard/mitm/MitmPageClient.js:9— MitmPageClient.MitmPageClient has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 24, 34, 44, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelsCard.ModelRow (cyclomatic 18) src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:11— ModelsCard.ModelRow 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.
ProviderTopology.buildLayout (cyclomatic 18) src/app/(dashboard)/dashboard/usage/components/ProviderTopology.js:263— ProviderTopology.buildLayout has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 301, 294). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProviderTopology.ProviderTopology (cyclomatic 18) src/app/(dashboard)/dashboard/usage/components/ProviderTopology.js:357— ProviderTopology.ProviderTopology has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 374, 391, 366, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.probeMcp (cyclomatic 18) src/app/api/cli-tools/cowork-mcp-tools/route.js:11— route.probeMcp has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
route.GET (cyclomatic 18) src/app/api/media-providers/tts/inworld/voices/route.js:10— route.GET has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
usageRepo.trackPendingRequest (cyclomatic 18) src/lib/db/repos/usageRepo.js:153— usageRepo.trackPendingRequest has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
requestDetailsRepo.flushToDatabase (cyclomatic 18) src/lib/db/repos/requestDetailsRepo.js:88— requestDetailsRepo.flushToDatabase has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 99). 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.
PricingModal.PricingModal (cyclomatic 18) src/shared/components/PricingModal.js:6— PricingModal.PricingModal has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 75, 17, 38, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UsageStats.sortData (cyclomatic 18) src/shared/components/UsageStats.js:91— UsageStats.sortData has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 93, 107). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
providerCustomModels.getProviderCustomModelRows (cyclomatic 18) src/shared/utils/providerCustomModels.js:5— providerCustomModels.getProviderCustomModelRows 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.
auth.clearAccountError (cyclomatic 18) src/sse/services/auth.js:301— auth.clearAccountError has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
backgroundTokenRefresh.runBackgroundTokenRefreshTick (cyclomatic 18) src/sse/services/backgroundTokenRefresh.js:90— backgroundTokenRefresh.runBackgroundTokenRefreshTick 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.
handleImportQoderModels (cyclomatic 18) src/app/(dashboard)/dashboard/providers/[id]/page.js:591— handleImportQoderModels has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
handleImportClineModels (cyclomatic 18) src/app/(dashboard)/dashboard/providers/[id]/page.js:646— handleImportClineModels has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
wrapQoderSSE::start (cyclomatic 18) open-sse/executors/qoder.js:523— wrapQoderSSE::start 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.
handleTest (cyclomatic 18) src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:172— handleTest 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.
markAccountUnavailable (cyclomatic 18) src/sse/services/auth.js:242— markAccountUnavailable 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.
stripHistoryForContext (cyclomatic 18) open-sse/services/capacityAdapter.js:118— stripHistoryForContext has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
connect.parseArgs (cyclomatic 17) REDACTED:40— connect.parseArgs has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
settings.showSettingsMenu (cyclomatic 17) cli/src/cli/menus/settings.js:22— settings.showSettingsMenu has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 26, 52, 90, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pricing.calculateCostFromTokens (cyclomatic 17) open-sse/providers/pricing.js:460— pricing.calculateCostFromTokens 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.
qoder.createQoderProvider (cyclomatic 17) src/lib/oauth/providers/qoder.js:9— qoder.createQoderProvider has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 85, 38). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
index.backfillCodexEmails (cyclomatic 17) src/lib/oauth/providers/index.js:226— index.backfillCodexEmails has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
migrate.runMigrationOnce (cyclomatic 17) src/lib/db/migrate.js:216— migrate.runMigrationOnce has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
image.fetchImageAsBase64 (cyclomatic 17) open-sse/translator/concerns/image.js:76— image.fetchImageAsBase64 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.
CodexExecutor._peekSseTransientError (cyclomatic 17) open-sse/executors/codex.js:328— CodexExecutor._peekSseTransientError has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
claude.fixToolUseOrdering (cyclomatic 17) open-sse/translator/formats/claude.js:116— claude.fixToolUseOrdering has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.translateResponse (cyclomatic 17) open-sse/translator/index.js:181— index.translateResponse 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.
error.parseUpstreamError (cyclomatic 17) open-sse/utils/error.js:59— error.parseUpstreamError 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.
VertexExecutor.buildUrl (cyclomatic 17) open-sse/executors/vertex.js:66— VertexExecutor.buildUrl 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.
OpenCodeZenExecutor.transformRequest (cyclomatic 17) open-sse/executors/opencode-zen.js:281— OpenCodeZenExecutor.transformRequest 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.
streamToJsonConverter.processSSEMessage (cyclomatic 17) open-sse/transformer/streamToJsonConverter.js:10— streamToJsonConverter.processSSEMessage 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.
minimax.minimaxTts (cyclomatic 17) open-sse/handlers/ttsProviders/minimax.js:13— minimax.minimaxTts 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.
utils.sortVisibleConnections (cyclomatic 17) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:50— utils.sortVisibleConnections has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 87, 58, 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.
route.PATCH (cyclomatic 17) src/app/api/cli-tools/antigravity-mitm/route.js:163— route.PATCH 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.
route.POST (cyclomatic 17) src/app/api/tunnel/tailscale-install/route.js:17— route.POST has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.comboSeatLimits (cyclomatic 17) src/app/api/v1/models/route.js:279— route.comboSeatLimits 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.
tailscale.startLogin (cyclomatic 17) REDACTED:642— tailscale.startLogin 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 8 function literals inside it that branch (lines 717, 689, 646, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tailscale.startFunnel (cyclomatic 17) REDACTED:741— tailscale.startFunnel has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 771, 757, 799, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
DonateModal.DonateModal (cyclomatic 17) src/shared/components/DonateModal.js:8— DonateModal.DonateModal has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
fetch.handleFetch (cyclomatic 17) src/sse/handlers/fetch.js:24— fetch.handleFetch 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.
getRecentLogs (cyclomatic 17) src/lib/db/repos/usageRepo.js:781— getRecentLogs has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 797). 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.
extractPanelText (cyclomatic 17) open-sse/services/combo.js:390— extractPanelText has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
emitToolCall (cyclomatic 17) open-sse/translator/response/openai-responses.js:339— emitToolCall 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.
startSessionLogin (cyclomatic 17) src/shared/components/XiaomiMimoAuthModal.js:131— startSessionLogin has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 148). 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.
resolveZedModels (cyclomatic 17) open-sse/shared/zedAuth.js:375— resolveZedModels has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 384, 396, 404). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity· GET (cyclomatic 17) · ×1
GET (cyclomatic 17) src/app/api/usage/[connectionId]/route.js:133— GET 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.
xaiVideo.pollUntilDone (cyclomatic 16) cli/src/cli/commands/xaiVideo.js:128— xaiVideo.pollUntilDone 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.
tray.killTray (cyclomatic 16) REDACTED:255— tray.killTray has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 6 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
cli.killProxyByPidFile (cyclomatic 16) REDACTED:379— cli.killProxyByPidFile 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.
index.pollForToken (cyclomatic 16) src/lib/oauth/providers/index.js:167— index.pollForToken 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.
gemini.flattenAnyOfOneOf (cyclomatic 16) open-sse/translator/formats/gemini.js:267— gemini.flattenAnyOfOneOf has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sqljsAdapter.createSqlJsAdapter (cyclomatic 16) src/lib/db/adapters/sqljsAdapter.js:13— sqljsAdapter.createSqlJsAdapter has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
codex.findNestedMessage (cyclomatic 16) open-sse/executors/codex.js:152— codex.findNestedMessage 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.
opencodeFingerprint.retargetToolChoice (cyclomatic 16) open-sse/utils/opencodeFingerprint.js:104— opencodeFingerprint.retargetToolChoice 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.
openai-to-claude.openaiToClaudeRequestForAntigravity (cyclomatic 16) open-sse/translator/request/openai-to-claude.js:328— openai-to-claude.openaiToClaudeRequestForAntigravity has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
kiroConversation.validateKiroConversation (cyclomatic 16) open-sse/translator/concerns/kiroConversation.js:341— kiroConversation.validateKiroConversation 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.
usageTracking.logUsage (cyclomatic 16) open-sse/utils/usageTracking.js:407— usageTracking.logUsage 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.
qoderModels.resolveQoderModels (cyclomatic 16) open-sse/services/qoderModels.js:302— qoderModels.resolveQoderModels has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sse.canonicalizeQoderUsage (cyclomatic 16) open-sse/shared/qoder/sse.js:23— sse.canonicalizeQoderUsage 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.
systemInject.injectSystemPrompt (cyclomatic 16) open-sse/rtk/systemInject.js:11— systemInject.injectSystemPrompt 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.
systemInject.injectClaudeSystem (cyclomatic 16) open-sse/rtk/systemInject.js:213— systemInject.injectClaudeSystem 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.
vertex.toVertexBody (cyclomatic 16) open-sse/handlers/videoProviders/vertex.js:60— vertex.toVertexBody 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.
codex.getCodexSparkRateLimit (cyclomatic 16) open-sse/services/usage/codex.js:90— codex.getCodexSparkRateLimit has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
deepseek.getDeepseekUsage (cyclomatic 16) open-sse/services/usage/deepseek.js:43— deepseek.getDeepseekUsage has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
opencode-go.getOpenCodeGoUsage (cyclomatic 16) open-sse/services/usage/opencode-go.js:25— opencode-go.getOpenCodeGoUsage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
opencode-zen.getOpenCodeZenUsage (cyclomatic 16) open-sse/services/usage/opencode-zen.js:25— opencode-zen.getOpenCodeZenUsage 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.
glm.parseGlmQuotaResponse (cyclomatic 16) open-sse/services/usage/glm.js:19— glm.parseGlmQuotaResponse 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.
page.ComboCard (cyclomatic 16) src/app/(dashboard)/dashboard/combos/page.js:566— page.ComboCard has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
page.ApiKeyProviderCard (cyclomatic 16) REDACTED:806— page.ApiKeyProviderCard has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
route.PUT (cyclomatic 16) src/app/api/provider-nodes/[id]/route.js:5— route.PUT has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
route.probeWebProvider (cyclomatic 16) src/app/api/providers/validate/route.js:12— route.probeWebProvider has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
route.GET (cyclomatic 16) src/app/api/usage/request-details/route.js:8— route.GET has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
manager.enableTailscale (cyclomatic 16) src/lib/tunnel/tailscale/manager.js:24— manager.enableTailscale 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.
proxy.proxy (cyclomatic 16) src/proxy.js:13— proxy.proxy 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.
LanguageSwitcher.LanguageSwitcher (cyclomatic 16) src/shared/components/LanguageSwitcher.js:59— LanguageSwitcher.LanguageSwitcher has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 67, 80, 92, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UsageStats.groupDataByKey (cyclomatic 16) src/shared/components/UsageStats.js:128— UsageStats.groupDataByKey has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 131). 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.
coworkPlugins.buildManagedMcpServers (cyclomatic 16) src/shared/constants/coworkPlugins.js:36— coworkPlugins.buildManagedMcpServers 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.
quotaAutoPing.pingConnection (cyclomatic 16) src/shared/services/quotaAutoPing.js:188— quotaAutoPing.pingConnection 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.
search.handleSearch (cyclomatic 16) src/sse/handlers/search.js:23— search.handleSearch 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.
ProviderTestResultsView (cyclomatic 16) REDACTED:945— ProviderTestResultsView has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
resolveKiroThinkingBudget (cyclomatic 16) open-sse/config/kiroConstants.js:147— resolveKiroThinkingBudget 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.
buildBody (cyclomatic 16) open-sse/handlers/imageProviders/codex.js:179— buildBody has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
page.ProviderDetailPage (cognitive 383) src/app/(dashboard)/dashboard/providers/[id]/page.js:39— page.ProviderDetailPage has cognitive complexity 383 (threshold 15). Drivers by points: boolean chains 132, if/else 103 (128 pts), ternaries 49 (80 pts), error handling 29 (32 pts), loops 9 (11 pts) (nesting depth added 61). Of this number, 108 points are the body's own statements and 275 belong to 74 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.
EndpointPageClient.APIPageClient (cognitive 338) REDACTED:21— EndpointPageClient.APIPageClient has cognitive complexity 338 (threshold 15). Drivers by points: if/else 84 (147 pts), boolean chains 78, ternaries 31 (68 pts), error handling 21 (33 pts), loops 8 (12 pts) (nesting depth added 116). Of this number, 72 points are the body's own statements and 266 belong to 41 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.
stream.createSSEStream (cognitive 280) open-sse/utils/stream.js:44— stream.createSSEStream has cognitive complexity 280 (threshold 15). Drivers by points: if/else 76 (194 pts), boolean chains 42, loops 11 (33 pts), ternaries 4 (6 pts), error handling 2 (5 pts) (nesting depth added 145). Of this number, 261 points are the body's own statements and 19 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.
getUsageStats (cognitive 268) src/lib/db/repos/usageRepo.js:347— getUsageStats has cognitive complexity 268 (threshold 15). Drivers by points: if/else 37 (112 pts), boolean chains 91, ternaries 11 (33 pts), loops 15 (29 pts), error handling 3 (nesting depth added 111). Of this number, 257 points are the body's own statements and 11 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.
ProviderLimits (cognitive 259) REDACTED:154— ProviderLimits has cognitive complexity 259 (threshold 15). Drivers by points: if/else 61 (85 pts), boolean chains 75, ternaries 57 (58 pts), error handling 18 (21 pts), loops 4 (12 pts), other 8 (nesting depth added 36). Of this number, 44 points are the body's own statements and 215 belong to 118 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
page.ProfilePage (cognitive 228) REDACTED:22— page.ProfilePage has cognitive complexity 228 (threshold 15). Drivers by points: boolean chains 118, if/else 48, ternaries 27 (43 pts), error handling 19 (nesting depth added 16). Of this number, 64 points are the body's own statements and 164 belong to 31 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.
KiroExecutor.transformEventStreamToSSE (cognitive 226) open-sse/executors/kiro.js:629— KiroExecutor.transformEventStreamToSSE has cognitive complexity 226 (threshold 15). Drivers by points: if/else 71 (116 pts), boolean chains 54, ternaries 19 (42 pts), error handling 6 (9 pts), loops 4 (5 pts) (nesting depth added 72). Most of this is not in the body itself: 2 of the 226 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 792, 996, 925, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
OAuthModal.OAuthModal (cognitive 219) src/shared/components/OAuthModal.js:38— OAuthModal.OAuthModal has cognitive complexity 219 (threshold 15). Drivers by points: if/else 79 (101 pts), boolean chains 62, ternaries 18 (39 pts), error handling 12 (16 pts), loops 1 (nesting depth added 47). Of this number, 23 points are the body's own statements and 196 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.
handleChatCore (cognitive 213) open-sse/handlers/chatCore.js:63— handleChatCore has cognitive complexity 213 (threshold 15). Drivers by points: if/else 59 (87 pts), boolean chains 64, ternaries 18 (35 pts), error handling 14 (27 pts) (nesting depth added 58). Of this number, 203 points are the body's own statements and 10 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildModelsList (cognitive 201) src/app/api/v1/models/route.js:319— buildModelsList has cognitive complexity 201 (threshold 15). Drivers by points: if/else 42 (135 pts), boolean chains 35, loops 8 (15 pts), error handling 6 (9 pts), ternaries 2 (7 pts) (nesting depth added 108). Of this number, 160 points are the body's own statements and 41 belong to 21 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BasicChatPageClient.BasicChatPageClient (cognitive 199) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:169— BasicChatPageClient.BasicChatPageClient has cognitive complexity 199 (threshold 15). Drivers by points: if/else 54 (73 pts), boolean chains 55, ternaries 37 (55 pts), error handling 6 (8 pts), loops 6 (8 pts) (nesting depth added 41). Of this number, 17 points are the body's own statements and 182 belong to 37 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.
parseQuotaData (cognitive 199) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:356— parseQuotaData has cognitive complexity 199 (threshold 15). Drivers by points: boolean chains 88, if/else 39 (78 pts), ternaries 7 (23 pts), other 8, error handling 1, match/switch 1 (nesting depth added 55). Of this number, 73 points are the body's own statements and 126 belong to 34 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.
openaiToGeminiBase (cognitive 175) open-sse/translator/request/openai-to-gemini.js:40— openaiToGeminiBase has cognitive complexity 175 (threshold 15). Drivers by points: if/else 34 (111 pts), loops 7 (23 pts), ternaries 4 (21 pts), boolean chains 20 (nesting depth added 110). 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.
execute (cognitive 160) open-sse/executors/devin-cli.js:322— execute has cognitive complexity 160 (threshold 15). Drivers by points: if/else 45 (88 pts), boolean chains 32, ternaries 13 (27 pts), error handling 6 (9 pts), other 3, loops 1 (nesting depth added 60). Most of this is not in the body itself: 15 of the 160 points are its own statements and the rest belongs to 15 function items inside it that branch (start::(anonymous), start::(anonymous), start::finish, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
page.ProxyPoolsPage (cognitive 158) src/app/(dashboard)/dashboard/proxy-pools/page.js:30— page.ProxyPoolsPage has cognitive complexity 158 (threshold 15). Drivers by points: if/else 48 (55 pts), ternaries 31 (42 pts), boolean chains 36, error handling 14 (19 pts), loops 5 (6 pts) (nesting depth added 24). Of this number, 26 points are the body's own statements and 132 belong to 30 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.
GenericExampleCard.GenericExampleCard (cognitive 154) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:37— GenericExampleCard.GenericExampleCard has cognitive complexity 154 (threshold 15). Drivers by points: boolean chains 61, if/else 25 (39 pts), ternaries 26 (37 pts), loops 4 (10 pts), error handling 3 (7 pts) (nesting depth added 35). Of this number, 68 points are the body's own statements and 86 belong to 14 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
convertMessages (cognitive 152) open-sse/translator/request/openai-to-kiro.js:43— convertMessages has cognitive complexity 152 (threshold 15). Drivers by points: if/else 39 (95 pts), ternaries 6 (27 pts), boolean chains 23, loops 4 (7 pts) (nesting depth added 80). Of this number, 115 points are the body's own statements and 37 belong to 9 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TokenSaverClient.TokenSaverClient (cognitive 147) src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13— TokenSaverClient.TokenSaverClient has cognitive complexity 147 (threshold 15). Drivers by points: ternaries 33 (72 pts), boolean chains 38, if/else 22 (24 pts), error handling 13 (nesting depth added 41). Of this number, 90 points are the body's own statements and 57 belong to 28 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.
startServer (cognitive 143) REDACTED:471— startServer has cognitive complexity 143 (threshold 15). Drivers by points: if/else 47 (81 pts), error handling 14 (31 pts), boolean chains 22, ternaries 3 (8 pts), loops 1 (nesting depth added 56). Of this number, 119 points are the body's own statements and 24 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.
prepareClaudeRequest (cognitive 140) open-sse/translator/formats/claude.js:485— prepareClaudeRequest has cognitive complexity 140 (threshold 15). Drivers by points: if/else 34 (95 pts), boolean chains 25, loops 5 (18 pts), ternaries 1 (2 pts) (nesting depth added 75). Of this number, 123 points are the body's own statements and 17 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.
convertClaudeMessagesToKiro (cognitive 132) open-sse/translator/request/claude-to-kiro.js:45— convertClaudeMessagesToKiro has cognitive complexity 132 (threshold 15). Drivers by points: if/else 35 (85 pts), loops 6 (18 pts), boolean chains 16, ternaries 2 (13 pts) (nesting depth added 73). Of this number, 120 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
route.POST (cognitive 128) src/app/api/providers/validate/route.js:85— route.POST has cognitive complexity 128 (threshold 15). Drivers by points: if/else 38 (59 pts), boolean chains 35, ternaries 12 (23 pts), error handling 6 (10 pts), match/switch 1 (nesting depth added 36). Of this number, 120 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelSelectModal.ModelSelectModal (cognitive 127) REDACTED:73— ModelSelectModal.ModelSelectModal has cognitive complexity 127 (threshold 15). Drivers by points: if/else 37 (53 pts), boolean chains 40, ternaries 13 (29 pts), error handling 4, loops 1 (nesting depth added 32). Most of this is not in the body itself: 3 of the 127 points are its own statements and the rest belongs to 33 function literals inside it that branch (lines 232, 583, 449, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TtsExampleCard.TtsExampleCard (cognitive 126) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:21— TtsExampleCard.TtsExampleCard has cognitive complexity 126 (threshold 15). Drivers by points: boolean chains 62, if/else 27 (34 pts), ternaries 18 (26 pts), error handling 2, loops 1 (2 pts) (nesting depth added 16). Of this number, 49 points are the body's own statements and 77 belong to 18 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.
openaiResponsesToOpenAIRequest (cognitive 123) open-sse/translator/request/openai-responses.js:22— openaiResponsesToOpenAIRequest has cognitive complexity 123 (threshold 15). Drivers by points: if/else 39 (74 pts), ternaries 8 (22 pts), boolean chains 14, loops 4 (11 pts), other 2 (nesting depth added 56). Of this number, 92 points are the body's own statements and 31 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenericCliToolCard (cognitive 121) src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:12— GenericCliToolCard has cognitive complexity 121 (threshold 15). Drivers by points: if/else 32 (46 pts), boolean chains 40, ternaries 19 (28 pts), error handling 4 (5 pts), match/switch 2 (nesting depth added 24). Of this number, 31 points are the body's own statements and 90 belong to 44 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.POST (cognitive 113) src/app/api/oauth/[provider]/[action]/route.js:296— route.POST has cognitive complexity 113 (threshold 15). Drivers by points: if/else 27 (51 pts), ternaries 10 (27 pts), boolean chains 21, error handling 6 (14 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.
wrapInCloudCodeEnvelopeForClaude (cognitive 110) open-sse/translator/request/openai-to-gemini.js:301— wrapInCloudCodeEnvelopeForClaude has cognitive complexity 110 (threshold 15). Drivers by points: if/else 20 (51 pts), ternaries 5 (29 pts), loops 6 (17 pts), boolean chains 13 (nesting depth added 66). Of this number, 103 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
executeAgent (cognitive 109) open-sse/executors/cursor.js:551— executeAgent has cognitive complexity 109 (threshold 15). Drivers by points: if/else 40 (80 pts), boolean chains 14, error handling 6 (7 pts), ternaries 3 (5 pts), loops 2 (3 pts) (nesting depth added 44). Of this number, 25 points are the body's own statements and 84 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extractContent (cognitive 104) open-sse/executors/perplexity-web.js:211— extractContent has cognitive complexity 104 (threshold 15). Drivers by points: if/else 18 (59 pts), loops 6 (23 pts), other 13, boolean chains 9 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
applyFormat (cognitive 103) open-sse/translator/concerns/thinkingUnified.js:254— applyFormat has cognitive complexity 103 (threshold 15). Drivers by points: if/else 22 (43 pts), ternaries 15 (33 pts), boolean chains 24, other 2, match/switch 1 (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.
ProvidersPage (cognitive 102) REDACTED:99— ProvidersPage has cognitive complexity 102 (threshold 15). Drivers by points: boolean chains 37, ternaries 32 (33 pts), if/else 20 (21 pts), other 9, error handling 2 (nesting depth added 2). Of this number, 23 points are the body's own statements and 79 belong to 68 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
route.GET (cognitive 101) src/app/api/oauth/[provider]/[action]/route.js:93— route.GET has cognitive complexity 101 (threshold 15). Drivers by points: if/else 46 (75 pts), ternaries 6 (15 pts), boolean chains 7, error handling 2 (4 pts) (nesting depth added 40). Of this number, 99 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.
responsesTransformer.createResponsesApiTransformStream (cognitive 100) open-sse/transformer/responsesTransformer.js:54— responsesTransformer.createResponsesApiTransformStream has cognitive complexity 100 (threshold 15). Drivers by points: if/else 28 (73 pts), boolean chains 13, loops 6 (12 pts), error handling 1 (2 pts) (nesting depth added 52). Of this number, 88 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.
normalizeClaudePassthrough (cognitive 99) open-sse/translator/formats/claude.js:215— normalizeClaudePassthrough has cognitive complexity 99 (threshold 15). Drivers by points: if/else 23 (57 pts), ternaries 6 (18 pts), boolean chains 11, loops 5 (11 pts), other 2 (nesting depth added 52). Of this number, 86 points are the body's own statements and 13 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.
nonStreamingHandler.translateNonStreamingResponse (cognitive 97) open-sse/handlers/chatCore/nonStreamingHandler.js:147— nonStreamingHandler.translateNonStreamingResponse has cognitive complexity 97 (threshold 15). Drivers by points: if/else 31 (60 pts), boolean chains 32, loops 2 (5 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openai-to-cursor.convertMessages (cognitive 96) open-sse/translator/request/openai-to-cursor.js:52— openai-to-cursor.convertMessages has cognitive complexity 96 (threshold 15). Drivers by points: if/else 20 (58 pts), boolean chains 26, loops 5 (12 pts) (nesting depth added 45). Of this number, 89 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
openai-responses.openaiToOpenAIResponsesRequest (cognitive 95) open-sse/translator/request/openai-responses.js:321— openai-responses.openaiToOpenAIResponsesRequest has cognitive complexity 95 (threshold 15). Drivers by points: if/else 27 (58 pts), ternaries 6 (25 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 52). Of this number, 67 points are the body's own statements and 28 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
auth.getProviderCredentials (cognitive 94) src/sse/services/auth.js:28— auth.getProviderCredentials has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 41, ternaries 6 (9 pts) (nesting depth added 20). Of this number, 53 points are the body's own statements and 41 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.
selectModelFromList (cognitive 94) cli/src/cli/utils/modelSelector.js:114— selectModelFromList has cognitive complexity 94 (threshold 15). Drivers by points: if/else 29 (75 pts), boolean chains 12, loops 2 (4 pts), ternaries 3 (nesting depth added 48). Of this number, 91 points are the body's own statements and 3 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.
AddApiKeyModal.AddApiKeyModal (cognitive 93) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:11— AddApiKeyModal.AddApiKeyModal has cognitive complexity 93 (threshold 15). Drivers by points: boolean chains 44, ternaries 17 (25 pts), if/else 15 (17 pts), error handling 4 (6 pts), loops 1 (nesting depth added 12). Of this number, 55 points are the body's own statements and 38 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.
claudeToOpenAIResponse (cognitive 91) open-sse/translator/response/claude-to-openai.js:19— claudeToOpenAIResponse has cognitive complexity 91 (threshold 15). Drivers by points: if/else 20 (43 pts), ternaries 10 (28 pts), boolean chains 19, match/switch 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
createResponsesApiTransformStream::transform (cognitive 90) open-sse/transformer/responsesTransformer.js:243— createResponsesApiTransformStream::transform has cognitive complexity 90 (threshold 15). Drivers by points: if/else 22 (67 pts), loops 4 (10 pts), boolean chains 7, ternaries 1 (3 pts), error handling 1 (2 pts), other 1 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openaiResponsesToOpenAIResponse (cognitive 88) open-sse/translator/response/openai-responses.js:510— openaiResponsesToOpenAIResponse has cognitive complexity 88 (threshold 15). Drivers by points: boolean chains 42, if/else 25 (42 pts), other 2, 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.
handleForcedSSEToJson (cognitive 87) open-sse/handlers/chatCore/sseToJsonHandler.js:183— handleForcedSSEToJson has cognitive complexity 87 (threshold 15). Drivers by points: boolean chains 36, if/else 15 (23 pts), ternaries 9 (20 pts), error handling 4 (6 pts), loops 1 (2 pts) (nesting depth added 22). Of this number, 83 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
imageGenerationCore.handleImageGenerationCore (cognitive 86) open-sse/handlers/imageGenerationCore.js:29— imageGenerationCore.handleImageGenerationCore has cognitive complexity 86 (threshold 15). Drivers by points: if/else 19 (31 pts), ternaries 8 (26 pts), error handling 7 (15 pts), boolean chains 14 (nesting depth added 38). 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.
page.CombosPage (cognitive 86) src/app/(dashboard)/dashboard/combos/page.js:55— page.CombosPage has cognitive complexity 86 (threshold 15). Drivers by points: boolean chains 27, if/else 21 (24 pts), ternaries 17 (22 pts), error handling 10, loops 3 (nesting depth added 8). Most of this is not in the body itself: 11 of the 86 points are its own statements and the rest belongs to 26 function literals inside it that branch (lines 96, 156, 330, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ConnectionRow (cognitive 84) src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:9— ConnectionRow has cognitive complexity 84 (threshold 15). Drivers by points: boolean chains 34, ternaries 29 (31 pts), if/else 15, error handling 1 (2 pts), other 2 (nesting depth added 3). Of this number, 64 points are the body's own statements and 20 belong to 23 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CodexToolCard.CodexToolCard (cognitive 82) src/app/(dashboard)/dashboard/cli-tools/components/CodexToolCard.js:13— CodexToolCard.CodexToolCard has cognitive complexity 82 (threshold 15). Drivers by points: boolean chains 41, if/else 21 (24 pts), ternaries 7 (9 pts), error handling 8 (nesting depth added 5). Of this number, 27 points are the body's own statements and 55 belong to 21 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.
page.ComboDetailPage (cognitive 82) src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:47— page.ComboDetailPage has cognitive complexity 82 (threshold 15). Drivers by points: boolean chains 36, if/else 27, ternaries 10 (12 pts), error handling 4 (6 pts), loops 1 (nesting depth added 4). Of this number, 23 points are the body's own statements and 59 belong to 12 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.
ZedAuthModal (cognitive 82) src/shared/components/ZedAuthModal.js:14— ZedAuthModal has cognitive complexity 82 (threshold 15). Drivers by points: boolean chains 30, if/else 29 (30 pts), ternaries 10 (11 pts), error handling 8 (10 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 15 of the 82 points are its own statements and the rest belongs to 21 function items inside it that branch ((anonymous), (anonymous)::(anonymous), (anonymous)::tick, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
transformRequest (cognitive 76) open-sse/executors/codex.js:412— transformRequest has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 21, ternaries 7 (16 pts), loops 4 (7 pts) (nesting depth added 23). Of this number, 73 points are the body's own statements and 3 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.
openaiToClaudeRequest (cognitive 76) open-sse/translator/request/openai-to-claude.js:16— openaiToClaudeRequest has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (46 pts), loops 5 (12 pts), boolean chains 10, ternaries 2 (7 pts), other 1 (nesting depth added 37). Of this number, 73 points are the body's own statements and 3 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoworkToolCard.CoworkToolCard (cognitive 75) src/app/(dashboard)/dashboard/cli-tools/components/CoworkToolCard.js:19— CoworkToolCard.CoworkToolCard has cognitive complexity 75 (threshold 15). Drivers by points: boolean chains 42, if/else 22, ternaries 6 (7 pts), error handling 4 (nesting depth added 1). Of this number, 26 points are the body's own statements and 49 belong to 22 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.
rewriteBlock (cognitive 74) open-sse/shared/qoder/attachments.js:158— rewriteBlock has cognitive complexity 74 (threshold 15). Drivers by points: if/else 22 (44 pts), boolean chains 20, ternaries 5 (10 pts) (nesting depth added 27). Of this number, 70 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.
EditConnectionModal.EditConnectionModal (cognitive 72) src/shared/components/EditConnectionModal.js:12— EditConnectionModal.EditConnectionModal has cognitive complexity 72 (threshold 15). Drivers by points: boolean chains 26, ternaries 13 (21 pts), if/else 15 (20 pts), error handling 3 (5 pts) (nesting depth added 15). Most of this is not in the body itself: 15 of the 72 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 116, 32, 91, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UsageStats (cognitive 72) src/shared/components/UsageStats.js:206— UsageStats has cognitive complexity 72 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 21, if/else 15 (18 pts), error handling 3, other 2, loops 1, match/switch 1 (nesting depth added 12). Of this number, 22 points are the body's own statements and 50 belong to 37 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeToolCard.ClaudeToolCard (cognitive 71) src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:29— ClaudeToolCard.ClaudeToolCard has cognitive complexity 71 (threshold 15). Drivers by points: boolean chains 31, if/else 24 (29 pts), ternaries 6 (7 pts), error handling 4 (nesting depth added 6). Of this number, 17 points are the body's own statements and 54 belong to 22 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.
OpenClawToolCard.OpenClawToolCard (cognitive 71) src/app/(dashboard)/dashboard/cli-tools/components/OpenClawToolCard.js:11— OpenClawToolCard.OpenClawToolCard has cognitive complexity 71 (threshold 15). Drivers by points: boolean chains 34, if/else 19 (26 pts), ternaries 6 (7 pts), error handling 4 (nesting depth added 8). Of this number, 21 points are the body's own statements and 50 belong to 16 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.
OpenCodeToolCard.OpenCodeToolCard (cognitive 70) src/app/(dashboard)/dashboard/cli-tools/components/OpenCodeToolCard.js:11— OpenCodeToolCard.OpenCodeToolCard has cognitive complexity 70 (threshold 15). Drivers by points: boolean chains 34, if/else 15 (16 pts), ternaries 12 (15 pts), error handling 5 (nesting depth added 4). Of this number, 21 points are the body's own statements and 49 belong to 18 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.
openai-to-claude.getContentBlocksFromMessage (cognitive 66) open-sse/translator/request/openai-to-claude.js:201— openai-to-claude.getContentBlocksFromMessage has cognitive complexity 66 (threshold 15). Drivers by points: if/else 22 (46 pts), loops 3 (9 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HermesToolCard.HermesToolCard (cognitive 66) src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:15— HermesToolCard.HermesToolCard has cognitive complexity 66 (threshold 15). Drivers by points: boolean chains 29, if/else 21 (26 pts), ternaries 4 (5 pts), error handling 4, loops 1 (2 pts) (nesting depth added 7). Of this number, 19 points are the body's own statements and 47 belong to 15 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.
index.compressMessages (cognitive 65) open-sse/rtk/index.js:8— index.compressMessages has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (42 pts), loops 5 (14 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1 (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.
DroidToolCard.DroidToolCard (cognitive 65) src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js:13— DroidToolCard.DroidToolCard has cognitive complexity 65 (threshold 15). Drivers by points: boolean chains 32, if/else 17 (21 pts), ternaries 7 (8 pts), error handling 4 (nesting depth added 5). Of this number, 17 points are the body's own statements and 48 belong to 16 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.
handleSingleModelChat (cognitive 65) src/sse/handlers/chat.js:167— handleSingleModelChat has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 22, ternaries 3 (6 pts), error handling 1 (4 pts), loops 1 (nesting depth added 25). Of this number, 59 points are the body's own statements and 6 belong to 6 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
kiroToClaudeResponse (cognitive 65) open-sse/translator/response/kiro-to-claude.js:57— kiroToClaudeResponse has cognitive complexity 65 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 10, ternaries 4 (7 pts), loops 2 (5 pts), other 3, error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JcodeToolCard.JcodeToolCard (cognitive 64) src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js:11— JcodeToolCard.JcodeToolCard has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 29, if/else 17 (23 pts), ternaries 7 (8 pts), error handling 4 (nesting depth added 7). Of this number, 18 points are the body's own statements and 46 belong to 14 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.
transformRequest (cognitive 64) open-sse/executors/antigravity.js:137— transformRequest has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 23, if/else 14 (21 pts), loops 5 (12 pts), ternaries 4 (8 pts) (nesting depth added 18). Of this number, 50 points are the body's own statements and 14 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openaiToClaudeResponse (cognitive 64) open-sse/translator/response/openai-to-claude.js:71— openaiToClaudeResponse has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 11, ternaries 5 (9 pts), loops 2 (4 pts), other 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
gemini-to-openai.geminiToOpenAIResponse (cognitive 63) open-sse/translator/response/gemini-to-openai.js:41— gemini-to-openai.geminiToOpenAIResponse has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 14, ternaries 3 (10 pts), loops 1 (2 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CursorExecutor.transformProtobufToSSE (cognitive 63) open-sse/executors/cursor.js:1055— CursorExecutor.transformProtobufToSSE has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (44 pts), ternaries 3 (8 pts), boolean chains 6, error handling 1 (3 pts), loops 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrokBuildToolCard.GrokBuildToolCard (cognitive 62) src/app/(dashboard)/dashboard/cli-tools/components/GrokBuildToolCard.js:63— GrokBuildToolCard.GrokBuildToolCard has cognitive complexity 62 (threshold 15). Drivers by points: boolean chains 32, if/else 14 (16 pts), ternaries 5 (8 pts), error handling 4, loops 2 (nesting depth added 5). Of this number, 28 points are the body's own statements and 34 belong to 12 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
convertClaudeMessage (cognitive 62) open-sse/translator/request/claude-to-openai.js:144— convertClaudeMessage has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (38 pts), ternaries 3 (8 pts), loops 2 (7 pts), boolean chains 6, match/switch 1 (3 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.
handleRun (cognitive 61) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:148— handleRun has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (33 pts), error handling 4 (9 pts), loops 3 (9 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
paramSupport.stripUnsupportedParams (cognitive 60) open-sse/translator/concerns/paramSupport.js:48— paramSupport.stripUnsupportedParams has cognitive complexity 60 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 5 (13 pts), boolean chains 11 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kiro-to-openai.kiroToOpenAIResponse (cognitive 60) open-sse/translator/response/kiro-to-openai.js:31— kiro-to-openai.kiroToOpenAIResponse has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 16, ternaries 5 (10 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 16). Of this number, 56 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.
combo.detectRequiredCapabilities (cognitive 60) open-sse/services/combo.js:105— combo.detectRequiredCapabilities has cognitive complexity 60 (threshold 15). Drivers by points: if/else 30 (37 pts), boolean chains 16, loops 5 (7 pts) (nesting depth added 9). Most of this is not in the body itself: 6 of the 60 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 141, 117, 109, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
normalizeCodexTools (cognitive 60) open-sse/executors/codex.js:78— normalizeCodexTools has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 10 (15 pts), boolean chains 14, loops 2 (4 pts) (nesting depth added 19). Most of this is not in the body itself: 14 of the 60 points are its own statements and the rest belongs to one function literal inside it that branches (line 84). 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.
parseGrokCliBilling (cognitive 60) open-sse/services/usage/grok-cli.js:141— parseGrokCliBilling has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 9 (20 pts), boolean chains 17, if/else 8 (11 pts), other 11, loops 1 (nesting depth added 14). Of this number, 56 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.
extractClientToolResults (cognitive 58) open-sse/executors/devin-cli.js:152— extractClientToolResults has cognitive complexity 58 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 4 (10 pts), ternaries 2 (10 pts), boolean chains 8, other 2 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
parseSSEToOpenAIResponse (cognitive 58) open-sse/handlers/chatCore/sseToJsonHandler.js:113— parseSSEToOpenAIResponse has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (38 pts), boolean chains 11, loops 3 (5 pts), error handling 1 (2 pts), other 1, ternaries 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.
CopilotToolCard.CopilotToolCard (cognitive 56) src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:11— CopilotToolCard.CopilotToolCard has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 23, if/else 13 (15 pts), ternaries 10 (13 pts), error handling 5 (nesting depth added 5). Most of this is not in the body itself: 12 of the 56 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 114, 66, 163, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ClineToolCard.ClineToolCard (cognitive 56) src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.js:11— ClineToolCard.ClineToolCard has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 29, if/else 12 (13 pts), ternaries 8 (10 pts), error handling 4 (nesting depth added 3). Of this number, 19 points are the body's own statements and 37 belong to 12 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sendMessage (cognitive 56) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:573— sendMessage has cognitive complexity 56 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 13, ternaries 7 (12 pts), error handling 4 (8 pts), loops 2 (3 pts) (nesting depth added 19). Of this number, 41 points are the body's own statements and 15 belong to 17 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.
antigravity-weekly.parseWeeklyQuotaSummary (cognitive 55) open-sse/services/usage/antigravity-weekly.js:49— antigravity-weekly.parseWeeklyQuotaSummary has cognitive complexity 55 (threshold 15). Drivers by points: if/else 9 (25 pts), ternaries 5 (13 pts), boolean chains 11, loops 3 (6 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
normalizeGrokCliTools (cognitive 55) open-sse/executors/grok-cli.js:243— normalizeGrokCliTools has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 18, ternaries 11 (14 pts), loops 1, other 1 (nesting depth added 8). Of this number, 21 points are the body's own statements and 34 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.
responsesApi.convertResponsesApiFormat (cognitive 54) open-sse/translator/formats/responsesApi.js:84— responsesApi.convertResponsesApiFormat has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 3 (7 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 28). Of this number, 40 points are the body's own statements and 14 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
commandcode.inspectAndWrapCommandCodeResponse (cognitive 54) open-sse/executors/commandcode.js:140— commandcode.inspectAndWrapCommandCodeResponse has cognitive complexity 54 (threshold 15). Drivers by points: if/else 9 (24 pts), error handling 5 (12 pts), ternaries 4 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SttExampleCard.SttExampleCard (cognitive 54) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:11— SttExampleCard.SttExampleCard has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 28, ternaries 16 (17 pts), if/else 8, error handling 1 (nesting depth added 1). Of this number, 31 points are the body's own statements and 23 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.POST (cognitive 54) src/app/api/oauth/xiaomi-mimo/api-key/route.js:11— route.POST has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 27, ternaries 12 (17 pts), if/else 6 (7 pts), error handling 2 (3 pts) (nesting depth added 7). Of this number, 48 points are the body's own statements and 6 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.
AntigravityToolCard.AntigravityToolCard (cognitive 53) src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.js:7— AntigravityToolCard.AntigravityToolCard has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 22, error handling 6, ternaries 2 (nesting depth added 1). Of this number, 16 points are the body's own statements and 37 belong to 16 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.
page.LoginPage (cognitive 53) src/app/login/page.js:6— page.LoginPage has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 23, if/else 12 (16 pts), ternaries 7 (11 pts), error handling 3 (nesting depth added 8). Of this number, 26 points are the body's own statements and 27 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.
sync.build (cognitive 53) src/lib/modelCatalog/sync.js:80— sync.build has cognitive complexity 53 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 6 (12 pts), boolean chains 10, ternaries 2 (5 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
importLegacyMain (cognitive 53) src/lib/db/migrate.js:112— importLegacyMain has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 33, other 11, loops 4, ternaries 3, if/else 2. Of this number, 19 points are the body's own statements and 34 belong to 10 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.
antigravity-to-openai.convertContent (cognitive 52) open-sse/translator/request/antigravity-to-openai.js:120— antigravity-to-openai.convertContent has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 10, ternaries 2 (3 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openai-to-antigravity.openaiToAntigravityResponse (cognitive 52) open-sse/translator/response/openai-to-antigravity.js:9— openai-to-antigravity.openaiToAntigravityResponse has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 12, loops 2 (4 pts), error handling 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gitStatus.gitStatus (cognitive 52) open-sse/rtk/filters/gitStatus.js:13— gitStatus.gitStatus has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (38 pts), boolean chains 7, loops 4 (7 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.
commandcode-to-openai.commandCodeToOpenAIResponse (cognitive 51) open-sse/translator/response/commandcode-to-openai.js:52— commandcode-to-openai.commandCodeToOpenAIResponse has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 13, ternaries 7 (13 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qoder.wrapQoderSSE (cognitive 51) open-sse/executors/qoder.js:426— qoder.wrapQoderSSE has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (25 pts), ternaries 4 (8 pts), boolean chains 7, error handling 5 (7 pts), loops 3 (4 pts) (nesting depth added 15). Of this number, 33 points are the body's own statements and 18 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.
DeepSeekTuiToolCard.DeepSeekTuiToolCard (cognitive 51) src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js:13— DeepSeekTuiToolCard.DeepSeekTuiToolCard has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 25, if/else 15 (17 pts), ternaries 4 (5 pts), error handling 4 (nesting depth added 3). Of this number, 17 points are the body's own statements and 34 belong to 13 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.
getAntigravityUsage (cognitive 51) open-sse/services/usage/google.js:120— getAntigravityUsage has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 16, ternaries 3 (7 pts), error handling 2, loops 1 (2 pts), other 2 (nesting depth added 15). Of this number, 38 points are the body's own statements and 13 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.
importDb (cognitive 51) src/lib/db/index.js:96— importDb has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 34, loops 9, ternaries 3 (6 pts), if/else 2 (nesting depth added 3). Most of this is not in the body itself: 3 of the 51 points are its own statements and the rest belongs to one function literal inside it that branches (line 102). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
buildOutput.buildOutput (cognitive 50) open-sse/rtk/filters/buildOutput.js:9— buildOutput.buildOutput has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 8, loops 4 (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.
codex.parseStream (cognitive 50) open-sse/handlers/imageProviders/codex.js:63— codex.parseStream has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (30 pts), error handling 2 (8 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConnectionsCard.ConnectionRow (cognitive 50) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:33— ConnectionsCard.ConnectionRow has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 24, ternaries 16 (20 pts), if/else 4, error handling 1 (2 pts) (nesting depth added 5). Of this number, 42 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
usageRepo.getChartData (cognitive 50) src/lib/db/repos/usageRepo.js:671— usageRepo.getChartData has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 17, if/else 7 (14 pts), ternaries 8 (12 pts), loops 4 (7 pts) (nesting depth added 14). Of this number, 33 points are the body's own statements and 17 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.
buildPromptText (cognitive 50) open-sse/executors/devin-cli.js:252— buildPromptText has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 3 (11 pts), boolean chains 7, loops 2 (4 pts), other 4 (nesting depth added 21). Of this number, 45 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.
startServer (cognitive 50) REDACTED:610— startServer has cognitive complexity 50 (threshold 15). Drivers by points: if/else 25 (33 pts), error handling 6 (9 pts), boolean chains 3, ternaries 2 (3 pts), loops 1, other 1 (nesting depth added 12). Most of this is not in the body itself: 4 of the 50 points are its own statements and the rest belongs to 26 function items inside it that branch ((anonymous), tryRestart, cleanup, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
handleNonStreamingResponse (cognitive 50) open-sse/handlers/chatCore/nonStreamingHandler.js:287— handleNonStreamingResponse has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 17, error handling 3 (5 pts), loops 2 (5 pts), ternaries 1 (nesting depth added 12). Of this number, 49 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kiroModels.resolveKiroModels (cognitive 49) open-sse/services/kiroModels.js:236— kiroModels.resolveKiroModels has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 10, error handling 3 (10 pts), loops 2 (3 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.
dashboardGuard.proxy (cognitive 49) src/dashboardGuard.js:207— dashboardGuard.proxy has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (33 pts), ternaries 2 (8 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
flattenToolHistory (cognitive 49) open-sse/services/combo.js:21— flattenToolHistory has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 4 (12 pts), boolean chains 9, loops 1 (3 pts), other 2 (nesting depth added 24). Most of this is not in the body itself: 0 of the 49 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 24, 30, 23, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
createProviderConnection (cognitive 49) src/lib/db/repos/connectionsRepo.js:135— createProviderConnection has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 19, ternaries 3, loops 1, other 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 49 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 140, 161, 192). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
transcribeGeminiLive (cognitive 49) open-sse/handlers/geminiLiveStt.js:94— transcribeGeminiLive has cognitive complexity 49 (threshold 15). Drivers by points: if/else 26 (27 pts), boolean chains 9, ternaries 6 (8 pts), error handling 4, loops 1 (nesting depth added 3). Most of this is not in the body itself: 5 of the 49 points are its own statements and the rest belongs to 15 function items inside it that branch ((anonymous)::open::onMessage, (anonymous)::shutdown, (anonymous)::open::onClose, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
headroom.compressWithHeadroom (cognitive 48) open-sse/rtk/headroom.js:248— headroom.compressWithHeadroom has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 6, ternaries 2 (3 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KiloToolCard.KiloToolCard (cognitive 48) src/app/(dashboard)/dashboard/cli-tools/components/KiloToolCard.js:11— KiloToolCard.KiloToolCard has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 24, if/else 10 (11 pts), ternaries 7 (9 pts), error handling 4 (nesting depth added 3). Of this number, 16 points are the body's own statements and 32 belong to 11 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.POST (cognitive 48) src/app/api/oauth/codex/bulk-import/route.js:19— route.POST has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 14, error handling 2 (3 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KiroAuthModal (cognitive 48) src/shared/components/KiroAuthModal.js:11— KiroAuthModal has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 26, if/else 11 (12 pts), error handling 4, loops 3, ternaries 3 (nesting depth added 1). Of this number, 24 points are the body's own statements and 24 belong to 24 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PxpipeClient.PxpipeClient (cognitive 47) src/app/(dashboard)/dashboard/pxpipe/PxpipeClient.js:61— PxpipeClient.PxpipeClient has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 31 (39 pts), boolean chains 7, error handling 1 (nesting depth added 8). Of this number, 31 points are the body's own statements and 16 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.
extractThinking (cognitive 47) open-sse/translator/concerns/thinkingUnified.js:50— extractThinking has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 11, other 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pipeTransformedSSE (cognitive 47) REDACTED:78— pipeTransformedSSE has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (9 pts), error handling 3 (6 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CursorExecutor.transformProtobufToJSON (cognitive 46) open-sse/executors/cursor.js:902— CursorExecutor.transformProtobufToJSON has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 5, error handling 1 (3 pts), loops 2, ternaries 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.
TraeExecutor.execute (cognitive 46) open-sse/executors/trae.js:176— TraeExecutor.execute has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 14, error handling 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 11). Of this number, 16 points are the body's own statements and 30 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.
prefetch.collectImageRefs (cognitive 46) open-sse/translator/concerns/prefetch.js:19— prefetch.collectImageRefs has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 6 (11 pts), boolean chains 5, ternaries 1 (4 pts), match/switch 1 (nesting depth added 25). Most of this is not in the body itself: 15 of the 46 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 21, 34, 27). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
MitmServerCard.MitmServerCard (cognitive 46) REDACTED:12— MitmServerCard.MitmServerCard has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 25, if/else 11 (13 pts), ternaries 5 (6 pts), error handling 2 (nesting depth added 3). Of this number, 22 points are the body's own statements and 24 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
QuotaTable.QuotaTable (cognitive 46) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js:87— QuotaTable.QuotaTable has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 23 (34 pts), boolean chains 11, if/else 1 (nesting depth added 11). Most of this is not in the body itself: 10 of the 46 points are its own statements and the rest belongs to one function literal inside it that branches (line 152). 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.
checkAndRefreshToken (cognitive 46) src/sse/services/tokenRefresh.js:224— checkAndRefreshToken has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 7 (17 pts), boolean chains 14, if/else 8 (13 pts), error handling 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
toolCall.ensureToolCallIds (cognitive 45) open-sse/translator/concerns/toolCall.js:27— toolCall.ensureToolCallIds has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 11, loops 3 (7 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.
gitDiff.gitDiff (cognitive 45) open-sse/rtk/filters/gitDiff.js:5— gitDiff.gitDiff has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 7, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConnectionsCard.ConnectionsCard (cognitive 45) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:298— ConnectionsCard.ConnectionsCard has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 14, if/else 13, ternaries 8 (10 pts), error handling 8 (nesting depth added 2). Most of this is not in the body itself: 4 of the 45 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 309, 330, 410, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pipeTransformedEventStream (cognitive 45) REDACTED:157— pipeTransformedEventStream has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (9 pts), error handling 3 (6 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
antigravity-to-openai.antigravityToOpenAIRequest (cognitive 44) open-sse/translator/request/antigravity-to-openai.js:11— antigravity-to-openai.antigravityToOpenAIRequest has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 3 (8 pts), boolean chains 6 (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.
buildHeaders (cognitive 44) open-sse/executors/default.js:153— buildHeaders has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 14, loops 2 (4 pts), ternaries 1 (nesting depth added 15). Of this number, 43 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MitmToolCard (cognitive 44) src/app/(dashboard)/dashboard/cli-tools/components/MitmToolCard.js:14— MitmToolCard has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 20, if/else 11 (12 pts), ternaries 8, error handling 3, other 1 (nesting depth added 1). Of this number, 18 points are the body's own statements and 26 belong to 22 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
handleVideoProxyCore (cognitive 44) open-sse/handlers/videoCore.js:77— handleVideoProxyCore has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 6 (12 pts), boolean chains 8, ternaries 6 (nesting depth added 12). Of this number, 36 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· POST (cognitive 44) · ×1
POST (cognitive 44) src/app/api/provider-nodes/validate/route.js:55— POST has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (27 pts), error handling 4 (8 pts), ternaries 2 (5 pts), boolean chains 4 (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.
combo.handleComboChat (cognitive 43) open-sse/services/combo.js:280— combo.handleComboChat has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 12, error handling 3 (7 pts), loops 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XiaomiMimoAuthModal.XiaomiMimoAuthModal (cognitive 43) src/shared/components/XiaomiMimoAuthModal.js:28— XiaomiMimoAuthModal.XiaomiMimoAuthModal has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 28, if/else 8 (9 pts), error handling 3, ternaries 2 (3 pts) (nesting depth added 2). Most of this is not in the body itself: 8 of the 43 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 131, 102, 192, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
convertOpenAIToKiro (cognitive 43) src/mitm/handlers/kiro.js:365— convertOpenAIToKiro has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 10, ternaries 2 (4 pts), loops 1 (2 pts), other 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.
McpMarketplaceModal (cognitive 43) REDACTED:9— McpMarketplaceModal has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 22, if/else 9, ternaries 9, error handling 2, loops 1. Most of this is not in the body itself: 4 of the 43 points are its own statements and the rest belongs to 34 function items inside it that branch ((anonymous), (anonymous)::(anonymous), fetchTools, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
claude.anchorClaudeCache (cognitive 42) open-sse/translator/formats/claude.js:385— claude.anchorClaudeCache has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 5 (12 pts), boolean chains 4 (nesting depth added 17). Of this number, 33 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qoder.normalizeContent (cognitive 42) open-sse/executors/qoder.js:86— qoder.normalizeContent has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 11, ternaries 3 (9 pts), loops 1 (nesting depth added 10). Of this number, 34 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ollamaTransform.transformToOllama (cognitive 42) open-sse/utils/ollamaTransform.js:2— ollamaTransform.transformToOllama has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (27 pts), error handling 2 (6 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 22). Of this number, 37 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.
page.MediaProviderDetailPage (cognitive 42) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js:18— page.MediaProviderDetailPage has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 25, if/else 10, ternaries 5 (6 pts), error handling 1 (nesting depth added 1). Of this number, 33 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
transformRequest (cognitive 42) open-sse/executors/grok-cli.js:419— transformRequest has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 14, ternaries 2 (5 pts), loops 1, other 1 (nesting depth added 9). Of this number, 37 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.
provider.detectFormat (cognitive 41) open-sse/services/provider.js:34— provider.detectFormat has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 13 (nesting depth added 16). Of this number, 38 points are the body's own statements and 3 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.
readIntegrityAttempt (cognitive 41) open-sse/executors/kiro.js:543— readIntegrityAttempt has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 6 (12 pts), boolean chains 10, error handling 3 (6 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.
extractAnswer (cognitive 41) open-sse/handlers/search/chatSearch.js:382— extractAnswer has cognitive complexity 41 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 5 (12 pts), loops 5 (10 pts), boolean chains 5 (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.
getMiniMaxUsage (cognitive 41) open-sse/services/usage/minimax.js:133— getMiniMaxUsage has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 7, error handling 2 (5 pts), other 4, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openai-to-commandcode.convertMessages (cognitive 40) open-sse/translator/request/openai-to-commandcode.js:106— openai-to-commandcode.convertMessages has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 9, ternaries 2 (6 pts), loops 2 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ToolDetailClient.ToolDetailClient (cognitive 40) src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.js:17— ToolDetailClient.ToolDetailClient has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 16, error handling 1, match/switch 1, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 40 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 31, 74, 122, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
extractAnswer (cognitive 40) open-sse/handlers/search/chatSearch.js:302— extractAnswer has cognitive complexity 40 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 10, loops 3 (7 pts), ternaries 3 (6 pts), error handling 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseExecutor.execute (cognitive 39) open-sse/executors/base.js:100— BaseExecutor.execute has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 8, ternaries 2 (5 pts), error handling 1 (2 pts), loops 1 (nesting depth added 16). Of this number, 31 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gemini.mergeAllOf (cognitive 39) open-sse/translator/formats/gemini.js:206— gemini.mergeAllOf has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 3 (7 pts), boolean chains 5 (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.
cursorProtobuf.encodeRequest (cognitive 38) open-sse/utils/cursorProtobuf.js:456— cursorProtobuf.encodeRequest has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 9, ternaries 7 (8 pts), loops 3 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.TranslatorPage (cognitive 38) src/app/(dashboard)/dashboard/translator/page.js:30— page.TranslatorPage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 14, error handling 6, ternaries 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 136, 232, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
openaiToOpenAIResponsesResponse (cognitive 38) open-sse/translator/response/openai-responses.js:50— openaiToOpenAIResponsesResponse has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 6, loops 3 (6 pts), ternaries 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestDetailsTab (cognitive 38) src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js:102— RequestDetailsTab has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 23, ternaries 10, if/else 3, error handling 2. Of this number, 26 points are the body's own statements and 12 belong to 18 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
bodyHasSessionHints (cognitive 38) open-sse/executors/opencode.js:218— bodyHasSessionHints has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 9, loops 2 (7 pts), ternaries 2, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runConnect (cognitive 38) REDACTED:179— runConnect has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12, ternaries 4 (8 pts), loops 4 (7 pts), boolean chains 5, error handling 2 (5 pts), other 1 (nesting depth added 10). Of this number, 36 points are the body's own statements and 2 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
sse.createQoderSseCoalescer (cognitive 37) open-sse/shared/qoder/sse.js:105— sse.createQoderSseCoalescer has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 13, ternaries 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 0 of the 37 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 149, 127, 141, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
perplexity-web.readPplxSseEvents (cognitive 37) open-sse/executors/perplexity-web.js:92— perplexity-web.readPplxSseEvents has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseUrlSelect.BaseUrlSelect (cognitive 37) src/app/(dashboard)/dashboard/cli-tools/components/BaseUrlSelect.js:42— BaseUrlSelect.BaseUrlSelect has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 11, ternaries 4 (5 pts), error handling 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 118, 90, 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.
DefaultToolCard.DefaultToolCard (cognitive 37) src/app/(dashboard)/dashboard/cli-tools/components/DefaultToolCard.js:10— DefaultToolCard.DefaultToolCard has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 20, if/else 10, ternaries 6 (7 pts) (nesting depth added 1). Most of this is not in the body itself: 3 of the 37 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 147, 20, 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.
systemone.handleSystemone (cognitive 37) src/sse/handlers/systemone.js:23— systemone.handleSystemone has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 7, 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.
openai-to-ollama.normalizeMessages (cognitive 36) open-sse/translator/request/openai-to-ollama.js:65— openai-to-ollama.normalizeMessages has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 10, loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 14). Of this number, 29 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.
nonStreamingHandler.openAICompletionToResponses (cognitive 36) open-sse/handlers/chatCore/nonStreamingHandler.js:83— nonStreamingHandler.openAICompletionToResponses has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 19, ternaries 7 (13 pts), if/else 3, loops 1 (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
headroom.collectKiroHeadroomMessages (cognitive 36) open-sse/rtk/headroom.js:100— headroom.collectKiroHeadroomMessages has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (9 pts), ternaries 4 (9 pts), boolean chains 5 (nesting depth added 15). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 126, 113, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EmbeddingExampleCard.EmbeddingExampleCard (cognitive 36) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/EmbeddingExampleCard.js:21— EmbeddingExampleCard.EmbeddingExampleCard has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 17, ternaries 11, if/else 7, error handling 1. Of this number, 18 points are the body's own statements and 18 belong to 8 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.
route.POST (cognitive 36) src/app/api/oauth/grok-cli/bulk-import/route.js:21— route.POST has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (13 pts), ternaries 2 (4 pts), error handling 2 (3 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.
route.GET (cognitive 36) src/app/api/oauth/kiro/auto-import/route.js:12— route.GET has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 6 (11 pts), boolean chains 6, 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.
config.normalizeLocale (cognitive 36) src/i18n/config.js:79— config.normalizeLocale has cognitive complexity 36 (threshold 15). Drivers by points: if/else 35, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
restoreToolNames (cognitive 36) open-sse/utils/opencodeFingerprint.js:168— restoreToolNames has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 11, ternaries 3 (6 pts), loops 1 (2 pts) (nesting depth added 9). Most of this is not in the body itself: 15 of the 36 points are its own statements and the rest belongs to 6 function items inside it that branch ((anonymous), (anonymous), (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
cli.killAllAppProcesses (cognitive 35) REDACTED:265— cli.killAllAppProcesses has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 7 (10 pts), boolean chains 8 (nesting depth added 10). Most of this is not in the body itself: 0 of the 35 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 266, 290, 316, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
gemini.convertOpenAIContentToParts (cognitive 35) open-sse/translator/formats/gemini.js:55— gemini.convertOpenAIContentToParts has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 7, ternaries 1 (4 pts), loops 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.
index.translateRequest (cognitive 35) open-sse/translator/index.js:68— index.translateRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 4 (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.
devin-cli.resolveWorkspaceCwd (cognitive 35) open-sse/executors/devin-cli.js:197— devin-cli.resolveWorkspaceCwd has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 5 (9 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 13). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 213, 199, 209). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
gitLog.gitLog (cognitive 35) open-sse/rtk/filters/gitLog.js:6— gitLog.gitLog has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.transformOpenAISSEToGeminiSSE (cognitive 35) src/app/api/v1beta/models/[...path]/route.js:427— route.transformOpenAISSEToGeminiSSE has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 10, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proxyAccountRequest (cognitive 35) src/lib/mimoLoginSession.js:547— proxyAccountRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 8, ternaries 2 (3 pts), loops 2, error handling 1 (nesting depth added 10). Of this number, 31 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rewriteQoderMessageAttachments (cognitive 35) open-sse/shared/qoder/attachments.js:287— rewriteQoderMessageAttachments has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (12 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude.fixToolUseOrdering (cognitive 34) open-sse/translator/formats/claude.js:116— claude.fixToolUseOrdering has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (9 pts), loops 3 (6 pts), boolean chains 3 (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.
WindsurfExecutor.transformToSSE (cognitive 34) open-sse/executors/windsurf.js:435— WindsurfExecutor.transformToSSE has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 5, loops 2 (3 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 17 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.
embeddings.handleEmbeddings (cognitive 34) src/sse/handlers/embeddings.js:32— embeddings.handleEmbeddings has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 5, 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.
normalizeGrokCliInputItem (cognitive 34) open-sse/executors/grok-cli.js:161— normalizeGrokCliInputItem has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 5 (10 pts), boolean chains 9, other 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.
claude.capCacheControlBlocks (cognitive 33) open-sse/translator/formats/claude.js:91— claude.capCacheControlBlocks has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (11 pts), boolean chains 2, ternaries 2 (nesting depth added 16). Of this number, 28 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.
copilotModels.resolveCopilotModels (cognitive 33) open-sse/services/copilotModels.js:94— copilotModels.resolveCopilotModels has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (10 pts), boolean chains 7 (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.
route.POST (cognitive 33) src/app/api/providers/route.js:87— route.POST has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 11, ternaries 3 (4 pts), error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
route.forwardGeminiNativeRequest (cognitive 33) src/app/api/v1beta/models/[...path]/route.js:238— route.forwardGeminiNativeRequest has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stt.handleStt (cognitive 33) src/sse/handlers/stt.js:37— stt.handleStt has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 33) src/app/(dashboard)/dashboard/providers/[id]/page.js:305— (anonymous) has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (13 pts), loops 1 (3 pts), ternaries 3, 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.
transformOpenAISSEToGeminiSSE::transform (cognitive 33) src/app/api/v1beta/models/[...path]/route.js:436— transformOpenAISSEToGeminiSSE::transform has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 9, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reconcileToolPair (cognitive 33) open-sse/translator/concerns/kiroConversation.js:261— reconcileToolPair has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 4 (8 pts), boolean chains 5, loops 2 (nesting depth added 10). Of this number, 31 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.
proxyAwareFetch (cognitive 33) open-sse/utils/proxyFetch.js:332— proxyAwareFetch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 3 (7 pts), boolean chains 6, ternaries 3 (4 pts), other 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.
translateResponse (cognitive 33) open-sse/translator/index.js:181— translateResponse has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 4 (13 pts), loops 1 (3 pts), boolean chains 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.
fetchClaudeUsageRaw (cognitive 33) open-sse/services/usage/claude.js:62— fetchClaudeUsageRaw has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 6, loops 2 (5 pts), error handling 1, other 1 (nesting depth added 14). Of this number, 31 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.killProxyByPidFile (cognitive 32) REDACTED:379— cli.killProxyByPidFile has cognitive complexity 32 (threshold 15). Drivers by points: error handling 9 (22 pts), if/else 7 (10 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.
claude-to-kiro.claudeToKiroRequest (cognitive 32) open-sse/translator/request/claude-to-kiro.js:231— claude-to-kiro.claudeToKiroRequest has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 12, ternaries 3, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
usageTracking.extractUsage (cognitive 32) open-sse/utils/usageTracking.js:239— usageTracking.extractUsage has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 23, if/else 7, ternaries 1 (2 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.
bypassHandler.handleBypassRequest (cognitive 32) open-sse/utils/bypassHandler.js:11— bypassHandler.handleBypassRequest has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 4 (8 pts), boolean chains 5 (nesting depth added 8). Of this number, 30 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sseToJsonHandler.chatCompletionToResponses (cognitive 32) open-sse/handlers/chatCore/sseToJsonHandler.js:53— sseToJsonHandler.chatCompletionToResponses has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 18, ternaries 5 (10 pts), if/else 3, loops 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.GET (cognitive 32) src/app/api/providers/[id]/models/route.js:533— route.GET has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 7, ternaries 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.
manager.stopServer (cognitive 32) REDACTED:746— manager.stopServer has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), error handling 5 (9 pts), boolean chains 3, ternaries 1 (nesting depth added 10). Of this number, 24 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
search.handleSingleProviderSearch (cognitive 32) src/sse/handlers/search.js:93— search.handleSingleProviderSearch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 7, 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.
parseCommandCodeError (cognitive 32) open-sse/executors/commandcode.js:80— parseCommandCodeError has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 12, other 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.
CompatibleModelsSection (cognitive 32) src/app/(dashboard)/dashboard/providers/[id]/CompatibleModelsSection.js:74— CompatibleModelsSection has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 9, ternaries 7, error handling 3, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to 14 function items inside it that branch (handleImport, handleAdd, handleTestModel, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
kimi.getKimiUsage (cognitive 31) open-sse/services/usage/kimi.js:103— kimi.getKimiUsage has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (9 pts), if/else 6 (8 pts), error handling 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.
migrate-registry.migrateEntry (cognitive 31) scripts/migrate-registry.mjs:46— migrate-registry.migrateEntry has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 6, loops 5 (6 pts), ternaries 1 (nesting depth added 10). Of this number, 28 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BulkImportGrokCliModal.BulkImportGrokCliModal (cognitive 31) REDACTED:55— BulkImportGrokCliModal.BulkImportGrokCliModal has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 13, if/else 11 (12 pts), error handling 3, ternaries 2, loops 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 74, 136, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.fetchAll (cognitive 31) src/app/api/cli-tools/cowork-mcp-registry/route.js:24— route.fetchAll has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 9, ternaries 4 (9 pts), loops 2 (3 pts) (nesting depth added 12). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tailscale.startDaemonWithPassword (cognitive 31) REDACTED:533— tailscale.startDaemonWithPassword has cognitive complexity 31 (threshold 15). Drivers by points: error handling 6 (12 pts), if/else 9 (12 pts), boolean chains 3, loops 1 (2 pts), ternaries 2 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
AddCustomEmbeddingModal.AddCustomEmbeddingModal (cognitive 31) src/shared/components/AddCustomEmbeddingModal.js:10— AddCustomEmbeddingModal.AddCustomEmbeddingModal has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 7 (9 pts), error handling 2 (nesting depth added 3). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 39, 23, 91, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CodeBuddyExecutor.parseError (cognitive 30) open-sse/executors/codebuddy-cn.js:67— CodeBuddyExecutor.parseError has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 3 (15 pts), if/else 4 (10 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CodeBuddyIntlExecutor.parseError (cognitive 30) open-sse/executors/codebuddy-intl.js:42— CodeBuddyIntlExecutor.parseError has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 3 (15 pts), if/else 4 (10 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
gemini-to-openai.geminiToOpenAIRequest (cognitive 30) open-sse/translator/request/gemini-to-openai.js:9— gemini-to-openai.geminiToOpenAIRequest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (8 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.
openai-to-kiro.openaiToKiroRequest (cognitive 30) open-sse/translator/request/openai-to-kiro.js:308— openai-to-kiro.openaiToKiroRequest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 13, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.comboSeatLimits (cognitive 30) src/app/api/v1/models/route.js:279— route.comboSeatLimits has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 4 (5 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.
countCacheControlBlocks (cognitive 30) open-sse/translator/formats/claude.js:73— countCacheControlBlocks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sidebar (cognitive 30) src/shared/components/Sidebar.js:43— Sidebar has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 15, boolean chains 7, error handling 3 (4 pts), if/else 4 (nesting depth added 1). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 27 function items inside it that branch ((anonymous), handleCopyAndShutdown::(anonymous), isActive, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
mergeChunksToResponse (cognitive 30) open-sse/utils/bypassHandler.js:230— mergeChunksToResponse has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 3 (15 pts), if/else 5 (11 pts), boolean chains 4 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
xaiVideo.run (cognitive 29) cli/src/cli/commands/xaiVideo.js:209— xaiVideo.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6, error handling 3, ternaries 2 (3 pts) (nesting depth added 4). Of this number, 23 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
index.pollForToken (cognitive 29) src/lib/oauth/providers/index.js:167— index.pollForToken has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, error handling 1 (4 pts) (nesting depth added 13). 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.
kiroConversation.validateKiroConversation (cognitive 29) open-sse/translator/concerns/kiroConversation.js:341— kiroConversation.validateKiroConversation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 5, loops 2 (4 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.
grok-web.extractContent (cognitive 29) open-sse/executors/grok-web.js:103— grok-web.extractContent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KiroExecutor.runIntegrityRecovery (cognitive 29) open-sse/executors/kiro.js:437— KiroExecutor.runIntegrityRecovery has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 7 (9 pts), boolean chains 8, 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.
appUpdater.collectAppPids (cognitive 29) REDACTED:41— appUpdater.collectAppPids has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 3 (7 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 13). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 50, 79, 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.
ComboFormModal.ComboFormModal (cognitive 29) src/shared/components/ComboFormModal.js:53— ComboFormModal.ComboFormModal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10, ternaries 8 (10 pts), boolean chains 9 (nesting depth added 2). Of this number, 15 points are the body's own statements and 14 belong to 9 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.
Header.getPageInfo (cognitive 29) src/shared/components/Header.js:18— Header.getPageInfo has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 8 (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.
fetch.handleSingleProviderFetch (cognitive 29) src/sse/handlers/fetch.js:113— fetch.handleSingleProviderFetch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 9, 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.
parseEventFrame (cognitive 29) open-sse/executors/kiro.js:1216— parseEventFrame has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1, loops 1 (nesting depth added 4). Of this number, 28 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
socksFetch (cognitive 29) src/lib/mimoLoginSession.js:445— socksFetch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 8, loops 2 (3 pts), error handling 1 (2 pts), other 1, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 473, 477, 448, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
build-cli.buildCliPackage (cognitive 28) cli/scripts/build-cli.js:151— build-cli.buildCliPackage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, error handling 4, ternaries 2 (4 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
AntigravityExecutor.cloakTools (cognitive 28) open-sse/executors/antigravity.js:454— AntigravityExecutor.cloakTools has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 9). Of this number, 23 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.
openai.filterToOpenAIFormat (cognitive 28) open-sse/translator/formats/openai.js:10— openai.filterToOpenAIFormat has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 19, if/else 7 (8 pts), ternaries 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.
claude-to-openai.claudeToOpenAIRequest (cognitive 28) open-sse/translator/request/claude-to-openai.js:14— claude-to-openai.claudeToOpenAIRequest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
toolDeduper.dedupeTools (cognitive 28) open-sse/utils/toolDeduper.js:46— toolDeduper.dedupeTools has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 13). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server.passthroughHttp2 (cognitive 28) REDACTED:178— server.passthroughHttp2 has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (19 pts), error handling 4 (5 pts), boolean chains 2, loops 2 (nesting depth added 4). Most of this is not in the body itself: 4 of the 28 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 212, 230, 200, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
NoAuthProxyCard.NoAuthProxyCard (cognitive 28) src/shared/components/NoAuthProxyCard.js:16— NoAuthProxyCard.NoAuthProxyCard has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (10 pts), if/else 7, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 38, 28, 26, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
videoGeneration.handleVideoCreate (cognitive 28) src/sse/handlers/videoGeneration.js:109— videoGeneration.handleVideoCreate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 11, 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.
streamEvents (cognitive 28) open-sse/executors/trae.js:136— streamEvents has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 2 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onboardUser (cognitive 28) open-sse/services/projectId.js:201— onboardUser has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (5 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaProviderKindPage (cognitive 28) src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:140— MediaProviderKindPage has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 13, if/else 7, error handling 3 (5 pts), ternaries 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 28 function items inside it that branch ((anonymous), handleCreateCombo, (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
codexToolSchema.stripNode (cognitive 27) open-sse/utils/codexToolSchema.js:37— codexToolSchema.stripNode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 12). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opencode.lastUserText (cognitive 27) open-sse/executors/opencode.js:163— opencode.lastUserText has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (8 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 10). Of this number, 23 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.
systemInject.injectClaudeSystem (cognitive 27) open-sse/rtk/systemInject.js:213— systemInject.injectClaudeSystem has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 6 (10 pts), loops 1 (2 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.
kiro.getKiroUsage (cognitive 27) open-sse/services/usage/kiro.js:51— kiro.getKiroUsage has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 5 (8 pts), boolean chains 7, error handling 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.PATCH (cognitive 27) src/app/api/settings/route.js:38— route.PATCH has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mimoLoginSession.parseSetCookie (cognitive 27) src/lib/mimoLoginSession.js:205— mimoLoginSession.parseSetCookie has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, ternaries 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
zedCredentials.readLinuxCredentials (cognitive 27) src/lib/oauth/utils/zedCredentials.js:153— zedCredentials.readLinuxCredentials has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (12 pts), error handling 2 (nesting depth added 5). Of this number, 26 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
cloudflared.spawnQuickTunnel (cognitive 27) REDACTED:275— cloudflared.spawnQuickTunnel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 3, error handling 1, loops 1, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 374, 338, 308, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
chat.handleChat (cognitive 27) src/sse/handlers/chat.js:34— chat.handleChat has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 7, error handling 1, ternaries 1 (nesting depth added 5). Of this number, 22 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.
(anonymous)::loadData (cognitive 27) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:216— (anonymous)::loadData has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 3 (5 pts), error handling 2, 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.
acquireViaDesktopPhases (cognitive 27) open-sse/shared/mimoAccount.js:166— acquireViaDesktopPhases has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, ternaries 2 (3 pts), loops 2, error handling 1, other 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.
ls.ls (cognitive 26) open-sse/rtk/filters/ls.js:34— ls.ls has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 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.
embeddingsCore.handleEmbeddingsCore (cognitive 26) open-sse/handlers/embeddingsCore.js:13— embeddingsCore.handleEmbeddingsCore has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, error handling 4 (6 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
combo.handleFusionChat (cognitive 26) open-sse/services/combo.js:547— combo.handleFusionChat has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, error handling 1 (2 pts), ternaries 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.
page.ComboFormModal (cognitive 26) src/app/(dashboard)/dashboard/combos/page.js:1009— page.ComboFormModal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 7, ternaries 4 (5 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 1026, 1037, 1052, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelsCard.ModelsCard (cognitive 26) src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:111— ModelsCard.ModelsCard has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, error handling 6, ternaries 4 (nesting depth added 1). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 123, 182, 138, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.normalizeOverride (cognitive 26) src/app/api/providers/[id]/overrides/route.js:28— route.normalizeOverride has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 12). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
coworkPlugins.buildManagedMcpServers (cognitive 26) src/shared/constants/coworkPlugins.js:36— coworkPlugins.buildManagedMcpServers has cognitive complexity 26 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (10 pts), boolean chains 4, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
peekFirstQoderFrame (cognitive 26) open-sse/executors/qoder.js:362— peekFirstQoderFrame has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 4 (9 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 26) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:69— (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (8 pts), ternaries 2 (4 pts), error handling 3 (nesting depth added 5). Of this number, 21 points are the body's own statements and 5 belong to 13 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetchQoderCatalogRaw (cognitive 26) open-sse/services/qoderModels.js:204— fetchQoderCatalogRaw has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 9, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditConnectionModal::handleSubmit (cognitive 26) src/shared/components/EditConnectionModal.js:116— EditConnectionModal::handleSubmit has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 7 (9 pts), error handling 1 (3 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.
xaiVideo.parseArgs (cognitive 25) cli/src/cli/commands/xaiVideo.js:50— xaiVideo.parseArgs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 9, 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.
gemini.normalizeGeminiContents (cognitive 25) open-sse/translator/formats/gemini.js:443— gemini.normalizeGeminiContents has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9, loops 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thoughtSignatureStore.getGeminiThoughtSignature (cognitive 25) open-sse/services/thoughtSignatureStore.js:123— thoughtSignatureStore.getGeminiThoughtSignature has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 11, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kiroConversation.normalizeTurns (cognitive 25) open-sse/translator/concerns/kiroConversation.js:158— kiroConversation.normalizeTurns has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, ternaries 2 (3 pts), 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.
qoder.buildQoderRequestBody (cognitive 25) open-sse/executors/qoder.js:210— qoder.buildQoderRequestBody has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, ternaries 4 (7 pts), error handling 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiKeySelect.ApiKeySelect (cognitive 25) src/app/(dashboard)/dashboard/cli-tools/components/ApiKeySelect.js:9— ApiKeySelect.ApiKeySelect has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, ternaries 6 (8 pts), if/else 5 (nesting depth added 2). Of this number, 17 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CustomConfigCard.CustomConfigCard (cognitive 25) src/app/(dashboard)/dashboard/providers/[id]/CustomConfigCard.js:12— CustomConfigCard.CustomConfigCard has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 9, ternaries 4, loops 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 42, 24, 23, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.GET (cognitive 25) src/app/api/media-providers/tts/deepgram/voices/route.js:11— route.GET has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (9 pts), loops 2 (3 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.PATCH (cognitive 25) src/app/api/pricing/route.js:27— route.PATCH has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), boolean chains 4, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.PUT (cognitive 25) src/app/api/providers/[id]/route.js:87— route.PUT has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
usageRepo.getActiveRequests (cognitive 25) src/lib/db/repos/usageRepo.js:197— usageRepo.getActiveRequests has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 7, if/else 3 (5 pts), loops 2 (3 pts) (nesting depth added 9). Of this number, 16 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
requestDetailsRepo.flushToDatabase (cognitive 25) src/lib/db/repos/requestDetailsRepo.js:88— requestDetailsRepo.flushToDatabase has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 8, loops 2 (3 pts), error handling 1 (nesting depth added 8). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 99). 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.
stdioSseBridge.collapseRepeated (cognitive 25) src/lib/mcp/stdioSseBridge.js:29— stdioSseBridge.collapseRepeated has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 5 (11 pts), boolean chains 2 (nesting depth added 13). 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.
tts.handleSingleModelTts (cognitive 25) src/sse/handlers/tts.js:68— tts.handleSingleModelTts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 8, 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.
renderModelsSection (cognitive 25) src/app/(dashboard)/dashboard/providers/[id]/page.js:1151— renderModelsSection has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, ternaries 8, if/else 4. Of this number, 13 points are the body's own statements and 12 belong to 28 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.
trackPendingRequest (cognitive 25) src/lib/db/repos/usageRepo.js:153— trackPendingRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 3 (4 pts), boolean chains 2 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resolveWorkspaceCwd::scanMessages (cognitive 25) open-sse/executors/devin-cli.js:213— resolveWorkspaceCwd::scanMessages has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (7 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.
gemini.cleanJSONSchemaForAntigravity (cognitive 24) open-sse/translator/formats/gemini.js:352— gemini.cleanJSONSchemaForAntigravity has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7, loops 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.
openai-to-commandcode.toContentBlocks (cognitive 24) open-sse/translator/request/openai-to-commandcode.js:75— openai-to-commandcode.toContentBlocks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (2 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.
PerplexityWebExecutor.execute (cognitive 24) open-sse/executors/perplexity-web.js:396— PerplexityWebExecutor.execute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 7, 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.
zed.parseZedAuthenticatedUserUsage (cognitive 24) open-sse/services/usage/zed.js:116— zed.parseZedAuthenticatedUserUsage has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (8 pts), ternaries 2 (3 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditCompatibleNodeModal.EditCompatibleNodeModal (cognitive 24) src/app/(dashboard)/dashboard/providers/[id]/EditCompatibleNodeModal.js:7— EditCompatibleNodeModal.EditCompatibleNodeModal has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 9, if/else 4, error handling 1. Of this number, 12 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
route.probeMcp (cognitive 24) src/app/api/cli-tools/cowork-mcp-tools/route.js:11— route.probeMcp has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, error handling 2 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.POST (cognitive 24) src/app/api/oauth/codex/import-token/route.js:12— route.POST has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestLogger.RequestLogger (cognitive 24) src/shared/components/RequestLogger.js:6— RequestLogger.RequestLogger has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 5 (7 pts), boolean chains 1, error handling 1 (nesting depth added 10). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 81, 25, 15). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
imageGeneration.handleSingleModelImage (cognitive 24) src/sse/handlers/imageGeneration.js:70— imageGeneration.handleSingleModelImage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, 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.
transformRequest (cognitive 24) open-sse/executors/opencode.js:412— transformRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extractAnswer (cognitive 24) open-sse/handlers/search/chatSearch.js:255— extractAnswer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 7, loops 2 (4 pts), ternaries 2 (3 pts), error handling 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.
D2 · Cognitive Complexity· GET (cognitive 24) · ×1
GET (cognitive 24) src/app/api/cli-tools/cowork-settings/route.js:244— GET has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, ternaries 7, loops 2 (3 pts), error handling 1, if/else 1 (nesting depth added 1). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 284, 271, 266, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
kiroToClaudeNonStreaming (cognitive 24) open-sse/translator/response/kiro-to-claude.js:235— kiroToClaudeNonStreaming has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (5 pts), other 4, error handling 1 (3 pts), if/else 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
getOllamaUsage (cognitive 24) open-sse/services/usage/misc.js:66— getOllamaUsage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 6 (7 pts), boolean chains 5, error handling 3, loops 1 (nesting depth added 3). Of this number, 22 points are the body's own statements and 2 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
tryDedicatedProvider (cognitive 24) open-sse/handlers/search/index.js:65— tryDedicatedProvider has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (8 pts), error handling 3 (4 pts), if/else 3, other 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.
xaiVideo.pollUntilDone (cognitive 23) cli/src/cli/commands/xaiVideo.js:128— xaiVideo.pollUntilDone has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, ternaries 1 (4 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.
kiroConstants.containsThinkingModeTag (cognitive 23) open-sse/config/kiroConstants.js:387— kiroConstants.containsThinkingModeTag has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kiro.inspectSSEChunk (cognitive 23) open-sse/executors/kiro.js:208— kiro.inspectSSEChunk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, loops 2 (3 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.
xiaomi-mimo.getXiaomiMimoUsage (cognitive 23) open-sse/services/usage/xiaomi-mimo.js:22— xiaomi-mimo.getXiaomiMimoUsage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proxy.proxy (cognitive 23) src/proxy.js:13— proxy.proxy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
saveRequestUsage (cognitive 23) src/lib/db/repos/usageRepo.js:242— saveRequestUsage has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 15, if/else 4 (5 pts), ternaries 2, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 257). 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.
parseError (cognitive 23) open-sse/executors/codex.js:384— parseError has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 5, error handling 1 (2 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.
getGrokCliUsage (cognitive 23) open-sse/services/usage/grok-cli.js:349— getGrokCliUsage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 5 (7 pts), boolean chains 4, 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.
D2 · Cognitive Complexity· POST (cognitive 23) · ×1
POST (cognitive 23) src/app/api/cli-tools/openclaw-settings/route.js:138— POST has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, error handling 2, ternaries 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 9 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
input.selectMenu (cognitive 22) cli/src/cli/utils/input.js:92— input.selectMenu has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, ternaries 3 (5 pts), boolean chains 3 (nesting depth added 2). Most of this is not in the body itself: 0 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 135, 113, 100, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CursorExecutor.openAgentHttp2Stream (cognitive 22) open-sse/executors/cursor.js:457— CursorExecutor.openAgentHttp2Stream has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3, error handling 3 (nesting depth added 2). Of this number, 16 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
index.compressKiroFormat (cognitive 22) open-sse/rtk/index.js:91— index.compressKiroFormat has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.CapacityAdapterCap (cognitive 22) src/app/(dashboard)/dashboard/combos/page.js:733— page.CapacityAdapterCap has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (10 pts), if/else 2 (nesting depth added 3). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 826, 739, 745, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.POST (cognitive 22) src/app/api/cli-tools/opencode-settings/route.js:92— route.POST has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, ternaries 3 (4 pts), error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
route.GET (cognitive 22) src/app/api/media-providers/tts/inworld/voices/route.js:10— route.GET has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.refreshAndUpdateCredentials (cognitive 22) src/app/api/usage/[connectionId]/route.js:24— route.refreshAndUpdateCredentials has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, ternaries 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.
Header.Header (cognitive 22) src/shared/components/Header.js:182— Header.Header has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (5 pts), ternaries 3 (5 pts), error handling 2 (nesting depth added 3). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 192, 247, 218). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
providerCustomModels.getProviderCustomModelRows (cognitive 22) src/shared/utils/providerCustomModels.js:5— providerCustomModels.getProviderCustomModelRows has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, 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.
stripRemainingDataUris (cognitive 22) open-sse/shared/qoder/attachments.js:258— stripRemainingDataUris has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, ternaries 1 (4 pts), loops 1 (nesting depth added 11). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 265, 261, 273). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
collectKiroHeadroomMessages::visit (cognitive 22) open-sse/rtk/headroom.js:126— collectKiroHeadroomMessages::visit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (7 pts), ternaries 2 (7 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.
containsPromptInResponsesInput (cognitive 22) open-sse/rtk/systemInject.js:176— containsPromptInResponsesInput has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, loops 2 (4 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.
handleStreamingResponse (cognitive 22) open-sse/handlers/chatCore/streamingHandler.js:48— handleStreamingResponse has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, error handling 3 (5 pts), if/else 4 (5 pts), ternaries 2 (3 pts) (nesting depth added 4). Of this number, 21 points are the body's own statements and 1 belongs to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
concealFingerprintToolNames (cognitive 22) open-sse/utils/opencodeFingerprint.js:44— concealFingerprintToolNames has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (6 pts), boolean chains 5, 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.
combos.editSingleCombo (cognitive 21) cli/src/cli/menus/combos.js:349— combos.editSingleCombo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build-cli.copyRecursive (cognitive 21) cli/scripts/build-cli.js:38— build-cli.copyRecursive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (8 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kiroExternalIdp.normalizeKiroExternalIdpAuth (cognitive 21) src/lib/oauth/kiroExternalIdp.js:77— kiroExternalIdp.normalizeKiroExternalIdpAuth has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 8, error handling 1 (2 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.
CodexExecutor._peekSseTransientError (cognitive 21) open-sse/executors/codex.js:328— CodexExecutor._peekSseTransientError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 5 (7 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ollama-to-openai.ollamaToOpenAIResponse (cognitive 21) open-sse/translator/response/ollama-to-openai.js:20— ollama-to-openai.ollamaToOpenAIResponse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, ternaries 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.
kimchiModels.normalizeKimchiModel (cognitive 21) open-sse/services/kimchiModels.js:49— kimchiModels.normalizeKimchiModel has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 8, if/else 3. 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: 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.
streamHandler.createDisconnectAwareStream (cognitive 21) open-sse/utils/streamHandler.js:102— streamHandler.createDisconnectAwareStream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, error handling 3 (4 pts) (nesting depth added 3). Of this number, 17 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ssrfGuard.parseIPv6ToGroups (cognitive 21) src/shared/utils/ssrfGuard.js:81— ssrfGuard.parseIPv6ToGroups has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, ternaries 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.
chatSearch.handleChatSearch (cognitive 21) open-sse/handlers/search/chatSearch.js:430— chatSearch.handleChatSearch has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 2 (3 pts), 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.
accountFallback.checkFallbackError (cognitive 21) open-sse/services/accountFallback.js:23— accountFallback.checkFallbackError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.POST (cognitive 21) REDACTED:21— route.POST has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, 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.
route.DELETE (cognitive 21) src/app/api/cli-tools/opencode-settings/route.js:213— route.DELETE has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 2, boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
saml.pickSamlEmail (cognitive 21) src/lib/auth/saml.js:182— saml.pickSamlEmail has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
requestDetailsRepo.getObservabilityConfig (cognitive 21) src/lib/db/repos/requestDetailsRepo.js:13— requestDetailsRepo.getObservabilityConfig has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 17, if/else 2, error handling 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
backgroundTokenRefresh.runBackgroundTokenRefreshTick (cognitive 21) src/sse/services/backgroundTokenRefresh.js:90— backgroundTokenRefresh.runBackgroundTokenRefreshTick has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, ternaries 2 (6 pts), if/else 3 (4 pts), error handling 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.
killLeftoverMitm (cognitive 21) REDACTED:315— killLeftoverMitm has cognitive complexity 21 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 6 (8 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildReasoningInputItem (cognitive 21) open-sse/translator/request/openai-responses.js:286— buildReasoningInputItem has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 2 (4 pts) (nesting depth added 2). Of this number, 17 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
resolveKiroThinkingBudget (cognitive 21) open-sse/config/kiroConstants.js:147— resolveKiroThinkingBudget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, other 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.
menuHelper.showListMenu (cognitive 20) cli/src/cli/utils/menuHelper.js:92— menuHelper.showListMenu has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
capabilities.refine (cognitive 20) open-sse/providers/capabilities.js:562— capabilities.refine has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
image.fetchImageAsBase64 (cognitive 20) open-sse/translator/concerns/image.js:76— image.fetchImageAsBase64 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 3 (5 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
gemini-to-openai.convertGeminiContent (cognitive 20) open-sse/translator/request/gemini-to-openai.js:75— gemini-to-openai.convertGeminiContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GithubExecutor.executeWithResponsesEndpoint (cognitive 20) open-sse/executors/github.js:167— GithubExecutor.executeWithResponsesEndpoint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 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.
QoderExecutor.execute (cognitive 20) open-sse/executors/qoder.js:614— QoderExecutor.execute has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), error handling 4 (5 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perplexity-web.buildStreamingResponse (cognitive 20) open-sse/executors/perplexity-web.js:294— perplexity-web.buildStreamingResponse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
searchList.searchList (cognitive 20) open-sse/rtk/filters/searchList.js:7— searchList.searchList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (5 pts), ternaries 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.
AddCustomModelModal.AddCustomModelModal (cognitive 20) src/app/(dashboard)/dashboard/providers/[id]/AddCustomModelModal.js:10— AddCustomModelModal.AddCustomModelModal has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 5, error handling 1. Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 30, 50, 20, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddCompatibleModal.AddCompatibleModal (cognitive 20) src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.js:37— AddCompatibleModal.AddCompatibleModal has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 5, error handling 2. Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 64, 115, 54, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProviderTopology.ProviderTopology (cognitive 20) src/app/(dashboard)/dashboard/usage/components/ProviderTopology.js:357— ProviderTopology.ProviderTopology has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4, boolean chains 3, loops 3 (nesting depth added 3). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 374, 391, 366, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.POST (cognitive 20) src/app/api/cli-tools/droid-settings/route.js:85— route.POST has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 3 (4 pts), error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
route.GET (cognitive 20) src/app/api/media-providers/tts/voices/route.js:22— route.GET has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (7 pts), error handling 1, loops 1, ternaries 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.
extractPanelText (cognitive 20) open-sse/services/combo.js:390— extractPanelText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 1 (2 pts), other 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transformToSSE::start (cognitive 20) open-sse/executors/windsurf.js:441— transformToSSE::start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (2 pts), 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.
updateProviderCredentials (cognitive 20) src/sse/services/tokenRefresh.js:163— updateProviderCredentials has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
fetchProjectId (cognitive 20) open-sse/services/projectId.js:158— fetchProjectId has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
containsPromptInMessages (cognitive 20) open-sse/rtk/systemInject.js:116— containsPromptInMessages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 2 (4 pts), 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.
createDisconnectAwareStream::pull (cognitive 20) open-sse/utils/streamHandler.js:118— createDisconnectAwareStream::pull has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 5 (7 pts), boolean chains 6 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
connect.parseArgs (cognitive 19) REDACTED:40— connect.parseArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, loops 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
menuHelper.showMenuWithBack (cognitive 19) cli/src/cli/utils/menuHelper.js:15— menuHelper.showMenuWithBack has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
combos.handleCreateCombo (cognitive 19) cli/src/cli/menus/combos.js:211— combos.handleCreateCombo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
capabilities.getCapabilitiesForModel (cognitive 19) open-sse/providers/capabilities.js:623— capabilities.getCapabilitiesForModel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.backfillCodexEmails (cognitive 19) src/lib/oauth/providers/index.js:226— index.backfillCodexEmails has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent 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.startZedProxy (cognitive 19) src/lib/oauth/utils/server.js:671— server.startZedProxy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, ternaries 2, error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 681, 672, 759). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
migrate.runMigrationOnce (cognitive 19) src/lib/db/migrate.js:216— migrate.runMigrationOnce has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 3 (6 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cursorProtobuf.extractToolCall (cognitive 19) open-sse/utils/cursorProtobuf.js:761— cursorProtobuf.extractToolCall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, error handling 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.
GrokWebExecutor.execute (cognitive 19) open-sse/executors/grok-web.js:226— GrokWebExecutor.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
grok-web.readGrokNdjsonEvents (cognitive 19) open-sse/executors/grok-web.js:74— grok-web.readGrokNdjsonEvents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pxpipe.compressWithPxpipe (cognitive 19) open-sse/rtk/pxpipe.js:32— pxpipe.compressWithPxpipe has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 7, ternaries 2, error handling 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
normalizers.normalizeXquik (cognitive 19) open-sse/handlers/search/normalizers.js:215— normalizers.normalizeXquik has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 5 (nesting depth added 1). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 218). 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.
capacityAdapter.stripHistoryForContext (cognitive 19) open-sse/services/capacityAdapter.js:118— capacityAdapter.stripHistoryForContext has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (6 pts), if/else 5, loops 2 (nesting depth added 3). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
commandcode.getCommandCodeUsage (cognitive 19) open-sse/services/usage/commandcode.js:58— commandcode.getCommandCodeUsage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
route.normalizeMiniMaxVoices (cognitive 19) src/app/api/media-providers/tts/minimax/voices/route.js:28— route.normalizeMiniMaxVoices has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (5 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pricingRepo.getPricing (cognitive 19) src/lib/db/repos/pricingRepo.js:18— pricingRepo.getPricing has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (8 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.
mimoLoginSession.rewriteMimoBases (cognitive 19) src/lib/mimoLoginSession.js:358— mimoLoginSession.rewriteMimoBases has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 3, ternaries 2, boolean chains 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
providers.buildProviderEntry (cognitive 19) src/shared/constants/providers.js:13— providers.buildProviderEntry has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 12, if/else 3 (4 pts), boolean chains 2, 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.
tailscale.installTailscaleMac (cognitive 19) REDACTED:294— tailscale.installTailscaleMac has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 353, 311, 334, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tailscale.startFunnel (cognitive 19) REDACTED:741— tailscale.startFunnel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 771, 757, 799, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
manager.enableTailscale (cognitive 19) src/lib/tunnel/tailscale/manager.js:24— manager.enableTailscale has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, error handling 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.
PricingModal.PricingModal (cognitive 19) src/shared/components/PricingModal.js:6— PricingModal.PricingModal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 3, error handling 3, ternaries 2. Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 17, 51, 75, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
UsageStats.sortData (cognitive 19) src/shared/components/UsageStats.js:91— UsageStats.sortData has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (7 pts), if/else 4 (nesting depth added 2). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 93, 107). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
(anonymous) (cognitive 19) src/app/(dashboard)/dashboard/providers/[id]/page.js:477— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 495, 507, 494, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddApiKeyModal (cognitive 19) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:197— AddApiKeyModal has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8, boolean chains 7, error handling 2, if/else 2. Of this number, 10 points are the body's own statements and 9 belong to 7 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
handleTest (cognitive 19) src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:172— handleTest has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 6, boolean chains 5, 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.
MitmServerCard::doAction (cognitive 19) REDACTED:65— MitmServerCard::doAction has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 2 (4 pts), error handling 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleSttCore (cognitive 19) open-sse/handlers/sttCore.js:186— handleSttCore has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 3 (4 pts), error handling 1, match/switch 1, other 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.
getQoderUsage (cognitive 19) open-sse/services/usage/misc.js:230— getQoderUsage has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 3, error handling 2, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CursorAuthModal (cognitive 19) src/shared/components/CursorAuthModal.js:11— CursorAuthModal has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 7, error handling 2, ternaries 1. Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (runAutoDetect, handleImportToken, (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
migrate.importLegacyUsage (cognitive 18) src/lib/db/migrate.js:172— migrate.importLegacyUsage has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 14, if/else 2, loops 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
image.isPrivateIp (cognitive 18) open-sse/translator/concerns/image.js:20— image.isPrivateIp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 2 (3 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.
codex.findNestedMessage (cognitive 18) open-sse/executors/codex.js:152— codex.findNestedMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
windsurf.decodeDoneChunk (cognitive 18) open-sse/executors/windsurf.js:264— windsurf.decodeDoneChunk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), 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.
nonStreamingHandler.openAICompletionToClaudeMessage (cognitive 18) open-sse/handlers/chatCore/nonStreamingHandler.js:27— nonStreamingHandler.openAICompletionToClaudeMessage has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4, loops 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
autodetect.autoDetectFilter (cognitive 18) open-sse/rtk/autodetect.js:28— autodetect.autoDetectFilter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
codebuddy-cn.getCodeBuddyUsage (cognitive 18) open-sse/services/usage/codebuddy-cn.js:46— codebuddy-cn.getCodeBuddyUsage has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 3, error handling 1. Of this number, 14 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ModelRow.ModelRow (cognitive 18) src/app/(dashboard)/dashboard/providers/[id]/ModelRow.js:4— ModelRow.ModelRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 12 (16 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.
page.getConnectionErrorTag (cognitive 18) REDACTED:55— page.getConnectionErrorTag has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, 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.
utils.sortVisibleConnections (cognitive 18) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:50— utils.sortVisibleConnections has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), ternaries 3 (4 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 87, 58, 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.
ProviderLimitCard.ProviderLimitCard (cognitive 18) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js:17— ProviderLimitCard.ProviderLimitCard has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, if/else 1, ternaries 1. Of this number, 15 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.POST (cognitive 18) src/app/api/cli-tools/antigravity-mitm/route.js:94— route.POST has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 2 (4 pts), error handling 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.PATCH (cognitive 18) src/app/api/cli-tools/antigravity-mitm/route.js:163— route.PATCH has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
route.GET (cognitive 18) src/app/api/media-providers/tts/elevenlabs/voices/route.js:12— route.GET has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), loops 2 (3 pts), error handling 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
appUpdater.killMitmByPidFile (cognitive 18) REDACTED:11— appUpdater.killMitmByPidFile has cognitive complexity 18 (threshold 15). Drivers by points: error handling 6 (12 pts), if/else 4, boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usageRepo.aggregateEntryToDay (cognitive 18) src/lib/db/repos/usageRepo.js:64— usageRepo.aggregateEntryToDay has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 14, if/else 2, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
events.readPxpipeEvents (cognitive 18) src/lib/pxpipe/events.js:26— events.readPxpipeEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitLabAuthModal.GitLabAuthModal (cognitive 18) src/shared/components/GitLabAuthModal.js:21— GitLabAuthModal.GitLabAuthModal has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, if/else 5, error handling 1. Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
fetch.handleFetch (cognitive 18) src/sse/handlers/fetch.js:24— fetch.handleFetch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
handleRunOneByOneTest (cognitive 18) src/app/(dashboard)/dashboard/providers/[id]/page.js:692— handleRunOneByOneTest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 12 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleHealthCheck (cognitive 18) src/app/(dashboard)/dashboard/proxy-pools/page.js:267— handleHealthCheck has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (worker, onConfirm, (anonymous)). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
openModal (cognitive 18) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:130— openModal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
execute (cognitive 18) open-sse/executors/codex.js:277— execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 3, loops 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 1 belongs 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.
emitToolCall (cognitive 18) open-sse/translator/response/openai-responses.js:339— emitToolCall has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 pts), boolean chains 4, other 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.
handleBulkSubmit (cognitive 18) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:136— handleBulkSubmit has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 5 (6 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderServerLogin (cognitive 18) src/shared/components/XiaomiMimoAuthModal.js:192— renderServerLogin has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, ternaries 7, loops 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
openaiToClaudeRequestForAntigravity (cognitive 18) open-sse/translator/request/openai-to-claude.js:328— openaiToClaudeRequestForAntigravity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7 (nesting depth added 4). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 343, 356, 361, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
runHeavyStartup (cognitive 18) src/shared/services/initializeApp.js:82— runHeavyStartup has cognitive complexity 18 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 5, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transformRequest (cognitive 18) open-sse/executors/opencode-zen.js:281— transformRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
renderGuideSteps (cognitive 18) src/app/(dashboard)/dashboard/cli-tools/components/DefaultToolCard.js:147— renderGuideSteps has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 4. 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 items inside it that branch ((anonymous), renderIcon, (anonymous)::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
format.getRelativeTime (cognitive 17) cli/src/cli/utils/format.js:88— format.getRelativeTime has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 7 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings.showSettingsMenu (cognitive 17) cli/src/cli/menus/settings.js:22— settings.showSettingsMenu has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8, boolean chains 7, if/else 2. Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 26, 52, 90, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli.killCloudflaredByAppPort (cognitive 17) REDACTED:235— cli.killCloudflaredByAppPort has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 252, 244). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
providers.refreshKiroToken (cognitive 17) open-sse/services/tokenRefresh/providers.js:326— providers.refreshKiroToken has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 328). 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.
AntigravityExecutor.parseRetryHeaders (cognitive 17) open-sse/executors/antigravity.js:356— AntigravityExecutor.parseRetryHeaders has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 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.
openai-to-vertex.postProcessForVertex (cognitive 17) open-sse/translator/request/openai-to-vertex.js:12— openai-to-vertex.postProcessForVertex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
openai-to-commandcode.toNativeImageBlock (cognitive 17) open-sse/translator/request/openai-to-commandcode.js:34— openai-to-commandcode.toNativeImageBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, 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.
cursor.decompressPayload (cognitive 17) open-sse/executors/cursor.js:256— cursor.decompressPayload has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (11 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GithubExecutor.executeWithMessagesEndpoint (cognitive 17) open-sse/executors/github.js:252— GithubExecutor.executeWithMessagesEndpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 2 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrokCliExecutor.buildHeaders (cognitive 17) open-sse/executors/grok-cli.js:362— GrokCliExecutor.buildHeaders has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts), 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.
grok-web.buildStreamingResponse (cognitive 17) open-sse/executors/grok-web.js:135— grok-web.buildStreamingResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VertexExecutor.buildUrl (cognitive 17) open-sse/executors/vertex.js:66— VertexExecutor.buildUrl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
streamToJsonConverter.processSSEMessage (cognitive 17) open-sse/transformer/streamToJsonConverter.js:10— streamToJsonConverter.processSSEMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, 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.
systemInject.appendToChatMessage (cognitive 17) open-sse/rtk/systemInject.js:132— systemInject.appendToChatMessage has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (8 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (systemInject.appendToResponsesMessage) 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.
systemInject.appendToResponsesMessage (cognitive 17) open-sse/rtk/systemInject.js:193— systemInject.appendToResponsesMessage has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (8 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (systemInject.appendToChatMessage) 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.
systemInject.injectGeminiSystem (cognitive 17) open-sse/rtk/systemInject.js:243— systemInject.injectGeminiSystem has cognitive complexity 17 (threshold 15). Drivers by points: error handling 7 (9 pts), if/else 3 (4 pts), boolean chains 3, 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.
grokCliModels.parseGrokCliModels (cognitive 17) open-sse/services/grokCliModels.js:20— grokCliModels.parseGrokCliModels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opencode-go.getOpenCodeGoUsage (cognitive 17) open-sse/services/usage/opencode-go.js:25— opencode-go.getOpenCodeGoUsage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opencode-zen.getOpenCodeZenUsage (cognitive 17) open-sse/services/usage/opencode-zen.js:25— opencode-zen.getOpenCodeZenUsage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
glm.parseGlmQuotaResponse (cognitive 17) open-sse/services/usage/glm.js:19— glm.parseGlmQuotaResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, ternaries 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
migrate-registry.formatEntry (cognitive 17) scripts/migrate-registry.mjs:164— migrate-registry.formatEntry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 3 (4 pts), boolean chains 3, 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.
BulkImportCodexModal.BulkImportCodexModal (cognitive 17) src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js:26— BulkImportCodexModal.BulkImportCodexModal has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 5, error handling 2, ternaries 1. Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 40, 32). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelAvailabilityBadge.ModelAvailabilityBadge (cognitive 17) src/app/(dashboard)/dashboard/providers/components/ModelAvailabilityBadge.js:21— ModelAvailabilityBadge.ModelAvailabilityBadge has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, error handling 2. Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 58, 87, 29, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
route.PUT (cognitive 17) src/app/api/provider-nodes/[id]/route.js:5— route.PUT has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, error handling 1, ternaries 1 (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.
route.GET (cognitive 17) src/app/api/v1/audio/voices/route.js:20— route.GET has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 3 (4 pts), if/else 2, error handling 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
route.buildInfo (cognitive 17) src/app/api/v1/models/info/route.js:18— route.buildInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 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.
saml.pickSamlDisplayName (cognitive 17) src/lib/auth/saml.js:231— saml.pickSamlDisplayName has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
comboPresets.buildClaudePresetItems (cognitive 17) src/lib/comboPresets.js:80— comboPresets.buildClaudePresetItems has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, 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.
cloudflared.spawnCloudflared (cognitive 17) REDACTED:195— cloudflared.spawnCloudflared has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 241, 216, 233). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tailscale.startLogin (cognitive 17) REDACTED:642— tailscale.startLogin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, ternaries 1. Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 689, 717, 646, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
KiroSocialOAuthModal.KiroSocialOAuthModal (cognitive 17) src/shared/components/KiroSocialOAuthModal.js:12— KiroSocialOAuthModal.KiroSocialOAuthModal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 6, error handling 3, ternaries 1. Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 60, 30, 27, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
bulkAdd.planBulkAdd (cognitive 17) src/shared/utils/bulkAdd.js:62— bulkAdd.planBulkAdd has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleImportQoderModels (cognitive 17) src/app/(dashboard)/dashboard/providers/[id]/page.js:591— handleImportQoderModels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
handleImportClineModels (cognitive 17) src/app/(dashboard)/dashboard/providers/[id]/page.js:646— handleImportClineModels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
refreshTraeToken (cognitive 17) open-sse/services/tokenRefresh/providers.js:619— refreshTraeToken has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 628). 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.
decodeCompletionChunk (cognitive 17) open-sse/executors/windsurf.js:311— decodeCompletionChunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1, other 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.
extractUrlFromUploadResponse (cognitive 17) open-sse/shared/qoder/attachments.js:67— extractUrlFromUploadResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, error handling 1 (2 pts), loops 2, other 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleSearch (cognitive 17) src/sse/handlers/search.js:23— handleSearch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
buildBody (cognitive 17) open-sse/handlers/imageProviders/codex.js:179— buildBody has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 3 (4 pts) (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.
D2 · Cognitive Complexity· GET (cognitive 17) · ×1
GET (cognitive 17) src/app/api/usage/[connectionId]/route.js:133— GET has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, error handling 3 (5 pts), if/else 4, other 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LanguageSwitcher (cognitive 17) src/shared/components/LanguageSwitcher.js:59— LanguageSwitcher has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 3, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 11 function items inside it that branch (setIsOpen, handleSetLocale, (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
pipeSSE (cognitive 17) REDACTED:43— pipeSSE has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server.startCodexProxy (cognitive 16) src/lib/oauth/utils/server.js:194— server.startCodexProxy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 201, 274, 195). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This shape REPEATS in the file: one other method here (server.startXaiProxy) 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.
server.startXaiProxy (cognitive 16) src/lib/oauth/utils/server.js:338— server.startXaiProxy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 345, 416, 339). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 shape REPEATS in the file: one other method here (server.startCodexProxy) 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.
oauthCredentialManager.mergeRefreshedCredentials (cognitive 16) open-sse/services/oauthCredentialManager.js:70— oauthCredentialManager.mergeRefreshedCredentials has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
gemini.flattenAnyOfOneOf (cognitive 16) open-sse/translator/formats/gemini.js:267— gemini.flattenAnyOfOneOf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 1 (nesting depth added 3). 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.
migrate.syncSchemaFromTables (cognitive 16) src/lib/db/migrate.js:79— migrate.syncSchemaFromTables has cognitive complexity 16 (threshold 15). Drivers by points: error handling 2 (7 pts), loops 3 (5 pts), if/else 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultExecutor.buildUrl (cognitive 16) open-sse/executors/default.js:108— DefaultExecutor.buildUrl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (6 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.
claude-to-openai.fixMissingToolResponsesOpenAI (cognitive 16) open-sse/translator/request/claude-to-openai.js:97— claude-to-openai.fixMissingToolResponsesOpenAI has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
grok-web.parseOpenAIMessages (cognitive 16) open-sse/executors/grok-web.js:46— grok-web.parseOpenAIMessages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3, boolean chains 2, ternaries 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.
qoder.stableChatRecordId (cognitive 16) open-sse/executors/qoder.js:179— qoder.stableChatRecordId has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
perplexity-web.parseOpenAIMessages (cognitive 16) open-sse/executors/perplexity-web.js:138— perplexity-web.parseOpenAIMessages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
zed.wrapZedCompletionStream (cognitive 16) open-sse/executors/zed.js:148— zed.wrapZedCompletionStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, loops 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 165, 157). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
systemoneCore.handleSystemoneCore (cognitive 16) open-sse/handlers/systemoneCore.js:13— systemoneCore.handleSystemoneCore has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5, error handling 2, ternaries 2. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
migrate-registry.formatValue (cognitive 16) scripts/migrate-registry.mjs:112— migrate-registry.formatValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). Of this number, 11 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.
codexConfig.getCurrentCodexProviderSettings (cognitive 16) REDACTED:7— codexConfig.getCurrentCodexProviderSettings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, 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.
MitmPageClient.MitmPageClient (cognitive 16) src/app/(dashboard)/dashboard/mitm/MitmPageClient.js:9— MitmPageClient.MitmPageClient has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, error handling 4, if/else 4, ternaries 1. Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 24, 34, 44, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ModelsCard.ModelRow (cognitive 16) src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:11— ModelsCard.ModelRow has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settingsRepo.mergeWithDefaults (cognitive 16) src/lib/db/repos/settingsRepo.js:76— settingsRepo.mergeWithDefaults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 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.
connectionsRepo.cleanupProviderConnections (cognitive 16) src/lib/db/repos/connectionsRepo.js:304— connectionsRepo.cleanupProviderConnections has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 314). 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.
mimoLoginSession.decodeSessionCookie (cognitive 16) src/lib/mimoLoginSession.js:123— mimoLoginSession.decodeSessionCookie has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 2, error handling 1, 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.
outboundProxy.applyOutboundProxyEnv (cognitive 16) src/lib/network/outboundProxy.js:20— outboundProxy.applyOutboundProxyEnv has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
events.getPxpipeStats (cognitive 16) src/lib/pxpipe/events.js:81— events.getPxpipeStats has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
manager.enableTunnel (cognitive 16) src/lib/tunnel/cloudflare/manager.js:34— manager.enableTunnel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, error handling 1 (nesting depth added 4). 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.
tailscale.ensureUserOwnedDir (cognitive 16) REDACTED:477— tailscale.ensureUserOwnedDir has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 4 (6 pts), loops 2 (4 pts) (nesting depth added 6). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 487). 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.
config.extractModel (cognitive 16) src/mitm/config.js:129— config.extractModel has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (7 pts), boolean chains 5, if/else 3, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
manager.getPort443Owner (cognitive 16) REDACTED:286— manager.getPort443Owner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 303, 292, 287, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
antigravityQuota.handleAntigravityQuotaError (cognitive 16) src/sse/services/antigravityQuota.js:138— antigravityQuota.handleAntigravityQuotaError has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
backgroundTokenRefresh.selectConnectionsNeedingRefresh (cognitive 16) src/sse/services/backgroundTokenRefresh.js:48— backgroundTokenRefresh.selectConnectionsNeedingRefresh has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildOAuthResolver (cognitive 16) src/app/api/providers/[id]/models/route.js:90— buildOAuthResolver has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 90). 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.
convertUserInputMessage (cognitive 16) src/mitm/handlers/kiro.js:211— convertUserInputMessage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (4 pts), loops 1, ternaries 1 (nesting depth added 1). Of this number, 11 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
startSessionLogin (cognitive 16) src/shared/components/XiaomiMimoAuthModal.js:131— startSessionLogin has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 5, error handling 2. Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 148). 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.
markAccountUnavailable (cognitive 16) src/sse/services/auth.js:242— markAccountUnavailable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 3 (4 pts), other 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.
resolveZedModels (cognitive 16) open-sse/shared/zedAuth.js:375— resolveZedModels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 3, error handling 1 (2 pts), other 2, loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 384, 396, 404). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
resolveQoderModels (cognitive 16) open-sse/services/qoderModels.js:302— resolveQoderModels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
handleRun (cognitive 16) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:73— handleRun has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 7, error handling 1, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
flattenQuery (cognitive 16) open-sse/executors/trae.js:22— flattenQuery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 1, loops 1, other 1 (nesting depth added 6). Of this number, 8 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
handleFetchCore (cognitive 16) open-sse/handlers/fetch/index.js:93— handleFetchCore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 6, error handling 1, other 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.
killTray (cognitive 16) REDACTED:255— killTray has cognitive complexity 16 (threshold 15). Drivers by points: error handling 7 (8 pts), if/else 5, boolean chains 2, ternaries 1 (nesting depth added 1). Of this number, 9 points are the body's own statements and 7 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retargetToolChoice (cognitive 16) open-sse/utils/opencodeFingerprint.js:104— retargetToolChoice has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
transformRequest (cognitive 16) open-sse/executors/opencode-go.js:158— transformRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity· POST (cognitive 16) · ×1
POST (cognitive 16) src/app/api/cli-tools/claude-settings/route.js:124— POST has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 2 (4 pts), boolean chains 2, error handling 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — tests/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
P12 · CI test-gate honesty· Test suite runs only after the merge · ×1
Test suite runs only after the merge — `REDACTED` run(s) the test suite, but no workflow that runs tests is triggered by a pull request (or a merge queue) — so the suite reports on code that is already on the default branch. A red build there blocks nothing and the only remedy is a revert. Add the pull-request trigger to the workflow that runs your suite so the gate applies before the merge, not after it.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplication concentrated across 6 sibling directories (52 clone groups) src/app/(dashboard)/dashboard/combos/page.js:977— 52 duplicated blocks under src/ have copies in at least two of the sibling directories app, i18n, lib, mitm, shared, sse — 37 of them are reported below, and 15 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 52 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 52 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 52 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 12 sibling directories (36 clone groups) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js:141— 36 duplicated blocks under src/app/(dashboard)/dashboard/ have copies in at least two of the sibling directories basic-chat, cli-tools, combos, endpoint, media-providers, mitm (+6 more sibling(s) not listed) — 20 of them are reported below, and 16 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 36 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 36 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 36 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 20 sibling directories (31 clone groups) src/app/api/cli-tools/crush-settings/route.js:15— 31 duplicated blocks under src/app/api/cli-tools/ have copies in at least two of the sibling directories antigravity-mitm, claude-settings, cline-settings, codewhale-settings, codex-settings, copilot-settings (+14 more sibling(s) not listed) — 21 of them are reported below, and 10 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 31 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 31 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 31 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 19 sibling directories (30 clone groups) src/app/api/providers/[id]/models/route.js:484— 30 duplicated blocks under src/app/api/ have copies in at least two of the sibling directories auth, cli-tools, combos, headroom, keys, mcp (+13 more sibling(s) not listed) — 19 of them are reported below, and 11 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 30 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 30 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 30 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (28 clone groups) cli/src/cli/api/client.js:46— 28 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, gitbook, open-sse, src — 26 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 28 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 28 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 28 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 2 sibling directories (19 clone groups) src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:11— 19 duplicated blocks under src/app/(dashboard)/dashboard/providers/ have copies in at least two of the sibling directories [id], components — 16 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 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 19 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 6 sibling directories (16 clone groups) open-sse/executors/cursor.js:401— 16 duplicated blocks under open-sse/ have copies in at least two of the sibling directories executors, services, shared, transformer, translator, utils — 13 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 16 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 16 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 16 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 2 sibling directories (11 clone groups) src/lib/oauth/providers/xai.js:11— 11 duplicated blocks under src/lib/oauth/ have copies in at least two of the sibling directories providers, services — 10 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 11 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 11 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 11 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 9 sibling directories (10 clone groups) src/app/api/oauth/codex/bulk-import/route.js:19— 10 duplicated blocks under src/app/api/oauth/ have copies in at least two of the sibling directories [provider], codex, cursor, gitlab, grok-cli, iflow (+3 more sibling(s) not listed) — 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.
Duplication concentrated across 5 sibling directories (8 clone groups) src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.js:204— 8 duplicated blocks under src/app/ have copies in at least two of the sibling directories (dashboard), api, callback, dashboard, login — 2 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 8 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 3 sibling directories (6 clone groups) open-sse/translator/formats/responsesApi.js:84— 6 duplicated blocks under open-sse/translator/ have copies in at least two of the sibling directories concerns, formats, request — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 12 sibling directories (6 clone groups) src/app/api/v1/chat/completions/route.js:4— 6 duplicated blocks under src/app/api/v1/ have copies in at least two of the sibling directories api, audio, chat, embeddings, images, messages (+6 more sibling(s) not listed) — 4 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 5 sibling directories (5 clone groups) src/app/api/media-providers/tts/deepgram/voices/route.js:4— 5 duplicated blocks under src/app/api/media-providers/tts/ have copies in at least two of the sibling directories deepgram, elevenlabs, inworld, minimax, voices — 4 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (221 matched lines × 2 locations) · ×1
Duplicated block with local edits (221 matched lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js:26— src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js:26 · src/app/(dashboard)/dashboard/cli-tools/components/OpenClawToolCard.js:27 — the two spans are one implementation copied and then locally edited — 1564 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 (217 matched lines × 2 locations) · ×1
Duplicated block with local edits (217 matched lines × 2 locations) open-sse/translator/request/claude-to-kiro.js:46— open-sse/translator/request/claude-to-kiro.js:46 · open-sse/translator/request/openai-to-kiro.js:44 — the two spans are one implementation copied and then locally edited — 1476 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 (195 matched lines × 2 locations) · ×1
Duplicated block with local edits (195 matched lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js:45— src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js:45 · src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:49 — the two spans are one implementation copied and then locally edited — 1331 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 (193 matched lines × 2 locations) · ×1
Duplicated block with local edits (193 matched lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:22— src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.js:22 · src/app/(dashboard)/dashboard/cli-tools/components/OpenCodeToolCard.js:27 — the two spans are one implementation copied and then locally edited — 1303 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (166 identical lines × 2 files) src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.js:3— src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.js:3 · src/app/(dashboard)/dashboard/cli-tools/components/KiloToolCard.js:3 — these 2 files are line-for-line copies of one another — 166 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (139 matched lines × 2 locations) · ×1
Duplicated block with local edits (139 matched lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:181— src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:181 · src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js:107 — the two spans are one implementation copied and then locally edited — 925 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 (134 matched lines × 2 locations) · ×1
Duplicated block with local edits (134 matched lines × 2 locations) src/lib/oauth/services/antigravity.js:12— src/lib/oauth/services/antigravity.js:12 · src/lib/oauth/services/gemini.js:12 — the two spans are one implementation copied and then locally edited — 806 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 (129 matched lines × 2 locations) · ×1
Duplicated block with local edits (129 matched lines × 2 locations) src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:11— src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:11 · src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:36 — the two spans are one implementation copied and then locally edited — 1191 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 (124 matched lines × 2 locations) · ×1
Duplicated block with local edits (124 matched lines × 2 locations) open-sse/translator/response/kiro-to-claude.js:19— open-sse/translator/response/kiro-to-claude.js:19 · open-sse/translator/response/openai-to-claude.js:50 — the two spans are one implementation copied and then locally edited — 798 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 (116 matched lines × 2 locations) · ×1
Duplicated block with local edits (116 matched lines × 2 locations) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:240— src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:240 · src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:106 — the two spans are one implementation copied and then locally edited — 606 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 (111 matched lines × 2 locations) · ×1
Duplicated block with local edits (111 matched lines × 2 locations) src/app/(dashboard)/dashboard/combos/page.js:977— src/app/(dashboard)/dashboard/combos/page.js:977 · src/shared/components/ComboFormModal.js:34 — the two spans are one implementation copied and then locally edited — 1011 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 (109 matched lines × 2 locations) · ×1
Duplicated block with local edits (109 matched lines × 2 locations) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:31— src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:31 · src/shared/components/EditConnectionModal.js:15 — the two spans are one implementation copied and then locally edited — 614 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (108 matched lines × 2 locations) · ×1
Duplicated block with local edits (108 matched lines × 2 locations) src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:15— src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:15 · src/app/(dashboard)/dashboard/media-providers/web/page.js:10 — the two spans are one implementation copied and then locally edited — 964 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (106 matched lines × 2 locations) · ×1
Duplicated block with local edits (106 matched lines × 2 locations) src/app/api/cli-tools/crush-settings/route.js:15— src/app/api/cli-tools/crush-settings/route.js:15 · src/app/api/cli-tools/pi-settings/route.js:15 — the two spans are one implementation copied and then locally edited — 743 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 (101 matched lines × 2 locations) · ×1
Duplicated block with local edits (101 matched lines × 2 locations) src/sse/handlers/fetch.js:37— src/sse/handlers/fetch.js:37 · src/sse/handlers/search.js:34 — the two spans are one implementation copied and then locally edited — 725 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 (99 matched lines × 2 locations) · ×1
Duplicated block with local edits (99 matched lines × 2 locations) src/app/api/cli-tools/droid-settings/route.js:10— src/app/api/cli-tools/droid-settings/route.js:10 · src/app/api/cli-tools/openclaw-settings/route.js:19 — the two spans are one implementation copied and then locally edited — 585 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 (97 matched lines × 2 locations) · ×1
Duplicated block with local edits (97 matched lines × 2 locations) open-sse/translator/request/antigravity-to-openai.js:39— open-sse/translator/request/antigravity-to-openai.js:39 · open-sse/translator/request/gemini-to-openai.js:27 — the two spans are one implementation copied and then locally edited — 596 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (95 matched lines × 2 locations) · ×1
Duplicated block with local edits (95 matched lines × 2 locations) src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js:23— src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js:23 · REDACTED:52 — the two spans are one implementation copied and then locally edited — 549 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 (93 matched lines × 2 locations) · ×1
Duplicated block with local edits (93 matched lines × 2 locations) src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.js:87— src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.js:87 · src/shared/components/AddCustomEmbeddingModal.js:63 — the two spans are one implementation copied and then locally edited — 507 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 (83 lines × 2 locations) open-sse/services/usage/opencode-go.js:25— open-sse/services/usage/opencode-go.js:25 · open-sse/services/usage/opencode-zen.js:25 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (80 matched lines × 2 locations) · ×1
Duplicated block with local edits (80 matched lines × 2 locations) src/lib/db/repos/nodesRepo.js:5— src/lib/db/repos/nodesRepo.js:5 · src/lib/db/repos/proxyPoolsRepo.js:5 — the two spans are one implementation copied and then locally edited — 539 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (74 identical lines × 2 files) src/app/api/cli-tools/codewhale-settings/route.js:3— src/app/api/cli-tools/codewhale-settings/route.js:3 · src/app/api/cli-tools/forge-settings/route.js:3 — these 2 files are line-for-line copies of one another — 74 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (68 matched lines × 2 locations) · ×1
Duplicated block with local edits (68 matched lines × 2 locations) open-sse/translator/formats/responsesApi.js:84— open-sse/translator/formats/responsesApi.js:84 · open-sse/translator/request/openai-responses.js:22 — the two spans are one implementation copied and then locally edited — 499 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Boundary violation [package:third-party-deep-import] custom-server.js:135— custom-server.js:135 imports next/dist/bin/next, 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.
Complex function handleChatCore (cyclomatic 165, cognitive 203) open-sse/handlers/chatCore.js:63— handleChatCore has cyclomatic complexity 165 and cognitive complexity 203; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 getUsageStats (cyclomatic 148, cognitive 257) src/lib/db/repos/usageRepo.js:347— getUsageStats has cyclomatic complexity 148 and cognitive complexity 257; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 testApiKeyConnection (cyclomatic 142, cognitive 147) src/app/api/providers/[id]/test/testUtils.js:496— testApiKeyConnection has cyclomatic complexity 142 and cognitive complexity 147; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function POST (cyclomatic 134, cognitive 120) · ×1
Complex function POST (cyclomatic 134, cognitive 120) src/app/api/providers/validate/route.js:85— POST has cyclomatic complexity 134 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function transform (cyclomatic 94, cognitive 201) open-sse/utils/stream.js:137— transform has cyclomatic complexity 94 and cognitive complexity 201; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ProfilePage (cyclomatic 80, cognitive 77) REDACTED:22— ProfilePage has cyclomatic complexity 80 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 applyFormat (cyclomatic 79, cognitive 103) open-sse/translator/concerns/thinkingUnified.js:254— applyFormat has cyclomatic complexity 79 and cognitive complexity 103; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 pingModelByKind (cyclomatic 78, cognitive 87) src/app/api/models/test/ping.js:55— pingModelByKind has cyclomatic complexity 78 and cognitive complexity 87; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildModelsList (cyclomatic 76, cognitive 160) src/app/api/v1/models/route.js:319— buildModelsList has cyclomatic complexity 76 and cognitive complexity 160; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 74, cognitive 112) open-sse/executors/devin-cli.js:600— (anonymous) has cyclomatic complexity 74 and cognitive complexity 112; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 openaiResponsesToOpenAIResponse (cyclomatic 74, cognitive 88) open-sse/translator/response/openai-responses.js:510— openaiResponsesToOpenAIResponse has cyclomatic complexity 74 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 translateNonStreamingResponse (cyclomatic 70, cognitive 96) open-sse/handlers/chatCore/nonStreamingHandler.js:147— translateNonStreamingResponse has cyclomatic complexity 70 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseGrokCliBilling (cyclomatic 70, cognitive 56) open-sse/services/usage/grok-cli.js:141— parseGrokCliBilling has cyclomatic complexity 70 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 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 startServer (cyclomatic 69, cognitive 119) REDACTED:471— startServer has cyclomatic complexity 69 and cognitive complexity 119; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 processEvent (cyclomatic 69, cognitive 101) open-sse/executors/kiro.js:792— processEvent has cyclomatic complexity 69 and cognitive complexity 101; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleForcedSSEToJson (cyclomatic 69, cognitive 83) open-sse/handlers/chatCore/sseToJsonHandler.js:183— handleForcedSSEToJson has cyclomatic complexity 69 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ConnectionRow (cyclomatic 68, cognitive 64) src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:9— ConnectionRow has cyclomatic complexity 68 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 openaiToGeminiBase (cyclomatic 67, cognitive 175) open-sse/translator/request/openai-to-gemini.js:40— openaiToGeminiBase has cyclomatic complexity 67 and cognitive complexity 175; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function POST (cyclomatic 67, cognitive 113) · ×1
Complex function POST (cyclomatic 67, cognitive 113) src/app/api/oauth/[provider]/[action]/route.js:296— POST has cyclomatic complexity 67 and cognitive complexity 113; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function APIPageClient (cyclomatic 62, cognitive 52) REDACTED:21— APIPageClient has cyclomatic complexity 62 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.
R4 · Test Coverage· This test file cannot be loaded · ×1
This test file cannot be loaded tests/unit/embeddings.cloud.test.js— tests/unit/embeddings.cloud.test.js:65 imports '../../cloud/src/services/storage.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
R6 · Tooling· The declared test suite includes a file that cannot be loaded · ×1
The declared test suite includes a file that cannot be loaded tests/unit/embeddings.cloud.test.js— This repository declares test tooling, and the ✓ above records that declaration — but tests/unit/embeddings.cloud.test.js cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
Dead file (~318 LoC) src/lib/oauth/services/antigravity.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/lib/oauth/services/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~271 LoC) scripts/migrate-registry.mjs— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~239 LoC) src/lib/oauth/services/gemini.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/lib/oauth/services/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~225 LoC) src/lib/oauth/services/github.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/lib/oauth/services/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~201 LoC) src/lib/oauth/services/iflow.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/lib/oauth/services/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~187 LoC) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~144 LoC) src/lib/oauth/services/codex.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/lib/oauth/services/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~143 LoC) REDACTED— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~133 LoC) src/lib/oauth/services/kimchi.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~132 LoC) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaProgressBar.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~122 LoC) src/lib/oauth/services/openai.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (src/lib/oauth/services/index.js) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~96 LoC) open-sse/providers/registry/grok-cli.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~94 LoC) open-sse/providers/registry/xiaomi-mimo.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~93 LoC) open-sse/providers/registry/glm.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~91 LoC) open-sse/providers/registry/github.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~88 LoC) open-sse/providers/registry/claude.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~86 LoC) open-sse/providers/registry/codebuddy-cn.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~85 LoC) open-sse/providers/registry/openai.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~84 LoC) open-sse/providers/registry/minimax.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~79 LoC) open-sse/providers/registry/codebuddy-intl.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~76 LoC) open-sse/providers/registry/trae.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~73 LoC) open-sse/providers/registry/selfhosted-embedding.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~72 LoC) open-sse/providers/registry/deepseek.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~67 LoC) open-sse/providers/registry/muse.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~64 LoC) open-sse/providers/registry/tokenrouter.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~62 LoC) open-sse/providers/registry/clinepass.js— no import path from any entry point (247 application, 11 tooling, 349 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unlisted import 'got-scraping' open-sse/utils/proxyFetch.js:20— Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json.
Unused dependency 'express' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'http-proxy-middleware' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'monaco-editor' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
SC1 · Supply-chain hygiene· JavaScript dependencies are not locked · ×1
JavaScript dependencies are not locked — No package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock — JS installs aren't reproducible (SSDF PW.4.4). Commit your package manager's lockfile and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
Silent fallback default in catch cli/src/cli/api/client.js:42— `loadRawMachineId` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch REDACTED:82— `getAutostartEnabled` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch gitbook/components/DocsSidebar.js:50— `DocsSidebar` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/translator/formats/responsesApi.js:47— `coerceResponsesArguments` swallows every exception into `return "{}"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/translator/request/openai-to-commandcode.js:103— `safeParseJson` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/shared/qoder/cosy.js:85— `computeSigPath` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/shared/qoder/attachments.js:253— `payloadBytes` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/shared/qoder/contextTier.js:80— `estimateQoderPromptTokens` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/executors/opencode.js:186— `lastUserText` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/handlers/chatCore/nonStreamingHandler.js:22— `parseToolArguments` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/rtk/headroom.js:19— `jsonBytes` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/rtk/pxpipe.js:15— `bodyChars` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/handlers/ttsProviders/localDevice.js:61— `fetchLocalDeviceVoices` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/services/usage/antigravity-weekly.js:147— `fetchAntigravityWeeklyQuota` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/services/usage/grok-cli.js:107— `planFromAccessToken` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch open-sse/utils/ollamaTransform.js:52— `transform` (in `transformToOllama`) swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/app/(dashboard)/dashboard/cli-tools/components/cliEndpointPresets.js:11— `read` (in `createStore`) swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/app/(dashboard)/dashboard/cli-tools/components/EndpointPresetControl.js:22— `readPresets` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:256— `formatResetTime` swallows every exception into `return "-"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/app/api/cli-tools/resolveApiKey.js:33— `resolveCliApiKey` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/app/api/cli-tools/cowork-settings/route.js:125— `read1pConfig` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/app/api/cli-tools/jcode-settings/route.js:94— `readProviderEnv` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/app/api/cli-tools/omp-settings/route.js:42— `readModelsYml` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/app/api/v1/models/route.js:252— `fetchCompatibleModelIds` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/lib/headroom/process.js:158— `getHeadroomLogTail` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Hand-rolled JSON/XML parsing via regex open-sse/executors/qoder.js:353— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex open-sse/executors/devin-cli.js:211— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex open-sse/executors/codebuddy-cn.js:29— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex open-sse/handlers/chatCore/streamingHandler.js:67— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex open-sse/handlers/ttsProviders/googleTts.js:14— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex open-sse/handlers/ttsProviders/googleTts.js:15— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex open-sse/shared/mimoAccount.js:187— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/cli-tools/components/GrokBuildToolCard.js:286— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/cli-tools/components/GrokBuildToolCard.js:360— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:1109— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:1122— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:1123— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:1135— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex REDACTED:1148— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:203— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:205— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:206— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/proxy-pools/page.js:878— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/proxy-pools/page.js:879— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/proxy-pools/page.js:881— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/proxy-pools/page.js:882— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/proxy-pools/page.js:945— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/(dashboard)/dashboard/proxy-pools/page.js:946— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/dashboard/settings/pricing/page.js:108— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex src/app/login/page.js:238— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Duplicated predicate open-sse/services/usage/commandcode.js:59— `!apiKey || typeof apiKey !== "string" || !apiKey.trim()` appears character-identically in 7 files — open-sse/services/usage/commandcode.js, open-sse/services/usage/deepseek.js, open-sse/services/usage/groq.js, open-sse/services/usage/opencode-go.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/handlers/systemoneCore.js:34— `!body.questions || typeof body.questions !== "object" || Array.isArray(body.questions)` appears character-identically in 2 files — open-sse/handlers/systemoneCore.js, src/sse/handlers/systemone.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/executors/codex.js:57— `!item || typeof item !== "object" || Array.isArray(item)` appears character-identically in 7 files — open-sse/executors/codex.js, open-sse/executors/grok-cli.js, open-sse/executors/opencode-go.js, open-sse/executors/opencode-zen.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/executors/opencode-go.js:98— `!item.name || typeof item.name !== "string" || item.name.trim() === ""` appears character-identically in 5 files — open-sse/executors/opencode-go.js, open-sse/executors/opencode-zen.js, open-sse/executors/opencode.js, open-sse/translator/formats/responsesApi.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/utils/streamHelpers.js:81— `!payload || typeof payload !== "object" || Array.isArray(payload)` appears character-identically in 2 files — open-sse/utils/streamHelpers.js, src/lib/db/index.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app/api/oauth/kiro/social-authorize/route.js:15— `!provider || !["google", "github"].includes(provider)` appears character-identically in 2 files — src/app/api/oauth/kiro/social-authorize/route.js, src/app/api/oauth/kiro/social-exchange/route.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app/api/oauth/codex/bulk-import/route.js:58— `!raw || typeof raw !== "object" || Array.isArray(raw)` appears character-identically in 2 files — src/app/api/oauth/codex/bulk-import/route.js, src/app/api/oauth/grok-cli/bulk-import/route.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/executors/codex.js:85— `!tool || typeof tool !== "object" || Array.isArray(tool)` appears character-identically in 6 files — open-sse/executors/codex.js, open-sse/executors/grok-cli.js, open-sse/executors/opencode-go.js, open-sse/executors/opencode-zen.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/shared/qoder/sse.js:24— `!usage || typeof usage !== "object" || Array.isArray(usage)` appears character-identically in 2 files — open-sse/shared/qoder/sse.js, open-sse/utils/usageTracking.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app/api/pxpipe/logs/route.js:10— `Number(searchParams.get("limit")) || 100` appears character-identically in 2 files — src/app/api/pxpipe/logs/route.js, src/app/api/pxpipe/stats/route.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app/api/oauth/codex/bulk-import/route.js:34— `body && typeof body === "object" && Array.isArray(body.accounts)` appears character-identically in 2 files — src/app/api/oauth/codex/bulk-import/route.js, src/app/api/oauth/grok-cli/bulk-import/route.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/executors/codex.js:124— `body.tool_choice && typeof body.tool_choice === "object" && !Array.isArray(body.tool_choice)` appears character-identically in 5 files — open-sse/executors/codex.js, open-sse/executors/grok-cli.js, open-sse/executors/opencode-go.js, open-sse/executors/opencode-zen.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app/api/cli-tools/codewhale-settings/route.js:35— `content.includes("managed by 9Router") || content.includes("localhost:20128")` appears character-identically in 2 files — src/app/api/cli-tools/codewhale-settings/route.js, src/app/api/cli-tools/forge-settings/route.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/handlers/videoProviders/openrouter.js:29— `contentType && !contentType.includes("application/json")` appears character-identically in 2 files — open-sse/handlers/videoProviders/openrouter.js, open-sse/handlers/videoProviders/vertex.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js:78— `err.message || translate("Request failed")` appears character-identically in 2 files — src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/executors/codex.js:111— `fn?.parameters && typeof fn.parameters === "object" && !Array.isArray(fn.parameters)` appears character-identically in 5 files — open-sse/executors/codex.js, open-sse/executors/grok-cli.js, open-sse/executors/opencode-go.js, open-sse/executors/opencode-zen.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/lib/auth/oidc.js:36— `forwardedProto || new URL(request.url).protocol || "http:"` appears character-identically in 2 files — src/lib/auth/oidc.js, src/lib/auth/saml.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/lib/oauth/providerHelpers.js:12— `host !== "x.ai" && !host.endsWith(".x.ai")` appears character-identically in 2 files — src/lib/oauth/providerHelpers.js, src/lib/oauth/services/xai.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/executors/kiro.js:715— `input && typeof input === "object" && !Array.isArray(input)` appears character-identically in 2 files — open-sse/executors/kiro.js, open-sse/translator/concerns/kiroConversation.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/executors/codex.js:68— `item && typeof item === "object" && !Array.isArray(item)` appears character-identically in 2 files — open-sse/executors/codex.js, open-sse/executors/grok-cli.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/services/usage/google.js:235— `k.startsWith("gemini-") && !k.includes("image")` appears character-identically in 3 files — open-sse/services/usage/google.js, REDACTED, src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:17— `k.startsWith("modelLock_") && v && new Date(v).getTime() > Date.now()` appears character-identically in 3 files — src/app/(dashboard)/dashboard/media-providers/[kind]/page.js, src/app/(dashboard)/dashboard/media-providers/web/page.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate cli/hooks/sqliteRuntime.js:78— `magic.startsWith("cffaedfe") || magic.startsWith("cefaedfe")` appears character-identically in 2 files — cli/hooks/sqliteRuntime.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/translator/response/kiro-to-claude.js:54— `map && typeof map.get === "function" && map.has(raw)` appears character-identically in 2 files — open-sse/translator/response/kiro-to-claude.js, open-sse/translator/response/kiro-to-openai.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate open-sse/translator/formats/claude.js:50— `msg.content && typeof msg.content === "object" && !Array.isArray(msg.content)` appears character-identically in 2 files — open-sse/translator/formats/claude.js, open-sse/translator/request/claude-to-openai.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 63 significant file(s) lose their only recent owner: open-sse/executors/devin-cli.js, open-sse/executors/windsurf.js, src/shared/components/Sidebar.js, open-sse/executors/perplexity-web.js, src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js, cli/src/cli/api/client.js, src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.js, open-sse/executors/grok-web.js (+55 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 12 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (78 single-owned of 550 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 550 of the 976 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) (+6 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
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/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 3.3/10. The most over is `(repository root)` (129897 LoC, 755 public types across 268 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D30 · Dependency Vulnerabilities· Scanner failed to run · ×1
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 9 of 550 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 550 of the 976 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: src/lib/oauth/services/xai.js, src/lib/auth/oidc.js, src/lib/oauth/services/cursor.js, open-sse/services/oauthCredentialManager.js, src/lib/oauth/constants/xai.js, src/app/api/media-providers/tts/minimax/voices/route.js, src/app/api/models/availability/route.js, src/app/api/auth/oidc/callback/route.js (and 1 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
Logging is not universal — Only 1/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `cli`, `gitbook`.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/javascript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 25749 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.
Skipped (documented): does not inject Claude Code system prompt for compatible providers tests/translator/bugs-toClaude-context.test.js:15— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): tool_choice=none is not turned into auto tests/translator/bugs-toClaude-context.test.js:38— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): input_audio content is preserved tests/translator/bugs-toClaude-context.test.js:49— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): image with source.type=url is preserved (NOT dropped) tests/translator/bugs-openai-bridge.test.js:14— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): tool_result with image block is not turned into raw JSON / dropped tests/translator/bugs-openai-bridge.test.js:40— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): tool_result is_error flag is preserved tests/translator/bugs-openai-bridge.test.js:60— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): respects client max_tokens tests/translator/bugs-kiro.test.js:53— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): remote image url is preserved as an image, not text tests/translator/bugs-kiro.test.js:60— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): multiple system messages are all kept tests/translator/bugs-gemini-cursor-commandcode.test.js:14— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): image content is preserved tests/translator/bugs-gemini-cursor-commandcode.test.js:29— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): respects client max_tokens tests/translator/bugs-gemini-cursor-commandcode.test.js:41— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): malformed tool arguments are not silently emptied tests/translator/bugs-gemini-cursor-commandcode.test.js:50— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): assistant has no empty tool_calls array when all names are empty tests/translator/bugs-codexCli-responses.test.js:13— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): input_image with file_id is not used as a raw url tests/translator/bugs-codexCli-responses.test.js:33— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): redacted_thinking block is not silently dropped tests/translator/bugs-claudeCode-context.test.js:44— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): tool_result image block is preserved tests/translator/bugs-claudeCode-context.test.js:59— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): inject a reasoning placeholder into Responses `input` items for DeepSeek models — tests/unit/opencode-go-deepseek-thinking-injection.test.js:96— Skipped with a documented reason — a deferral, not lazy debt: declared with it.todo — a placeholder that registers a name and runs nothing
Skipped (documented): (unnamed test) tests/unit/antigravity-cache.test.js:125— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no committed lockfile, so no resolved version to grade) — This repository's npm dependencies were read for PINNING discipline: 47 production declaration(s) plus 10 development one(s) across 4 package.json (3 of them the product — the rest are example, documentation or fixture manifests, which are read and counted but screened off the rules below, because both prescribe a MOVE and "align your example apps" is not a remedy), against 0 committed lockfile(s). No pinning defect was found. That is only PART of dependency hygiene, so this dimension is NOT SCORED: whether any of these packages has a newer, deprecated or abandoned release is the dependency-CURRENCY question, and answering it needs a lockfile resolved to concrete versions, which this repository does not commit: a package.json states version RANGES, and a range names no particular release to be behind. So there was nothing here for the registry to grade — that is a fact about the repository, not a reader we are missing, and no lockfile reader we could write would change it. A clean pinning pass is NOT an all-clear for these dependencies, and it is not a finding that they are all USED. Note also what is deliberately NOT charged here: a workspace legitimately carries ONE lockfile for many manifests, so no row is raised off the lockfile count, only reported. Known CVEs in the same dependency graph are a separate question again, reported under D30 wherever the manifest is OSV-readable.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 3 file(s) — `open-sse/shared/clineAuth.js`, `src/app/api/version/route.js`, `src/shared/constants/config.js` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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 01a0f857-6ee0-7c3f-b0d2-62f0a774f17a · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 110 · Warnings: 1503 · Recommendations: 101 · Info: 19 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 01-10-2026 @ 16:41 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.