Public report of decolua/9router, published 15 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 15 November 2026, 03:36 UTC · Survey ID cd_9a2837847a844f36b407f39cae7ba355

decolua/9router

Measured 15 November 2026, 03:32 UTC, at code version 1855aa4

Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).

CAI score 29out of 100 Weak
CriticalWeakAdequateStrongExemplary
Down 1 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 164,594 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 1.3 person-years · Weakest lens: Production Readiness, 17

Findings by how serious they are

122 critical 2223 serious 304 minor

5 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
15 November 2026, 03:32 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

68of 68 dimensions measured by tools.
2625of 2649 findings point to an exact file and line, so you can open each one in the code. The other 24 concern the repository as a whole, such as missing documentation.
68dimensions across 6 lenses, read from 164,594 lines of product code in 3 projects.
Chapters

Executive summary

decolua/9router falls short of our standard for a preview release because 23 passwords or keys sit in the current code and we found no automated security scanning of the code, its secrets or its dependencies. It scores 29 out of 100 and is rated Weak, and 109 of its 122 critical findings are security problems.

Production Readiness, at 17, is the weakest lens and counts most in the score. The best first step is replacing the 23 exposed passwords or keys and switching the old ones off, worth about 12 points. Restoring certificate checks comes next, worth about 5 points. Raising Production Readiness to 62 would lift the score to about 41.

Thirty-one places in the code run text as code, which an attacker could use. Twenty-three passwords or keys in the code and 18 in the code's history are open to anyone who can read the repository, and eighteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Replacing text run as code with direct calls, replacing each exposed password or key and pinning each tool to an exact version would close these risks. Limiting each secret to its own step would fix the six secrets exposed to more of the pipeline than needed, and fixing the weaknesses the scanner points to would deal with the five security weaknesses in the code. The six sets of files in separate parts that keep changing together need that dependency made explicit.

The product code is 164,594 lines, about €190,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 17 · counts for 46%Security and Compliance 31 · counts for 25%Code Health 34 · counts for 14%Performance 60 · counts for 8%Architecture 67 · counts for 4%Maturity 68 · counts for 2%

If Production Readiness rose from 17 to 62, the lowest score rated Strong, the score would rise from 29 to about 41.

Code composition: what the lines of code are
Product code 73%Tests 27%
New since the last survey: 247 findings

These 247 critical or serious findings weren't in the previous survey, on 29 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 2310 findings

These 2310 critical or serious findings were in the previous survey, on 29 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · imageGenerationCore.handleImageGenerationCore (cyclomatic 49) open-sse/handlers/imageGenerationCore.js
  • Cyclomatic Complexity · openaiToClaudeResponse (cyclomatic 40) open-sse/translator/response/openai-to-claude.js
  • Cyclomatic Complexity · getMiniMaxUsage (cyclomatic 31) open-sse/services/usage/minimax.js
  • Cyclomatic Complexity · migrate-registry.migrateEntry (cyclomatic 22) scripts/migrate-registry.mjs
  • Cyclomatic Complexity · handleStreamingResponse (cyclomatic 20) open-sse/handlers/chatCore/streamingHandler.js
  • Cyclomatic Complexity · route.GET (cyclomatic 19) REDACTED
  • Cyclomatic Complexity · (anonymous) (cyclomatic 19) src/app/(dashboard)/dashboard/providers/[id]/page.js
  • Cyclomatic Complexity · migrate-registry.formatEntry::emitKey (cyclomatic 16) scripts/migrate-registry.mjs
  • Cyclomatic Complexity · buildBody (cyclomatic 16) open-sse/handlers/imageProviders/codex.js
  • Cognitive Complexity · route.POST (cognitive 131) REDACTED
  • Cognitive Complexity · openaiToClaudeResponse (cognitive 64) open-sse/translator/response/openai-to-claude.js
  • Cognitive Complexity · getMiniMaxUsage (cognitive 41) open-sse/services/usage/minimax.js
  • Cognitive Complexity · migrate-registry.migrateEntry (cognitive 31) scripts/migrate-registry.mjs
  • Cognitive Complexity · claude-to-openai.claudeToOpenAIRequest (cognitive 28) open-sse/translator/request/claude-to-openai.js
  • Cognitive Complexity · handleStreamingResponse (cognitive 22) open-sse/handlers/chatCore/streamingHandler.js
  • Cognitive Complexity · route.GET (cognitive 20) REDACTED
  • Cognitive Complexity · (anonymous) (cognitive 19) src/app/(dashboard)/dashboard/providers/[id]/page.js
  • Cognitive Complexity · migrate-registry.formatEntry (cognitive 17) scripts/migrate-registry.mjs
  • Cognitive Complexity · buildBody (cognitive 17) open-sse/handlers/imageProviders/codex.js
  • Cognitive Complexity · migrate-registry.formatValue (cognitive 16) scripts/migrate-registry.mjs
  • REDACTED Scanning · Leaked secret: REDACTED open-sse/executors/xiaomi-mimo.js
  • Churn × Complexity Hotspots · Hotspot: open-sse/providers/capabilities.js open-sse/providers/capabilities.js
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: open-sse/providers/thinkingLevels.js open-sse/providers/thinkingLevels.js
  • Churn × Complexity Hotspots · Hotspot: src/sse/services/tokenRefresh.js src/sse/services/tokenRefresh.js
  • Churn × Complexity Hotspots · Hotspot: src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.js src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.js
  • Churn × Complexity Hotspots · Hotspot: open-sse/translator/response/kiro-to-claude.js open-sse/translator/response/kiro-to-claude.js
  • Churn × Complexity Hotspots · Hotspot: src/app/login/page.js src/app/login/page.js
  • Churn × Complexity Hotspots · Hotspot: src/mitm/config.js src/mitm/config.js
  • Churn × Complexity Hotspots · Hotspot: custom-server.js custom-server.js
  • Churn × Complexity Hotspots · Hotspot: cli/scripts/build-cli.js cli/scripts/build-cli.js
  • Churn × Complexity Hotspots · Hotspot: src/shared/components/Header.js src/shared/components/Header.js
  • Churn × Complexity Hotspots · Hotspot: src/app/api/auth/status/route.js src/app/api/auth/status/route.js
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: src/lib/network/connectionProxy.js src/lib/network/connectionProxy.js
  • Churn × Complexity Hotspots · Repeated repair: REDACTED REDACTED
  • Churn × Complexity Hotspots · Repeated repair: open-sse/services/tokenRefresh.js open-sse/services/tokenRefresh.js
  • Static Analysis (SAST) · Medium: watchdog-regexp-from-parameter-ts REDACTED
  • Static Analysis (SAST) · Medium: watchdog-regexp-from-parameter-ts REDACTED
  • Static Analysis (SAST) · Medium: watchdog-regexp-from-parameter-ts REDACTED
  • Static Analysis (SAST) · Medium: watchdog-regexp-from-parameter-ts src/app/(dashboard)/dashboard/cli-tools/components/codexConfig.js
  • Change Coupling · Change coupling: opencode-go.js ↔ opencode-go.js open-sse/executors/opencode-go.js
  • Code Duplication · Duplication concentrated across 18 sibling directories (34 clone groups) src/app/api/providers/[id]/models/route.js
  • Code Duplication · Duplication concentrated across 9 sibling directories (9 clone groups) REDACTED
  • Code Duplication · Duplication concentrated across 5 sibling directories (5 clone groups) REDACTED
  • Code Duplication · Duplicated block with local edits (145 matched lines × 2 locations) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js
  • Code Duplication · Duplicated block with local edits (136 matched lines × 2 locations) open-sse/executors/opencode-zen.js
  • Code Duplication · Duplicated block with local edits (97 matched lines × 2 locations) open-sse/translator/request/antigravity-to-openai.js
  • Code Duplication · Duplicated block with local edits (68 matched lines × 2 locations) open-sse/translator/formats/responsesApi.js
  • Code Duplication · Duplicated block with local edits (64 matched lines × 2 locations) src/lib/oauth/providers/antigravity.js
  • Code Duplication · Duplicated block with local edits (63 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (59 lines × 2 locations) open-sse/handlers/chatCore/nonStreamingHandler.js
  • Code Duplication · Duplicated block with local edits (55 matched lines × 2 locations) open-sse/executors/github.js
  • Code Duplication · Duplicated block (54 lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/KiloToolCard.js
  • Code Duplication · Duplicated block with local edits (53 matched lines × 2 locations) src/app/(dashboard)/dashboard/providers/[id]/ModelRow.js
  • Code Duplication · Duplicated block (52 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (52 lines × 2 locations) REDACTED
  • Code Duplication · Wholesale file copy (51 identical lines × 2 files) src/lib/oauth/providers/codebuddy-cn.js
  • Code Duplication · Duplicated block (50 lines × 2 locations) open-sse/services/tokenRefresh/providers.js
  • Code Duplication · Duplicated block with local edits (50 matched lines × 2 locations) src/lib/db/repos/apiKeysRepo.js
  • Code Duplication · Duplicated block (49 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (48 lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js
  • Code Duplication · Duplicated block with local edits (48 matched lines × 2 locations) src/sse/handlers/stt.js
  • Code Duplication · Duplicated block with local edits (47 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (47 matched lines × 2 locations) src/lib/oauth/providers/xai.js
  • Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) open-sse/executors/codebuddy-cn.js
  • Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) open-sse/handlers/embeddingsCore.js
  • Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (44 matched lines × 2 locations) src/shared/components/Input.js
  • Code Duplication · Duplicated block (43 lines × 2 locations) open-sse/executors/deepseek-web.js
  • Code Duplication · Duplicated block (42 lines × 3 locations) src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js
  • Code Duplication · Duplicated block with local edits (42 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (42 matched lines × 2 locations) src/app/api/providers/[id]/route.js
  • Code Duplication · Duplicated block (42 lines × 2 locations) src/shared/components/KiroSocialOAuthModal.js
  • Code Duplication · Duplicated block (41 lines × 3 locations) src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js
  • Code Duplication · Duplicated block (40 lines × 2 locations) src/app/(dashboard)/dashboard/usage/components/ProviderBarChart.js
  • Code Duplication · Duplicated block (40 lines × 2 locations) src/lib/oauth/utils/server.js
  • Code Duplication · Duplicated block (39 lines × 2 locations) src/lib/db/adapters/bunSqliteAdapter.js
  • Code Duplication · Duplicated block with local edits (39 matched lines × 2 locations) src/lib/oauth/providers/kiro.js
  • Code Duplication · Duplicated block (38 lines × 2 locations) src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js
  • Code Duplication · Duplicated block with local edits (38 matched lines × 2 locations) src/lib/oauth/services/claude.js
  • Code Duplication · Duplicated block (37 lines × 3 locations) src/app/(dashboard)/dashboard/cli-tools/components/CodexToolCard.js
  • Code Duplication · Duplicated block (37 lines × 2 locations) src/lib/oauth/providers/cline.js
  • Code Duplication · Duplicated block (36 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (36 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (36 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (34 lines × 2 locations) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js
  • Code Duplication · Duplicated block with local edits (33 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (33 lines × 2 locations) src/lib/oauth/providers/grok-cli.js
  • Code Duplication · Duplicated block (32 lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js
  • Code Duplication · Duplicated block (32 lines × 2 locations) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js
  • Code Duplication · Duplicated block with local edits (32 matched lines × 2 locations) src/lib/db/repos/connectionsRepo.js
  • Code Duplication · Duplicated block (32 lines × 2 locations) src/shared/components/OAuthModal.js
  • Code Duplication · Duplicated block (31 lines × 2 locations) src/shared/components/CursorAuthModal.js
  • Code Duplication · Duplicated block (30 lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.js
  • Code Duplication · Duplicated block (30 lines × 2 locations) src/app/(dashboard)/dashboard/cli-tools/components/DeepSeekTuiToolCard.js
  • Code Duplication · Duplicated block (30 lines × 3 locations) src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js
  • Code Duplication · Duplicated block (30 lines × 2 locations) src/shared/components/Drawer.js
  • Code Duplication · Duplicated block with local edits (29 matched lines × 2 locations) open-sse/services/grokTlsClient.js
  • Code Duplication · Duplicated block (29 lines × 2 locations) REDACTED
Rebuild cost: about €190,000 · Estimate
Cost to rebuild€63,000 to €320,000, for 1,057 to 3,353 hours of work, about 1.3 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 29. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 164,594 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 23 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (5), REDACTED (4), REDACTED (3).
Raises the score by about 12 points · Medium effort · REDACTED Scanning
2
Stop accepting every TLS certificate: delete `rejectUnauthorized: false` / `NODE_TLS_REJECT_UNAUTHORIZED=0` so the chain, hostname and expiry are verified, and trust a self-signed or private server by passing its CA (`ca`, or `NODE_EXTRA_CA_CERTS`) — never by switching verification off.
This repository constructs a TLS client that accepts any certificate at 4 sites, not one: `REDACTED:350` (`rejectUnauthorized: false`), `REDACTED:164` (`rejectUnauthorized: false`), `REDACTED:197` (`rejectUnauthorized: false`), `REDACTED:259` (`rejectUnauthorized: false`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Raises the score by about 5 points · Medium effort · Web-Security Posture
3
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.
Raises the score by about 3 points · Medium effort · Security & performance tooling

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €190,000 to build again, about 1.3 person-years of work. Its weakest lens is Production Readiness, at 17 (Critical). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 23 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 12 points for medium effort, because it clears the 23 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 107,230 lines over the last 90 days, which is about 434,877 lines a year. At that pace, the extra work comes to an estimated 54.4 to 326.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

353 modules, with 42 dependencies between them. Every module uses only modules listed above it, so there are no loops.

The table shows the 40 modules with the most connections; 313 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 open-sse.executors.base2 src.lib.oauth.services.oauth3 open-sse.executors.antigravity4 open-sse.executors.bedrock5 open-sse.executors.chatgpt-web6 open-sse.executors.codex7 open-sse.executors.commandcode8 open-sse.executors.cursor9 open-sse.executors.deepseek-web10 open-sse.executors.default11 open-sse.executors.devin-cli12 open-sse.executors.gemini-cli13 open-sse.executors.gemini-web14 open-sse.executors.github15 open-sse.executors.grok-cli16 open-sse.executors.grok-web17 open-sse.executors.iflow18 open-sse.executors.kiro19 open-sse.executors.mimo-free20 open-sse.executors.muse-web21 open-sse.executors.opencode22 open-sse.executors.perplexity-web23 open-sse.executors.qoder24 open-sse.executors.trae25 open-sse.executors.uc-web26 open-sse.executors.veoaifree-web27 open-sse.executors.vertex28 open-sse.executors.windsurf29 open-sse.executors.zed30 src.lib.oauth.services.claude31 open-sse.executors.azure32 open-sse.executors.codebuddy-cn33 open-sse.executors.codebuddy-intl34 open-sse.executors.kimchi35 open-sse.executors.minimax-code36 open-sse.executors.ollama-local37 open-sse.executors.opencode-go38 open-sse.executors.opencode-zen39 open-sse.executors.xiaomi-mimo40 open-sse.executors.xiaomi-tokenplan
1 open-sse.executors.base
2 src.lib.oauth.services.oauth
3 open-sse.executors.antigravity1
4 open-sse.executors.bedrock1
5 open-sse.executors.chatgpt-web1
6 open-sse.executors.codex1
7 open-sse.executors.commandcode1
8 open-sse.executors.cursor1
9 open-sse.executors.deepseek-web1
10 open-sse.executors.default1
11 open-sse.executors.devin-cli1
12 open-sse.executors.gemini-cli1
13 open-sse.executors.gemini-web1
14 open-sse.executors.github1
15 open-sse.executors.grok-cli1
16 open-sse.executors.grok-web1
17 open-sse.executors.iflow1
18 open-sse.executors.kiro1
19 open-sse.executors.mimo-free1
20 open-sse.executors.muse-web1
21 open-sse.executors.opencode1
22 open-sse.executors.perplexity-web1
23 open-sse.executors.qoder1
24 open-sse.executors.trae1
25 open-sse.executors.uc-web1
26 open-sse.executors.veoaifree-web1
27 open-sse.executors.vertex1
28 open-sse.executors.windsurf1
29 open-sse.executors.zed1
30 src.lib.oauth.services.claude1
31 open-sse.executors.azure1
32 open-sse.executors.codebuddy-cn1
33 open-sse.executors.codebuddy-intl1
34 open-sse.executors.kimchi1
35 open-sse.executors.minimax-code1
36 open-sse.executors.ollama-local1
37 open-sse.executors.opencode-go1
38 open-sse.executors.opencode-zen1
39 open-sse.executors.xiaomi-mimo1
40 open-sse.executors.xiaomi-tokenplan1
Uses a module listed above itPart of a loopThe module itself
1 open-sse.executors.base2 src.lib.oauth.services.oauth3 open-sse.executors.antigravity4 open-sse.executors.bedrock5 open-sse.executors.chatgpt-web6 open-sse.executors.codex7 open-sse.executors.commandcode8 open-sse.executors.cursor9 open-sse.executors.deepseek-web10 open-sse.executors.default11 open-sse.executors.devin-cli12 open-sse.executors.gemini-cli13 open-sse.executors.gemini-web14 open-sse.executors.github15 open-sse.executors.grok-cli16 open-sse.executors.grok-web17 open-sse.executors.iflow18 open-sse.executors.kiro19 open-sse.executors.mimo-free20 open-sse.executors.muse-web21 open-sse.executors.opencode22 open-sse.executors.perplexity-web23 open-sse.executors.qoder24 open-sse.executors.trae25 open-sse.executors.uc-web26 open-sse.executors.veoaifree-web27 open-sse.executors.vertex28 open-sse.executors.windsurf29 open-sse.executors.zed30 src.lib.oauth.services.claude31 open-sse.executors.azure32 open-sse.executors.codebuddy-cn33 open-sse.executors.codebuddy-intl34 open-sse.executors.kimchi35 open-sse.executors.minimax-code36 open-sse.executors.ollama-local37 open-sse.executors.opencode-go38 open-sse.executors.opencode-zen39 open-sse.executors.xiaomi-mimo40 open-sse.executors.xiaomi-tokenplanopen-sse.executors.base1src.lib.oauth.services.oauth2open-sse.executors.antigravity3open-sse.executors.bedrock4open-sse.executors.chatgpt-web5open-sse.executors.codex6open-sse.executors.commandcode7open-sse.executors.cursor8open-sse.executors.deepseek-web9open-sse.executors.default10open-sse.executors.devin-cli11open-sse.executors.gemini-cli12open-sse.executors.gemini-web13open-sse.executors.github14open-sse.executors.grok-cli15open-sse.executors.grok-web16open-sse.executors.iflow17open-sse.executors.kiro18open-sse.executors.mimo-free19open-sse.executors.muse-web20open-sse.executors.opencode21open-sse.executors.perplexity-web22open-sse.executors.qoder23open-sse.executors.trae24open-sse.executors.uc-web25open-sse.executors.veoaifree-web26open-sse.executors.vertex27open-sse.executors.windsurf28open-sse.executors.zed29src.lib.oauth.services.claude30open-sse.executors.azure31open-sse.executors.codebuddy-cn32open-sse.executors.codebuddy-intl33open-sse.executors.kimchi34open-sse.executors.minimax-code35open-sse.executors.ollama-local36open-sse.executors.opencode-go37open-sse.executors.opencode-zen38open-sse.executors.xiaomi-mimo39open-sse.executors.xiaomi-tokenplan4011111111111111111111111111111111111111+313 more modules (most-connected shown)

At a glance — Code Health · 34% · Weak · gated by D1, D2, R1, R10 ·

At a glance — Architecture · 67% · Adequate · gated by D26, R9 ·

At a glance — Maturity · 68% · Strong ·

At a glance — Readiness · 17% · Critical · gated by D13, R6, R8, P3, P5, P7 ·

At a glance — Security · 31% · Weak · gated by D28, D29, D36, S1 ·

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A05:2025 — Injection386High / Critical
A07:2025 — Authentication Failures42High / Critical
A02:2025 — Security Misconfiguration8High / Critical
A03:2025 — Software Supply Chain Failures6Medium

Roadmap

Top priorities: Resolve the 23 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (5), REDACTED (4), REDACTED (3); Stop accepting every TLS certificate: delete `rejectUnauthorized: false` / `NODE_TLS_REJECT_UNAUTHORIZED=0` so the chain, hostname and expiry are verified, and trust a self-signed or private server by passing its CA (`ca`, or `NODE_EXTRA_CA_CERTS`) — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 4 sites, not one: `REDACTED:350` (`rejectUnauthorized: false`), `REDACTED:164` (`rejectUnauthorized: false`), `REDACTED:197` (`rejectUnauthorized: false`), `REDACTED:259` (`rejectUnauthorized: false`). Each is a separate decision — fixing only the line this row cites leaves the others in place; 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.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 23 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (5), REDACTED (4), REDACTED (3).+12.3 ptsMediumREDACTED Scanning
Stop accepting every TLS certificate: delete `rejectUnauthorized: false` / `NODE_TLS_REJECT_UNAUTHORIZED=0` so the chain, hostname and expiry are verified, and trust a self-signed or private server by passing its CA (`ca`, or `NODE_EXTRA_CA_CERTS`) — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 4 sites, not one: `REDACTED:350` (`rejectUnauthorized: false`), `REDACTED:164` (`rejectUnauthorized: false`), `REDACTED:197` (`rejectUnauthorized: false`), `REDACTED:259` (`rejectUnauthorized: false`). Each is a separate decision — fixing only the line this row cites leaves the others in place.+4.9 ptsMediumWeb-Security Posture
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.+3.1 ptsMediumSecurity & performance tooling
Resolve the 1 finding(s) in DR & Backup.+3.1 ptsMediumDR & Backup
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+3.1 ptsMediumDependency Hygiene
Resolve the 18 REDACTED finding(s) in Secrets (history) — start with REDACTED (4), REDACTED (3), REDACTED (3).+2.6 ptsMediumSecrets (history)
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.+1.9 ptsMediumType Safety
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED.+0.8 ptsLowStatic Analysis (SAST)

File quality

Per-file score 0–10 — a quality signature. Of 544 files carrying findings, judged against the Preview bar: 3% slop · 27% mixed · 70% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.4SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED0.6SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED0.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.8SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED1.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.6SlopSecrets (history): REDACTED: REDACTED
REDACTED2.1SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.6SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED3.0MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED3.0MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED3.0MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED3.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.2MixedStatic 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 — 122

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 — 2223

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 — 304

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 5

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 68 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 68 dimensions across the health lenses
D1D2D3D4D5D6D10D13D15D16D19D20D21D24D26D27D28D29D30D31D34D35D36D43D44AX10AX3AX4C2GD1IC1M1M2M3M4P1P2P3P4P5P6P7PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X13X14X16X19X2X21X23X24X28X29X3X30

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
  1. 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, 2625 of 2649 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1dd43-ed10-79c4-9025-0698fb0ec268.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 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.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 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 an ADMISSION gap, not an environment fault: it declares a published package (cli/package.json), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
  • 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; osv was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that osv is free of known-vulnerable dependencies. osv: the scanner produced no output at all, so no dependency was actually scanned. This is reported as a measurement gap rather than a clean pass. osv-scanner documents exit 128 as "no package sources found" — but this scan only invoked it because the tree declares a source it supports (`pom.xml` and the resolved lockfiles among them), so the tool's report and this repository disagree. Check that those sources are reachable from the directory the scan ran in before concluding anything is missing. If this tree really does commit only range-pinned manifests, commit the lockfile your package manager produces — but only where your ecosystem HAS one and commits it: Maven has none at all (osv-scanner reads `pom.xml` directly) and Gradle writes one only under opt-in dependency locking, while a published Composer package and a published Dart library both deliberately exclude theirs. In those three, generate one in CI before the scan instead — a resolved dependency list or an SBOM fed to the scanner.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `open-sse/shared/clineAuth.js`, `REDACTED`, `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; osv was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that osv is free of known-vulnerable dependencies. osv: the scanner produced no output at all, so no dependency was actually scanned. This is reported as a measurement gap rather than a clean pass. osv-scanner documents exit 128 as "no package sources found" — but this scan only invoked it because the tree declares a source it supports (`pom.xml` and the resolved lockfiles among them), so the tool's report and this repository disagree. Check that those sources are reachable from the directory the scan ran in before concluding anything is missing. If this tree really does commit only range-pinned manifests, commit the lockfile your package manager produces — but only where your ecosystem HAS one and commits it: Maven has none at all (osv-scanner reads `pom.xml` directly) and Gradle writes one only under opt-in dependency locking, while a published Composer package and a published Dart library both deliberately exclude theirs. In those three, generate one in CI before the scan instead — a resolved dependency list or an SBOM fed to the scanner.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — 44.77 44.77 > Build failed because of webpack errors 45.00 npm notice 45.00 npm notice New major version of npm available! 10.9.9 -> 12.2.2 45.00 npm notice Changelog: https://github.com/npm/cli/releases/tag/v12.2.2 45.00 npm notice To update run: npm install -g npm@12.2.2 45.00 npm notice ------ ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1; runtime evidence skipped.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P2 Observability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 434 further occurrence(s) are not listed individually; the score already reflects all 474.
  • P7 Outbound HTTP resilience — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 178 further occurrence(s) are not listed individually; the score already reflects all 218.
  • PF3 Async & latency hygiene — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 87 further occurrence(s) are not listed individually; the score already reflects all 127.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 727 further occurrence(s) are not listed individually; the score already reflects all 767.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 723 further occurrence(s) are not listed individually; the score already reflects all 763.
  • R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 50 further occurrence(s) are not listed individually; the score already reflects all 90.
  • R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 260 further occurrence(s) are not listed individually; the score already reflects all 300.
  • R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 279 further occurrence(s) are not listed individually; the score already reflects all 319.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 219 further occurrence(s) are not listed individually; the score already reflects all 259.
  • X2 Cancellation propagation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 190 further occurrence(s) are not listed individually; the score already reflects all 230.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 614 further occurrence(s) are not listed individually; the score already reflects all 654.
  • X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X6 Hand-rolled structured-format parsing — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 14 further occurrence(s) are not listed individually; the score already reflects all 54.
  • X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 1 further occurrence(s) are not listed individually; the score already reflects all 41.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • 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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

813 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ProviderLimits at 248. A further 6 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.ToolDetailClient::renderToolCard at 20 — they are counted neither in the figure above nor in this dimension's score. 4 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), src/app/(dashboard)/dashboard/cli-tools/[toolId]/ToolDetailClient.js (ToolDetailClient.ToolDetailClient::renderToolCard at 20), open-sse/translator/concerns/modality.js (modality.stripUnsupportedModalities at 19), REDACTED (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.

route.POST (cyclomatic 37) · ×3REDACTED:19
route.POST (cyclomatic 21) · ×3REDACTED:21
route.GET (cyclomatic 17) · ×3REDACTED:12
route.POST (cyclomatic 16) · ×3REDACTED:94
createSSEStream::transform (cyclomatic 105) · ×2open-sse/utils/stream.js:152

+ 518 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 181 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with ProviderLimits (cyclomatic 248), parseQuotaData (cyclomatic 218), handleChatCore (cyclomatic 177). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 181 together lifts Cyclomatic Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

981 method(s) exceeded the cognitive complexity threshold of 15; the worst was stream.createSSEStream at 319.

createSSEStream::transform (cognitive 237) · ×3open-sse/utils/stream.js:152
route.GET (cognitive 16) · ×3REDACTED:65
OAuthModal.OAuthModal::startOAuthFlow (cognitive 82) · ×2src/shared/components/OAuthModal.js:270
buildStreamingResponse::start (cognitive 55) · ×2REDACTED:207
KiroExecutor.transformEventStreamToSSE::finish (cognitive 49) · ×2open-sse/executors/kiro.js:1003

+ 624 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 266 bodies over 30 down to 30 or less in Cognitive Complexity — start with stream.createSSEStream (cognitive 319), getUsageStats (cognitive 275), ProviderLimits (cognitive 270). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 266 together lifts Cognitive Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes5.8 / 10Adequate✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.8 / 10 · rule-coverage 100% · ceiling Prevented

172 god class(es) detected.

FunctionTooLong: page.ProviderDetailPage · ×116src/app/(dashboard)/dashboard/providers/[id]/page.js:50
FileTooLong: [id]/page.js · ×34src/app/(dashboard)/dashboard/providers/[id]/page.js
ClassTooLong: TokenSaverClient · ×14src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:1
MethodTooLong: KiroExecutor.transformEventStreamToSSE · ×8open-sse/executors/kiro.js:636

What to do

  1. Resolve the 116 FunctionTooLong finding(s) in God Classes — start with REDACTED (15), REDACTED (5), ConnectionsCard.js (2). — One of this dimension's main actionable groups (116 warning-level).
  2. Resolve the 34 FileTooLong finding(s) in God Classes — start with REDACTED (5), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (34 warning-level).
  3. Resolve the 14 ClassTooLong finding(s) in God Classes — start with TokenSaverClient.js, REDACTED, OAuthModal.js. — One of this dimension's main actionable groups (14 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication10.0 / 10Exemplary✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 duplicated block group(s) detected. 0.0 % of the production lines (0 of 164,594) are in a reported copy.

✓ On the Gold path — maintain.

Detailed fixes: d4_recommendation.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

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.

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 9 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

16 skipped (16 with a documented reason), 5 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 3918 tests.

No assertions: INSERT ${N_ITEMS} provider connections · ×5tests/unit/db-benchmark.test.js:53
Mock-dominated test: logs why Headroom was skipped on chat completions · ×8tests/unit/headroom-chat-core.test.js:61
Skipped (documented): (unnamed test) · ×16tests/unit/antigravity-cache.test.js:125

What to do

  1. Resolve the 8 Mock-dominated test finding(s) in Test Quality — start with headroom-chat-core.test.js (8). — One of this dimension's main actionable groups (8 recommendation-level).
  2. 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).

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

18 secret(s) detected. 1 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

REDACTED

What to do

  1. Resolve the 23 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (5), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (23 issue-level).

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots7.8 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 7.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/app/(dashboard)/dashboard/providers/[id]/page.js (19×378=7182); src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js (18×205=3690); src/app/api/providers/[id]/test/testUtils.js (20×162=3240) Repeated repair below the complexity floor: open-sse/providers/capabilities.js (31 of 57 changes were fixes); open-sse/config/appConstants.js (6 of 6 changes were fixes); open-sse/utils/claudeCloaking.js (5 of 7 changes were fixes)

Hotspot: src/app/(dashboard)/dashboard/providers/[id]/page.js · ×102src/app/(dashboard)/dashboard/providers/[id]/page.js:50
Repeated repair: open-sse/providers/capabilities.js · ×6open-sse/providers/capabilities.js:839

What to do

  1. Resolve the 102 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (8), REDACTED (5), REDACTED (4). — One of this dimension's main actionable groups (102 warning-level).
  2. Resolve the 6 Repeated repair finding(s) in Churn × Complexity Hotspots — start with capabilities.js, appConstants.js, claudeCloaking.js. — One of this dimension's main actionable groups (6 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor8.9 / 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.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Documented

73 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 644 of the 1108 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 · ×3
Further sole-owners (lower concentration)

What to do

  1. Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).
  2. 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.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 19 document(s) read across 3 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs foundpackage.json:10

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with package.json. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming Consistency8.9 / 10Strong✓ Tool-verified

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Verified

4 naming inconsistencies among 355 declarations measured against a convention their peers follow.

`sessionID` spells `ID` where 352 names in the project spell it `Id`open-sse/executors/iflow.js:29
`userID` spells `ID` where 352 names in the project spell it `Id`open-sse/services/minimaxCodeUsage.js:117
`tierID` spells `ID` where 352 names in the project spell it `Id`open-sse/services/projectId.js:201
`generateFakeUserID` spells `ID` where 352 names in the project spell it `Id`open-sse/utils/claudeCloaking.js:27

What to do

  1. Resolve the 1 `sessionID` spells `ID` where 352 names in the project spell it `Id` finding(s) in Naming Consistency — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `userID` spells `ID` where 352 names in the project spell it `Id` finding(s) in Naming Consistency — start with minimaxCodeUsage.js. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `tierID` spells `ID` where 352 names in the project spell it `Id` finding(s) in Naming Consistency — start with projectId.js. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.

D24 · Comment Value8.9 8.5 / 10Strong✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 96% · ceiling Documented

67 of 6004 judged comments only repeat the code they sit on (1.1 %). 340 comment(s) in another language or script were not judged.

redundant comment · ×62REDACTED:429
doc comments repeat the names · ×3REDACTED:173

What to do

  1. Resolve the 62 redundant comment finding(s) in Comment Value — start with REDACTED (6), github.js (5), REDACTED (4). — One of this dimension's main actionable groups (62 recommendation-level).

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

Maturity: Documented → Verified → Prevented · effective 3.3 / 10 · rule-coverage 100% · ceiling Documented

1 of 3 build units (npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. 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.

D27 · Navigability10.0 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

44 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

  1. 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).
  2. 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.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

387 finding(s): 0 critical, 60 high, 327 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), `REDACTED` (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

+ 12 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. 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).
  2. 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).
  3. 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.

D30 · Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

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. osv was not scanned (osv: 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.

✓ On the Gold path — maintain.

Detailed fixes: d30_recommendation.md.

D31 · IaC & Container Security8.6 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 8.6 / 10 · rule-coverage 100% · ceiling Documented

8 finding(s): 0 critical, 3 high, 4 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

  1. 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).
  2. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
  3. 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.

D34 · Knowledge Freshness9.6 / 10Adequategated by 1 critical finding✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

27 of 644 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js. Counted over 644 of the 1108 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledgesrc/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:1
Orphaned file · ×26src/app/(dashboard)/dashboard/pxpipe/PxpipeClient.js:1
Further orphaned files (smaller)

What to do

  1. Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with BasicChatPageClient.js. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 26 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (6), xai.js (2), PxpipeClient.js. — One of this dimension's main actionable groups (26 recommendation-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling9.7 / 10Adequategated by 6 critical findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: config.js↔cliTools.js 93%; REDACTED↔OAuthModal.js 77%; REDACTED↔REDACTED 75%

Boundary-crossing change coupling: config.js ↔ cliTools.js · ×6src/mitm/config.js:1
Change coupling: REDACTED ↔ OAuthModal.js · ×9REDACTED:1
Change-coupling hub: REDACTED → REDACTED, MitmToolCard.js, REDACTED · ×2REDACTED

What to do

  1. Resolve the 6 Boundary-crossing change coupling finding(s) in Change Coupling — start with config.js, REDACTED, model.js. — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 9 Change coupling finding(s) in Change Coupling — start with REDACTED (2), REDACTED, providerModels.js. — One of this dimension's main actionable groups (9 warning-level).
  3. 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.

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

1/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

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. osv was not scanned (osv: 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.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 30 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition8.8 / 10Exemplary✓ Tool-verified

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.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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.

C2 · Access Controls7.0 / 10Strong✓ Tool-verified

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect. — open-sse/executors/chatgpt-web.js:37

What to do

  • Name the access rules — roles/permissions declared once (a @Roles/@Permissions decorator with its guard, a CASL ability, a casbin model, or Supabase CREATE POLICY) and consulted where access is checked, so the rule set is reviewable and testable on its own.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs6.8 / 10Strong✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • `DevinCliExecutor` has 2 unfinished members out of 4 declared members (methods and accessors, whether or not each carries a body) — a scaffolded class that was never implemented. — open-sse/executors/devin-cli.js:305
  • `buildHeaders` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — open-sse/executors/devin-cli.js:314
  • `transformRequest` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — open-sse/executors/devin-cli.js:318
  • `refreshWindsurfToken` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — open-sse/services/tokenRefresh/providers.js:701
  • The guard above `return "Grok Build";` also returns `"Grok Build"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — open-sse/services/usage/grok-cli.js:90
  • The guard above `return chunk;` also returns `chunk`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — open-sse/translator/response/cursor-to-openai.js:17
  • The guard above `return "configured";` also returns `"configured"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:153
  • `onChange` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it. (×3) — src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:88, REDACTED:783, REDACTED:921
  • `onSetAlias` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it. (×2) — src/app/(dashboard)/dashboard/providers/[id]/page.js:1237, src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:257
  • `handleCopy` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/app/(dashboard)/dashboard/translator/page.js:200
  • The guard above `return null;` also returns `null`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — REDACTED:64
  • `runMigrationOnce` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:216
  • `ensureUserOwnedDir` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:477
  • `intercept` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/mitm/handlers/cursor.js:5
  • The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/shared/utils/apiKey.js:83
  • The guard above `return result.response;` also returns `result.response`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/sse/handlers/search.js:148
  • `logResponse` has an empty body — confirm it's an intentional no-op and not an unfinished method. — open-sse/utils/requestLogger.js:233

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
  • Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
M1 · Documentation (README)8.3 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy5.5 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

  • i18n/README.fa_IR.md links to `./i18n/README.vi.md`, but `i18n/i18n/README.vi.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — i18n/README.fa_IR.md:20
  • i18n/README.fa_IR.md links to `./i18n/README.zh-CN.md`, but `i18n/i18n/README.zh-CN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — i18n/README.fa_IR.md:20
  • i18n/README.fa_IR.md links to `./i18n/README.ja-JP.md`, but `i18n/i18n/README.ja-JP.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — i18n/README.fa_IR.md:20
  • i18n/README.fa_IR.md links to `./i18n/README.ru.md`, but `i18n/i18n/README.ru.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — i18n/README.fa_IR.md:20
  • i18n/README.fa_IR.md links to `./i18n/README.fa_IR.md`, but `i18n/i18n/README.fa_IR.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — i18n/README.fa_IR.md:20

What to do

  • Reconcile the README with reality: i18n/README.fa_IR.md links to `./i18n/README.vi.md`, but `i18n/i18n/README.vi.md` does not exist; i18n/README.fa_IR.md links to `./i18n/README.zh-CN.md`, but `i18n/i18n/README.zh-CN.md` does not exist; i18n/README.fa_IR.md links to `./i18n/README.ja-JP.md`, but `i18n/i18n/README.ja-JP.md` does not exist; i18n/README.fa_IR.md links to `./i18n/README.ru.md`, but `i18n/i18n/README.ru.md` does not exist; i18n/README.fa_IR.md links to `./i18n/README.fa_IR.md`, but `i18n/i18n/README.fa_IR.md` does not exist.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P2 · Observability6.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • 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`.
  • `src/proxy.js` reports through `console.*` at line 36 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/proxy.js:36
  • `src/proxy.js` reports through `console.*` at line 51 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/proxy.js:51
  • `src/proxy.js` reports through `console.*` at line 56 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/proxy.js:56
  • `src/sse/services/auth.js` reports through `console.*` at line 291 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/sse/services/auth.js:291
  • `src/shared/services/bootstrap.js` reports through `console.*` at line 11 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/bootstrap.js:11
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 75 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:75
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:78
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 89 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:89
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 90 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:90
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 96 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:96
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 97 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:97
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:113
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 120 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:120
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 142 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:142
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 149 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:149
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 151 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:151
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 154 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:154
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 156 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:156
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 159 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:159
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 185 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:185
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 190 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:190
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 194 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:194
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 197 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:197
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 219 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:219
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 221 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:221
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 228 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:228
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 233 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:233
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 237 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:237
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 239 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:239
  • `src/shared/services/initializeApp.js` reports through `console.*` at line 314 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/initializeApp.js:314
  • `src/shared/services/quotaAutoPing.js` reports through `console.*` at line 214 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/quotaAutoPing.js:214
  • `src/shared/services/quotaAutoPing.js` reports through `console.*` at line 266 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/quotaAutoPing.js:266
  • `src/shared/services/quotaAutoPing.js` reports through `console.*` at line 279 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/quotaAutoPing.js:279
  • `src/shared/services/quotaAutoPing.js` reports through `console.*` at line 322 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/quotaAutoPing.js:322
  • `src/shared/services/quotaAutoPing.js` reports through `console.*` at line 327 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/quotaAutoPing.js:327
  • `src/shared/services/quotaAutoPing.js` reports through `console.*` at line 335 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/quotaAutoPing.js:335
  • `src/shared/services/quotaAutoPing.js` reports through `console.*` at line 345 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/services/quotaAutoPing.js:345
  • `src/shared/components/AddCustomEmbeddingModal.js` reports through `console.*` at line 63 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/shared/components/AddCustomEmbeddingModal.js:63
  • `REDACTED` reports through `console.*` at line 65 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:65

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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 3 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.
  • `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — package.json:22

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.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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.

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.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×40) — open-sse/executors/chatgpt-web/imageGen.js:66, open-sse/executors/gemini-cli.js:60, open-sse/executors/gemini-web/imageGen.js:47, …

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.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `fs.readFileSync` in `apply` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/connectTools.js:128
  • `fs.readFileSync` in `show` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/connectTools.js:149
  • `fs.readFileSync` in `reset` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/connectTools.js:171
  • `fs.readFileSync` in `readYaml` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/connectTools.js:488
  • `fs.unlinkSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/xaiVideo.js:182
  • `fs.renameSync` in `downloadToFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/xaiVideo.js:206
  • `fs.unlinkSync` in `onSigint` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — cli/src/cli/commands/xaiVideo.js:232
  • `fs.mkdtempSync` in `execute` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/executors/devin-cli.js:371
  • `fs.mkdirSync` in `execute` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/executors/devin-cli.js:373
  • `fs.writeFileSync` in `execute` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/executors/devin-cli.js:374
  • `fs.rmSync` in `cleanupMcp` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/executors/devin-cli.js:387
  • `fs.rmSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/services/lazyRuntime.js:123
  • `accessSync` in `obscuraBinaryPath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/services/obscura.js:51
  • `existsSync` in `obscuraBinaryPath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/services/obscura.js:52
  • `mkdirSync` in `runLogin` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/services/webLogin.js:198
  • `fs.existsSync` in `readDesktopAccountCookies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/shared/mimoAccount.js:77
  • `fs.copyFileSync` in `readDesktopAccountCookies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/shared/mimoAccount.js:80
  • `fs.unlinkSync` in `readDesktopAccountCookies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/shared/mimoAccount.js:95
  • `fs.existsSync` in `createLogSession` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/utils/requestLogger.js:42
  • `fs.mkdirSync` in `createLogSession` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — open-sse/utils/requestLogger.js:43, open-sse/utils/requestLogger.js:51
  • `fs.appendFileSync` in `appendProviderChunk` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/utils/requestLogger.js:183
  • `fs.appendFileSync` in `appendOpenAIChunk` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/utils/requestLogger.js:194
  • `fs.appendFileSync` in `appendConvertedChunk` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — open-sse/utils/requestLogger.js:213
  • `fs.readFileSync` in `GET` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:11, REDACTED:38
  • `fs.statSync` in `GET` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:16
  • `fs.existsSync` in `GET` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:34
  • `fs.existsSync` in `POST` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:32
  • `fs.mkdirSync` in `POST` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:33
  • `fs.writeFileSync` in `POST` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:37
  • `execSync` in `callback to pids.forEach` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:147, REDACTED:149
  • `fs.existsSync` in `createSqlJsAdapter` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/db/adapters/sqljsAdapter.js:15
  • `fs.readFileSync` in `createSqlJsAdapter` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/db/adapters/sqljsAdapter.js:15
  • `fs.writeFileSync` in `persist` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/db/adapters/sqljsAdapter.js:26
  • `fs.existsSync` in `runMigrationOnce` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:256
  • `fs.writeFileSync` in `runMigrationOnce` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:286
  • `fs.openSync` in `startHeadroomProxy` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/headroom/process.js:69
  • `fs.closeSync` in `startHeadroomProxy` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/lib/headroom/process.js:80

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.
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 · 1583 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 (+1577 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.
R10 · Code Duplication3.2 / 10Weak✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 57 duplicated blocks under src/ have copies in at least two of the sibling directories app, i18n, lib, mitm, shared, sse — 40 of them are reported below, and 17 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 57 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 57 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 57 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:1148
  • 39 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) — 25 of them are reported below, and 14 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 39 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 39 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 39 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — REDACTED:663
  • 35 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, gitbook, open-sse, src — 31 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 35 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 35 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 35 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/utils/launcherProcess.js:145
  • 34 duplicated blocks under src/app/api/ have copies in at least two of the sibling directories cli-tools, combos, headroom, keys, mcp, models (+11 more sibling(s) not listed) — 20 of them are reported below, and 14 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 34 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 34 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 34 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:516
  • 30 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) — 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. — REDACTED:15
  • 26 duplicated blocks under src/app/(dashboard)/dashboard/providers/ have copies in at least two of the sibling directories [id], components — 22 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 26 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 26 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 26 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]/ModelRow.js:6
  • 24 duplicated blocks under open-sse/ have copies in at least two of the sibling directories executors, handlers, services, shared, transformer, translator (+1 more sibling(s) not listed) — 19 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 24 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 24 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 24 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — REDACTED:486
  • 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
  • 9 duplicated blocks under src/app/api/oauth/ have copies in at least two of the sibling directories [provider], codex, commandcode, cursor, gitlab, grok-cli (+4 more sibling(s) not listed) — 7 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 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 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 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — REDACTED:19
  • 8 duplicated blocks under src/app/ have copies in at least two of the sibling directories (dashboard), api, callback, dashboard, login — 1 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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 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. — REDACTED:4
  • 5 of the duplicated blocks reported below have copies in at least two of the sibling directories formats, request under open-sse/translator/. 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. — open-sse/translator/formats/responsesApi.js:84
  • 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/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/media-providers/[kind]/[id]/components/GenericExampleCard.js:258 · src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:123 — the two spans are one implementation copied and then locally edited — 731 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:258
  • 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
  • open-sse/executors/opencode-zen.js:12 · open-sse/executors/opencode.js:21 — the two spans are one implementation copied and then locally edited — 1129 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-zen.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. — src/lib/oauth/services/antigravity.js:12
  • 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]/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/sse/handlers/fetch.js:38 · src/sse/handlers/search.js:35 — the two spans are one implementation copied and then locally edited — 749 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:38
  • src/app/(dashboard)/dashboard/combos/page.js:1148 · src/shared/components/ComboFormModal.js:34 — the two spans are one implementation copied and then locally edited — 943 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:1148
  • src/sse/handlers/embeddings.js:33 · src/sse/handlers/systemone.js:24 — the two spans are one implementation copied and then locally edited — 733 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:33
  • REDACTED:15 · REDACTED:15 — the two spans are one implementation copied and then locally edited — 688 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:15
  • REDACTED:10 · REDACTED: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. — REDACTED:10
  • open-sse/executors/opencode-go.js:67 · open-sse/executors/opencode-zen.js:190 — the two spans are one implementation copied and then locally edited — 860 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — open-sse/executors/opencode-go.js:67
  • 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 — 620 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
  • REDACTED:231 · src/shared/utils/selectableModels.js:90 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — REDACTED:231
  • 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 — 532 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
  • open-sse/executors/chatgpt-web/chatHttp.js:40 · open-sse/executors/chatgpt-web/imageGenHttp.js:31 — the two spans are one implementation copied and then locally edited — 497 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/chatgpt-web/chatHttp.js:40
  • src/sse/handlers/imageGeneration.js:47 · src/sse/handlers/tts.js:22 — the two spans are one implementation copied and then locally edited — 641 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/imageGeneration.js:47
  • REDACTED:3 · REDACTED: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. — REDACTED:3
  • REDACTED:343 · src/shared/utils/selectableModels.js:202 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:343

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.
R11 · Import Boundaries9.8 / 10Exemplary✓ Tool-verified

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
  • open-sse/translator/deepseekWebToolBinding.js:5 imports ajv/dist/2020.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — open-sse/translator/deepseekWebToolBinding.js:5

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity4.0 / 10Weak✓ Tool-verified

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 170 and cognitive complexity 208; 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:64
  • testApiKeyConnection has cyclomatic complexity 162 and cognitive complexity 170; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:524
  • getUsageStats has cyclomatic complexity 156 and cognitive complexity 264; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/lib/db/repos/usageRepo.js:348
  • POST has cyclomatic complexity 144 and cognitive complexity 129; 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:93
  • applyFormat has cyclomatic complexity 109 and cognitive complexity 142; 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:266
  • handleComboChat has cyclomatic complexity 106 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/services/combo.js:354
  • transform has cyclomatic complexity 105 and cognitive complexity 237; 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:152
  • buildModelsList has cyclomatic complexity 84 and cognitive complexity 173; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:330
  • parseQuotaData has cyclomatic complexity 80 and cognitive complexity 97; 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/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:362
  • 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
  • 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:58
  • POST has cyclomatic complexity 74 and cognitive complexity 127; 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:317
  • (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
  • openaiToGeminiBase has cyclomatic complexity 73 and cognitive complexity 182; 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:77
  • handleForcedSSEToJson has cyclomatic complexity 71 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — open-sse/handlers/chatCore/sseToJsonHandler.js:189
  • 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:97
  • ConnectionRow has cyclomatic complexity 70 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:10
  • 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:799
  • prepareClaudeRequest has cyclomatic complexity 66 and cognitive complexity 135; 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/formats/claude.js:495
  • GET has cyclomatic complexity 65 and cognitive complexity 109; 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:95
  • 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:22
  • TokenSaverClient has cyclomatic complexity 60 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13
  • claudeToOpenAIResponse has cyclomatic complexity 57 and cognitive complexity 91; 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/claude-to-openai.js:19
  • parseStream has cyclomatic complexity 54 and cognitive complexity 114; 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/imageProviders/codex.js:187
  • handleImageGenerationCore has cyclomatic complexity 54 and cognitive complexity 94; 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/imageGenerationCore.js:30
  • convertMessages has cyclomatic complexity 53 and cognitive complexity 115; 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-kiro.js:43
  • testOAuthConnection has cyclomatic complexity 53 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/app/api/providers/[id]/test/testUtils.js:369
  • transformRequest has cyclomatic complexity 53 and cognitive complexity 73; 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/codex.js:414
  • startOAuthFlow has cyclomatic complexity 53 and cognitive complexity 73; 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/shared/components/OAuthModal.js:270
  • getProviderCredentials has cyclomatic complexity 53 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. — src/sse/services/auth.js:28
  • execute has cyclomatic complexity 52 and cognitive complexity 81; 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/deepseek-web.js:794
  • runConnect has cyclomatic complexity 51 and cognitive complexity 72; 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:273
  • commandCodeToOpenAIResponse has cyclomatic complexity 51 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/commandcode-to-openai.js:52
  • ProviderLimits has cyclomatic complexity 51 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:156
  • (anonymous) has cyclomatic complexity 51 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1119
  • rewriteBlock has cyclomatic complexity 49 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — open-sse/shared/qoder/attachments.js:158
  • convertClaudeMessagesToKiro has cyclomatic complexity 48 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 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/claude-to-kiro.js:45
R3 · Large Files6.8 / 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.

  • src/app/(dashboard)/dashboard/providers/[id]/page.js has 1903 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/(dashboard)/dashboard/providers/[id]/page.js:1
  • REDACTED has 1591 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 1576 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 1321 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/app/(dashboard)/dashboard/combos/page.js has 1290 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/(dashboard)/dashboard/combos/page.js:1
  • REDACTED has 1255 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • open-sse/executors/kiro.js has 1165 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/executors/kiro.js:1
  • REDACTED has 1129 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js has 1037 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:1
  • open-sse/executors/deepseek-web.js has 1014 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/executors/deepseek-web.js:1
  • REDACTED has 994 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 992 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • open-sse/utils/cursorProtobuf.js has 968 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/utils/cursorProtobuf.js:1
  • REDACTED has 947 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/shared/components/OAuthModal.js has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/components/OAuthModal.js:1
  • src/lib/oauth/utils/server.js has 884 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/lib/oauth/utils/server.js:1
  • src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js has 862 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:1
  • REDACTED has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js has 842 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:1
  • open-sse/providers/capabilities.js has 833 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/providers/capabilities.js:1
  • open-sse/services/combo.js has 812 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/services/combo.js:1
  • REDACTED has 806 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 803 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • cli/src/cli/menus/providers.js has 787 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — cli/src/cli/menus/providers.js:1
  • open-sse/executors/devin-cli.js has 784 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/executors/devin-cli.js:1
  • REDACTED has 773 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • open-sse/services/tokenRefresh/providers.js has 767 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/services/tokenRefresh/providers.js:1
  • open-sse/executors/gemini-web.js has 733 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/executors/gemini-web.js:1
  • src/lib/db/repos/usageRepo.js has 723 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/lib/db/repos/usageRepo.js:1
  • src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js has 721 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:1
  • src/app/api/providers/[id]/models/route.js has 680 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/api/providers/[id]/models/route.js:1
  • open-sse/translator/formats/claude.js has 675 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/translator/formats/claude.js:1
  • src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js has 670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:1
  • REDACTED has 665 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 647 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 641 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js has 630 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:1
  • open-sse/executors/muse-web.js has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — open-sse/executors/muse-web.js:1
  • cli/src/cli/menus/cliTools.js has 624 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — cli/src/cli/menus/cliTools.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage6.8 / 10Strong✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • 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:65
  • 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:1, REDACTED:1, REDACTED:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
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:65

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.
R7 · Dead Code6.6 / 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 264 application, 11 tooling and 477 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 (264 application, 11 tooling, 477 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 (264 application, 11 tooling, 477 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) — src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js, open-sse/providers/registry/opencode-zen.js, src/lib/oauth/services/kimchi.js, …
  • no import path from any entry point (264 application, 11 tooling, 477 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 (264 application, 11 tooling, 477 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.
R8 · Dependency Hygiene0.0 / 10Critical✓ Tool-verified

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. — REDACTED:59
  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×3) — REDACTED:177, REDACTED:175, 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. (×2)
  • Declared in cli/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. (×2)

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports1.8 / 10Critical✓ Tool-verified

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/config/kiroConstants.js → open-sse/translator/concerns/thinkingUnified.js → open-sse/providers/thinkingLevels.js → open-sse/config/kiroConstants.js — open-sse/config/kiroConstants.js:18
  • 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:327
  • 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:5

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture0.0 / 10Critical✓ Tool-verified

Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository. Every Node listener it starts is bound to the loopback interface, so its cookies never cross a network and the Secure flag was not asked — the same reason HTTPS enforcement is N/A for a loopback listener; HttpOnly and SameSite still were.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • `rejectUnauthorized: false` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the option so Node validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: pass its CA as `ca` (or set `NODE_EXTRA_CA_CERTS`), which keeps the chain and hostname checks on. A managed database or broker that documents `rejectUnauthorized: false` publishes a CA bundle for exactly this purpose. (×4) — REDACTED:350, REDACTED:164, REDACTED:197, …
  • `API_KEY_SECRET` is the MAC key, and its shipped DEFAULT is a compile-time constant — an installation that never overrides it encrypts with a value published in this repository, and the code cannot distinguish that state from a configured one. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash. — src/shared/utils/apiKey.js:3
  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×5) — open-sse/services/minimaxCodeUsage.js:22, open-sse/shared/mimoAccount.js:120, open-sse/shared/qoder/cosy.js:74, …

What to do

  • Stop accepting every TLS certificate: delete `rejectUnauthorized: false` / `NODE_TLS_REJECT_UNAUTHORIZED=0` so the chain, hostname and expiry are verified, and trust a self-signed or private server by passing its CA (`ca`, or `NODE_EXTRA_CA_CERTS`) — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 4 sites, not one: `REDACTED:350` (`rejectUnauthorized: false`), `REDACTED:164` (`rejectUnauthorized: false`), `REDACTED:197` (`rejectUnauthorized: false`), `REDACTED:259` (`rejectUnauthorized: false`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Load cryptographic key and salt material from configuration, an environment variable or a secrets manager rather than fixing it in the source, and fail fast at startup when it is absent — a default that silently works is the one that reaches production. Rotate anything already committed: it must be treated as disclosed. Salts should be generated per password and stored with the hash, never shared across installations.
  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 5 sites, not one: `open-sse/services/minimaxCodeUsage.js:22` (createHash("md5")), `open-sse/shared/mimoAccount.js:120` (createHash("sha1")), `open-sse/shared/qoder/cosy.js:74` (createHash("md5")), `src/lib/network/netlifyRelay.js:99` (createHash("sha1")), `REDACTED:36` (createHash("sha1")). Each is a separate decision — fixing only the line this row cites leaves the others in place.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream5.4 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

  • `spawn` pipes `stdout` here — it is given no `stdio` option, or `'pipe'` — but nothing in this scope ever reads `child.stdout`, while `child.stderr` is read and the child's end is awaited. Node holds an unread pipe's output only up to its buffer: once the child writes more than that to stdout (measured on Linux: about 128 KB — the 64 KB pipe plus Node's 64 KB read-ahead — and less elsewhere), the child blocks on the write, never exits, and the `close`/`exit` this code waits for never fires. Nothing fails loudly: the promise never settles, the request never returns, and the stuck child holds its resources until something kills it. Consume both streams (`child.stdout.on('data', …)`, or `child.stdout.resume()` to discard it), or stop piping the one you do not want — `stdio: ['pipe', 'pipe', 'inherit']` or `'ignore'` in that slot. (×4) — REDACTED:326, REDACTED:427, REDACTED:449, …

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X14 · Bypassable address classification4.8 / 10Weak✓ Tool-verified

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

  • This function unwraps IPv4-MAPPED IPv6 (`::ffff:`, line 24) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 33 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright. — open-sse/executors/veoaifree-web.js:33

What to do

  • Each finding names the IPv4 branch that rejects the host and the IPv6 branch that accepts the same host in another notation. Confirm from the two, then unwrap every IPv4-in-IPv6 embedding before classifying, or reject non-native IPv6 outright.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation5.4 / 10Adequate✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 67/296 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `fetchProviders` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/store/providerStore.js:36
  • `fetchSettings` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/store/settingsStore.js:17
  • `patchSettings` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/store/settingsStore.js:43
  • `fetchSuggestedModels` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/shared/utils/providerModelsFetcher.js:13
  • `loadAuthStatus` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/shared/components/Header.js:195
  • `autoDetect` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/shared/components/KiroAuthModal.js:29
  • `initAuth` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/shared/components/KiroSocialOAuthModal.js:30
  • `fetchTools` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:50
  • `fetchConnections` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:96
  • `fetchCombos` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:160
  • `fetchProviderNodes` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:176
  • `fetchCustomModels` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:192
  • `fetchDisabledModels` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:208
  • `tick` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — src/shared/components/OAuthModal.js:542, src/shared/components/ZedAuthModal.js:217
  • `loadPricing` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/shared/components/PricingModal.js:17
  • `fetchLogs` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/shared/components/RequestLogger.js:25
  • `fetchRouter` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:19
  • `registerTunnelUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/tunnel/cloudflare/manager.js:22
  • `fetchKiroProfileArn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/providerHelpers.js:53
  • `exchangeCode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×3) — src/lib/oauth/services/antigravity.js:37, src/lib/oauth/services/gemini.js:37, src/lib/oauth/services/iflow.js:35
  • `getUserInfo` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×4) — src/lib/oauth/services/antigravity.js:64, src/lib/oauth/services/gemini.js:108, src/lib/oauth/services/github.js:126, …
  • `loadCodeAssist` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/services/antigravity.js:102
  • `onboardUser` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/services/antigravity.js:139
  • `saveTokens` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×4) — src/lib/oauth/services/antigravity.js:196, src/lib/oauth/services/claude.js:76, src/lib/oauth/services/codex.js:43, …
  • `exchangeClaudeCode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/services/claude.js:36
  • `fetchProjectId` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/services/gemini.js:64
  • `getDeviceCode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/services/github.js:17
  • `pollAccessToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/services/github.js:41
  • `getCopilotToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/services/github.js:105
  • `connect` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/lib/oauth/services/github.js:188

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation6.3 / 10Adequate✓ Tool-verified

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

  • `debug` at line 75 is called with an argument built by `join(",")` (line 75), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/sse/services/auth.js:75

What to do

  • Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is JavaScript's evaluation order, not a guess — then put the construction behind the level check the logger offers (`if (logger.isLevelEnabled('debug'))` for pino and winston, `isDebugEnabled()` for log4js, the repository's own debug flag where it has one), or hand the logger the object and a format string (`logger.debug({ payload }, 'raw request')`) so the serialising happens only when the line is written. Moving the call is not the fix: it is the join/projection/stringify in the argument that is paid, wherever the call sits.
X24 · Document value interpolated into markup unescaped5.5 / 10Adequate✓ Tool-verified

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

  • ``window.location.replace("${target}");`` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — gitbook/app/page.js:17
  • `message||(success?"You can close this tab and return to 9Router.":"Please try again.")` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/lib/oauth/utils/server.js:843
  • `html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/shared/components/ChangelogModal.js:86

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

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.

X3 · Exception handling4.5 / 10Weak✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×18) — custom-server.js:34, src/dashboardGuard.js:262, src/shared/utils/machineId.js:21, …
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×21) — src/sse/handlers/chat.js:307, src/sse/handlers/embeddings.js:153, src/sse/handlers/imageGeneration.js:40, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — src/shared/utils/ssrfGuard.js:185

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

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.

LensScoreRatingImpact
Code Health34%Weak — gated by D1, D2, R1, R10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture67%Adequate — gated by D26, R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity68%StrongStrongest area.
Readiness17%Critical — gated by D13, R6, R8, P3, P5, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security31%Weak — gated by D28, D29, D36, S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
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 — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 55 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.
  • 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 applicable — JavaScript has no interface declaration, so there is no declared member list whose width this check could measure
  • 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 — docker build failed (exit 1) — 44.77 44.77 > Build failed because of webpack errors 45.00 npm notice 45.00 npm notice New major version of npm available! 10.9.9 -> 12.2.2 45.00 npm notice Changelog: https://github.com/npm/cli/releases/tag/v12.2.2 45.00 npm notice To update run: npm install -g npm@12.2.2 45.00 npm notice ------ ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1; 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 — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
  • 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, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • 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.
  • 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.
  • 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 — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • 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 scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • 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
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — Not applicable: this check asks whether the null-typed discipline a language offers is switched on, and how much of that the assertion operator takes back, and in this repository's languages there is no such switch and no such operator. Plain JavaScript carries no type annotations and commits no tsconfig, so it states no null-typed discipline for this check to grade: there is nothing here that switches null checking on or off, and TypeScript (or `// @ts-check`) is how a repository acquires one — advice, not a defect this card measures. Not a gap in the analyzer and not a finding about your code.
  • 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.

Critical — 122 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 5 more in this group — see findings.md.
D13 · REDACTED Scanning · Leaked secret · ×23
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×18
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×6
  • Boundary-crossing change coupling: config.js ↔ cliTools.js src/mitm/config.js:1 — `src/mitm/config.js` (context mitm) and `src/shared/constants/cliTools.js` (context shared) sit in DIFFERENT parts of the tree yet change together 93% of the time (14 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) — 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 14 shared commits counted here, the most recent 3 are `24034f69` feat(antigravity): refresh model catalog and update MITM defaults to …; `a07ed95b` feat(antigravity): add Claude Sonnet 5.5 and Opus 5.5 support; `70f15aa5` feat(antigravity,gemini): add Gemini 3.8 Flash support and bump IDE f… — run `git show` on any of them.
  • Boundary-crossing change coupling: REDACTED ↔ REDACTED REDACTED:1 — `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:1 — `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:1 — `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: REDACTED ↔ REDACTED REDACTED:1 — `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 ↔ REDACTED open-sse/config/providerModels.js:1 — `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 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
S1 · Web-Security Posture · TLS certificate validation disabled · ×4
  • TLS certificate validation disabled REDACTED:350 — `rejectUnauthorized: false` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the option so Node validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: pass its CA as `ca` (or set `NODE_EXTRA_CA_CERTS`), which keeps the chain and hostname checks on. A managed database or broker that documents `rejectUnauthorized: false` publishes a CA bundle for exactly this purpose.
  • TLS certificate validation disabled REDACTED:164 — `rejectUnauthorized: false` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the option so Node validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: pass its CA as `ca` (or set `NODE_EXTRA_CA_CERTS`), which keeps the chain and hostname checks on. A managed database or broker that documents `rejectUnauthorized: false` publishes a CA bundle for exactly this purpose.
  • TLS certificate validation disabled REDACTED:197 — `rejectUnauthorized: false` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the option so Node validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: pass its CA as `ca` (or set `NODE_EXTRA_CA_CERTS`), which keeps the chain and hostname checks on. A managed database or broker that documents `rejectUnauthorized: false` publishes a CA bundle for exactly this purpose.
  • TLS certificate validation disabled REDACTED:259 — `rejectUnauthorized: false` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the option so Node validates the peer. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: pass its CA as `ca` (or set `NODE_EXTRA_CA_CERTS`), which keeps the chain and hostname checks on. A managed database or broker that documents `rejectUnauthorized: false` publishes a CA bundle for exactly this purpose.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×2
  • Import cycle (2 files) open-sse/translator/index.js:327 — 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)
  • Import cycle (2 files) src/shared/components/AddCustomEmbeddingModal.js:5 — 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)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
R8 · Dependency Hygiene · Unlisted import 'systray' · ×1
  • Unlisted import 'systray' REDACTED:177 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'systray2' · ×1
  • Unlisted import 'systray2' REDACTED:175 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'got-scraping' · ×1
  • 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.
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) open-sse/config/kiroConstants.js:18 — open-sse/config/kiroConstants.js → open-sse/translator/concerns/thinkingUnified.js → open-sse/providers/thinkingLevels.js → open-sse/config/kiroConstants.js
S1 · Web-Security Posture · Cryptographic key material is a compile-time constant · ×1
  • Cryptographic key material is a compile-time constant src/shared/utils/apiKey.js:3 — `API_KEY_SECRET` is the MAC key, and its shipped DEFAULT is a compile-time constant — an installation that never overrides it encrypts with a value published in this repository, and the code cannot distinguish that state from a configured one. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Serious — 2223 finding(s)
D29 · Static Analysis (SAST) · REDACTED · ×153
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 128 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×122
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 97 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×116
  • FunctionTooLong: page.ProviderDetailPage src/app/(dashboard)/dashboard/providers/[id]/page.js:50 — FunctionTooLong — ProviderDetailPage runs 1563 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1463 over it, 15.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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:156 — FunctionTooLong — ProviderLimits runs 1249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1149 over it, 12.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: EndpointPageClient.APIPageClient REDACTED:22 — FunctionTooLong — APIPageClient runs 1068 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 968 over it, 10.68× 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 REDACTED:31 — FunctionTooLong — ProxyPoolsPage runs 987 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 887 over it, 9.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: TokenSaverClient.TokenSaverClient src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13 — FunctionTooLong — TokenSaverClient runs 927 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 827 over it, 9.27× 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 702 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 602 over it, 7.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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: ModelSelectModal.ModelSelectModal REDACTED:75 — FunctionTooLong — ModelSelectModal runs 576 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 476 over it, 5.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: GenericCliToolCard.GenericCliToolCard src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:44 — FunctionTooLong — GenericCliToolCard runs 573 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 473 over it, 5.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: TtsExampleCard.TtsExampleCard src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:53 — FunctionTooLong — TtsExampleCard runs 544 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 444 over it, 5.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: GenericExampleCard.GenericExampleCard src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:37 — FunctionTooLong — GenericExampleCard runs 543 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 443 over it, 5.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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: HermesToolCard.HermesToolCard src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:15 — FunctionTooLong — HermesToolCard runs 497 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 397 over it, 4.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: page.ProvidersPage REDACTED:99 — FunctionTooLong — ProvidersPage runs 494 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 394 over it, 4.94× 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: 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: page.CombosPage src/app/(dashboard)/dashboard/combos/page.js:69 — FunctionTooLong — CombosPage runs 446 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 346 over it, 4.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: route.POST REDACTED:93 — FunctionTooLong — POST runs 432 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 332 over it, 4.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AddApiKeyModal.AddApiKeyModal src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:11 — FunctionTooLong — AddApiKeyModal runs 427 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 327 over it, 4.27× 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: ClaudeToolCard.ClaudeToolCard src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:29 — FunctionTooLong — ClaudeToolCard runs 389 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 289 over it, 3.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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: utils.parseQuotaData src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:362 — FunctionTooLong — parseQuotaData 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: RequestDetailsTab.RequestDetailsTab src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js:86 — 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.
  • + 91 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×102
  • Hotspot: src/app/(dashboard)/dashboard/providers/[id]/page.js src/app/(dashboard)/dashboard/providers/[id]/page.js:50 — src/app/(dashboard)/dashboard/providers/[id]/page.js changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 378 in page.ProviderDetailPage at line 50. 8 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:362 — src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 205 in utils.parseQuotaData at line 362. 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: src/app/api/providers/[id]/test/testUtils.js src/app/api/providers/[id]/test/testUtils.js:524 — src/app/api/providers/[id]/test/testUtils.js changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 162 in testApiKeyConnection at line 524. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: open-sse/handlers/chatCore.js open-sse/handlers/chatCore.js:64 — open-sse/handlers/chatCore.js changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 171 in chatCore.handleChatCore at line 64. 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: open-sse/translator/concerns/thinkingUnified.js open-sse/translator/concerns/thinkingUnified.js:266 — open-sse/translator/concerns/thinkingUnified.js changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in thinkingUnified.applyFormat at line 266. 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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/utils/stream.js open-sse/utils/stream.js:47 — open-sse/utils/stream.js changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 162 in stream.createSSEStream at line 47. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: REDACTED REDACTED:156 — REDACTED changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 235 in index.ProviderLimits at line 156. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: REDACTED REDACTED:93 — REDACTED changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 148 in route.POST at line 93. 4 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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/shared/components/OAuthModal.js src/shared/components/OAuthModal.js:38 — src/shared/components/OAuthModal.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 208 in OAuthModal.OAuthModal at line 38. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: REDACTED REDACTED:75 — REDACTED changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 163 in ModelSelectModal.ModelSelectModal at line 75. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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/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 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 160 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: src/lib/db/repos/usageRepo.js src/lib/db/repos/usageRepo.js:348 — src/lib/db/repos/usageRepo.js changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 170 in usageRepo.getUsageStats at line 348. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: REDACTED REDACTED:330 — REDACTED changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in route.buildModelsList at line 330. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: open-sse/translator/formats/claude.js open-sse/translator/formats/claude.js:495 — open-sse/translator/formats/claude.js changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in claude.prepareClaudeRequest at line 495. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: REDACTED REDACTED:22 — REDACTED changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 229 in EndpointPageClient.APIPageClient 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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:69 — src/app/(dashboard)/dashboard/combos/page.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in page.CombosPage at line 69. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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/handlers/imageProviders/codex.js open-sse/handlers/imageProviders/codex.js:187 — open-sse/handlers/imageProviders/codex.js changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in codex.parseStream at line 187. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- open-sse/handlers/imageProviders/codex.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:636 — REDACTED changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in CursorExecutor.executeAgent at line 636. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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/sse/handlers/chat.js src/sse/handlers/chat.js:193 — src/sse/handlers/chat.js changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in chat.handleSingleModelChat at line 193. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: REDACTED REDACTED:317 — REDACTED changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in route.POST at line 317. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: open-sse/services/combo.js open-sse/services/combo.js:354 — open-sse/services/combo.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in combo.handleComboChat at line 354. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- open-sse/services/combo.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/cli-tools/components/HermesToolCard.js src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:15 — src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 125 in HermesToolCard.HermesToolCard at line 15. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.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/providers/[id]/ConnectionRow.js src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:10 — src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 98 in ConnectionRow.ConnectionRow at line 10. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.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/TtsExampleCard.js src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:53 — src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 154 in TtsExampleCard.TtsExampleCard at line 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.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-gemini.js open-sse/translator/request/openai-to-gemini.js:77 — open-sse/translator/request/openai-to-gemini.js changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in openai-to-gemini.openaiToGeminiBase at line 77. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- open-sse/translator/request/openai-to-gemini.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.
  • + 77 more in this group — see findings.md.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×40
  • Outbound HTTP without resilience open-sse/executors/chatgpt-web/imageGen.js:66 — `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/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.
  • Outbound HTTP without resilience open-sse/executors/gemini-web/imageGen.js:47 — `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/executors/gemini-web/imageGen.js:70 — `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/executors/muse-web.js:187 — `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/executors/vertex.js:39 — `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:113 — `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:147 — `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:168 — `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/falAi.js:29 — `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:95 — `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:109 — `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:128 — `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:182 — `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:251 — `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/ttsProviders/edgeTts.js:15 — `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/ttsProviders/edgeTts.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/ttsProviders/edgeTts.js:55 — `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/ttsProviders/elevenlabs.js:13 — `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.
  • + 15 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×40
  • Sync-over-async blocking cli/src/cli/commands/connectTools.js:128 — `fs.readFileSync` in `apply` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking cli/src/cli/commands/connectTools.js:149 — `fs.readFileSync` in `show` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking cli/src/cli/commands/connectTools.js:171 — `fs.readFileSync` in `reset` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking cli/src/cli/commands/connectTools.js:488 — `fs.readFileSync` in `readYaml` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking cli/src/cli/commands/xaiVideo.js:182 — `fs.unlinkSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking cli/src/cli/commands/xaiVideo.js:206 — `fs.renameSync` in `downloadToFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking cli/src/cli/commands/xaiVideo.js:232 — `fs.unlinkSync` in `onSigint` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/executors/devin-cli.js:371 — `fs.mkdtempSync` in `execute` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/executors/devin-cli.js:373 — `fs.mkdirSync` in `execute` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/executors/devin-cli.js:374 — `fs.writeFileSync` in `execute` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/executors/devin-cli.js:387 — `fs.rmSync` in `cleanupMcp` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/services/lazyRuntime.js:123 — `fs.rmSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/services/obscura.js:51 — `accessSync` in `obscuraBinaryPath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/services/obscura.js:52 — `existsSync` in `obscuraBinaryPath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/services/webLogin.js:198 — `mkdirSync` in `runLogin` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/shared/mimoAccount.js:77 — `fs.existsSync` in `readDesktopAccountCookies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/shared/mimoAccount.js:80 — `fs.copyFileSync` in `readDesktopAccountCookies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/shared/mimoAccount.js:95 — `fs.unlinkSync` in `readDesktopAccountCookies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/utils/requestLogger.js:42 — `fs.existsSync` in `createLogSession` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/utils/requestLogger.js:43 — `fs.mkdirSync` in `createLogSession` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/utils/requestLogger.js:51 — `fs.mkdirSync` in `createLogSession` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/utils/requestLogger.js:183 — `fs.appendFileSync` in `appendProviderChunk` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/utils/requestLogger.js:194 — `fs.appendFileSync` in `appendOpenAIChunk` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking open-sse/utils/requestLogger.js:213 — `fs.appendFileSync` in `appendConvertedChunk` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:11 — `fs.readFileSync` in `GET` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • + 15 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×39
  • No test reaches this file src/app/(dashboard)/dashboard/providers/[id]/page.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/combos/page.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/CoworkToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/OpenCodeToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/DroidToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/OpenClawToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/GrokBuildToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/app/api/cli-tools/hermes-settings/route.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 14 more in this group — see findings.md.
X2 · Cancellation propagation · Async function without AbortSignal · ×39
  • Async function without AbortSignal: fetchProviders src/store/providerStore.js:36 — `fetchProviders` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchSettings src/store/settingsStore.js:17 — `fetchSettings` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: patchSettings src/store/settingsStore.js:43 — `patchSettings` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchSuggestedModels src/shared/utils/providerModelsFetcher.js:13 — `fetchSuggestedModels` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: loadAuthStatus src/shared/components/Header.js:195 — `loadAuthStatus` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: autoDetect src/shared/components/KiroAuthModal.js:29 — `autoDetect` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: initAuth src/shared/components/KiroSocialOAuthModal.js:30 — `initAuth` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchTools REDACTED:50 — `fetchTools` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchConnections REDACTED:96 — `fetchConnections` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchCombos REDACTED:160 — `fetchCombos` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchProviderNodes REDACTED:176 — `fetchProviderNodes` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchCustomModels REDACTED:192 — `fetchCustomModels` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchDisabledModels REDACTED:208 — `fetchDisabledModels` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: tick src/shared/components/OAuthModal.js:542 — `tick` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: loadPricing src/shared/components/PricingModal.js:17 — `loadPricing` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchLogs src/shared/components/RequestLogger.js:25 — `fetchLogs` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: tick src/shared/components/ZedAuthModal.js:217 — `tick` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchRouter REDACTED:19 — `fetchRouter` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: registerTunnelUrl src/lib/tunnel/cloudflare/manager.js:22 — `registerTunnelUrl` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchKiroProfileArn src/lib/oauth/providerHelpers.js:53 — `fetchKiroProfileArn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: exchangeCode src/lib/oauth/services/antigravity.js:37 — `exchangeCode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getUserInfo src/lib/oauth/services/antigravity.js:64 — `getUserInfo` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: loadCodeAssist src/lib/oauth/services/antigravity.js:102 — `loadCodeAssist` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: onboardUser src/lib/oauth/services/antigravity.js:139 — `onboardUser` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: saveTokens src/lib/oauth/services/antigravity.js:196 — `saveTokens` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • + 14 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×39
  • Swallowed exception (empty catch) custom-server.js:34 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/dashboardGuard.js:262 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/sse/handlers/chat.js:307 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/sse/handlers/embeddings.js:153 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/sse/handlers/imageGeneration.js:40 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/sse/handlers/systemone.js:140 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/shared/utils/machineId.js:21 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/utils/machineId.js:30 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/utils/machineId.js:40 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/utils/machineId.js:45 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:60 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:75 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:28 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:30 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:58 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:59 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:65 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:70 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:100 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:104 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:248 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:249 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:311 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/initializeApp.js:312 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) src/shared/services/quotaAutoPing.js:180 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • + 14 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×34
  • FileTooLong: [id]/page.js src/app/(dashboard)/dashboard/providers/[id]/page.js — FileTooLong — 1600 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 (50-2029). The bar is 1500 significant lines; this is 100 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: 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 — 1365 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 92% of them inside a single declaration: ProviderLimits (156-1697). The bar is 500 significant lines; this is 865 over it, 2.73× 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 — 1130 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 630 over it, 2.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1090 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: APIPageClient (22-1331). The bar is 500 significant lines; this is 590 over it, 2.18× 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 — 1008 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ProxyPoolsPage (31-1210). The bar is 500 significant lines; this is 508 over it, 2.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: REDACTED REDACTED — FileTooLong — 970 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 470 over it, 1.94× 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: token-saver/TokenSaverClient.js src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js — FileTooLong — 937 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: TokenSaverClient (13-1080). The bar is 500 significant lines; this is 437 over it, 1.87× 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/kiro.js open-sse/executors/kiro.js — FileTooLong — 891 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 81% of them inside a single declaration: KiroExecutor (224-1217). The bar is 500 significant lines; this is 391 over it, 1.78× 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 — 866 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 366 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: executors/deepseek-web.js open-sse/executors/deepseek-web.js — FileTooLong — 744 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 244 over it, 1.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: components/OAuthModal.js src/shared/components/OAuthModal.js — FileTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: OAuthModal (38-998). The bar is 500 significant lines; this is 233 over it, 1.47× 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 — 727 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 227 over it, 1.45× 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/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: REDACTED REDACTED — FileTooLong — 652 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 152 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: 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 — 640 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: ModelSelectModal (75-860). The bar is 500 significant lines; this is 140 over it, 1.28× 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 — 615 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 115 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: 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: components/GenericCliToolCard.js src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js — FileTooLong — 605 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 95% of them inside a single declaration: GenericCliToolCard (44-764). The bar is 500 significant lines; this is 105 over it, 1.21× 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 — 603 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 103 over it, 1.21× 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 — 598 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 98 over it, 1.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: tokenRefresh/providers.js open-sse/services/tokenRefresh/providers.js — FileTooLong — 591 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 91 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ProviderLimits/utils.js src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js — FileTooLong — 589 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: parseQuotaData (362-923). The bar is 500 significant lines; this is 89 over it, 1.18× 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.
  • + 9 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×20
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · ClassTooLong · ×14
  • ClassTooLong: TokenSaverClient src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:1 — ClassTooLong — 927 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 527 over it, 2.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: KiroExecutor open-sse/executors/kiro.js:224 — ClassTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 325 over it, 1.81× 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 — 702 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 302 over it, 1.76× 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: ModelSelectModal REDACTED:1 — ClassTooLong — 576 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 176 over it, 1.44× 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 — 573 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 173 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TtsExampleCard src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:1 — ClassTooLong — 544 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 144 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GenericExampleCard src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:1 — ClassTooLong — 543 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 143 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • 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: HermesToolCard src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:1 — ClassTooLong — 497 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 97 over it, 1.24× 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: 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: AddApiKeyModal src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:1 — ClassTooLong — 427 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 27 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×9
  • Change coupling: REDACTED ↔ OAuthModal.js REDACTED:1 — `REDACTED` and `src/shared/components/OAuthModal.js` change together 77% of the time (17 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 17 shared commits counted here, the most recent 3 are `165f9b90` feat(providers): add Nous Research OAuth + free-tier provider; `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 — run `git show` on any of them.
  • Change coupling: REDACTED ↔ google.js REDACTED:1 — `REDACTED` and `open-sse/services/usage/google.js` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `8aef7480` feat(providers): add Claude Fable 5.2, Haiku 5.5 and Gemini 4 Carbon; `f172c3c4` fix(antigravity): use hub/2.24.0 User-Agent and add Gemini 4 Argon me…; `24034f69` feat(antigravity): refresh model catalog and update MITM defaults to … — run `git show` on any of them.
  • Change coupling: providerModels.js ↔ model.js open-sse/config/providerModels.js:1 — `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:1 — `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: ConnectionRow.js ↔ REDACTED src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:1 — `src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js` and `REDACTED` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 `28d40159` feat(quota): unify auto-ping mode selection and default to local time…; `7878f53b` fix(codex): drop retired gpt-5.5 from registry, image and auto-ping; `b66b5c68` feat(quota): add opt-in Codex auto-ping — run `git show` on any of them.
  • Change coupling: chatCore.js ↔ usageTracking.js open-sse/handlers/chatCore.js:1 — `open-sse/handlers/chatCore.js` and `open-sse/utils/usageTracking.js` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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:1 — `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 ↔ REDACTED REDACTED:1 — `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:1 — `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.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · MethodTooLong · ×8
  • MethodTooLong: KiroExecutor.transformEventStreamToSSE open-sse/executors/kiro.js:636 — 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: GeminiWebExecutor.execute open-sse/executors/gemini-web.js:420 — MethodTooLong — execute runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.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.
  • MethodTooLong: BedrockExecutor.eventStreamToSse open-sse/executors/bedrock.js:193 — MethodTooLong — eventStreamToSse runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • 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:172 — MethodTooLong — transformRequest runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MuseWebExecutor.execute open-sse/executors/muse-web.js:481 — MethodTooLong — execute 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.
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D15 · Churn × Complexity Hotspots · Repeated repair · ×6
  • Repeated repair: open-sse/providers/capabilities.js open-sse/providers/capabilities.js:839 — open-sse/providers/capabilities.js changed 57 times in last 90 days and 31 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is capabilities.getCapabilitiesForModel at line 839), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(nvidia): harden NIM against parameter rejection and degraded clusters”; “fix(sensenova): add international site provider (token.sensenova.ai)”; “fix(github): apply Claude 5.5 thinking rules to Copilot's dotted model ids”; “fix(opencode): cap oc/deepseek-v4.1-flash-free context window at 330k”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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.
  • Repeated repair: open-sse/config/appConstants.js open-sse/config/appConstants.js:227 — open-sse/config/appConstants.js changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is appConstants.buildKimiHeaders at line 227), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(nous): add API-key attribution tags (#4770)”; “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”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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: open-sse/utils/claudeCloaking.js open-sse/utils/claudeCloaking.js:58 — open-sse/utils/claudeCloaking.js changed 7 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 15 (its worst body is claudeCloaking.cloakClaudeTools at line 58), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(claude): rename tool_reference blocks when cloaking tools”; “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”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +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/translator/concerns/usage.js open-sse/translator/concerns/usage.js:3 — open-sse/translator/concerns/usage.js changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is usage.buildUsage at line 3), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ollama): report prompt_eval_cached_count as cached_tokens in usage tracking”; “revert(qoder): drop the Responses usage plumbing from shared code”; “fix(qoder): report usage to all clients and stop inlining large attachments”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- open-sse/translator/concerns/usage.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/providers/models/helpers.js open-sse/providers/models/helpers.js:6 — open-sse/providers/models/helpers.js changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is helpers.withCodexReviewModels at line 6), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(opencode-zen): use attested free-tier identity for -free models on keyed lane (#4784)”; “fix(claude): inject unsigned thinking placeholders for opencode-go DeepSeek /messages (#4436)”; “fix(opencode): route Muse Spark models to Responses API and declare vision”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- open-sse/providers/models/helpers.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/utils/toolDeduper.js open-sse/utils/toolDeduper.js:80 — open-sse/utils/toolDeduper.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 14 (its worst body is toolDeduper.dedupeTools at line 80), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(dedupe): drop tool_reference blocks naming stripped tools”; “fix(claude): inject unsigned thinking placeholders for opencode-go DeepSeek /messages (#4436)”; “fix(tools): dedupe same-name tools for DeepSeek models (#3333)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 18:50:35 +07:00' --until='2026-11-12 18:50:35 +07:00' --full-history --no-merges -- open-sse/utils/toolDeduper.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.
IC1 · Incompleteness & stubs · Guard cannot change the result · ×6
  • Guard cannot change the result — returns what the code already falls through to open-sse/services/usage/grok-cli.js:90 — The guard above `return "Grok Build";` also returns `"Grok Build"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to open-sse/translator/response/cursor-to-openai.js:17 — The guard above `return chunk;` also returns `chunk`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:153 — The guard above `return "configured";` also returns `"configured"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to REDACTED:64 — The guard above `return null;` also returns `null`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to src/shared/utils/apiKey.js:83 — The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to src/sse/handlers/search.js:148 — The guard above `return result.response;` also returns `result.response`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
D10 · Test Quality · No assertions · ×5
  • 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
IC1 · Incompleteness & stubs · Fake-async · ×5
  • Fake-async — async method never awaits open-sse/services/tokenRefresh/providers.js:701 — `refreshWindsurfToken` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/app/(dashboard)/dashboard/translator/page.js:200 — `handleCopy` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits REDACTED:216 — `runMigrationOnce` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits REDACTED:477 — `ensureUserOwnedDir` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits src/mitm/handlers/cursor.js:5 — `intercept` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
IC1 · Incompleteness & stubs · Markup wires an event to an empty handler · ×5
  • Markup wires an event to an empty handler src/app/(dashboard)/dashboard/media-providers/[kind]/page.js:88 — `onChange` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
  • Markup wires an event to an empty handler src/app/(dashboard)/dashboard/providers/[id]/page.js:1237 — `onSetAlias` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
  • Markup wires an event to an empty handler src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:257 — `onSetAlias` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
  • Markup wires an event to an empty handler REDACTED:783 — `onChange` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
  • Markup wires an event to an empty handler REDACTED:921 — `onChange` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
S1 · Web-Security Posture · Weak hash algorithm · ×5
  • Weak hash algorithm open-sse/services/minimaxCodeUsage.js:22 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm open-sse/shared/mimoAccount.js:120 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm open-sse/shared/qoder/cosy.js:74 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm src/lib/network/netlifyRelay.js:99 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:36 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R7 · Dead Code · Dead file (~77 LoC) · ×4
  • Dead file (~77 LoC) open-sse/providers/registry/bedrock.js — no import path from any entry point (264 application, 11 tooling, 477 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/minimax-cn.js — no import path from any entry point (264 application, 11 tooling, 477 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 (264 application, 11 tooling, 477 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 (264 application, 11 tooling, 477 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
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×4
  • JavaScript dependencies are not locked cli/package.json:25 — cli/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked gitbook/package.json:11 — gitbook/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked package.json:22 — package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked tests/package.json:11 — tests/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
X13 · Undrained process stream · Redirected process stream is never drained (deadlock) · ×4
  • Redirected process stream is never drained (deadlock) REDACTED:326 — `spawn` pipes `stdout` here — it is given no `stdio` option, or `'pipe'` — but nothing in this scope ever reads `child.stdout`, while `child.stderr` is read and the child's end is awaited. Node holds an unread pipe's output only up to its buffer: once the child writes more than that to stdout (measured on Linux: about 128 KB — the 64 KB pipe plus Node's 64 KB read-ahead — and less elsewhere), the child blocks on the write, never exits, and the `close`/`exit` this code waits for never fires. Nothing fails loudly: the promise never settles, the request never returns, and the stuck child holds its resources until something kills it. Consume both streams (`child.stdout.on('data', …)`, or `child.stdout.resume()` to discard it), or stop piping the one you do not want — `stdio: ['pipe', 'pipe', 'inherit']` or `'ignore'` in that slot.
  • Redirected process stream is never drained (deadlock) REDACTED:427 — `spawn` pipes `stdout` here — it is given no `stdio` option, or `'pipe'` — but nothing in this scope ever reads `child.stdout`, while `child.stderr` is read and the child's end is awaited. Node holds an unread pipe's output only up to its buffer: once the child writes more than that to stdout (measured on Linux: about 128 KB — the 64 KB pipe plus Node's 64 KB read-ahead — and less elsewhere), the child blocks on the write, never exits, and the `close`/`exit` this code waits for never fires. Nothing fails loudly: the promise never settles, the request never returns, and the stuck child holds its resources until something kills it. Consume both streams (`child.stdout.on('data', …)`, or `child.stdout.resume()` to discard it), or stop piping the one you do not want — `stdio: ['pipe', 'pipe', 'inherit']` or `'ignore'` in that slot.
  • Redirected process stream is never drained (deadlock) REDACTED:449 — `spawn` pipes `stdout` here — it is given no `stdio` option, or `'pipe'` — but nothing in this scope ever reads `child.stdout`, while `child.stderr` is read and the child's end is awaited. Node holds an unread pipe's output only up to its buffer: once the child writes more than that to stdout (measured on Linux: about 128 KB — the 64 KB pipe plus Node's 64 KB read-ahead — and less elsewhere), the child blocks on the write, never exits, and the `close`/`exit` this code waits for never fires. Nothing fails loudly: the promise never settles, the request never returns, and the stuck child holds its resources until something kills it. Consume both streams (`child.stdout.on('data', …)`, or `child.stdout.resume()` to discard it), or stop piping the one you do not want — `stdio: ['pipe', 'pipe', 'inherit']` or `'ignore'` in that slot.
  • Redirected process stream is never drained (deadlock) open-sse/services/lazyRuntime.js:51 — `spawn` pipes `stdout` here — it is given no `stdio` option, or `'pipe'` — but nothing in this scope ever reads `child.stdout`, while `child.stderr` is read and the child's end is awaited. Node holds an unread pipe's output only up to its buffer: once the child writes more than that to stdout (measured on Linux: about 128 KB — the 64 KB pipe plus Node's 64 KB read-ahead — and less elsewhere), the child blocks on the write, never exits, and the `close`/`exit` this code waits for never fires. Nothing fails loudly: the promise never settles, the request never returns, and the stuck child holds its resources until something kills it. Consume both streams (`child.stdout.on('data', …)`, or `child.stdout.resume()` to discard it), or stop piping the one you do not want — `stdio: ['pipe', 'pipe', 'inherit']` or `'ignore'` in that slot.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 37) · ×3
  • route.POST (cyclomatic 37) REDACTED: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) REDACTED: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.POST (cyclomatic 37) REDACTED:84 — route.POST 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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 21) · ×3
  • 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) REDACTED:112 — route.POST 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.
  • route.POST (cyclomatic 21) REDACTED: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.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 17) · ×3
  • route.GET (cyclomatic 17) REDACTED: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 items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • route.GET (cyclomatic 17) REDACTED:9 — route.GET 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 3 function literals inside it that branch (lines 51, 15, 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.
  • route.GET (cyclomatic 17) REDACTED:134 — route.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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 16) · ×3
  • route.POST (cyclomatic 16) REDACTED: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) REDACTED: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) REDACTED: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.
D2 · Cognitive Complexity · createSSEStream · ×3
  • createSSEStream::transform (cognitive 237) open-sse/utils/stream.js:152 — createSSEStream::transform has cognitive complexity 237 (threshold 15). Drivers by points: if/else 57 (179 pts), boolean chains 27, loops 7 (25 pts), error handling 1 (4 pts), ternaries 1 (2 pts) (nesting depth added 144). 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 59) open-sse/utils/stream.js:474 — createSSEStream::flush has cognitive complexity 59 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 13, loops 4 (12 pts), 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:110 — 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.
D2 · Cognitive Complexity · route.GET (cognitive 16) · ×3
  • route.GET (cognitive 16) REDACTED: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) REDACTED:134 — route.GET has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, error handling 3 (5 pts), if/else 4 (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.
  • route.GET (cognitive 16) REDACTED: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.
R7 · Dead Code · Dead file (~98 LoC) · ×3
  • Dead file (~98 LoC) open-sse/handlers/responsesHandler.js — no import path from any entry point (264 application, 11 tooling, 477 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 (264 application, 11 tooling, 477 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/kimi.js — no import path from any entry point (264 application, 11 tooling, 477 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
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×3
  • Untrusted text written into markup unescaped gitbook/app/page.js:17 — ``window.location.replace("${target}");`` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/lib/oauth/utils/server.js:843 — `message||(success?"You can close this tab and return to 9Router.":"Please try again.")` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/shared/components/ChangelogModal.js:86 — `html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
D1 · Cyclomatic Complexity · createSSEStream · ×2
  • createSSEStream::transform (cyclomatic 105) open-sse/utils/stream.js:152 — createSSEStream::transform has cyclomatic complexity 105 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • createSSEStream::flush (cyclomatic 37) open-sse/utils/stream.js:474 — createSSEStream::flush 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.
D1 · Cyclomatic Complexity · OAuthModal.OAuthModal · ×2
  • OAuthModal.OAuthModal::startOAuthFlow (cyclomatic 53) src/shared/components/OAuthModal.js:270 — OAuthModal.OAuthModal::startOAuthFlow has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (OAuthModal.OAuthModal::handleManualSubmit) 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.
  • OAuthModal.OAuthModal::handleManualSubmit (cyclomatic 30) src/shared/components/OAuthModal.js:658 — OAuthModal.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. This shape REPEATS in the file: one other method here (OAuthModal.OAuthModal::startOAuthFlow) 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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 26) · ×2
  • route.POST (cyclomatic 26) REDACTED:102 — route.POST has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 26) src/app/api/provider-nodes/validate/route.js:55 — route.POST 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.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 24) · ×2
  • 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) REDACTED: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.
D1 · Cyclomatic Complexity · eventStreamToSse · ×2
  • eventStreamToSse::start::drainFrames (cyclomatic 24) open-sse/executors/bedrock.js:235 — eventStreamToSse::start::drainFrames 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.
  • eventStreamToSse::start (cyclomatic 16) open-sse/executors/bedrock.js:209 — eventStreamToSse::start 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.
D1 · Cyclomatic Complexity · combo.detectRequiredCapabilities · ×2
  • combo.detectRequiredCapabilities::scanMessage (cyclomatic 23) open-sse/services/combo.js:164 — combo.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. This shape REPEATS in the file: one other method here (combo.detectRequiredCapabilities::scanBlock) 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.
  • combo.detectRequiredCapabilities::scanBlock (cyclomatic 21) open-sse/services/combo.js:140 — combo.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. This shape REPEATS in the file: one other method here (combo.detectRequiredCapabilities::scanMessage) 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.
D1 · Cyclomatic Complexity · page.ProviderDetailPage · ×2
  • page.ProviderDetailPage::handleImportQoderModels (cyclomatic 23) src/app/(dashboard)/dashboard/providers/[id]/page.js:607 — page.ProviderDetailPage::handleImportQoderModels has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (page.ProviderDetailPage, page.ProviderDetailPage::handleImportClineModels) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • page.ProviderDetailPage::handleImportClineModels (cyclomatic 16) src/app/(dashboard)/dashboard/providers/[id]/page.js:682 — page.ProviderDetailPage::handleImportClineModels has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 2 other methods here (page.ProviderDetailPage, page.ProviderDetailPage::handleImportQoderModels) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: page.ProviderDetailPage::renderModelsSection (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · page.ProfilePage · ×2
  • page.ProfilePage::saveOidcSettings (cyclomatic 22) REDACTED:350 — page.ProfilePage::saveOidcSettings 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. This shape REPEATS in the file: one other method here (page.ProfilePage::saveSamlSettings) 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.
  • page.ProfilePage::saveSamlSettings (cyclomatic 18) REDACTED:555 — page.ProfilePage::saveSamlSettings has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (page.ProfilePage::saveOidcSettings) 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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 18) · ×2
  • route.POST (cyclomatic 18) REDACTED: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) REDACTED: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.
D2 · Cognitive Complexity · OAuthModal.OAuthModal · ×2
  • OAuthModal.OAuthModal::startOAuthFlow (cognitive 82) src/shared/components/OAuthModal.js:270 — OAuthModal.OAuthModal::startOAuthFlow has cognitive complexity 82 (threshold 15). Drivers by points: if/else 26 (38 pts), ternaries 6 (22 pts), boolean chains 17, error handling 3 (5 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (OAuthModal.OAuthModal::handleManualSubmit) 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.
  • OAuthModal.OAuthModal::handleManualSubmit (cognitive 33) src/shared/components/OAuthModal.js:658 — OAuthModal.OAuthModal::handleManualSubmit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (11 pts), boolean chains 8, 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. This shape REPEATS in the file: one other method here (OAuthModal.OAuthModal::startOAuthFlow) 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.
D2 · Cognitive Complexity · buildStreamingResponse · ×2
  • buildStreamingResponse::start (cognitive 55) REDACTED:207 — buildStreamingResponse::start has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 12, loops 2 (3 pts), ternaries 2, error handling 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • buildStreamingResponse::start (cognitive 20) REDACTED: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.
D2 · Cognitive Complexity · KiroExecutor.transformEventStreamToSSE · ×2
  • KiroExecutor.transformEventStreamToSSE::finish (cognitive 49) open-sse/executors/kiro.js:1003 — KiroExecutor.transformEventStreamToSSE::finish has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 11 (27 pts), boolean chains 12, if/else 9, error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (KiroExecutor.transformEventStreamToSSE::processBytes) 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.
  • KiroExecutor.transformEventStreamToSSE::processBytes (cognitive 21) open-sse/executors/kiro.js:932 — KiroExecutor.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. This shape REPEATS in the file: one other method here (KiroExecutor.transformEventStreamToSSE::finish) 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.
D2 · Cognitive Complexity · EndpointPageClient.APIPageClient · ×2
  • EndpointPageClient.APIPageClient::handleConnectTailscale (cognitive 40) REDACTED:489 — EndpointPageClient.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. This shape REPEATS in the file: 2 other methods here (EndpointPageClient.APIPageClient, EndpointPageClient.APIPageClient::handleInstallTailscale) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • EndpointPageClient.APIPageClient::handleInstallTailscale (cognitive 32) REDACTED:409 — EndpointPageClient.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. This shape REPEATS in the file: 2 other methods here (EndpointPageClient.APIPageClient, EndpointPageClient.APIPageClient::handleConnectTailscale) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · eventStreamToSse · ×2
  • eventStreamToSse::start::drainFrames (cognitive 36) open-sse/executors/bedrock.js:235 — eventStreamToSse::start::drainFrames has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • eventStreamToSse::start (cognitive 25) open-sse/executors/bedrock.js:209 — eventStreamToSse::start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeResponsesTools (cognitive 34) · ×2
  • 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:175 — 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 178). 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.
D2 · Cognitive Complexity · extractAnswer (cognitive 31) · ×2
  • 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.
D2 · Cognitive Complexity · page.ProviderDetailPage · ×2
  • page.ProviderDetailPage::handleImportQoderModels (cognitive 30) src/app/(dashboard)/dashboard/providers/[id]/page.js:607 — page.ProviderDetailPage::handleImportQoderModels has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 9, loops 2 (3 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. This shape REPEATS in the file: 2 other methods here (page.ProviderDetailPage, page.ProviderDetailPage::handleImportClineModels) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • page.ProviderDetailPage::handleImportClineModels (cognitive 18) src/app/(dashboard)/dashboard/providers/[id]/page.js:682 — page.ProviderDetailPage::handleImportClineModels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 2 other methods here (page.ProviderDetailPage, page.ProviderDetailPage::handleImportQoderModels) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · combo.detectRequiredCapabilities · ×2
  • combo.detectRequiredCapabilities::scanMessage (cognitive 27) open-sse/services/combo.js:164 — combo.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. This shape REPEATS in the file: one other method here (combo.detectRequiredCapabilities::scanBlock) 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.
  • combo.detectRequiredCapabilities::scanBlock (cognitive 19) open-sse/services/combo.js:140 — combo.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. This shape REPEATS in the file: one other method here (combo.detectRequiredCapabilities::scanMessage) 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.
D2 · Cognitive Complexity · APIPageClient · ×2
  • APIPageClient::(anonymous)::probeBoth (cognitive 26) REDACTED:129 — 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:280 — 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.
D2 · Cognitive Complexity · ProfilePage · ×2
  • 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::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.
D2 · Cognitive Complexity · page.ProfilePage · ×2
  • page.ProfilePage::saveOidcSettings (cognitive 21) REDACTED:350 — page.ProfilePage::saveOidcSettings has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, ternaries 2 (5 pts), if/else 4, error handling 1 (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. This shape REPEATS in the file: one other method here (page.ProfilePage::saveSamlSettings) 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.
  • page.ProfilePage::saveSamlSettings (cognitive 21) REDACTED:555 — page.ProfilePage::saveSamlSettings has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, ternaries 2 (5 pts), if/else 2, error handling 1 (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. This shape REPEATS in the file: one other method here (page.ProfilePage::saveOidcSettings) 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.
D2 · Cognitive Complexity · route.GET (cognitive 19) · ×2
  • 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) REDACTED: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.
D2 · Cognitive Complexity · AddApiKeyModal.AddApiKeyModal · ×2
  • AddApiKeyModal.AddApiKeyModal::buildProviderSpecificData (cognitive 17) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:92 — AddApiKeyModal.AddApiKeyModal::buildProviderSpecificData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), 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. This shape REPEATS in the file: 2 other methods here (AddApiKeyModal.AddApiKeyModal, AddApiKeyModal.AddApiKeyModal::handleBulkSubmit) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • AddApiKeyModal.AddApiKeyModal::handleBulkSubmit (cognitive 16) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:194 — AddApiKeyModal.AddApiKeyModal::handleBulkSubmit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), error handling 2 (4 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (AddApiKeyModal.AddApiKeyModal, AddApiKeyModal.AddApiKeyModal::buildProviderSpecificData) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · route.POST (cognitive 16) · ×2
  • route.POST (cognitive 16) REDACTED: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 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×2
  • Change-coupling hub: REDACTED → REDACTED, MitmToolCard.js, REDACTED REDACTED — `REDACTED` 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.
IC1 · Incompleteness & stubs · Hollow method · ×2
  • Hollow method — returns a constant without doing the work open-sse/executors/devin-cli.js:314 — `buildHeaders` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work open-sse/executors/devin-cli.js:318 — `transformRequest` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
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 (102 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (102 matched lines × 2 locations) src/app/(dashboard)/dashboard/combos/page.js:1148 — src/app/(dashboard)/dashboard/combos/page.js:1148 · src/shared/components/ComboFormModal.js:34 — the two spans are one implementation copied and then locally edited — 943 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 (102 matched lines × 2 locations) src/sse/handlers/embeddings.js:33 — src/sse/handlers/embeddings.js:33 · src/sse/handlers/systemone.js:24 — the two spans are one implementation copied and then locally edited — 733 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (76 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (76 matched lines × 2 locations) open-sse/executors/chatgpt-web/chatHttp.js:40 — open-sse/executors/chatgpt-web/chatHttp.js:40 · open-sse/executors/chatgpt-web/imageGenHttp.js:31 — the two spans are one implementation copied and then locally edited — 497 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 (76 matched lines × 2 locations) src/sse/handlers/imageGeneration.js:47 — src/sse/handlers/imageGeneration.js:47 · src/sse/handlers/tts.js:22 — the two spans are one implementation copied and then locally edited — 641 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.
R11 · Import Boundaries · Boundary violation [package · ×2
  • 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.
  • Boundary violation [package:third-party-deep-import] open-sse/translator/deepseekWebToolBinding.js:5 — open-sse/translator/deepseekWebToolBinding.js:5 imports ajv/dist/2020.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
R7 · Dead Code · Dead file (~89 LoC) · ×2
  • Dead file (~89 LoC) open-sse/providers/registry/claude.js — no import path from any entry point (264 application, 11 tooling, 477 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 (~89 LoC) open-sse/providers/registry/codebuddy-cn.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~70 LoC) · ×2
  • Dead file (~70 LoC) open-sse/providers/registry/zed.js — no import path from any entry point (264 application, 11 tooling, 477 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 (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~66 LoC) · ×2
  • Dead file (~66 LoC) open-sse/providers/registry/cursor.js — no import path from any entry point (264 application, 11 tooling, 477 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 (~66 LoC) open-sse/providers/registry/sensenova-intl.js — no import path from any entry point (264 application, 11 tooling, 477 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
D1 · Cyclomatic Complexity · ProviderLimits (cyclomatic 248) · ×1
  • ProviderLimits (cyclomatic 248) REDACTED:156 — ProviderLimits has cyclomatic complexity 248 (threshold 15). Of this number, 51 points are the body's own statements and 197 belong to 121 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 · parseQuotaData (cyclomatic 218) · ×1
  • parseQuotaData (cyclomatic 218) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:362 — parseQuotaData has cyclomatic complexity 218 (threshold 15). Of this number, 80 points are the body's own statements and 138 belong to 43 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.
D1 · Cyclomatic Complexity · handleChatCore (cyclomatic 177) · ×1
  • handleChatCore (cyclomatic 177) open-sse/handlers/chatCore.js:64 — handleChatCore has cyclomatic complexity 177 (threshold 15). Of this number, 170 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.
D1 · Cyclomatic Complexity · usageRepo.getUsageStats (cyclomatic 170) · ×1
  • usageRepo.getUsageStats (cyclomatic 170) src/lib/db/repos/usageRepo.js:348 — usageRepo.getUsageStats has cyclomatic complexity 170 (threshold 15). Of this number, 157 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.
D1 · Cyclomatic Complexity · ModelSelectModal.ModelSelectModal (cyclomatic 163) · ×1
  • ModelSelectModal.ModelSelectModal (cyclomatic 163) REDACTED:75 — ModelSelectModal.ModelSelectModal has cyclomatic complexity 163 (threshold 15). Of this number, 16 points are the body's own statements and 147 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.
D1 · Cyclomatic Complexity · stream.createSSEStream (cyclomatic 162) · ×1
  • stream.createSSEStream (cyclomatic 162) open-sse/utils/stream.js:47 — stream.createSSEStream has cyclomatic complexity 162 (threshold 15). Of this number, 145 points are the body's own statements and 17 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.
D1 · Cyclomatic Complexity · TtsExampleCard.TtsExampleCard (cyclomatic 154) · ×1
  • TtsExampleCard.TtsExampleCard (cyclomatic 154) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:53 — TtsExampleCard.TtsExampleCard has cyclomatic complexity 154 (threshold 15). Of this number, 66 points are the body's own statements and 88 belong to 20 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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 148) · ×1
  • route.POST (cyclomatic 148) REDACTED:93 — route.POST has cyclomatic complexity 148 (threshold 15). Of this number, 144 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.
D1 · Cyclomatic Complexity · page.ProxyPoolsPage (cyclomatic 147) · ×1
  • page.ProxyPoolsPage (cyclomatic 147) REDACTED:31 — page.ProxyPoolsPage has cyclomatic complexity 147 (threshold 15). Of this number, 40 points are the body's own statements and 107 belong to 31 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TokenSaverClient (cyclomatic 135) · ×1
  • TokenSaverClient (cyclomatic 135) src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13 — TokenSaverClient has cyclomatic complexity 135 (threshold 15). Of this number, 60 points are the body's own statements and 75 belong to 88 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 · AddApiKeyModal.AddApiKeyModal (cyclomatic 127) · ×1
  • AddApiKeyModal.AddApiKeyModal (cyclomatic 127) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:11 — AddApiKeyModal.AddApiKeyModal has cyclomatic complexity 127 (threshold 15). Of this number, 78 points are the body's own statements and 49 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProvidersPage (cyclomatic 126) · ×1
  • ProvidersPage (cyclomatic 126) REDACTED:99 — ProvidersPage has cyclomatic complexity 126 (threshold 15). Of this number, 31 points are the body's own statements and 95 belong to 72 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.
D1 · Cyclomatic Complexity · HermesToolCard.HermesToolCard (cyclomatic 125) · ×1
  • HermesToolCard.HermesToolCard (cyclomatic 125) src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:15 — HermesToolCard.HermesToolCard has cyclomatic complexity 125 (threshold 15). Of this number, 50 points are the body's own statements and 75 belong to 24 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 · GenericCliToolCard (cyclomatic 114) · ×1
  • GenericCliToolCard (cyclomatic 114) src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:44 — GenericCliToolCard has cyclomatic complexity 114 (threshold 15). Of this number, 36 points are the body's own statements and 78 belong to 59 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 · page.ProviderDetailPage (cyclomatic 113) · ×1
  • page.ProviderDetailPage (cyclomatic 113) src/app/(dashboard)/dashboard/providers/[id]/page.js:50 — page.ProviderDetailPage has cyclomatic complexity 113 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (page.ProviderDetailPage::handleImportQoderModels, page.ProviderDetailPage::handleImportClineModels) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · execute (cyclomatic 113) · ×1
  • 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 (a function literal at line 600, start, start::finish, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · applyFormat (cyclomatic 109) · ×1
  • applyFormat (cyclomatic 109) open-sse/translator/concerns/thinkingUnified.js:266 — applyFormat has cyclomatic complexity 109 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · route.buildModelsList (cyclomatic 108) · ×1
  • route.buildModelsList (cyclomatic 108) REDACTED:330 — route.buildModelsList has cyclomatic complexity 108 (threshold 15). Of this number, 85 points are the body's own statements and 23 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.
D1 · Cyclomatic Complexity · handleComboChat (cyclomatic 106) · ×1
  • handleComboChat (cyclomatic 106) open-sse/services/combo.js:354 — handleComboChat has cyclomatic complexity 106 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConnectionRow (cyclomatic 100) · ×1
  • ConnectionRow (cyclomatic 100) src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:10 — ConnectionRow has cyclomatic complexity 100 (threshold 15). Of this number, 70 points are the body's own statements and 30 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.
D1 · Cyclomatic Complexity · CodexToolCard.CodexToolCard (cyclomatic 94) · ×1
  • 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 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 · CoworkToolCard.CoworkToolCard (cyclomatic 93) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · GenericExampleCard.GenericExampleCard (cyclomatic 90) · ×1
  • GenericExampleCard.GenericExampleCard (cyclomatic 90) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:37 — GenericExampleCard.GenericExampleCard has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (GenericExampleCard.GenericExampleCard::handleRun) 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.
D1 · Cyclomatic Complexity · OpenCodeToolCard.OpenCodeToolCard (cyclomatic 89) · ×1
  • 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 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 · auth.getProviderCredentials (cyclomatic 88) · ×1
  • auth.getProviderCredentials (cyclomatic 88) src/sse/services/auth.js:28 — auth.getProviderCredentials has cyclomatic complexity 88 (threshold 15). Of this number, 53 points are the body's own statements and 35 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.
D1 · Cyclomatic Complexity · ZedAuthModal (cyclomatic 86) · ×1
  • 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.
D1 · Cyclomatic Complexity · CombosPage (cyclomatic 85) · ×1
  • CombosPage (cyclomatic 85) src/app/(dashboard)/dashboard/combos/page.js:69 — CombosPage has cyclomatic complexity 85 (threshold 15). Most of this is not in the body itself: 14 of the 85 points are its own statements and the rest belongs to 70 function items inside it that branch (handleGeneratePresets, fetchData, handleBulkSetStrategy, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · executeAgent (cyclomatic 82) · ×1
  • executeAgent (cyclomatic 82) REDACTED:636 — executeAgent has cyclomatic complexity 82 (threshold 15). Of this number, 23 points are the body's own statements and 59 belong to 17 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · startServer (cyclomatic 82) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProfilePage (cyclomatic 80) · ×1
  • ProfilePage (cyclomatic 80) REDACTED:22 — ProfilePage has cyclomatic complexity 80 (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.
D1 · Cyclomatic Complexity · buildModelGroups (cyclomatic 80) · ×1
  • buildModelGroups (cyclomatic 80) src/shared/utils/selectableModels.js:60 — buildModelGroups has cyclomatic complexity 80 (threshold 15). Most of this is not in the body itself: 9 of the 80 points are its own statements and the rest belongs to 51 function items inside it that branch (a function literal at line 145, a function literal at line 340, a function literal at line 328, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ClaudeToolCard.ClaudeToolCard (cyclomatic 78) · ×1
  • 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 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 · route.POST (cyclomatic 75) · ×1
  • route.POST (cyclomatic 75) REDACTED:317 — route.POST has cyclomatic complexity 75 (threshold 15). Of this number, 74 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.
D1 · Cyclomatic Complexity · openaiToGeminiBase (cyclomatic 75) · ×1
  • openaiToGeminiBase (cyclomatic 75) open-sse/translator/request/openai-to-gemini.js:77 — openaiToGeminiBase has cyclomatic complexity 75 (threshold 15). Of this number, 73 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.
D1 · Cyclomatic Complexity · openaiResponsesToOpenAIResponse (cyclomatic 74) · ×1
  • 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.
D1 · Cyclomatic Complexity · handleForcedSSEToJson (cyclomatic 74) · ×1
  • handleForcedSSEToJson (cyclomatic 74) open-sse/handlers/chatCore/sseToJsonHandler.js:189 — handleForcedSSEToJson has cyclomatic complexity 74 (threshold 15). Of this number, 71 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · parseGrokCliBilling (cyclomatic 74) · ×1
  • 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.
D1 · Cyclomatic Complexity · prepareClaudeRequest (cyclomatic 73) · ×1
  • prepareClaudeRequest (cyclomatic 73) open-sse/translator/formats/claude.js:495 — prepareClaudeRequest has cyclomatic complexity 73 (threshold 15). Of this number, 66 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openai-to-kiro.convertMessages (cyclomatic 71) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · DroidToolCard.DroidToolCard (cyclomatic 71) · ×1
  • 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 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 · OpenClawToolCard.OpenClawToolCard (cyclomatic 71) · ×1
  • 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 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 · GrokBuildToolCard.GrokBuildToolCard (cyclomatic 71) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · JcodeToolCard.JcodeToolCard (cyclomatic 70) · ×1
  • 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 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 · execute (cyclomatic 70) · ×1
  • execute (cyclomatic 70) REDACTED:663 — execute has cyclomatic complexity 70 (threshold 15). Of this number, 39 points are the body's own statements and 31 belong to 12 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · translateNonStreamingResponse (cyclomatic 70) · ×1
  • translateNonStreamingResponse (cyclomatic 70) open-sse/handlers/chatCore/nonStreamingHandler.js:97 — 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.
D1 · Cyclomatic Complexity · transformEventStreamToSSE · ×1
  • transformEventStreamToSSE::processEvent (cyclomatic 69) open-sse/executors/kiro.js:799 — 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.
D1 · Cyclomatic Complexity · openaiResponsesToOpenAIRequest (cyclomatic 68) · ×1
  • 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.
D1 · Cyclomatic Complexity · deepseek-web.transformSSE (cyclomatic 67) · ×1
  • deepseek-web.transformSSE (cyclomatic 67) open-sse/executors/deepseek-web.js:150 — deepseek-web.transformSSE has cyclomatic complexity 67 (threshold 15). Of this number, 46 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.
D1 · Cyclomatic Complexity · page.MediaProviderDetailPage (cyclomatic 67) · ×1
  • page.MediaProviderDetailPage (cyclomatic 67) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js:19 — page.MediaProviderDetailPage has cyclomatic complexity 67 (threshold 15). Of this number, 58 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 66) · ×1
  • route.GET (cyclomatic 66) REDACTED:95 — route.GET has cyclomatic complexity 66 (threshold 15). Of this number, 65 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.
D1 · Cyclomatic Complexity · AntigravityToolCard.AntigravityToolCard (cyclomatic 65) · ×1
  • 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 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 · UsageStats (cyclomatic 65) · ×1
  • UsageStats (cyclomatic 65) src/shared/components/UsageStats.js:206 — UsageStats has cyclomatic complexity 65 (threshold 15). Of this number, 23 points are the body's own statements and 42 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.
D1 · Cyclomatic Complexity · deepseek-web.collectSSEContent (cyclomatic 63) · ×1
  • deepseek-web.collectSSEContent (cyclomatic 63) open-sse/executors/deepseek-web.js:347 — deepseek-web.collectSSEContent has cyclomatic complexity 63 (threshold 15). Of this number, 44 points are the body's own statements and 19 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EndpointPageClient.APIPageClient (cyclomatic 62) · ×1
  • EndpointPageClient.APIPageClient (cyclomatic 62) REDACTED:22 — EndpointPageClient.APIPageClient has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EndpointPageClient.APIPageClient::handleConnectTailscale) 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.
D1 · Cyclomatic Complexity · DeepSeekTuiToolCard.DeepSeekTuiToolCard (cyclomatic 61) · ×1
  • 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 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 · ClineToolCard.ClineToolCard (cyclomatic 60) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · claude-to-kiro.convertClaudeMessagesToKiro (cyclomatic 58) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 58) · ×1
  • route.POST (cyclomatic 58) REDACTED: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.
D1 · Cyclomatic Complexity · claude-to-openai.claudeToOpenAIResponse (cyclomatic 57) · ×1
  • 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.
D1 · Cyclomatic Complexity · CodexExecutor.transformRequest (cyclomatic 56) · ×1
  • CodexExecutor.transformRequest (cyclomatic 56) open-sse/executors/codex.js:414 — 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.
D1 · Cyclomatic Complexity · CopilotToolCard.CopilotToolCard (cyclomatic 56) · ×1
  • 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 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 · ConnectionsCard.ConnectionRow (cyclomatic 56) · ×1
  • ConnectionsCard.ConnectionRow (cyclomatic 56) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:34 — 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 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.
D1 · Cyclomatic Complexity · execute (cyclomatic 56) · ×1
  • execute (cyclomatic 56) open-sse/executors/deepseek-web.js:794 — execute has cyclomatic complexity 56 (threshold 15). Of this number, 52 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · parseStream (cyclomatic 56) · ×1
  • parseStream (cyclomatic 56) open-sse/handlers/imageProviders/codex.js:187 — parseStream 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.
D1 · Cyclomatic Complexity · XiaomiMimoAuthModal.XiaomiMimoAuthModal (cyclomatic 54) · ×1
  • 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 items inside it that branch (startSessionLogin, handleImportLocal, a function literal at line 148, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · MitmServerCard (cyclomatic 54) · ×1
  • 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.
D1 · Cyclomatic Complexity · importLegacyMain (cyclomatic 54) · ×1
  • importLegacyMain (cyclomatic 54) REDACTED: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.
D1 · Cyclomatic Complexity · McpMarketplaceModal (cyclomatic 54) · ×1
  • 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 (a function literal at line 144, a function literal at line 38, fetchTools, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · handleImageGenerationCore (cyclomatic 54) · ×1
  • handleImageGenerationCore (cyclomatic 54) open-sse/handlers/imageGenerationCore.js:30 — handleImageGenerationCore has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AntigravityExecutor.transformRequest (cyclomatic 53) · ×1
  • AntigravityExecutor.transformRequest (cyclomatic 53) open-sse/executors/antigravity.js:172 — AntigravityExecutor.transformRequest has cyclomatic complexity 53 (threshold 15). Of this number, 34 points are the body's own statements and 19 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.
D1 · Cyclomatic Complexity · openai-to-cursor.convertMessages (cyclomatic 53) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · runConnect (cyclomatic 53) · ×1
  • runConnect (cyclomatic 53) REDACTED:273 — runConnect has cyclomatic complexity 53 (threshold 15). Of this number, 51 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KiloToolCard.KiloToolCard (cyclomatic 52) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · page.LoginPage (cyclomatic 52) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · normalizeClaudePassthrough (cyclomatic 52) · ×1
  • normalizeClaudePassthrough (cyclomatic 52) open-sse/translator/formats/claude.js:221 — normalizeClaudePassthrough has cyclomatic complexity 52 (threshold 15). Of this number, 40 points are the body's own statements and 12 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.
D1 · Cyclomatic Complexity · pollConversationImages (cyclomatic 52) · ×1
  • pollConversationImages (cyclomatic 52) open-sse/executors/chatgpt-web/imageGen.js:193 — pollConversationImages has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 13 of the 52 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 206, (anonymous)::hasAssetPointer, (anonymous)::collectIds, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · attachments.rewriteBlock (cyclomatic 51) · ×1
  • 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.
D1 · Cyclomatic Complexity · SttExampleCard.SttExampleCard (cyclomatic 51) · ×1
  • SttExampleCard.SttExampleCard (cyclomatic 51) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:11 — SttExampleCard.SttExampleCard has cyclomatic complexity 51 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (SttExampleCard.SttExampleCard::handleRun) 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.
D1 · Cyclomatic Complexity · index.importDb (cyclomatic 51) · ×1
  • index.importDb (cyclomatic 51) src/lib/db/index.js:98 — index.importDb has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 4 of the 51 points are its own statements and the rest belongs to one function literal inside it that branches (line 104). 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.
D1 · Cyclomatic Complexity · kiro-to-openai.kiroToOpenAIResponse (cyclomatic 50) · ×1
  • 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.
D1 · Cyclomatic Complexity · responsesTransformer.createResponsesApiTransformStream (cyclomatic 50) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · WebLoginButton.WebLoginButton (cyclomatic 50) · ×1
  • WebLoginButton.WebLoginButton (cyclomatic 50) src/app/(dashboard)/dashboard/providers/components/WebLoginButton.js:46 — WebLoginButton.WebLoginButton has cyclomatic complexity 50 (threshold 15). Of this number, 16 points are the body's own statements and 34 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.
D1 · Cyclomatic Complexity · QuotaTable (cyclomatic 50) · ×1
  • QuotaTable (cyclomatic 50) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js:87 — QuotaTable has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 11 of the 50 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 152, (anonymous)::renderResetCell, a function literal at line 97, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · handleSingleModelChat (cyclomatic 49) · ×1
  • handleSingleModelChat (cyclomatic 49) src/sse/handlers/chat.js:193 — handleSingleModelChat has cyclomatic complexity 49 (threshold 15). Of this number, 46 points are the body's own statements and 3 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openai.filterToOpenAIFormat (cyclomatic 48) · ×1
  • openai.filterToOpenAIFormat (cyclomatic 48) open-sse/translator/formats/openai.js:10 — openai.filterToOpenAIFormat has cyclomatic complexity 48 (threshold 15). Of this number, 28 points are the body's own statements and 20 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · openai-responses.openaiToOpenAIResponsesRequest (cyclomatic 48) · ×1
  • 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.
D1 · Cyclomatic Complexity · commandcode-to-openai.commandCodeToOpenAIResponse (cyclomatic 48) · ×1
  • 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.
D1 · Cyclomatic Complexity · generateMedia (cyclomatic 48) · ×1
  • generateMedia (cyclomatic 48) open-sse/executors/uc-web.js:338 — generateMedia 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.
D1 · Cyclomatic Complexity · KiroAuthModal (cyclomatic 48) · ×1
  • 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.
D1 · Cyclomatic Complexity · getAntigravityUsage (cyclomatic 48) · ×1
  • getAntigravityUsage (cyclomatic 48) open-sse/services/usage/google.js:120 — getAntigravityUsage has cyclomatic complexity 48 (threshold 15). Of this number, 33 points are the body's own statements and 15 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.
D1 · Cyclomatic Complexity · openai-to-gemini.wrapInCloudCodeEnvelopeForClaude (cyclomatic 47) · ×1
  • openai-to-gemini.wrapInCloudCodeEnvelopeForClaude (cyclomatic 47) open-sse/translator/request/openai-to-gemini.js:379 — 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.
D1 · Cyclomatic Complexity · geminiLiveStt.transcribeGeminiLive (cyclomatic 47) · ×1
  • 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.
D1 · Cyclomatic Complexity · OAuthModal (cyclomatic 47) · ×1
  • OAuthModal (cyclomatic 47) src/shared/components/OAuthModal.js:38 — OAuthModal has cyclomatic complexity 47 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · normalizeGrokCliTools (cyclomatic 47) · ×1
  • normalizeGrokCliTools (cyclomatic 47) REDACTED: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.
D1 · Cyclomatic Complexity · handleNonStreamingResponse (cyclomatic 47) · ×1
  • handleNonStreamingResponse (cyclomatic 47) open-sse/handlers/chatCore/nonStreamingHandler.js:237 — handleNonStreamingResponse has cyclomatic complexity 47 (threshold 15). Of this number, 46 points are the body's own statements and 1 belongs 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.
D1 · Cyclomatic Complexity · modelSelector.selectModelFromList (cyclomatic 46) · ×1
  • 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.
D1 · Cyclomatic Complexity · paramSupport.stripUnsupportedParams (cyclomatic 46) · ×1
  • paramSupport.stripUnsupportedParams (cyclomatic 46) open-sse/translator/concerns/paramSupport.js:77 — paramSupport.stripUnsupportedParams has cyclomatic complexity 46 (threshold 15). Of this number, 45 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · extractContent (cyclomatic 46) · ×1
  • extractContent (cyclomatic 46) REDACTED: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.
D1 · Cyclomatic Complexity · getAntigravityModelQuota (cyclomatic 46) · ×1
  • getAntigravityModelQuota (cyclomatic 46) src/sse/services/antigravityQuota.js:75 — getAntigravityModelQuota has cyclomatic complexity 46 (threshold 15). Of this number, 45 points are the body's own statements and 1 belongs 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.
D1 · Cyclomatic Complexity · headroom.compressWithHeadroom (cyclomatic 45) · ×1
  • headroom.compressWithHeadroom (cyclomatic 45) open-sse/rtk/headroom.js:404 — headroom.compressWithHeadroom has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConnectionsCard.ConnectionsCard (cyclomatic 45) · ×1
  • ConnectionsCard.ConnectionsCard (cyclomatic 45) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:299 — ConnectionsCard.ConnectionsCard has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 7 of the 45 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 310, saveStrategy, a function literal at line 411, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · transformSSE · ×1
  • transformSSE::start (cyclomatic 45) open-sse/executors/deepseek-web.js:163 — transformSSE::start has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kiroConstants.normalizeKiroUpstreamModelId (cyclomatic 44) · ×1
  • kiroConstants.normalizeKiroUpstreamModelId (cyclomatic 44) open-sse/config/kiroConstants.js:75 — kiroConstants.normalizeKiroUpstreamModelId has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codex.normalizeCodexTools (cyclomatic 44) · ×1
  • codex.normalizeCodexTools (cyclomatic 44) open-sse/executors/codex.js:78 — codex.normalizeCodexTools has cyclomatic complexity 44 (threshold 15). Of this number, 16 points are the body's own statements and 28 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.
D1 · Cyclomatic Complexity · DefaultToolCard.DefaultToolCard (cyclomatic 44) · ×1
  • 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 items inside it that branch (renderGuideSteps, a function literal at line 106, replaceVars, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · EmbeddingExampleCard.EmbeddingExampleCard (cyclomatic 44) · ×1
  • 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 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 · MitmToolCard (cyclomatic 44) · ×1
  • 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.
D1 · Cyclomatic Complexity · stt.handleStt (cyclomatic 43) · ×1
  • stt.handleStt (cyclomatic 43) src/sse/handlers/stt.js:40 — stt.handleStt has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sendMessage (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · getOllamaUsage (cyclomatic 43) · ×1
  • getOllamaUsage (cyclomatic 43) open-sse/services/usage/misc.js:70 — getOllamaUsage has cyclomatic complexity 43 (threshold 15). Of this number, 40 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BedrockExecutor.eventStreamToSse (cyclomatic 42) · ×1
  • BedrockExecutor.eventStreamToSse (cyclomatic 42) open-sse/executors/bedrock.js:193 — BedrockExecutor.eventStreamToSse 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 4 function literals inside it that branch (lines 235, 209, 210, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · KiroExecutor.transformEventStreamToSSE · ×1
  • KiroExecutor.transformEventStreamToSSE::finish (cyclomatic 42) open-sse/executors/kiro.js:1003 — KiroExecutor.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.
D1 · Cyclomatic Complexity · startServer (cyclomatic 42) · ×1
  • startServer (cyclomatic 42) REDACTED:646 — startServer has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 4 of the 42 points are its own statements and the rest belongs to 28 function items inside it that branch (a function literal at line 802, tryRestart, spawnServer, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · execute (cyclomatic 42) · ×1
  • execute (cyclomatic 42) open-sse/executors/gemini-web.js:420 — execute has cyclomatic complexity 42 (threshold 15). Of this number, 35 points are the body's own statements and 7 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createProviderConnection (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · buildOutput.buildOutput (cyclomatic 41) · ×1
  • 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.
D1 · Cyclomatic Complexity · openaiToClaudeRequest (cyclomatic 41) · ×1
  • 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.
D1 · Cyclomatic Complexity · kiroToClaudeResponse (cyclomatic 41) · ×1
  • 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.
D1 · Cyclomatic Complexity · grok-web-tools.toolScore (cyclomatic 40) · ×1
  • grok-web-tools.toolScore (cyclomatic 40) open-sse/executors/grok-web-tools.js:323 — grok-web-tools.toolScore 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.
D1 · Cyclomatic Complexity · PxpipeClient.PxpipeClient (cyclomatic 40) · ×1
  • 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.
D1 · Cyclomatic Complexity · openai-to-claude.openaiToClaudeResponse (cyclomatic 39) · ×1
  • openai-to-claude.openaiToClaudeResponse (cyclomatic 39) open-sse/translator/response/openai-to-claude.js:71 — openai-to-claude.openaiToClaudeResponse has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · usageTracking.extractUsage (cyclomatic 39) · ×1
  • usageTracking.extractUsage (cyclomatic 39) open-sse/utils/usageTracking.js:239 — usageTracking.extractUsage has cyclomatic complexity 39 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · RequestDetailsTab.RequestDetailsTab (cyclomatic 39) · ×1
  • RequestDetailsTab.RequestDetailsTab (cyclomatic 39) src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js:86 — RequestDetailsTab.RequestDetailsTab has cyclomatic complexity 39 (threshold 15). Of this number, 28 points are the body's own statements and 11 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · providerModels.getModelUpstreamId (cyclomatic 38) · ×1
  • providerModels.getModelUpstreamId (cyclomatic 38) open-sse/config/providerModels.js:95 — providerModels.getModelUpstreamId has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · qoder.wrapQoderSSE (cyclomatic 38) · ×1
  • qoder.wrapQoderSSE (cyclomatic 38) REDACTED:475 — 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 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.
D1 · Cyclomatic Complexity · page.TranslatorPage (cyclomatic 38) · ×1
  • page.TranslatorPage (cyclomatic 38) src/app/(dashboard)/dashboard/translator/page.js:37 — 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 items inside it that branch (handleSend, a function literal at line 239, handleLoad, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · extractCall (cyclomatic 38) · ×1
  • extractCall (cyclomatic 38) REDACTED:367 — extractCall has cyclomatic complexity 38 (threshold 15). Of this number, 36 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.
D1 · Cyclomatic Complexity · parsePlanWindows (cyclomatic 38) · ×1
  • parsePlanWindows (cyclomatic 38) open-sse/services/minimaxCodeUsage.js:156 — parsePlanWindows has cyclomatic complexity 38 (threshold 15). Of this number, 37 points are the body's own statements and 1 belongs 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.
D1 · Cyclomatic Complexity · gemini-to-openai.geminiToOpenAIResponse (cyclomatic 37) · ×1
  • 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.
D1 · Cyclomatic Complexity · openai-to-antigravity.openaiToAntigravityResponse (cyclomatic 37) · ×1
  • openai-to-antigravity.openaiToAntigravityResponse (cyclomatic 37) open-sse/translator/response/openai-to-antigravity.js:10 — 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.
D1 · Cyclomatic Complexity · config.normalizeLocale (cyclomatic 37) · ×1
  • 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.
D1 · Cyclomatic Complexity · usageRepo.getChartData (cyclomatic 37) · ×1
  • usageRepo.getChartData (cyclomatic 37) src/lib/db/repos/usageRepo.js:675 — 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.
D1 · Cyclomatic Complexity · createResponsesApiTransformStream · ×1
  • 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.
D1 · Cyclomatic Complexity · gitStatus.gitStatus (cyclomatic 36) · ×1
  • 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.
D1 · Cyclomatic Complexity · handleVideoProxyCore (cyclomatic 36) · ×1
  • handleVideoProxyCore (cyclomatic 36) open-sse/handlers/videoCore.js:151 — handleVideoProxyCore has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · antigravity-to-openai.convertContent (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · TraeExecutor.execute (cyclomatic 35) · ×1
  • 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 items inside it that branch (a function literal at line 216, renderNewText, a function literal at line 226, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · index.compressMessages (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · codexStt.transcribeCodex (cyclomatic 35) · ×1
  • codexStt.transcribeCodex (cyclomatic 35) open-sse/handlers/codexStt.js:41 — codexStt.transcribeCodex 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.
D1 · Cyclomatic Complexity · parseSSEToOpenAIResponse (cyclomatic 35) · ×1
  • parseSSEToOpenAIResponse (cyclomatic 35) open-sse/handlers/chatCore/sseToJsonHandler.js:115 — parseSSEToOpenAIResponse 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.
D1 · Cyclomatic Complexity · checkAndRefreshToken (cyclomatic 35) · ×1
  • checkAndRefreshToken (cyclomatic 35) src/sse/services/tokenRefresh.js:229 — 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.
D1 · Cyclomatic Complexity · provider.detectFormat (cyclomatic 34) · ×1
  • provider.detectFormat (cyclomatic 34) open-sse/services/provider.js:35 — 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.
D1 · Cyclomatic Complexity · claude-to-openai.convertClaudeMessage (cyclomatic 34) · ×1
  • claude-to-openai.convertClaudeMessage (cyclomatic 34) open-sse/translator/request/claude-to-openai.js:163 — claude-to-openai.convertClaudeMessage 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.
D1 · Cyclomatic Complexity · openai-to-claude.getContentBlocksFromMessage (cyclomatic 34) · ×1
  • openai-to-claude.getContentBlocksFromMessage (cyclomatic 34) open-sse/translator/request/openai-to-claude.js:250 — openai-to-claude.getContentBlocksFromMessage 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.
D1 · Cyclomatic Complexity · openai-to-commandcode.convertMessages (cyclomatic 34) · ×1
  • openai-to-commandcode.convertMessages (cyclomatic 34) open-sse/translator/request/openai-to-commandcode.js:116 — openai-to-commandcode.convertMessages 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.
D1 · Cyclomatic Complexity · quotaAutoPing.pingConnection (cyclomatic 34) · ×1
  • quotaAutoPing.pingConnection (cyclomatic 34) src/shared/services/quotaAutoPing.js:194 — quotaAutoPing.pingConnection 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.
D1 · Cyclomatic Complexity · parseDeepSeekToolCalls (cyclomatic 34) · ×1
  • parseDeepSeekToolCalls (cyclomatic 34) REDACTED:798 — parseDeepSeekToolCalls has cyclomatic complexity 34 (threshold 15). Of this number, 29 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · handleRun (cyclomatic 34) · ×1
  • handleRun (cyclomatic 34) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:158 — 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.
D1 · Cyclomatic Complexity · extractThinking (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · parseCommandCodeError (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · qoder.normalizeContent (cyclomatic 33) · ×1
  • qoder.normalizeContent (cyclomatic 33) REDACTED:95 — 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 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.
D1 · Cyclomatic Complexity · nonStreamingHandler.openAICompletionToResponses (cyclomatic 33) · ×1
  • nonStreamingHandler.openAICompletionToResponses (cyclomatic 33) open-sse/handlers/chatCore/nonStreamingHandler.js:33 — 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.
D1 · Cyclomatic Complexity · GenericExampleCard.GenericExampleCard · ×1
  • GenericExampleCard.GenericExampleCard::handleRun (cyclomatic 33) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:158 — GenericExampleCard.GenericExampleCard::handleRun has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (GenericExampleCard.GenericExampleCard) 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.
D1 · Cyclomatic Complexity · BulkImportGrokCliModal.BulkImportGrokCliModal (cyclomatic 33) · ×1
  • 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 items inside it that branch (handleSubmit, processFiles, a function literal at line 78, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 33) · ×1
  • route.GET (cyclomatic 33) REDACTED:17 — route.GET has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComboFormModal.ComboFormModal (cyclomatic 33) · ×1
  • ComboFormModal.ComboFormModal (cyclomatic 33) src/shared/components/ComboFormModal.js:53 — ComboFormModal.ComboFormModal has cyclomatic complexity 33 (threshold 15). Of this number, 18 points are the body's own statements and 15 belong to 11 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · waitForMedia (cyclomatic 33) · ×1
  • waitForMedia (cyclomatic 33) open-sse/executors/muse-web.js:337 — waitForMedia has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · transformRequest (cyclomatic 33) · ×1
  • transformRequest (cyclomatic 33) REDACTED: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.
D1 · Cyclomatic Complexity · claude-to-openai.claudeToOpenAIRequest (cyclomatic 32) · ×1
  • claude-to-openai.claudeToOpenAIRequest (cyclomatic 32) open-sse/translator/request/claude-to-openai.js:14 — claude-to-openai.claudeToOpenAIRequest has cyclomatic complexity 32 (threshold 15). Of this number, 31 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.
D1 · Cyclomatic Complexity · CursorExecutor.transformProtobufToSSE (cyclomatic 32) · ×1
  • CursorExecutor.transformProtobufToSSE (cyclomatic 32) REDACTED:1226 — 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.
D1 · Cyclomatic Complexity · grok-web.buildStreamingResponse (cyclomatic 32) · ×1
  • grok-web.buildStreamingResponse (cyclomatic 32) REDACTED:204 — grok-web.buildStreamingResponse 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.
D1 · Cyclomatic Complexity · antigravity-weekly.parseWeeklyQuotaSummary (cyclomatic 32) · ×1
  • antigravity-weekly.parseWeeklyQuotaSummary (cyclomatic 32) open-sse/services/usage/antigravity-weekly.js:56 — 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.
D1 · Cyclomatic Complexity · kimi.getKimiUsage (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseUrlSelect.BaseUrlSelect (cyclomatic 32) · ×1
  • 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 items inside it that branch (a function literal at line 90, handleSelect, a function literal at line 68, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CompatibleModelsSection.CompatibleModelsSection (cyclomatic 32) · ×1
  • 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 items inside it that branch (handleImport, handleAdd, handleTestModel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · EditCompatibleNodeModal.EditCompatibleNodeModal (cyclomatic 32) · ×1
  • 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 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 · AddCustomEmbeddingModal.AddCustomEmbeddingModal (cyclomatic 32) · ×1
  • 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 items inside it that branch (handleSubmit, a function literal at line 23, renderValidationResult, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · videoGeneration.handleVideoCreate (cyclomatic 32) · ×1
  • videoGeneration.handleVideoCreate (cyclomatic 32) src/sse/handlers/videoGeneration.js:112 — videoGeneration.handleVideoCreate 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.
D1 · Cyclomatic Complexity · buildPromptText (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · buildStreamingResponse · ×1
  • buildStreamingResponse::start (cyclomatic 32) REDACTED:207 — buildStreamingResponse::start 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.
D1 · Cyclomatic Complexity · convertOpenAIToKiro (cyclomatic 32) · ×1
  • convertOpenAIToKiro (cyclomatic 32) REDACTED: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.
D1 · Cyclomatic Complexity · claude-to-kiro.claudeToKiroRequest (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · prefetch.collectImageRefs (cyclomatic 31) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · BasicChatPageClient.BasicChatPageClient · ×1
  • BasicChatPageClient.BasicChatPageClient::sendMessage (cyclomatic 31) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:573 — BasicChatPageClient.BasicChatPageClient::sendMessage 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. This shape REPEATS in the file: one other method here (BasicChatPageClient.BasicChatPageClient) 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.
D1 · Cyclomatic Complexity · runChatGptWebHttpTurn (cyclomatic 31) · ×1
  • runChatGptWebHttpTurn (cyclomatic 31) open-sse/executors/chatgpt-web/chatHttp.js:163 — runChatGptWebHttpTurn 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.
D1 · Cyclomatic Complexity · DefaultExecutor.buildHeaders (cyclomatic 30) · ×1
  • DefaultExecutor.buildHeaders (cyclomatic 30) open-sse/executors/default.js:206 — 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.
D1 · Cyclomatic Complexity · responsesApi.convertResponsesApiFormat (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · GrokWebExecutor.generateMedia (cyclomatic 30) · ×1
  • GrokWebExecutor.generateMedia (cyclomatic 30) REDACTED:499 — GrokWebExecutor.generateMedia 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.
D1 · Cyclomatic Complexity · opencode.normalizeResponsesTools (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · opencode-go.normalizeResponsesTools (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · opencode-zen.normalizeResponsesTools (cyclomatic 30) · ×1
  • opencode-zen.normalizeResponsesTools (cyclomatic 30) open-sse/executors/opencode-zen.js:175 — 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 178). 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.
D1 · Cyclomatic Complexity · sseToJsonHandler.chatCompletionToResponses (cyclomatic 30) · ×1
  • sseToJsonHandler.chatCompletionToResponses (cyclomatic 30) open-sse/handlers/chatCore/sseToJsonHandler.js:55 — 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.
D1 · Cyclomatic Complexity · sync.build (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · server.passthroughHttp2 (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · readIntegrityAttempt (cyclomatic 30) · ×1
  • readIntegrityAttempt (cyclomatic 30) open-sse/executors/kiro.js:550 — 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.
D1 · Cyclomatic Complexity · Sidebar (cyclomatic 30) · ×1
  • Sidebar (cyclomatic 30) src/shared/components/Sidebar.js:42 — 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 25 function items inside it that branch (a function literal at line 268, isActive, a function literal at line 91, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · acquireViaDesktopPhases (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · opencodeFingerprint.restoreToolNames (cyclomatic 29) · ×1
  • opencodeFingerprint.restoreToolNames (cyclomatic 29) open-sse/utils/opencodeFingerprint.js:447 — 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 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.
D1 · Cyclomatic Complexity · openai-to-kiro.openaiToKiroRequest (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · finishReason.toOpenAIFinish (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · ProviderLimitCard.ProviderLimitCard (cyclomatic 29) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 29) · ×1
  • route.GET (cyclomatic 29) src/app/api/providers/[id]/models/route.js:565 — 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.
D1 · Cyclomatic Complexity · mimoLoginSession.proxyAccountRequest (cyclomatic 29) · ×1
  • mimoLoginSession.proxyAccountRequest (cyclomatic 29) REDACTED: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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Header.getPageInfo (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · chat.handleChat (cyclomatic 29) · ×1
  • chat.handleChat (cyclomatic 29) src/sse/handlers/chat.js:37 — chat.handleChat has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · systemone.handleSystemone (cyclomatic 29) · ×1
  • systemone.handleSystemone (cyclomatic 29) src/sse/handlers/systemone.js:24 — systemone.handleSystemone 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.
D1 · Cyclomatic Complexity · proxyAwareFetch (cyclomatic 29) · ×1
  • proxyAwareFetch (cyclomatic 29) REDACTED:476 — proxyAwareFetch 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.
D1 · Cyclomatic Complexity · getMiniMaxCodeUsage (cyclomatic 29) · ×1
  • getMiniMaxCodeUsage (cyclomatic 29) open-sse/services/minimaxCodeUsage.js:203 — getMiniMaxCodeUsage 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.
D1 · Cyclomatic Complexity · BaseExecutor.execute (cyclomatic 28) · ×1
  • BaseExecutor.execute (cyclomatic 28) open-sse/executors/base.js:100 — BaseExecutor.execute has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · toolCall.ensureToolCallIds (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · commandcode.inspectAndWrapCommandCodeResponse (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · cursorProtobuf.encodeRequest (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · kimchiModels.normalizeKimchiModel (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · WindsurfExecutor.transformToSSE (cyclomatic 28) · ×1
  • 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 items inside it that branch (handleFrame, drainFrames). 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.
D1 · Cyclomatic Complexity · streamHandler.createDisconnectAwareStream (cyclomatic 28) · ×1
  • 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 item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · combo.isZeroContentResponse (cyclomatic 28) · ×1
  • combo.isZeroContentResponse (cyclomatic 28) open-sse/services/combo.js:301 — combo.isZeroContentResponse has cyclomatic complexity 28 (threshold 15). Of this number, 26 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 28) · ×1
  • (anonymous) (cyclomatic 28) src/app/(dashboard)/dashboard/providers/[id]/page.js:317 — (anonymous) has cyclomatic complexity 28 (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.
D1 · Cyclomatic Complexity · ComboCard (cyclomatic 28) · ×1
  • ComboCard (cyclomatic 28) src/app/(dashboard)/dashboard/combos/page.js:658 — ComboCard has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to 15 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.
D1 · Cyclomatic Complexity · getQoderUsage (cyclomatic 28) · ×1
  • getQoderUsage (cyclomatic 28) open-sse/services/usage/misc.js:305 — getQoderUsage has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · POST (cyclomatic 28) · ×1
  • POST (cyclomatic 28) src/app/api/cli-tools/hermes-settings/route.js:193 — POST has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · xaiVideo.run (cyclomatic 27) · ×1
  • 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 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 · opencode.bodyHasSessionHints (cyclomatic 27) · ×1
  • opencode.bodyHasSessionHints (cyclomatic 27) open-sse/executors/opencode.js:230 — 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.
D1 · Cyclomatic Complexity · kiroModels.resolveKiroModels (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · ApiKeySelect.ApiKeySelect (cyclomatic 27) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · SttExampleCard.SttExampleCard · ×1
  • SttExampleCard.SttExampleCard::handleRun (cyclomatic 27) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:78 — SttExampleCard.SttExampleCard::handleRun has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (SttExampleCard.SttExampleCard) 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.
D1 · Cyclomatic Complexity · CustomConfigCard.CustomConfigCard (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · ModelsCard.ModelsCard (cyclomatic 27) · ×1
  • ModelsCard.ModelsCard (cyclomatic 27) src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:113 — 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 items inside it that branch (a function literal at line 125, handleTestModel, handleSetAlias, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · route.forwardGeminiNativeRequest (cyclomatic 27) · ×1
  • route.forwardGeminiNativeRequest (cyclomatic 27) REDACTED:239 — route.forwardGeminiNativeRequest 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.
D1 · Cyclomatic Complexity · dashboardGuard.proxy (cyclomatic 27) · ×1
  • dashboardGuard.proxy (cyclomatic 27) src/dashboardGuard.js:211 — 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.
D1 · Cyclomatic Complexity · EditConnectionModal.EditConnectionModal (cyclomatic 27) · ×1
  • EditConnectionModal.EditConnectionModal (cyclomatic 27) src/shared/components/EditConnectionModal.js:12 — EditConnectionModal.EditConnectionModal has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EditConnectionModal.EditConnectionModal::handleSubmit) 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.
D1 · Cyclomatic Complexity · flattenToolHistory (cyclomatic 27) · ×1
  • flattenToolHistory (cyclomatic 27) open-sse/services/combo.js:44 — 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 47, 53, 46, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · extractClientToolResults (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 27) · ×1
  • (anonymous) (cyclomatic 27) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:106 — (anonymous) has cyclomatic complexity 27 (threshold 15). Of this number, 18 points are the body's own statements and 9 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.
D1 · Cyclomatic Complexity · handleRun (cyclomatic 27) · ×1
  • handleRun (cyclomatic 27) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:78 — handleRun has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MediaProviderKindPage (cyclomatic 27) · ×1
  • 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 (a function literal at line 159, handleCreateCombo, a function literal at line 149, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · thoughtSignatureStore.getGeminiThoughtSignature (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · awsEventStream.parseEventFrame (cyclomatic 26) · ×1
  • awsEventStream.parseEventFrame (cyclomatic 26) open-sse/utils/awsEventStream.js:38 — awsEventStream.parseEventFrame has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · openai-responses.openaiToOpenAIResponsesResponse (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · deepseek-web.messagesToPrompt (cyclomatic 26) · ×1
  • deepseek-web.messagesToPrompt (cyclomatic 26) open-sse/executors/deepseek-web.js:513 — deepseek-web.messagesToPrompt 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.
D1 · Cyclomatic Complexity · bypassHandler.handleBypassRequest (cyclomatic 26) · ×1
  • 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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gitDiff.gitDiff (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · minimax.getMiniMaxUsage (cyclomatic 26) · ×1
  • minimax.getMiniMaxUsage (cyclomatic 26) open-sse/services/usage/minimax.js:133 — minimax.getMiniMaxUsage 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.
D1 · Cyclomatic Complexity · zed.parseZedAuthenticatedUserUsage (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · commandcode.getCommandCodeUsage (cyclomatic 26) · ×1
  • commandcode.getCommandCodeUsage (cyclomatic 26) open-sse/services/usage/commandcode.js:81 — commandcode.getCommandCodeUsage has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · route.probeMediaProvider (cyclomatic 26) · ×1
  • route.probeMediaProvider (cyclomatic 26) REDACTED:55 — 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.
D1 · Cyclomatic Complexity · zedCredentials.readLinuxCredentials (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · Header.Header (cyclomatic 26) · ×1
  • Header.Header (cyclomatic 26) src/shared/components/Header.js:182 — Header.Header has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 195, a function literal at line 247, handleLogout). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · normalizeGrokCliInputItem (cyclomatic 26) · ×1
  • normalizeGrokCliInputItem (cyclomatic 26) REDACTED: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.
D1 · Cyclomatic Complexity · transcribeElevenLabs (cyclomatic 26) · ×1
  • transcribeElevenLabs (cyclomatic 26) open-sse/handlers/sttCore.js:144 — transcribeElevenLabs has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · handleSttCore (cyclomatic 26) · ×1
  • handleSttCore (cyclomatic 26) open-sse/handlers/sttCore.js:287 — handleSttCore has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · cli.killAllAppProcesses (cyclomatic 25) · ×1
  • cli.killAllAppProcesses (cyclomatic 25) REDACTED:285 — cli.killAllAppProcesses has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 301, 327, 286, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · kiroExternalIdp.normalizeKiroExternalIdpAuth (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · CursorExecutor.transformProtobufToJSON (cyclomatic 25) · ×1
  • CursorExecutor.transformProtobufToJSON (cyclomatic 25) REDACTED:1073 — 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.
D1 · Cyclomatic Complexity · headroom.collectToolOutputText (cyclomatic 25) · ×1
  • headroom.collectToolOutputText (cyclomatic 25) open-sse/rtk/headroom.js:109 — headroom.collectToolOutputText has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to one function item inside it that branches (visit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · page.ComboFormModal (cyclomatic 25) · ×1
  • page.ComboFormModal (cyclomatic 25) src/app/(dashboard)/dashboard/combos/page.js:1180 — 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 items inside it that branch (handleDragEnd, fetchModalData, validateName, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AddCompatibleModal.AddCompatibleModal (cyclomatic 25) · ×1
  • 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 items inside it that branch (handleSubmit, renderValidationResult, a function literal at line 54, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 25) · ×1
  • route.GET (cyclomatic 25) REDACTED: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.
D1 · Cyclomatic Complexity · route.PUT (cyclomatic 25) · ×1
  • route.PUT (cyclomatic 25) src/app/api/providers/[id]/route.js:81 — route.PUT has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · appUpdater.collectAppPids (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · usageRepo.saveRequestUsage (cyclomatic 25) · ×1
  • usageRepo.saveRequestUsage (cyclomatic 25) src/lib/db/repos/usageRepo.js:243 — 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 258). 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.
D1 · Cyclomatic Complexity · embeddings.handleEmbeddings (cyclomatic 25) · ×1
  • embeddings.handleEmbeddings (cyclomatic 25) src/sse/handlers/embeddings.js:33 — embeddings.handleEmbeddings 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.
D1 · Cyclomatic Complexity · imageGeneration.handleSingleModelImage (cyclomatic 25) · ×1
  • imageGeneration.handleSingleModelImage (cyclomatic 25) src/sse/handlers/imageGeneration.js:97 — imageGeneration.handleSingleModelImage has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · handleImportQoderModels (cyclomatic 25) · ×1
  • handleImportQoderModels (cyclomatic 25) src/app/(dashboard)/dashboard/providers/[id]/page.js:607 — handleImportQoderModels has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · renderModelsSection (cyclomatic 25) · ×1
  • renderModelsSection (cyclomatic 25) src/app/(dashboard)/dashboard/providers/[id]/page.js:1190 — 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.
D1 · Cyclomatic Complexity · buildToolConversationPrompt (cyclomatic 25) · ×1
  • buildToolConversationPrompt (cyclomatic 25) REDACTED:139 — buildToolConversationPrompt 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.
D1 · Cyclomatic Complexity · socksFetch (cyclomatic 25) · ×1
  • socksFetch (cyclomatic 25) REDACTED: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.
D1 · Cyclomatic Complexity · execute (cyclomatic 25) · ×1
  • execute (cyclomatic 25) open-sse/executors/muse-web.js:481 — execute has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 8 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · flattenMessages (cyclomatic 25) · ×1
  • flattenMessages (cyclomatic 25) open-sse/executors/chatgpt-web/adapter.js:177 — flattenMessages 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.
D1 · Cyclomatic Complexity · extractAnswer (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · createDisconnectAwareStream · ×1
  • 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.
D1 · Cyclomatic Complexity · xaiVideo.parseArgs (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · claude.anchorClaudeCache (cyclomatic 24) · ×1
  • claude.anchorClaudeCache (cyclomatic 24) open-sse/translator/formats/claude.js:395 — 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.
D1 · Cyclomatic Complexity · antigravity-to-openai.antigravityToOpenAIRequest (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · openai-to-ollama.normalizeMessages (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · devin-cli.resolveWorkspaceCwd (cyclomatic 24) · ×1
  • 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 items inside it that branch (scanMessages, push, scanText). 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.
D1 · Cyclomatic Complexity · qoder.buildQoderRequestBody (cyclomatic 24) · ×1
  • qoder.buildQoderRequestBody (cyclomatic 24) REDACTED:242 — qoder.buildQoderRequestBody has cyclomatic complexity 24 (threshold 15). Of this number, 19 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.
D1 · Cyclomatic Complexity · muse-web.pollChat (cyclomatic 24) · ×1
  • muse-web.pollChat (cyclomatic 24) open-sse/executors/muse-web.js:237 — muse-web.pollChat 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.
D1 · Cyclomatic Complexity · claudeMessage.openAICompletionToClaudeMessage (cyclomatic 24) · ×1
  • claudeMessage.openAICompletionToClaudeMessage (cyclomatic 24) open-sse/translator/concerns/claudeMessage.js:15 — claudeMessage.openAICompletionToClaudeMessage 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.
D1 · Cyclomatic Complexity · AddCustomModelModal.AddCustomModelModal (cyclomatic 24) · ×1
  • AddCustomModelModal.AddCustomModelModal (cyclomatic 24) src/app/(dashboard)/dashboard/providers/[id]/AddCustomModelModal.js:10 — AddCustomModelModal.AddCustomModelModal has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · page.getConnectionErrorTag (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · route.transformOpenAISSEToGeminiSSE (cyclomatic 24) · ×1
  • route.transformOpenAISSEToGeminiSSE (cyclomatic 24) REDACTED:433 — 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.
D1 · Cyclomatic Complexity · cloudflared.spawnQuickTunnel (cyclomatic 24) · ×1
  • 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 items inside it that branch (a function literal at line 374, a function literal at line 338, a function literal at line 313, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · tts.handleSingleModelTts (cyclomatic 24) · ×1
  • tts.handleSingleModelTts (cyclomatic 24) src/sse/handlers/tts.js:73 — tts.handleSingleModelTts 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.
D1 · Cyclomatic Complexity · runImageConversation (cyclomatic 24) · ×1
  • runImageConversation (cyclomatic 24) open-sse/executors/chatgpt-web/imageGen.js:77 — runImageConversation has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 82, (anonymous)::readBody, (anonymous)::addUnique, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · extractAnswer (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · DELETE (cyclomatic 24) · ×1
  • DELETE (cyclomatic 24) src/app/api/cli-tools/hermes-settings/route.js:270 — DELETE 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.
D1 · Cyclomatic Complexity · uc-web (cyclomatic 24) · ×1
  • uc-web (cyclomatic 24) open-sse/services/webIdentity.js:178 — uc-web 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.
D1 · Cyclomatic Complexity · image.isPrivateIp (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · index.translateRequest (cyclomatic 23) · ×1
  • index.translateRequest (cyclomatic 23) open-sse/translator/index.js:69 — index.translateRequest 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.
D1 · Cyclomatic Complexity · sse.createQoderSseCoalescer.handleInner (cyclomatic 23) · ×1
  • sse.createQoderSseCoalescer.handleInner (cyclomatic 23) open-sse/shared/qoder/sse.js:149 — sse.createQoderSseCoalescer.handleInner 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.
D1 · Cyclomatic Complexity · KiroExecutor.runIntegrityRecovery (cyclomatic 23) · ×1
  • KiroExecutor.runIntegrityRecovery (cyclomatic 23) open-sse/executors/kiro.js:444 — 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.
D1 · Cyclomatic Complexity · OpenCodeExecutor.transformRequest (cyclomatic 23) · ×1
  • OpenCodeExecutor.transformRequest (cyclomatic 23) open-sse/executors/opencode.js:421 — OpenCodeExecutor.transformRequest 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.
D1 · Cyclomatic Complexity · PerplexityWebExecutor.execute (cyclomatic 23) · ×1
  • PerplexityWebExecutor.execute (cyclomatic 23) REDACTED: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.
D1 · Cyclomatic Complexity · index.tryDedicatedProvider (cyclomatic 23) · ×1
  • index.tryDedicatedProvider (cyclomatic 23) open-sse/handlers/search/index.js:65 — index.tryDedicatedProvider 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.
D1 · Cyclomatic Complexity · systemoneCore.handleSystemoneCore (cyclomatic 23) · ×1
  • systemoneCore.handleSystemoneCore (cyclomatic 23) open-sse/handlers/systemoneCore.js:33 — systemoneCore.handleSystemoneCore 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.
D1 · Cyclomatic Complexity · AutoPingScheduleModal.AutoPingScheduleModal (cyclomatic 23) · ×1
  • AutoPingScheduleModal.AutoPingScheduleModal (cyclomatic 23) src/app/(dashboard)/dashboard/providers/[id]/AutoPingScheduleModal.js:31 — AutoPingScheduleModal.AutoPingScheduleModal has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · base.pipeTransformedSSE (cyclomatic 23) · ×1
  • base.pipeTransformedSSE (cyclomatic 23) REDACTED:78 — base.pipeTransformedSSE 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.
D1 · Cyclomatic Complexity · NoAuthProxyCard.NoAuthProxyCard (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · fetch.handleSingleProviderFetch (cyclomatic 23) · ×1
  • fetch.handleSingleProviderFetch (cyclomatic 23) src/sse/handlers/fetch.js:119 — 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.
D1 · Cyclomatic Complexity · search.handleSingleProviderSearch (cyclomatic 23) · ×1
  • search.handleSingleProviderSearch (cyclomatic 23) src/sse/handlers/search.js:99 — 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.
D1 · Cyclomatic Complexity · inspectFirstPartyAsset (cyclomatic 23) · ×1
  • inspectFirstPartyAsset (cyclomatic 23) REDACTED:219 — inspectFirstPartyAsset 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.
D1 · Cyclomatic Complexity · parseToolCallsFromText (cyclomatic 23) · ×1
  • parseToolCallsFromText (cyclomatic 23) open-sse/translator/webTools.js:427 — parseToolCallsFromText 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.
D1 · Cyclomatic Complexity · parseResponse (cyclomatic 23) · ×1
  • parseResponse (cyclomatic 23) open-sse/handlers/imageProviders/codex.js:402 — parseResponse has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · executeExecutorDrivenVideo (cyclomatic 23) · ×1
  • executeExecutorDrivenVideo (cyclomatic 23) open-sse/handlers/videoCore.js:26 — executeExecutorDrivenVideo has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gemini.convertOpenAIContentToParts (cyclomatic 22) · ×1
  • gemini.convertOpenAIContentToParts (cyclomatic 22) open-sse/translator/formats/gemini.js:67 — 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.
D1 · Cyclomatic Complexity · kiroConversation.reconcileToolPair (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ollama-to-openai.ollamaToOpenAIResponse (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · grok-web-tools.adaptArguments (cyclomatic 22) · ×1
  • grok-web-tools.adaptArguments (cyclomatic 22) open-sse/executors/grok-web-tools.js:294 — grok-web-tools.adaptArguments 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.
D1 · Cyclomatic Complexity · headroom.collectKiroHeadroomMessages (cyclomatic 22) · ×1
  • headroom.collectKiroHeadroomMessages (cyclomatic 22) open-sse/rtk/headroom.js:217 — 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 items inside it that branch (visit, toToolCalls, a function literal at line 232, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · pxpipe.compressWithPxpipe (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · embeddingsCore.handleEmbeddingsCore (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · chatSearch.handleChatSearch (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · kiro.getKiroUsage (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · codebuddy-cn.getCodeBuddyUsage (cyclomatic 22) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · xiaomi-mimo.getXiaomiMimoUsage (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · cursor.getCursorUsage (cyclomatic 22) · ×1
  • cursor.getCursorUsage (cyclomatic 22) open-sse/services/usage/cursor.js:174 — cursor.getCursorUsage 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.
D1 · Cyclomatic Complexity · page.CapacityAdapterCap (cyclomatic 22) · ×1
  • page.CapacityAdapterCap (cyclomatic 22) src/app/(dashboard)/dashboard/combos/page.js:904 — 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 items inside it that branch (a function literal at line 997, handleAdd, handleDeselect, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · EndpointPageClient.APIPageClient · ×1
  • EndpointPageClient.APIPageClient::handleConnectTailscale (cyclomatic 22) REDACTED:489 — EndpointPageClient.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. This shape REPEATS in the file: one other method here (EndpointPageClient.APIPageClient) 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.
D1 · Cyclomatic Complexity · page.ComboDetailPage (cyclomatic 22) · ×1
  • page.ComboDetailPage (cyclomatic 22) src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:47 — page.ComboDetailPage has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (page.ComboDetailPage::handleTest) 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.
D1 · Cyclomatic Complexity · ConnectionsCard.AddApiKeyModal (cyclomatic 22) · ×1
  • ConnectionsCard.AddApiKeyModal (cyclomatic 22) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:198 — 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 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 · route.fetchAll (cyclomatic 22) · ×1
  • route.fetchAll (cyclomatic 22) REDACTED: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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 22) · ×1
  • route.POST (cyclomatic 22) REDACTED: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.
D1 · Cyclomatic Complexity · route.PATCH (cyclomatic 22) · ×1
  • route.PATCH (cyclomatic 22) REDACTED: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.
D1 · Cyclomatic Complexity · route.refreshAndUpdateCredentials (cyclomatic 22) · ×1
  • route.refreshAndUpdateCredentials (cyclomatic 22) REDACTED:25 — 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.
D1 · Cyclomatic Complexity · usageRepo.aggregateEntryToDay (cyclomatic 22) · ×1
  • usageRepo.aggregateEntryToDay (cyclomatic 22) src/lib/db/repos/usageRepo.js:65 — 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.
D1 · Cyclomatic Complexity · requestDetailsRepo.getObservabilityConfig (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · CursorAuthModal.CursorAuthModal (cyclomatic 22) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · ProfilePage · ×1
  • 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.
D1 · Cyclomatic Complexity · execute (cyclomatic 22) · ×1
  • execute (cyclomatic 22) REDACTED:360 — execute 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.
D1 · Cyclomatic Complexity · transformOpenAISSEToGeminiSSE · ×1
  • transformOpenAISSEToGeminiSSE::transform (cyclomatic 22) REDACTED:442 — 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.
D1 · Cyclomatic Complexity · handleFetchCore (cyclomatic 22) · ×1
  • handleFetchCore (cyclomatic 22) open-sse/handlers/fetch/index.js:94 — handleFetchCore 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.
D1 · Cyclomatic Complexity · custom-server.http.createServer (cyclomatic 21) · ×1
  • 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 items inside it that branch (wrapped, a function literal at line 81, a function literal at line 94, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · oauthCredentialManager.mergeRefreshedCredentials (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · gemini.flattenTypeArrays (cyclomatic 21) · ×1
  • gemini.flattenTypeArrays (cyclomatic 21) open-sse/translator/formats/gemini.js:310 — gemini.flattenTypeArrays 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.
D1 · Cyclomatic Complexity · gemini.cleanJSONSchemaForAntigravity (cyclomatic 21) · ×1
  • gemini.cleanJSONSchemaForAntigravity (cyclomatic 21) open-sse/translator/formats/gemini.js:439 — gemini.cleanJSONSchemaForAntigravity has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (cleanupRequired, addPlaceholders). 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.
D1 · Cyclomatic Complexity · migrate.importLegacyUsage (cyclomatic 21) · ×1
  • migrate.importLegacyUsage (cyclomatic 21) REDACTED: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.
D1 · Cyclomatic Complexity · imageGen.downloadGeneratedImage (cyclomatic 21) · ×1
  • imageGen.downloadGeneratedImage (cyclomatic 21) open-sse/executors/chatgpt-web/imageGen.js:305 — imageGen.downloadGeneratedImage has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 308, 344). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · index.translateResponse (cyclomatic 21) · ×1
  • index.translateResponse (cyclomatic 21) open-sse/translator/index.js:184 — index.translateResponse 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.
D1 · Cyclomatic Complexity · domCapture.waitForGeminiReply (cyclomatic 21) · ×1
  • domCapture.waitForGeminiReply (cyclomatic 21) open-sse/executors/gemini-web/domCapture.js:50 — domCapture.waitForGeminiReply 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.
D1 · Cyclomatic Complexity · gemini-web.buildGeminiToolPrompt (cyclomatic 21) · ×1
  • gemini-web.buildGeminiToolPrompt (cyclomatic 21) open-sse/executors/gemini-web.js:160 — gemini-web.buildGeminiToolPrompt has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GrokCliExecutor.buildHeaders (cyclomatic 21) · ×1
  • GrokCliExecutor.buildHeaders (cyclomatic 21) REDACTED: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.
D1 · Cyclomatic Complexity · grok-web-tools.mapNativeToolCard (cyclomatic 21) · ×1
  • grok-web-tools.mapNativeToolCard (cyclomatic 21) open-sse/executors/grok-web-tools.js:376 — grok-web-tools.mapNativeToolCard has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · requestDetail.extractUsageFromResponse (cyclomatic 21) · ×1
  • requestDetail.extractUsageFromResponse (cyclomatic 21) open-sse/handlers/chatCore/requestDetail.js:24 — requestDetail.extractUsageFromResponse 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.
D1 · Cyclomatic Complexity · clientDetector.detectClientTool (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · gitLog.gitLog (cyclomatic 21) · ×1
  • gitLog.gitLog (cyclomatic 21) open-sse/rtk/filters/gitLog.js:6 — gitLog.gitLog has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kimi.formatKimiUsageError (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · ollamaTransform.transformToOllama (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · ModelAvailabilityBadge.ModelAvailabilityBadge (cyclomatic 21) · ×1
  • 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 items inside it that branch (a function literal at line 87, a function literal at line 29, a function literal at line 51, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 21) · ×1
  • route.GET (cyclomatic 21) REDACTED: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.
D1 · Cyclomatic Complexity · providers.buildProviderEntry (cyclomatic 21) · ×1
  • providers.buildProviderEntry (cyclomatic 21) src/shared/constants/providers.js:13 — providers.buildProviderEntry 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.
D1 · Cyclomatic Complexity · base.pipeTransformedEventStream (cyclomatic 21) · ×1
  • base.pipeTransformedEventStream (cyclomatic 21) REDACTED:157 — base.pipeTransformedEventStream 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.
D1 · Cyclomatic Complexity · (anonymous) · ×1
  • (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.
D1 · Cyclomatic Complexity · extractAnswer (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · fetchQoderCatalogRaw (cyclomatic 21) · ×1
  • fetchQoderCatalogRaw (cyclomatic 21) open-sse/services/qoderModels.js:205 — fetchQoderCatalogRaw 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.
D1 · Cyclomatic Complexity · getMiniMaxCodeMembership (cyclomatic 21) · ×1
  • getMiniMaxCodeMembership (cyclomatic 21) open-sse/services/minimaxCodeUsage.js:117 — getMiniMaxCodeMembership 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.
D1 · Cyclomatic Complexity · pollToken (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · fetchClaudeUsageRaw (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · input.selectMenu (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · build-cli.buildCliPackage (cyclomatic 20) · ×1
  • build-cli.buildCliPackage (cyclomatic 20) cli/scripts/build-cli.js:182 — build-cli.buildCliPackage has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · server.startZedProxy (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · AntigravityExecutor.cloakTools (cyclomatic 20) · ×1
  • AntigravityExecutor.cloakTools (cyclomatic 20) open-sse/executors/antigravity.js:493 — 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.
D1 · Cyclomatic Complexity · gemini-to-openai.convertGeminiContent (cyclomatic 20) · ×1
  • gemini-to-openai.convertGeminiContent (cyclomatic 20) open-sse/translator/request/gemini-to-openai.js:76 — gemini-to-openai.convertGeminiContent 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.
D1 · Cyclomatic Complexity · openai-responses.buildReasoningInputItem (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · grok-web-tools.buildGrokMessage (cyclomatic 20) · ×1
  • grok-web-tools.buildGrokMessage (cyclomatic 20) open-sse/executors/grok-web-tools.js:226 — grok-web-tools.buildGrokMessage 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.
D1 · Cyclomatic Complexity · grok-web-tools.defaultRequiredValue (cyclomatic 20) · ×1
  • grok-web-tools.defaultRequiredValue (cyclomatic 20) open-sse/executors/grok-web-tools.js:273 — grok-web-tools.defaultRequiredValue 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.
D1 · Cyclomatic Complexity · attachments.rewriteQoderMessageAttachments (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · VertexExecutor.buildUrl (cyclomatic 20) · ×1
  • VertexExecutor.buildUrl (cyclomatic 20) open-sse/executors/vertex.js:67 — VertexExecutor.buildUrl 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.
D1 · Cyclomatic Complexity · combo.handleFusionChat (cyclomatic 20) · ×1
  • combo.handleFusionChat (cyclomatic 20) open-sse/services/combo.js:820 — 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.
D1 · Cyclomatic Complexity · BulkImportCodexModal.BulkImportCodexModal (cyclomatic 20) · ×1
  • 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 items inside it that branch (handleSubmit, handleClose). 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.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 20) · ×1
  • route.GET (cyclomatic 20) REDACTED: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.
D1 · Cyclomatic Complexity · tailscale.startDaemonWithPassword (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · kiro.convertUserInputMessage (cyclomatic 20) · ×1
  • kiro.convertUserInputMessage (cyclomatic 20) REDACTED: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.
D1 · Cyclomatic Complexity · tokenRefresh.updateProviderCredentials (cyclomatic 20) · ×1
  • tokenRefresh.updateProviderCredentials (cyclomatic 20) src/sse/services/tokenRefresh.js:167 — tokenRefresh.updateProviderCredentials 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.
D1 · Cyclomatic Complexity · renderServerLogin (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · renderGuideSteps (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · kiroToClaudeNonStreaming (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · proxyFetch.fetchWithTlsFallback (cyclomatic 19) · ×1
  • proxyFetch.fetchWithTlsFallback (cyclomatic 19) REDACTED:380 — proxyFetch.fetchWithTlsFallback 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.
D1 · Cyclomatic Complexity · providers.refreshTraeToken (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · gemini.mergeAllOf (cyclomatic 19) · ×1
  • gemini.mergeAllOf (cyclomatic 19) open-sse/translator/formats/gemini.js:218 — 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.
D1 · Cyclomatic Complexity · gemini.normalizeGeminiContents (cyclomatic 19) · ×1
  • gemini.normalizeGeminiContents (cyclomatic 19) open-sse/translator/formats/gemini.js:565 — gemini.normalizeGeminiContents has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chatHttp.flattenMessages (cyclomatic 19) · ×1
  • chatHttp.flattenMessages (cyclomatic 19) open-sse/executors/chatgpt-web/chatHttp.js:54 — chatHttp.flattenMessages 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.
D1 · Cyclomatic Complexity · codexToolSchema.stripNode (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · gemini-to-openai.geminiToOpenAIRequest (cyclomatic 19) · ×1
  • gemini-to-openai.geminiToOpenAIRequest (cyclomatic 19) open-sse/translator/request/gemini-to-openai.js:9 — gemini-to-openai.geminiToOpenAIRequest 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.
D1 · Cyclomatic Complexity · CursorExecutor.openAgentHttp2Stream (cyclomatic 19) · ×1
  • CursorExecutor.openAgentHttp2Stream (cyclomatic 19) REDACTED:542 — 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 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 · qoderModels.routableQoderModels (cyclomatic 19) · ×1
  • qoderModels.routableQoderModels (cyclomatic 19) open-sse/services/qoderModels.js:365 — qoderModels.routableQoderModels 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.
D1 · Cyclomatic Complexity · perplexity-web.readPplxSseEvents (cyclomatic 19) · ×1
  • perplexity-web.readPplxSseEvents (cyclomatic 19) REDACTED:92 — perplexity-web.readPplxSseEvents has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · uc-web.aspectFor (cyclomatic 19) · ×1
  • uc-web.aspectFor (cyclomatic 19) open-sse/executors/uc-web.js:247 — uc-web.aspectFor has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ls.ls (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · autodetect.autoDetectFilter (cyclomatic 19) · ×1
  • autodetect.autoDetectFilter (cyclomatic 19) REDACTED: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.
D1 · Cyclomatic Complexity · accountFallback.checkFallbackError (cyclomatic 19) · ×1
  • accountFallback.checkFallbackError (cyclomatic 19) open-sse/services/accountFallback.js:29 — 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.
D1 · Cyclomatic Complexity · systemoneRouter.extractPromptState (cyclomatic 19) · ×1
  • systemoneRouter.extractPromptState (cyclomatic 19) open-sse/services/systemoneRouter.js:27 — systemoneRouter.extractPromptState 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.
D1 · Cyclomatic Complexity · copilotModels.resolveCopilotModels (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · clinepass.getClinepassUsage (cyclomatic 19) · ×1
  • clinepass.getClinepassUsage (cyclomatic 19) open-sse/services/usage/clinepass.js:54 — clinepass.getClinepassUsage 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.
D1 · Cyclomatic Complexity · page.MediaProviderCard (cyclomatic 19) · ×1
  • 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 items inside it that branch (renderStatus, a function literal at line 28, a function literal at line 27, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ModelRow.ModelRow (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 19) · ×1
  • route.POST (cyclomatic 19) REDACTED:27 — route.POST 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.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 19) · ×1
  • route.GET (cyclomatic 19) REDACTED:21 — route.GET has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · usageRepo.getActiveRequests (cyclomatic 19) · ×1
  • usageRepo.getActiveRequests (cyclomatic 19) src/lib/db/repos/usageRepo.js:198 — 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 220, 229). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · mimoLoginSession.parseSetCookie (cyclomatic 19) · ×1
  • mimoLoginSession.parseSetCookie (cyclomatic 19) REDACTED: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.
D1 · Cyclomatic Complexity · manager.stopServer (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · GitLabAuthModal.GitLabAuthModal (cyclomatic 19) · ×1
  • 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 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.
D1 · Cyclomatic Complexity · KiroSocialOAuthModal.KiroSocialOAuthModal (cyclomatic 19) · ×1
  • 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 items inside it that branch (handleManualSubmit, a function literal at line 30, a function literal at line 27, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · modelSearchFilter.matchesSearch (cyclomatic 19) · ×1
  • modelSearchFilter.matchesSearch (cyclomatic 19) REDACTED:111 — modelSearchFilter.matchesSearch 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.
D1 · Cyclomatic Complexity · extractAnswer (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · getGrokCliUsage (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · normalizeXquik (cyclomatic 19) · ×1
  • normalizeXquik (cyclomatic 19) open-sse/handlers/search/normalizers.js:215 — 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 2 function literals inside it that branch (lines 218, 230). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · isPrivateAddress (cyclomatic 19) · ×1
  • isPrivateAddress (cyclomatic 19) open-sse/executors/veoaifree-web.js:22 — isPrivateAddress 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.
D1 · Cyclomatic Complexity · connect.parseArgs (cyclomatic 18) · ×1
  • connect.parseArgs (cyclomatic 18) REDACTED:52 — connect.parseArgs has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · DefaultExecutor.applyNousAttribution (cyclomatic 18) · ×1
  • DefaultExecutor.applyNousAttribution (cyclomatic 18) open-sse/executors/default.js:118 — DefaultExecutor.applyNousAttribution has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · imageSniff.jpegDimensions (cyclomatic 18) · ×1
  • imageSniff.jpegDimensions (cyclomatic 18) open-sse/executors/chatgpt-web/imageSniff.js:45 — imageSniff.jpegDimensions 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.
D1 · Cyclomatic Complexity · webTools.findBareJsonCandidates (cyclomatic 18) · ×1
  • webTools.findBareJsonCandidates (cyclomatic 18) open-sse/translator/webTools.js:270 — webTools.findBareJsonCandidates 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.
D1 · Cyclomatic Complexity · CodeBuddyIntlExecutor.transformRequest (cyclomatic 18) · ×1
  • CodeBuddyIntlExecutor.transformRequest (cyclomatic 18) open-sse/executors/codebuddy-intl.js:16 — CodeBuddyIntlExecutor.transformRequest has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · claude.capCacheControlBlocks (cyclomatic 18) · ×1
  • 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 item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · streamHelpers.hasValuableContent (cyclomatic 18) · ×1
  • streamHelpers.hasValuableContent (cyclomatic 18) open-sse/utils/streamHelpers.js:42 — 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.
D1 · Cyclomatic Complexity · kiroConversation.normalizeTurns (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · session.renewSession (cyclomatic 18) · ×1
  • session.renewSession (cyclomatic 18) open-sse/executors/muse-web/session.js:134 — session.renewSession 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.
D1 · Cyclomatic Complexity · VeoAiFreeWebExecutor.generateMedia (cyclomatic 18) · ×1
  • VeoAiFreeWebExecutor.generateMedia (cyclomatic 18) open-sse/executors/veoaifree-web.js:172 — VeoAiFreeWebExecutor.generateMedia 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. This is NOT this file's highest cyclomatic complexity: veoaifree-web.isPrivateAddress (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · zed.wrapZedCompletionStream (cyclomatic 18) · ×1
  • 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 items inside it that branch (processLine, 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.
D1 · Cyclomatic Complexity · codex.getCodexReviewRateLimit (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · BasicChatPageClient.BasicChatPageClient (cyclomatic 18) · ×1
  • BasicChatPageClient.BasicChatPageClient (cyclomatic 18) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:169 — BasicChatPageClient.BasicChatPageClient has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (BasicChatPageClient.BasicChatPageClient::sendMessage) 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.
D1 · Cyclomatic Complexity · MitmPageClient.MitmPageClient (cyclomatic 18) · ×1
  • 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 items inside it that branch (fetchConnections, fetchApiKeys, fetchAliases, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ModelsCard.ModelRow (cyclomatic 18) · ×1
  • ModelsCard.ModelRow (cyclomatic 18) src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:13 — 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.
D1 · Cyclomatic Complexity · ProviderTopology.buildLayout (cyclomatic 18) · ×1
  • 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 items inside it that branch (a function literal at line 301, edgeStyle). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ProviderTopology.ProviderTopology (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · route.probeMcp (cyclomatic 18) · ×1
  • route.probeMcp (cyclomatic 18) REDACTED: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.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 18) · ×1
  • route.GET (cyclomatic 18) REDACTED: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.
D1 · Cyclomatic Complexity · usageRepo.trackPendingRequest (cyclomatic 18) · ×1
  • usageRepo.trackPendingRequest (cyclomatic 18) src/lib/db/repos/usageRepo.js:154 — 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.
D1 · Cyclomatic Complexity · requestDetailsRepo.flushToDatabase (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · PricingModal.PricingModal (cyclomatic 18) · ×1
  • 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 items inside it that branch (handleReset, loadPricing, handlePricingChange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · UsageStats.sortData (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · providerCustomModels.getProviderCustomModelRows (cyclomatic 18) · ×1
  • providerCustomModels.getProviderCustomModelRows (cyclomatic 18) src/shared/utils/providerCustomModels.js:13 — 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.
D1 · Cyclomatic Complexity · auth.clearAccountError (cyclomatic 18) · ×1
  • auth.clearAccountError (cyclomatic 18) src/sse/services/auth.js:306 — 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.
D1 · Cyclomatic Complexity · fetch.handleFetch (cyclomatic 18) · ×1
  • fetch.handleFetch (cyclomatic 18) src/sse/handlers/fetch.js:25 — fetch.handleFetch 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.
D1 · Cyclomatic Complexity · backgroundTokenRefresh.runBackgroundTokenRefreshTick (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 18) · ×1
  • (anonymous) (cyclomatic 18) src/app/(dashboard)/dashboard/providers/[id]/page.js:493 — (anonymous) has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 511, 523, 510, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · handleImportClineModels (cyclomatic 18) · ×1
  • handleImportClineModels (cyclomatic 18) src/app/(dashboard)/dashboard/providers/[id]/page.js:682 — 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.
D1 · Cyclomatic Complexity · wrapQoderSSE · ×1
  • wrapQoderSSE::start (cyclomatic 18) REDACTED:572 — 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.
D1 · Cyclomatic Complexity · handleTest (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · markAccountUnavailable (cyclomatic 18) · ×1
  • markAccountUnavailable (cyclomatic 18) src/sse/services/auth.js:247 — 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.
D1 · Cyclomatic Complexity · parseClaudeResetGrants (cyclomatic 18) · ×1
  • parseClaudeResetGrants (cyclomatic 18) open-sse/services/usage/claude.js:158 — parseClaudeResetGrants has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · settings.showSettingsMenu (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · pricing.calculateCostFromTokens (cyclomatic 17) · ×1
  • pricing.calculateCostFromTokens (cyclomatic 17) REDACTED:475 — 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.
D1 · Cyclomatic Complexity · index.backfillCodexEmails (cyclomatic 17) · ×1
  • index.backfillCodexEmails (cyclomatic 17) src/lib/oauth/providers/index.js:232 — 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.
D1 · Cyclomatic Complexity · migrate.runMigrationOnce (cyclomatic 17) · ×1
  • migrate.runMigrationOnce (cyclomatic 17) REDACTED: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.
D1 · Cyclomatic Complexity · image.fetchImageAsBase64 (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · CodexExecutor._peekSseTransientError (cyclomatic 17) · ×1
  • CodexExecutor._peekSseTransientError (cyclomatic 17) open-sse/executors/codex.js:330 — 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.
D1 · Cyclomatic Complexity · claude.fixToolUseOrdering (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · opencodeFingerprint.applyEnvFingerprint (cyclomatic 17) · ×1
  • opencodeFingerprint.applyEnvFingerprint (cyclomatic 17) open-sse/utils/opencodeFingerprint.js:367 — opencodeFingerprint.applyEnvFingerprint has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · error.parseUpstreamError (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · grok-web.buildNonStreamingResponse (cyclomatic 17) · ×1
  • grok-web.buildNonStreamingResponse (cyclomatic 17) REDACTED:308 — grok-web.buildNonStreamingResponse 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.
D1 · Cyclomatic Complexity · queue.parseQoderQueueInfo (cyclomatic 17) · ×1
  • queue.parseQoderQueueInfo (cyclomatic 17) open-sse/shared/qoder/queue.js:118 — queue.parseQoderQueueInfo 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.
D1 · Cyclomatic Complexity · OpenCodeZenExecutor.transformRequest (cyclomatic 17) · ×1
  • OpenCodeZenExecutor.transformRequest (cyclomatic 17) open-sse/executors/opencode-zen.js:296 — 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.
D1 · Cyclomatic Complexity · prompt.contentToText (cyclomatic 17) · ×1
  • prompt.contentToText (cyclomatic 17) open-sse/executors/muse-web/prompt.js:19 — prompt.contentToText 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.
D1 · Cyclomatic Complexity · streamToJsonConverter.processSSEMessage (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · streamingHandler.handleStreamingResponse (cyclomatic 17) · ×1
  • streamingHandler.handleStreamingResponse (cyclomatic 17) open-sse/handlers/chatCore/streamingHandler.js:51 — streamingHandler.handleStreamingResponse 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · minimax.minimaxTts (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · capacityAdapter.stripHistoryForContext (cyclomatic 17) · ×1
  • capacityAdapter.stripHistoryForContext (cyclomatic 17) open-sse/services/capacityAdapter.js:118 — capacityAdapter.stripHistoryForContext has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
D1 · Cyclomatic Complexity · page.ComboDetailPage · ×1
  • page.ComboDetailPage::handleTest (cyclomatic 17) src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:172 — page.ComboDetailPage::handleTest has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: one other method here (page.ComboDetailPage) 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.
D1 · Cyclomatic Complexity · utils.sortVisibleConnections (cyclomatic 17) · ×1
  • 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 items inside it that branch (a function literal at line 87, a function literal at line 58, getEarliestResetTime, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · route.PATCH (cyclomatic 17) · ×1
  • route.PATCH (cyclomatic 17) REDACTED: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.
D1 · Cyclomatic Complexity · route.POST (cyclomatic 17) · ×1
  • 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 item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · route.comboSeatLimits (cyclomatic 17) · ×1
  • route.comboSeatLimits (cyclomatic 17) REDACTED:290 — 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.
D1 · Cyclomatic Complexity · tailscale.startLogin (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · tailscale.startFunnel (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · DonateModal.DonateModal (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · EditConnectionModal.EditConnectionModal · ×1
  • EditConnectionModal.EditConnectionModal::handleSubmit (cyclomatic 17) src/shared/components/EditConnectionModal.js:139 — EditConnectionModal.EditConnectionModal::handleSubmit has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EditConnectionModal.EditConnectionModal) 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.
D1 · Cyclomatic Complexity · SmartPolicyModal.SmartPolicyModal (cyclomatic 17) · ×1
  • SmartPolicyModal.SmartPolicyModal (cyclomatic 17) src/shared/components/SmartPolicyModal.js:10 — SmartPolicyModal.SmartPolicyModal has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 21, a function literal at line 97, handleSave, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · systemoneRouter.resolveSmartChoice (cyclomatic 17) · ×1
  • systemoneRouter.resolveSmartChoice (cyclomatic 17) src/sse/services/systemoneRouter.js:29 — systemoneRouter.resolveSmartChoice 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.
D1 · Cyclomatic Complexity · search.handleSearch (cyclomatic 17) · ×1
  • search.handleSearch (cyclomatic 17) src/sse/handlers/search.js:24 — search.handleSearch 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.
D1 · Cyclomatic Complexity · tts.handleTts (cyclomatic 17) · ×1
  • tts.handleTts (cyclomatic 17) src/sse/handlers/tts.js:22 — tts.handleTts 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.
D1 · Cyclomatic Complexity · extractPanelText (cyclomatic 17) · ×1
  • extractPanelText (cyclomatic 17) open-sse/services/combo.js:663 — 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.
D1 · Cyclomatic Complexity · getRecentLogs (cyclomatic 17) · ×1
  • getRecentLogs (cyclomatic 17) src/lib/db/repos/usageRepo.js:785 — 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 801). 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.
D1 · Cyclomatic Complexity · parsePartialChatGptWebFirstPartyModuleContract (cyclomatic 17) · ×1
  • parsePartialChatGptWebFirstPartyModuleContract (cyclomatic 17) REDACTED:85 — parsePartialChatGptWebFirstPartyModuleContract 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.
D1 · Cyclomatic Complexity · refreshNousToken (cyclomatic 17) · ×1
  • refreshNousToken (cyclomatic 17) open-sse/services/tokenRefresh/providers.js:772 — refreshNousToken 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 3 function literals inside it that branch (lines 774, 792, 830). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · emitToolCall (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · normalizeResponsesUsage (cyclomatic 17) · ×1
  • normalizeResponsesUsage (cyclomatic 17) open-sse/handlers/imageProviders/codex.js:158 — normalizeResponsesUsage 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.
D1 · Cyclomatic Complexity · startSessionLogin (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · resolveZedModels (cyclomatic 17) · ×1
  • 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 · parseSttBlock (cyclomatic 17) · ×1
  • parseSttBlock (cyclomatic 17) REDACTED:165 — parseSttBlock 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.
D1 · Cyclomatic Complexity · downloadGeneratedImage (cyclomatic 17) · ×1
  • downloadGeneratedImage (cyclomatic 17) open-sse/executors/chatgpt-web/imageGenHttp.js:248 — downloadGeneratedImage 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.
D1 · Cyclomatic Complexity · xaiVideo.pollUntilDone (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · tray.killTray (cyclomatic 16) · ×1
  • tray.killTray (cyclomatic 16) REDACTED:334 — 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 items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · cli.killProxyByPidFile (cyclomatic 16) · ×1
  • cli.killProxyByPidFile (cyclomatic 16) REDACTED:390 — 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.
D1 · Cyclomatic Complexity · index.pollForToken (cyclomatic 16) · ×1
  • index.pollForToken (cyclomatic 16) src/lib/oauth/providers/index.js:173 — 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.
D1 · Cyclomatic Complexity · gemini.flattenAnyOfOneOf (cyclomatic 16) · ×1
  • gemini.flattenAnyOfOneOf (cyclomatic 16) open-sse/translator/formats/gemini.js:279 — 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.
D1 · Cyclomatic Complexity · AntigravityExecutor.parseError (cyclomatic 16) · ×1
  • AntigravityExecutor.parseError (cyclomatic 16) open-sse/executors/antigravity.js:119 — AntigravityExecutor.parseError 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.
D1 · Cyclomatic Complexity · codex.findNestedMessage (cyclomatic 16) · ×1
  • codex.findNestedMessage (cyclomatic 16) open-sse/executors/codex.js:154 — 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.
D1 · Cyclomatic Complexity · openai-to-claude.openaiToClaudeRequestForAntigravity (cyclomatic 16) · ×1
  • openai-to-claude.openaiToClaudeRequestForAntigravity (cyclomatic 16) open-sse/translator/request/openai-to-claude.js:368 — 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.
D1 · Cyclomatic Complexity · kiroConversation.validateKiroConversation (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · usageTracking.logUsage (cyclomatic 16) · ×1
  • usageTracking.logUsage (cyclomatic 16) open-sse/utils/usageTracking.js:409 — 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.
D1 · Cyclomatic Complexity · webCookieAuth.parseJsonCookiesToHeader (cyclomatic 16) · ×1
  • webCookieAuth.parseJsonCookiesToHeader (cyclomatic 16) open-sse/utils/webCookieAuth.js:25 — webCookieAuth.parseJsonCookiesToHeader 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.
D1 · Cyclomatic Complexity · grok-web.extractContent (cyclomatic 16) · ×1
  • grok-web.extractContent (cyclomatic 16) REDACTED:167 — grok-web.extractContent 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.
D1 · Cyclomatic Complexity · qoderModels.resolveQoderModels (cyclomatic 16) · ×1
  • qoderModels.resolveQoderModels (cyclomatic 16) open-sse/services/qoderModels.js:301 — 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.
D1 · Cyclomatic Complexity · sse.canonicalizeQoderUsage (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · systemInject.injectSystemPrompt (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · systemInject.injectClaudeSystem (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · normalizers.normalizeXquik.results (cyclomatic 16) · ×1
  • normalizers.normalizeXquik.results (cyclomatic 16) open-sse/handlers/search/normalizers.js:218 — normalizers.normalizeXquik.results 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.
D1 · Cyclomatic Complexity · vertex.toVertexBody (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · codex.getCodexSparkRateLimit (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · deepseek.getDeepseekUsage (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · opencode-go.getOpenCodeGoUsage (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · opencode-zen.getOpenCodeZenUsage (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · glm.parseGlmQuotaResponse (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · page.ApiKeyProviderCard (cyclomatic 16) · ×1
  • page.ApiKeyProviderCard (cyclomatic 16) REDACTED:813 — 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 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 · route.PUT (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · route.probeWebProvider (cyclomatic 16) · ×1
  • route.probeWebProvider (cyclomatic 16) REDACTED:20 — 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.
D1 · Cyclomatic Complexity · route.GET (cyclomatic 16) · ×1
  • route.GET (cyclomatic 16) REDACTED: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.
D1 · Cyclomatic Complexity · ttsVoices.listTtsVoices (cyclomatic 16) · ×1
  • ttsVoices.listTtsVoices (cyclomatic 16) src/lib/ttsVoices.js:15 — ttsVoices.listTtsVoices 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.
D1 · Cyclomatic Complexity · manager.enableTailscale (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · proxy.proxy (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · LanguageSwitcher.LanguageSwitcher (cyclomatic 16) · ×1
  • 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 5 function items inside it that branch (setIsOpen, handleSetLocale, a function literal at line 81, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · UsageStats.groupDataByKey (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · coworkPlugins.buildManagedMcpServers (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · modelSearchFilter.parseSearchQuery (cyclomatic 16) · ×1
  • modelSearchFilter.parseSearchQuery (cyclomatic 16) REDACTED:21 — modelSearchFilter.parseSearchQuery 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.
D1 · Cyclomatic Complexity · serializeDeepSeekToolPrompt (cyclomatic 16) · ×1
  • serializeDeepSeekToolPrompt (cyclomatic 16) REDACTED:60 — serializeDeepSeekToolPrompt 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.
D1 · Cyclomatic Complexity · ProviderTestResultsView (cyclomatic 16) · ×1
  • ProviderTestResultsView (cyclomatic 16) REDACTED:952 — 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.
D1 · Cyclomatic Complexity · submitConversationRequest (cyclomatic 16) · ×1
  • submitConversationRequest (cyclomatic 16) REDACTED:818 — submitConversationRequest has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 820, 851). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · resolveKiroThinkingBudget (cyclomatic 16) · ×1
  • resolveKiroThinkingBudget (cyclomatic 16) open-sse/config/kiroConstants.js:215 — 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.
D1 · Cyclomatic Complexity · acquireBrowserContext (cyclomatic 16) · ×1
  • acquireBrowserContext (cyclomatic 16) open-sse/services/browserPool.js:339 — acquireBrowserContext has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 360, 378, 380, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · parseMembership (cyclomatic 16) · ×1
  • parseMembership (cyclomatic 16) open-sse/services/minimaxCodeUsage.js:96 — parseMembership has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · stream.createSSEStream (cognitive 319) · ×1
  • stream.createSSEStream (cognitive 319) open-sse/utils/stream.js:47 — stream.createSSEStream has cognitive complexity 319 (threshold 15). Drivers by points: if/else 82 (223 pts), boolean chains 47, loops 12 (38 pts), ternaries 4 (6 pts), error handling 2 (5 pts) (nesting depth added 172). Of this number, 300 points are the body's own statements and 19 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · getUsageStats (cognitive 275) · ×1
  • getUsageStats (cognitive 275) src/lib/db/repos/usageRepo.js:348 — getUsageStats has cognitive complexity 275 (threshold 15). Drivers by points: if/else 38 (114 pts), boolean chains 92, ternaries 12 (37 pts), loops 15 (29 pts), error handling 3 (nesting depth added 115). Of this number, 264 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.
D2 · Cognitive Complexity · ProviderLimits (cognitive 270) · ×1
  • ProviderLimits (cognitive 270) REDACTED:156 — ProviderLimits has cognitive complexity 270 (threshold 15). Drivers by points: if/else 63 (87 pts), boolean chains 82, ternaries 59 (60 pts), error handling 18 (21 pts), loops 4 (12 pts), other 8 (nesting depth added 36). Of this number, 46 points are the body's own statements and 224 belong to 121 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.
D2 · Cognitive Complexity · parseQuotaData (cognitive 257) · ×1
  • parseQuotaData (cognitive 257) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:362 — parseQuotaData has cognitive complexity 257 (threshold 15). Drivers by points: boolean chains 117, if/else 48 (99 pts), ternaries 9 (30 pts), other 9, error handling 1, match/switch 1 (nesting depth added 72). Of this number, 97 points are the body's own statements and 160 belong to 43 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.
D2 · Cognitive Complexity · handleChatCore (cognitive 218) · ×1
  • handleChatCore (cognitive 218) open-sse/handlers/chatCore.js:64 — handleChatCore has cognitive complexity 218 (threshold 15). Drivers by points: if/else 60 (88 pts), boolean chains 67, ternaries 19 (36 pts), error handling 14 (27 pts) (nesting depth added 58). Of this number, 208 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.
D2 · Cognitive Complexity · buildModelsList (cognitive 214) · ×1
  • buildModelsList (cognitive 214) REDACTED:330 — buildModelsList has cognitive complexity 214 (threshold 15). Drivers by points: if/else 44 (142 pts), boolean chains 40, loops 9 (16 pts), error handling 6 (9 pts), ternaries 2 (7 pts) (nesting depth added 113). Of this number, 173 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.
D2 · Cognitive Complexity · handleComboChat (cognitive 201) · ×1
  • handleComboChat (cognitive 201) open-sse/services/combo.js:354 — handleComboChat has cognitive complexity 201 (threshold 15). Drivers by points: if/else 48 (120 pts), boolean chains 35, error handling 8 (26 pts), ternaries 6 (18 pts), loops 1, other 1 (nesting depth added 102). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · openaiToGeminiBase (cognitive 184) · ×1
  • openaiToGeminiBase (cognitive 184) open-sse/translator/request/openai-to-gemini.js:77 — openaiToGeminiBase has cognitive complexity 184 (threshold 15). Drivers by points: if/else 35 (112 pts), boolean chains 27, loops 7 (23 pts), ternaries 4 (21 pts), other 1 (nesting depth added 110). Of this number, 182 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · page.ProxyPoolsPage (cognitive 179) · ×1
  • page.ProxyPoolsPage (cognitive 179) REDACTED:31 — page.ProxyPoolsPage has cognitive complexity 179 (threshold 15). Drivers by points: if/else 52 (59 pts), ternaries 32 (51 pts), boolean chains 43, error handling 15 (20 pts), loops 5 (6 pts) (nesting depth added 32). Of this number, 32 points are the body's own statements and 147 belong to 31 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · ModelSelectModal (cognitive 179) · ×1
  • ModelSelectModal (cognitive 179) REDACTED:75 — ModelSelectModal has cognitive complexity 179 (threshold 15). Drivers by points: if/else 52 (74 pts), boolean chains 65, ternaries 26 (33 pts), error handling 5, loops 2 (nesting depth added 29). Most of this is not in the body itself: 11 of the 179 points are its own statements and the rest belongs to 103 function items inside it that branch (a function literal at line 286, a function literal at line 525, a function literal at line 481, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · execute (cognitive 160) · ×1
  • 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 (a function literal at line 600, a function literal at line 777, start::finish, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · prepareClaudeRequest (cognitive 152) · ×1
  • prepareClaudeRequest (cognitive 152) open-sse/translator/formats/claude.js:495 — prepareClaudeRequest has cognitive complexity 152 (threshold 15). Drivers by points: if/else 36 (103 pts), boolean chains 28, loops 5 (18 pts), ternaries 1 (2 pts), other 1 (nesting depth added 81). Of this number, 135 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.
D2 · Cognitive Complexity · convertMessages (cognitive 152) · ×1
  • 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.
D2 · Cognitive Complexity · TokenSaverClient.TokenSaverClient (cognitive 149) · ×1
  • TokenSaverClient.TokenSaverClient (cognitive 149) src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13 — TokenSaverClient.TokenSaverClient has cognitive complexity 149 (threshold 15). Drivers by points: ternaries 33 (72 pts), boolean chains 40, if/else 22 (24 pts), error handling 13 (nesting depth added 41). Of this number, 91 points are the body's own statements and 58 belong to 28 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deepseek-web.transformSSE (cognitive 147) · ×1
  • deepseek-web.transformSSE (cognitive 147) open-sse/executors/deepseek-web.js:150 — deepseek-web.transformSSE has cognitive complexity 147 (threshold 15). Drivers by points: if/else 39 (98 pts), loops 7 (26 pts), boolean chains 19, error handling 2 (4 pts) (nesting depth added 80). Of this number, 124 points are the body's own statements and 23 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.
D2 · Cognitive Complexity · startServer (cognitive 143) · ×1
  • 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.
D2 · Cognitive Complexity · applyFormat (cognitive 142) · ×1
  • applyFormat (cognitive 142) open-sse/translator/concerns/thinkingUnified.js:266 — applyFormat has cognitive complexity 142 (threshold 15). Drivers by points: if/else 28 (55 pts), ternaries 23 (50 pts), boolean chains 34, other 2, match/switch 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.
D2 · Cognitive Complexity · collectSSEContent (cognitive 139) · ×1
  • collectSSEContent (cognitive 139) open-sse/executors/deepseek-web.js:347 — collectSSEContent has cognitive complexity 139 (threshold 15). Drivers by points: if/else 36 (90 pts), loops 7 (26 pts), boolean chains 20, error handling 1 (3 pts) (nesting depth added 75). Of this number, 118 points are the body's own statements and 21 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.
D2 · Cognitive Complexity · POST (cognitive 137) · ×1
  • POST (cognitive 137) REDACTED:93 — POST has cognitive complexity 137 (threshold 15). Drivers by points: if/else 41 (64 pts), boolean chains 36, ternaries 13 (26 pts), error handling 6 (10 pts), match/switch 1 (nesting depth added 40). Of this number, 129 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · executeAgent (cognitive 132) · ×1
  • executeAgent (cognitive 132) REDACTED:636 — executeAgent has cognitive complexity 132 (threshold 15). Drivers by points: if/else 51 (97 pts), boolean chains 19, error handling 6 (7 pts), ternaries 3 (5 pts), loops 3 (4 pts) (nesting depth added 50). Of this number, 30 points are the body's own statements and 102 belong to 17 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · convertClaudeMessagesToKiro (cognitive 132) · ×1
  • 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.
D2 · Cognitive Complexity · route.POST (cognitive 128) · ×1
  • route.POST (cognitive 128) REDACTED:317 — route.POST has cognitive complexity 128 (threshold 15). Drivers by points: if/else 30 (56 pts), ternaries 13 (34 pts), boolean chains 22, error handling 7 (16 pts) (nesting depth added 56). Of this number, 127 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.
D2 · Cognitive Complexity · transformSSE · ×1
  • transformSSE::start (cognitive 124) open-sse/executors/deepseek-web.js:163 — transformSSE::start has cognitive complexity 124 (threshold 15). Drivers by points: if/else 25 (83 pts), loops 7 (26 pts), boolean chains 11, error handling 2 (4 pts) (nesting depth added 79). 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.
D2 · Cognitive Complexity · openaiResponsesToOpenAIRequest (cognitive 123) · ×1
  • 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.
D2 · Cognitive Complexity · HermesToolCard.HermesToolCard (cognitive 119) · ×1
  • HermesToolCard.HermesToolCard (cognitive 119) src/app/(dashboard)/dashboard/cli-tools/components/HermesToolCard.js:15 — HermesToolCard.HermesToolCard has cognitive complexity 119 (threshold 15). Drivers by points: boolean chains 58, if/else 34 (40 pts), ternaries 8 (12 pts), error handling 7, loops 1 (2 pts) (nesting depth added 11). Of this number, 34 points are the body's own statements and 85 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.
D2 · Cognitive Complexity · parseStream (cognitive 119) · ×1
  • parseStream (cognitive 119) open-sse/handlers/imageProviders/codex.js:187 — parseStream has cognitive complexity 119 (threshold 15). Drivers by points: if/else 19 (57 pts), error handling 7 (23 pts), boolean chains 19, loops 5 (14 pts), ternaries 1 (5 pts), other 1 (nesting depth added 67). Of this number, 114 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.
D2 · Cognitive Complexity · GenericCliToolCard (cognitive 117) · ×1
  • GenericCliToolCard (cognitive 117) src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:44 — GenericCliToolCard has cognitive complexity 117 (threshold 15). Drivers by points: if/else 31 (45 pts), boolean chains 41, ternaries 19 (21 pts), error handling 6 (7 pts), match/switch 2, other 1 (nesting depth added 17). Of this number, 31 points are the body's own statements and 86 belong to 59 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.
D2 · Cognitive Complexity · execute (cognitive 115) · ×1
  • execute (cognitive 115) REDACTED:663 — execute has cognitive complexity 115 (threshold 15). Drivers by points: if/else 25 (54 pts), boolean chains 26, error handling 11 (20 pts), ternaries 5 (12 pts), other 2, loops 1 (nesting depth added 45). Of this number, 60 points are the body's own statements and 55 belong to 12 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 · page.ProviderDetailPage (cognitive 113) · ×1
  • page.ProviderDetailPage (cognitive 113) src/app/(dashboard)/dashboard/providers/[id]/page.js:50 — page.ProviderDetailPage has cognitive complexity 113 (threshold 15). Drivers by points: boolean chains 141, if/else 106 (135 pts), ternaries 49 (80 pts), error handling 29 (32 pts), loops 10 (13 pts) (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (page.ProviderDetailPage::handleImportQoderModels, page.ProviderDetailPage::handleImportClineModels) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · route.GET (cognitive 111) · ×1
  • route.GET (cognitive 111) REDACTED:95 — route.GET has cognitive complexity 111 (threshold 15). Drivers by points: if/else 48 (78 pts), ternaries 8 (20 pts), boolean chains 7, error handling 3 (6 pts) (nesting depth added 45). Of this number, 109 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.
D2 · Cognitive Complexity · wrapInCloudCodeEnvelopeForClaude (cognitive 110) · ×1
  • wrapInCloudCodeEnvelopeForClaude (cognitive 110) open-sse/translator/request/openai-to-gemini.js:379 — 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.
D2 · Cognitive Complexity · ProvidersPage (cognitive 109) · ×1
  • ProvidersPage (cognitive 109) REDACTED:99 — ProvidersPage has cognitive complexity 109 (threshold 15). Drivers by points: boolean chains 40, ternaries 34 (35 pts), if/else 21 (22 pts), other 10, error handling 2 (nesting depth added 2). Of this number, 23 points are the body's own statements and 86 belong to 72 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.
D2 · Cognitive Complexity · extractContent (cognitive 104) · ×1
  • extractContent (cognitive 104) REDACTED: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.
D2 · Cognitive Complexity · transformEventStreamToSSE · ×1
  • transformEventStreamToSSE::processEvent (cognitive 101) open-sse/executors/kiro.js:799 — 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.
D2 · Cognitive Complexity · normalizeClaudePassthrough (cognitive 101) · ×1
  • normalizeClaudePassthrough (cognitive 101) open-sse/translator/formats/claude.js:221 — normalizeClaudePassthrough has cognitive complexity 101 (threshold 15). Drivers by points: if/else 23 (57 pts), ternaries 6 (18 pts), boolean chains 12, loops 5 (11 pts), other 3 (nesting depth added 52). Of this number, 86 points are the body's own statements and 15 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.
D2 · Cognitive Complexity · responsesTransformer.createResponsesApiTransformStream (cognitive 100) · ×1
  • 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 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 · pollConversationImages (cognitive 100) · ×1
  • pollConversationImages (cognitive 100) open-sse/executors/chatgpt-web/imageGen.js:193 — pollConversationImages has cognitive complexity 100 (threshold 15). Drivers by points: if/else 23 (58 pts), loops 7 (18 pts), boolean chains 17, ternaries 1 (4 pts), error handling 1 (2 pts), other 1 (nesting depth added 50). Of this number, 30 points are the body's own statements and 70 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nonStreamingHandler.translateNonStreamingResponse (cognitive 97) · ×1
  • nonStreamingHandler.translateNonStreamingResponse (cognitive 97) open-sse/handlers/chatCore/nonStreamingHandler.js:97 — 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.
D2 · Cognitive Complexity · ConnectionRow (cognitive 97) · ×1
  • ConnectionRow (cognitive 97) src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:10 — ConnectionRow has cognitive complexity 97 (threshold 15). Drivers by points: boolean chains 37, ternaries 33 (35 pts), if/else 21, error handling 1 (2 pts), other 2 (nesting depth added 3). Of this number, 66 points are the body's own statements and 31 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.
D2 · Cognitive Complexity · openai-to-cursor.convertMessages (cognitive 96) · ×1
  • 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 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.
D2 · Cognitive Complexity · auth.getProviderCredentials (cognitive 96) · ×1
  • auth.getProviderCredentials (cognitive 96) src/sse/services/auth.js:28 — auth.getProviderCredentials has cognitive complexity 96 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 43, ternaries 6 (9 pts) (nesting depth added 20). Of this number, 53 points are the body's own statements and 43 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.
D2 · Cognitive Complexity · openai-responses.openaiToOpenAIResponsesRequest (cognitive 95) · ×1
  • 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.
D2 · Cognitive Complexity · page.CombosPage (cognitive 95) · ×1
  • page.CombosPage (cognitive 95) src/app/(dashboard)/dashboard/combos/page.js:69 — page.CombosPage has cognitive complexity 95 (threshold 15). Drivers by points: boolean chains 31, if/else 23 (28 pts), ternaries 18 (23 pts), error handling 10, loops 3 (nesting depth added 10). Most of this is not in the body itself: 14 of the 95 points are its own statements and the rest belongs to 28 function items inside it that branch (handleGeneratePresets, fetchData, handleBulkSetStrategy, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · imageGenerationCore.handleImageGenerationCore (cognitive 94) · ×1
  • imageGenerationCore.handleImageGenerationCore (cognitive 94) open-sse/handlers/imageGenerationCore.js:30 — imageGenerationCore.handleImageGenerationCore has cognitive complexity 94 (threshold 15). Drivers by points: if/else 21 (34 pts), ternaries 8 (26 pts), error handling 8 (18 pts), boolean chains 16 (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · selectModelFromList (cognitive 94) · ×1
  • 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.
D2 · Cognitive Complexity · selectableModels.buildModelGroups (cognitive 93) · ×1
  • selectableModels.buildModelGroups (cognitive 93) src/shared/utils/selectableModels.js:60 — selectableModels.buildModelGroups has cognitive complexity 93 (threshold 15). Drivers by points: boolean chains 36, if/else 21 (36 pts), ternaries 8 (20 pts), loops 1 (nesting depth added 27). Most of this is not in the body itself: 7 of the 93 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 145, a function literal at line 340, a function literal at line 328, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · sseToJsonHandler.handleForcedSSEToJson (cognitive 90) · ×1
  • sseToJsonHandler.handleForcedSSEToJson (cognitive 90) open-sse/handlers/chatCore/sseToJsonHandler.js:189 — sseToJsonHandler.handleForcedSSEToJson has cognitive complexity 90 (threshold 15). Drivers by points: boolean chains 38, if/else 16 (25 pts), ternaries 9 (22 pts), error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 24). Of this number, 86 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.
D2 · Cognitive Complexity · createResponsesApiTransformStream · ×1
  • 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.
D2 · Cognitive Complexity · claude-to-openai.claudeToOpenAIResponse (cognitive 89) · ×1
  • claude-to-openai.claudeToOpenAIResponse (cognitive 89) open-sse/translator/response/claude-to-openai.js:19 — claude-to-openai.claudeToOpenAIResponse has cognitive complexity 89 (threshold 15). Drivers by points: if/else 20 (43 pts), ternaries 9 (25 pts), boolean chains 20, 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.
D2 · Cognitive Complexity · paramSupport.stripUnsupportedParams (cognitive 88) · ×1
  • paramSupport.stripUnsupportedParams (cognitive 88) open-sse/translator/concerns/paramSupport.js:77 — paramSupport.stripUnsupportedParams has cognitive complexity 88 (threshold 15). Drivers by points: if/else 17 (52 pts), loops 7 (19 pts), boolean chains 17 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openaiResponsesToOpenAIResponse (cognitive 88) · ×1
  • 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.
D2 · Cognitive Complexity · execute (cognitive 86) · ×1
  • execute (cognitive 86) open-sse/executors/deepseek-web.js:794 — execute has cognitive complexity 86 (threshold 15). Drivers by points: if/else 22 (40 pts), ternaries 12 (17 pts), error handling 7 (16 pts), boolean chains 10, other 3 (nesting depth added 32). Of this number, 81 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · CodexToolCard.CodexToolCard (cognitive 82) · ×1
  • 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 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.
D2 · Cognitive Complexity · ZedAuthModal (cognitive 82) · ×1
  • 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 (a function literal at line 77, a function literal at line 156, (anonymous)::tick, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ProfilePage (cognitive 77) · ×1
  • ProfilePage (cognitive 77) REDACTED:22 — ProfilePage has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 114, if/else 53 (56 pts), ternaries 49 (56 pts), error handling 25 (26 pts), loops 6, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transformRequest (cognitive 76) · ×1
  • transformRequest (cognitive 76) open-sse/executors/codex.js:414 — 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.
D2 · Cognitive Complexity · openaiToClaudeRequest (cognitive 76) · ×1
  • 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.
D2 · Cognitive Complexity · CoworkToolCard.CoworkToolCard (cognitive 75) · ×1
  • 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 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.
D2 · Cognitive Complexity · GenericExampleCard.GenericExampleCard (cognitive 75) · ×1
  • GenericExampleCard.GenericExampleCard (cognitive 75) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:37 — GenericExampleCard.GenericExampleCard has cognitive complexity 75 (threshold 15). Drivers by points: boolean chains 67, ternaries 34 (57 pts), if/else 29 (47 pts), loops 4 (10 pts), error handling 3 (7 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (GenericExampleCard.GenericExampleCard::handleRun) 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.
D2 · Cognitive Complexity · handleSingleModelChat (cognitive 75) · ×1
  • handleSingleModelChat (cognitive 75) src/sse/handlers/chat.js:193 — handleSingleModelChat has cognitive complexity 75 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 26, ternaries 5 (12 pts), error handling 1 (4 pts), loops 1 (nesting depth added 29). Of this number, 69 points are the body's own statements and 6 belong to 7 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.
D2 · Cognitive Complexity · runConnect (cognitive 74) · ×1
  • runConnect (cognitive 74) REDACTED:273 — runConnect has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (37 pts), loops 7 (10 pts), ternaries 5 (10 pts), boolean chains 9, error handling 3 (7 pts), other 1 (nesting depth added 25). Of this number, 72 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rewriteBlock (cognitive 74) · ×1
  • 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.
D2 · Cognitive Complexity · UsageStats (cognitive 73) · ×1
  • UsageStats (cognitive 73) src/shared/components/UsageStats.js:206 — UsageStats has cognitive complexity 73 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 22, 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 51 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.
D2 · Cognitive Complexity · EndpointPageClient.APIPageClient (cognitive 72) · ×1
  • EndpointPageClient.APIPageClient (cognitive 72) REDACTED:22 — EndpointPageClient.APIPageClient has cognitive complexity 72 (threshold 15). Drivers by points: if/else 86 (149 pts), boolean chains 81, ternaries 32 (70 pts), error handling 22 (34 pts), loops 8 (12 pts) (nesting depth added 117). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (EndpointPageClient.APIPageClient::handleInstallTailscale, EndpointPageClient.APIPageClient::handleConnectTailscale) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ClaudeToolCard.ClaudeToolCard (cognitive 71) · ×1
  • 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 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.
D2 · Cognitive Complexity · OpenClawToolCard.OpenClawToolCard (cognitive 71) · ×1
  • 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 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.
D2 · Cognitive Complexity · OpenCodeToolCard.OpenCodeToolCard (cognitive 70) · ×1
  • 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 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.
D2 · Cognitive Complexity · transformRequest (cognitive 70) · ×1
  • transformRequest (cognitive 70) open-sse/executors/antigravity.js:172 — transformRequest has cognitive complexity 70 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 23, loops 5 (12 pts), ternaries 4 (8 pts) (nesting depth added 22). Of this number, 50 points are the body's own statements and 20 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.
D2 · Cognitive Complexity · convertClaudeMessage (cognitive 67) · ×1
  • convertClaudeMessage (cognitive 67) open-sse/translator/request/claude-to-openai.js:163 — convertClaudeMessage has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (38 pts), ternaries 4 (12 pts), boolean chains 7, loops 2 (7 pts), match/switch 1 (3 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grok-web-tools.toolScore (cognitive 66) · ×1
  • grok-web-tools.toolScore (cognitive 66) open-sse/executors/grok-web-tools.js:323 — grok-web-tools.toolScore has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (54 pts), boolean chains 12 (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.
D2 · Cognitive Complexity · generateMedia (cognitive 66) · ×1
  • generateMedia (cognitive 66) open-sse/executors/uc-web.js:338 — generateMedia has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (28 pts), error handling 6 (13 pts), boolean chains 12, ternaries 9 (12 pts), other 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.
D2 · Cognitive Complexity · getOllamaUsage (cognitive 66) · ×1
  • getOllamaUsage (cognitive 66) open-sse/services/usage/misc.js:70 — getOllamaUsage has cognitive complexity 66 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 10 (20 pts), boolean chains 14, error handling 5 (8 pts), loops 1 (nesting depth added 24). Of this number, 63 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getAntigravityUsage (cognitive 66) · ×1
  • getAntigravityUsage (cognitive 66) open-sse/services/usage/google.js:120 — getAntigravityUsage has cognitive complexity 66 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 21, ternaries 4 (10 pts), other 3, error handling 2, loops 1 (2 pts) (nesting depth added 20). Of this number, 46 points are the body's own statements and 20 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.
D2 · Cognitive Complexity · openai-to-claude.getContentBlocksFromMessage (cognitive 65) · ×1
  • openai-to-claude.getContentBlocksFromMessage (cognitive 65) open-sse/translator/request/openai-to-claude.js:250 — openai-to-claude.getContentBlocksFromMessage has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (46 pts), loops 3 (9 pts), boolean chains 7, 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.
D2 · Cognitive Complexity · index.compressMessages (cognitive 65) · ×1
  • 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.
D2 · Cognitive Complexity · headroom.compressWithHeadroom (cognitive 65) · ×1
  • headroom.compressWithHeadroom (cognitive 65) open-sse/rtk/headroom.js:404 — headroom.compressWithHeadroom has cognitive complexity 65 (threshold 15). Drivers by points: if/else 32 (52 pts), boolean chains 9, ternaries 2 (3 pts), error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DroidToolCard.DroidToolCard (cognitive 65) · ×1
  • 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 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.
D2 · Cognitive Complexity · kiroToClaudeResponse (cognitive 65) · ×1
  • 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.
D2 · Cognitive Complexity · BedrockExecutor.eventStreamToSse (cognitive 64) · ×1
  • BedrockExecutor.eventStreamToSse (cognitive 64) open-sse/executors/bedrock.js:193 — BedrockExecutor.eventStreamToSse has cognitive complexity 64 (threshold 15). Drivers by points: if/else 23 (44 pts), boolean chains 7, error handling 3 (6 pts), ternaries 3 (5 pts), loops 2 (nesting depth added 26). None of this is in the body itself: all 64 points belong to 4 function literals inside it that branch (lines 235, 209, 210, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · JcodeToolCard.JcodeToolCard (cognitive 64) · ×1
  • 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 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.
D2 · Cognitive Complexity · openai-to-claude.openaiToClaudeResponse (cognitive 63) · ×1
  • openai-to-claude.openaiToClaudeResponse (cognitive 63) open-sse/translator/response/openai-to-claude.js:71 — openai-to-claude.openaiToClaudeResponse has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 11, ternaries 5 (9 pts), loops 2 (4 pts) (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.
D2 · Cognitive Complexity · gemini-to-openai.geminiToOpenAIResponse (cognitive 63) · ×1
  • 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.
D2 · Cognitive Complexity · CursorExecutor.transformProtobufToSSE (cognitive 63) · ×1
  • CursorExecutor.transformProtobufToSSE (cognitive 63) REDACTED:1226 — 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.
D2 · Cognitive Complexity · TtsExampleCard.TtsExampleCard (cognitive 63) · ×1
  • TtsExampleCard.TtsExampleCard (cognitive 63) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:53 — TtsExampleCard.TtsExampleCard has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 75, if/else 34 (44 pts), ternaries 24 (39 pts), error handling 2, loops 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TtsExampleCard.TtsExampleCard::openModal) 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.
D2 · Cognitive Complexity · getAntigravityModelQuota (cognitive 63) · ×1
  • getAntigravityModelQuota (cognitive 63) src/sse/services/antigravityQuota.js:75 — getAntigravityModelQuota has cognitive complexity 63 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 14, other 2, ternaries 2, loops 1 (nesting depth added 17). Of this number, 62 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.
D2 · Cognitive Complexity · GrokBuildToolCard.GrokBuildToolCard (cognitive 62) · ×1
  • 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 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.
D2 · Cognitive Complexity · normalizeCodexTools (cognitive 62) · ×1
  • normalizeCodexTools (cognitive 62) open-sse/executors/codex.js:78 — normalizeCodexTools has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 11 (16 pts), boolean chains 14, loops 2 (4 pts) (nesting depth added 19). Most of this is not in the body itself: 14 of the 62 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.
D2 · Cognitive Complexity · handleRun (cognitive 61) · ×1
  • handleRun (cognitive 61) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:158 — 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.
D2 · Cognitive Complexity · kiro-to-openai.kiroToOpenAIResponse (cognitive 60) · ×1
  • 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.
D2 · Cognitive Complexity · AddApiKeyModal.AddApiKeyModal (cognitive 60) · ×1
  • AddApiKeyModal.AddApiKeyModal (cognitive 60) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:11 — AddApiKeyModal.AddApiKeyModal has cognitive complexity 60 (threshold 15). Drivers by points: boolean chains 56, if/else 24 (30 pts), ternaries 16 (25 pts), error handling 5 (7 pts), loops 1 (nesting depth added 17). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: 2 other methods here (AddApiKeyModal.AddApiKeyModal::buildProviderSpecificData, AddApiKeyModal.AddApiKeyModal::handleBulkSubmit) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · QuotaTable.QuotaTable (cognitive 60) · ×1
  • QuotaTable.QuotaTable (cognitive 60) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js:87 — QuotaTable.QuotaTable has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 30 (46 pts), boolean chains 13, if/else 1 (nesting depth added 16). Most of this is not in the body itself: 10 of the 60 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 152, 182). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · parseGrokCliBilling (cognitive 60) · ×1
  • 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.
D2 · Cognitive Complexity · GenericExampleCard.GenericExampleCard · ×1
  • GenericExampleCard.GenericExampleCard::handleRun (cognitive 59) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:158 — GenericExampleCard.GenericExampleCard::handleRun has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 3 (9 pts), error handling 3 (7 pts), boolean chains 6, ternaries 1 (4 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. This shape REPEATS in the file: one other method here (GenericExampleCard.GenericExampleCard) 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.
D2 · Cognitive Complexity · stt.handleStt (cognitive 58) · ×1
  • stt.handleStt (cognitive 58) src/sse/handlers/stt.js:40 — stt.handleStt has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 13, error handling 2 (3 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · extractClientToolResults (cognitive 58) · ×1
  • 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.
D2 · Cognitive Complexity · parseSSEToOpenAIResponse (cognitive 57) · ×1
  • parseSSEToOpenAIResponse (cognitive 57) open-sse/handlers/chatCore/sseToJsonHandler.js:115 — parseSSEToOpenAIResponse has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (38 pts), boolean chains 10, 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.
D2 · Cognitive Complexity · handleNonStreamingResponse (cognitive 57) · ×1
  • handleNonStreamingResponse (cognitive 57) open-sse/handlers/chatCore/nonStreamingHandler.js:237 — handleNonStreamingResponse has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 19, error handling 3 (5 pts), loops 2 (5 pts), ternaries 2 (4 pts) (nesting depth added 15). Of this number, 56 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.
D2 · Cognitive Complexity · kiroConstants.normalizeKiroUpstreamModelId (cognitive 56) · ×1
  • kiroConstants.normalizeKiroUpstreamModelId (cognitive 56) open-sse/config/kiroConstants.js:75 — kiroConstants.normalizeKiroUpstreamModelId has cognitive complexity 56 (threshold 15). Drivers by points: if/else 25 (38 pts), boolean chains 14, ternaries 2 (4 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.
D2 · Cognitive Complexity · GrokWebExecutor.generateMedia (cognitive 56) · ×1
  • GrokWebExecutor.generateMedia (cognitive 56) REDACTED:499 — GrokWebExecutor.generateMedia has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 6 (14 pts), error handling 2 (6 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CopilotToolCard.CopilotToolCard (cognitive 56) · ×1
  • 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 items inside it that branch (handleApply, saveModels, getManualConfigs, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ClineToolCard.ClineToolCard (cognitive 56) · ×1
  • 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 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.
D2 · Cognitive Complexity · sendMessage (cognitive 56) · ×1
  • 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.
D2 · Cognitive Complexity · startServer (cognitive 56) · ×1
  • startServer (cognitive 56) REDACTED:646 — startServer has cognitive complexity 56 (threshold 15). Drivers by points: if/else 27 (37 pts), error handling 7 (10 pts), boolean chains 4, ternaries 2 (3 pts), loops 1, other 1 (nesting depth added 14). Most of this is not in the body itself: 4 of the 56 points are its own statements and the rest belongs to 28 function items inside it that branch (a function literal at line 802, tryRestart, spawnServer, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · parsePlanWindows (cognitive 56) · ×1
  • parsePlanWindows (cognitive 56) open-sse/services/minimaxCodeUsage.js:156 — parsePlanWindows has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 9 (24 pts), if/else 6 (11 pts), boolean chains 10, other 8, loops 2 (3 pts) (nesting depth added 21). Of this number, 55 points are the body's own statements and 1 belongs 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.
D2 · Cognitive Complexity · openai-to-commandcode.convertMessages (cognitive 55) · ×1
  • openai-to-commandcode.convertMessages (cognitive 55) open-sse/translator/request/openai-to-commandcode.js:116 — openai-to-commandcode.convertMessages has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 11, loops 4 (9 pts), ternaries 3 (9 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.
D2 · Cognitive Complexity · antigravity-weekly.parseWeeklyQuotaSummary (cognitive 55) · ×1
  • antigravity-weekly.parseWeeklyQuotaSummary (cognitive 55) open-sse/services/usage/antigravity-weekly.js:56 — 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.
D2 · Cognitive Complexity · index.importDb (cognitive 55) · ×1
  • index.importDb (cognitive 55) src/lib/db/index.js:98 — index.importDb has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 33, loops 9, if/else 4 (7 pts), ternaries 3 (6 pts) (nesting depth added 6). Most of this is not in the body itself: 2 of the 55 points are its own statements and the rest belongs to one function literal inside it that branches (line 104). 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.
D2 · Cognitive Complexity · waitForMedia (cognitive 55) · ×1
  • waitForMedia (cognitive 55) open-sse/executors/muse-web.js:337 — waitForMedia has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 13, ternaries 2 (10 pts), error handling 1 (4 pts), loops 1, other 1 (nesting depth added 25). Of this number, 53 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · normalizeGrokCliTools (cognitive 55) · ×1
  • normalizeGrokCliTools (cognitive 55) REDACTED: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.
D2 · Cognitive Complexity · responsesApi.convertResponsesApiFormat (cognitive 54) · ×1
  • 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.
D2 · Cognitive Complexity · commandcode.inspectAndWrapCommandCodeResponse (cognitive 54) · ×1
  • 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.
D2 · Cognitive Complexity · grok-web.buildStreamingResponse (cognitive 54) · ×1
  • grok-web.buildStreamingResponse (cognitive 54) REDACTED:204 — grok-web.buildStreamingResponse has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 12, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.POST (cognitive 54) · ×1
  • route.POST (cognitive 54) REDACTED: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.
D2 · Cognitive Complexity · AntigravityToolCard.AntigravityToolCard (cognitive 53) · ×1
  • 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 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.
D2 · Cognitive Complexity · page.LoginPage (cognitive 53) · ×1
  • 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 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 · sync.build (cognitive 53) · ×1
  • 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.
D2 · Cognitive Complexity · importLegacyMain (cognitive 53) · ×1
  • importLegacyMain (cognitive 53) REDACTED: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.
D2 · Cognitive Complexity · claudeToOpenAIRequest (cognitive 53) · ×1
  • claudeToOpenAIRequest (cognitive 53) open-sse/translator/request/claude-to-openai.js:14 — claudeToOpenAIRequest has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 4 (13 pts), boolean chains 8, loops 2 (5 pts) (nesting depth added 22). Of this number, 50 points are the body's own statements and 3 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.
D2 · Cognitive Complexity · antigravity-to-openai.convertContent (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · openai-to-antigravity.openaiToAntigravityResponse (cognitive 52) · ×1
  • openai-to-antigravity.openaiToAntigravityResponse (cognitive 52) open-sse/translator/response/openai-to-antigravity.js:10 — 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.
D2 · Cognitive Complexity · gitStatus.gitStatus (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · commandcode-to-openai.commandCodeToOpenAIResponse (cognitive 51) · ×1
  • 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.
D2 · Cognitive Complexity · DeepSeekTuiToolCard.DeepSeekTuiToolCard (cognitive 51) · ×1
  • 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 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.
D2 · Cognitive Complexity · buildOutput.buildOutput (cognitive 50) · ×1
  • 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.
D2 · Cognitive Complexity · ConnectionsCard.ConnectionRow (cognitive 50) · ×1
  • ConnectionsCard.ConnectionRow (cognitive 50) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:34 — 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 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.
D2 · Cognitive Complexity · usageRepo.getChartData (cognitive 50) · ×1
  • usageRepo.getChartData (cognitive 50) src/lib/db/repos/usageRepo.js:675 — 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.
D2 · Cognitive Complexity · buildPromptText (cognitive 50) · ×1
  • 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.
D2 · Cognitive Complexity · flattenMessages (cognitive 50) · ×1
  • flattenMessages (cognitive 50) open-sse/executors/chatgpt-web/adapter.js:177 — flattenMessages has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (27 pts), ternaries 3 (12 pts), boolean chains 6, loops 2 (4 pts), other 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kiroModels.resolveKiroModels (cognitive 49) · ×1
  • 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.
D2 · Cognitive Complexity · page.MediaProviderDetailPage (cognitive 49) · ×1
  • page.MediaProviderDetailPage (cognitive 49) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js:19 — page.MediaProviderDetailPage has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 27, ternaries 7 (11 pts), if/else 10, error handling 1 (nesting depth added 4). Of this number, 40 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · dashboardGuard.proxy (cognitive 49) · ×1
  • dashboardGuard.proxy (cognitive 49) src/dashboardGuard.js:211 — 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.
D2 · Cognitive Complexity · flattenToolHistory (cognitive 49) · ×1
  • flattenToolHistory (cognitive 49) open-sse/services/combo.js:44 — 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). None of this is in the body itself: all 49 points belong to 5 function literals inside it that branch (lines 47, 53, 46, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · createProviderConnection (cognitive 49) · ×1
  • 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). None of this is in the body itself: all 49 points belong 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.
D2 · Cognitive Complexity · transcribeGeminiLive (cognitive 49) · ×1
  • 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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · KiloToolCard.KiloToolCard (cognitive 48) · ×1
  • 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 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.
D2 · Cognitive Complexity · route.POST (cognitive 48) · ×1
  • route.POST (cognitive 48) REDACTED: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.
D2 · Cognitive Complexity · execute (cognitive 48) · ×1
  • execute (cognitive 48) open-sse/executors/gemini-web.js:420 — execute has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 13, error handling 6 (9 pts), ternaries 3 (6 pts) (nesting depth added 10). Of this number, 38 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KiroAuthModal (cognitive 48) · ×1
  • 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.
D2 · Cognitive Complexity · BaseExecutor.execute (cognitive 47) · ×1
  • BaseExecutor.execute (cognitive 47) open-sse/executors/base.js:100 — BaseExecutor.execute has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 9, ternaries 4 (9 pts), error handling 1 (2 pts), loops 1 (nesting depth added 20). Of this number, 39 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionsCard.ConnectionsCard (cognitive 47) · ×1
  • ConnectionsCard.ConnectionsCard (cognitive 47) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:299 — ConnectionsCard.ConnectionsCard has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 16, if/else 13, ternaries 8 (10 pts), error handling 8 (nesting depth added 2). Most of this is not in the body itself: 6 of the 47 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 310, saveStrategy, a function literal at line 411, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PxpipeClient.PxpipeClient (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · extractCall (cognitive 47) · ×1
  • extractCall (cognitive 47) REDACTED:367 — extractCall has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (27 pts), ternaries 7 (8 pts), boolean chains 6, loops 1 (3 pts), other 3 (nesting depth added 12). Of this number, 45 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent 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 · extractThinking (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · handleVideoProxyCore (cognitive 47) · ×1
  • handleVideoProxyCore (cognitive 47) open-sse/handlers/videoCore.js:151 — handleVideoProxyCore has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (19 pts), error handling 6 (12 pts), boolean chains 10, ternaries 6 (nesting depth added 12). Of this number, 39 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · CursorExecutor.transformProtobufToJSON (cognitive 46) · ×1
  • CursorExecutor.transformProtobufToJSON (cognitive 46) REDACTED:1073 — 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.
D2 · Cognitive Complexity · TraeExecutor.execute (cognitive 46) · ×1
  • 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 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 · MitmServerCard.MitmServerCard (cognitive 46) · ×1
  • 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 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.
D2 · Cognitive Complexity · checkAndRefreshToken (cognitive 46) · ×1
  • checkAndRefreshToken (cognitive 46) src/sse/services/tokenRefresh.js:229 — 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.
D2 · Cognitive Complexity · runChatGptWebHttpTurn (cognitive 46) · ×1
  • runChatGptWebHttpTurn (cognitive 46) open-sse/executors/chatgpt-web/chatHttp.js:163 — runChatGptWebHttpTurn has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (23 pts), error handling 4 (8 pts), ternaries 4 (7 pts), boolean chains 6, loops 1, other 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolCall.ensureToolCallIds (cognitive 45) · ×1
  • 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.
D2 · Cognitive Complexity · gitDiff.gitDiff (cognitive 45) · ×1
  • 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.
D2 · Cognitive Complexity · base.pipeTransformedSSE (cognitive 45) · ×1
  • base.pipeTransformedSSE (cognitive 45) REDACTED:78 — base.pipeTransformedSSE has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (9 pts), ternaries 2 (6 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buildToolConversationPrompt (cognitive 45) · ×1
  • buildToolConversationPrompt (cognitive 45) REDACTED:139 — buildToolConversationPrompt has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (25 pts), ternaries 3 (11 pts), boolean chains 4, loops 2 (4 pts), other 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · antigravity-to-openai.antigravityToOpenAIRequest (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · deepseek-web.messagesToPrompt (cognitive 44) · ×1
  • deepseek-web.messagesToPrompt (cognitive 44) open-sse/executors/deepseek-web.js:513 — deepseek-web.messagesToPrompt has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 5 (11 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 20). Of this number, 39 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.
D2 · Cognitive Complexity · SttExampleCard.SttExampleCard (cognitive 44) · ×1
  • SttExampleCard.SttExampleCard (cognitive 44) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:11 — SttExampleCard.SttExampleCard has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 41, ternaries 20 (21 pts), if/else 12, 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. This shape REPEATS in the file: one other method here (SttExampleCard.SttExampleCard::handleRun) 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.
D2 · Cognitive Complexity · buildHeaders (cognitive 44) · ×1
  • buildHeaders (cognitive 44) open-sse/executors/default.js:206 — 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.
D2 · Cognitive Complexity · MitmToolCard (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · base.pipeTransformedEventStream (cognitive 43) · ×1
  • base.pipeTransformedEventStream (cognitive 43) REDACTED:157 — base.pipeTransformedEventStream has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (9 pts), ternaries 2 (6 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XiaomiMimoAuthModal.XiaomiMimoAuthModal (cognitive 43) · ×1
  • 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 items inside it that branch (startSessionLogin, handleImportLocal, renderServerLogin, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · proxyAwareFetch (cognitive 43) · ×1
  • proxyAwareFetch (cognitive 43) REDACTED:476 — proxyAwareFetch has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 9, error handling 4 (9 pts), ternaries 3 (4 pts), other 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.
D2 · Cognitive Complexity · convertOpenAIToKiro (cognitive 43) · ×1
  • convertOpenAIToKiro (cognitive 43) REDACTED: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.
D2 · Cognitive Complexity · McpMarketplaceModal (cognitive 43) · ×1
  • 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 (a function literal at line 144, a function literal at line 38, fetchTools, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · claude.anchorClaudeCache (cognitive 42) · ×1
  • claude.anchorClaudeCache (cognitive 42) open-sse/translator/formats/claude.js:395 — 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.
D2 · Cognitive Complexity · qoder.normalizeContent (cognitive 42) · ×1
  • qoder.normalizeContent (cognitive 42) REDACTED:95 — 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 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 · ollamaTransform.transformToOllama (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · route.GET (cognitive 42) · ×1
  • route.GET (cognitive 42) REDACTED:17 — route.GET has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 17, if/else 7 (12 pts), ternaries 4 (8 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 12). Of this number, 40 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.
D2 · Cognitive Complexity · transformRequest (cognitive 42) · ×1
  • transformRequest (cognitive 42) REDACTED: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.
D2 · Cognitive Complexity · provider.detectFormat (cognitive 41) · ×1
  • provider.detectFormat (cognitive 41) open-sse/services/provider.js:35 — 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.
D2 · Cognitive Complexity · readIntegrityAttempt (cognitive 41) · ×1
  • readIntegrityAttempt (cognitive 41) open-sse/executors/kiro.js:550 — 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.
D2 · Cognitive Complexity · extractAnswer (cognitive 41) · ×1
  • 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.
D2 · Cognitive Complexity · flattenMessages (cognitive 41) · ×1
  • flattenMessages (cognitive 41) open-sse/executors/chatgpt-web/chatHttp.js:54 — flattenMessages has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 3 (7 pts), ternaries 2 (7 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolDetailClient.ToolDetailClient (cognitive 40) · ×1
  • 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 items inside it that branch (a function literal at line 31, a function literal at line 74, getBaseUrl, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WebLoginButton.WebLoginButton (cognitive 40) · ×1
  • WebLoginButton.WebLoginButton (cognitive 40) src/app/(dashboard)/dashboard/providers/components/WebLoginButton.js:46 — WebLoginButton.WebLoginButton has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 12 (16 pts), boolean chains 13, if/else 10, error handling 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 23 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.
D2 · Cognitive Complexity · extractAnswer (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · gemini.mergeAllOf (cognitive 39) · ×1
  • gemini.mergeAllOf (cognitive 39) open-sse/translator/formats/gemini.js:218 — 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.
D2 · Cognitive Complexity · gemini-web.buildGeminiToolPrompt (cognitive 39) · ×1
  • gemini-web.buildGeminiToolPrompt (cognitive 39) open-sse/executors/gemini-web.js:160 — gemini-web.buildGeminiToolPrompt has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 9 (23 pts), if/else 7 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 19). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.POST (cognitive 39) · ×1
  • route.POST (cognitive 39) src/app/api/provider-nodes/validate/route.js:55 — route.POST has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 2 (5 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · translateResponse (cognitive 39) · ×1
  • translateResponse (cognitive 39) open-sse/translator/index.js:184 — translateResponse has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 4 (13 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cursorProtobuf.encodeRequest (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · muse-web.pollChat (cognitive 38) · ×1
  • muse-web.pollChat (cognitive 38) open-sse/executors/muse-web.js:237 — muse-web.pollChat has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 12, ternaries 1 (3 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.TranslatorPage (cognitive 38) · ×1
  • page.TranslatorPage (cognitive 38) src/app/(dashboard)/dashboard/translator/page.js:37 — 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 items inside it that branch (handleSend, a function literal at line 239, handleLoad, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · systemone.handleSystemone (cognitive 38) · ×1
  • systemone.handleSystemone (cognitive 38) src/sse/handlers/systemone.js:24 — systemone.handleSystemone has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (29 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.
D2 · Cognitive Complexity · parseDeepSeekToolCalls (cognitive 38) · ×1
  • parseDeepSeekToolCalls (cognitive 38) REDACTED:798 — parseDeepSeekToolCalls has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 13, loops 3 (4 pts), other 2, ternaries 2 (nesting depth added 7). Of this number, 34 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · OAuthModal (cognitive 38) · ×1
  • OAuthModal (cognitive 38) src/shared/components/OAuthModal.js:38 — OAuthModal has cognitive complexity 38 (threshold 15). Drivers by points: if/else 79 (101 pts), boolean chains 65, ternaries 34 (45 pts), error handling 14 (20 pts), loops 3 (nesting depth added 39). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
D2 · Cognitive Complexity · openaiToOpenAIResponsesResponse (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · bodyHasSessionHints (cognitive 38) · ×1
  • bodyHasSessionHints (cognitive 38) open-sse/executors/opencode.js:230 — 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.
D2 · Cognitive Complexity · perplexity-web.readPplxSseEvents (cognitive 37) · ×1
  • perplexity-web.readPplxSseEvents (cognitive 37) REDACTED: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). Of this number, 33 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.
D2 · Cognitive Complexity · minimax.getMiniMaxUsage (cognitive 37) · ×1
  • minimax.getMiniMaxUsage (cognitive 37) open-sse/services/usage/minimax.js:133 — minimax.getMiniMaxUsage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 7, error handling 2 (5 pts), 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.
D2 · Cognitive Complexity · BasicChatPageClient.BasicChatPageClient · ×1
  • BasicChatPageClient.BasicChatPageClient::sendMessage (cognitive 37) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:573 — BasicChatPageClient.BasicChatPageClient::sendMessage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 10, error handling 2 (4 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BasicChatPageClient.BasicChatPageClient) 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.
D2 · Cognitive Complexity · BaseUrlSelect.BaseUrlSelect (cognitive 37) · ×1
  • 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 items inside it that branch (handleSelect, a function literal at line 90, a function literal at line 68, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · DefaultToolCard.DefaultToolCard (cognitive 37) · ×1
  • 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 items inside it that branch (renderGuideSteps, replaceVars, a function literal at line 106, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · quotaAutoPing.pingConnection (cognitive 37) · ×1
  • quotaAutoPing.pingConnection (cognitive 37) src/shared/services/quotaAutoPing.js:194 — quotaAutoPing.pingConnection has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 7, ternaries 6 (7 pts), error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · openai-to-ollama.normalizeMessages (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · index.translateRequest (cognitive 36) · ×1
  • index.translateRequest (cognitive 36) open-sse/translator/index.js:69 — index.translateRequest has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · nonStreamingHandler.openAICompletionToResponses (cognitive 36) · ×1
  • nonStreamingHandler.openAICompletionToResponses (cognitive 36) open-sse/handlers/chatCore/nonStreamingHandler.js:33 — 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.
D2 · Cognitive Complexity · EmbeddingExampleCard.EmbeddingExampleCard (cognitive 36) · ×1
  • 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 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.
D2 · Cognitive Complexity · route.POST (cognitive 36) · ×1
  • route.POST (cognitive 36) REDACTED: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.
D2 · Cognitive Complexity · route.GET (cognitive 36) · ×1
  • route.GET (cognitive 36) REDACTED: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.
D2 · Cognitive Complexity · config.normalizeLocale (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · tts.handleSingleModelTts (cognitive 36) · ×1
  • tts.handleSingleModelTts (cognitive 36) src/sse/handlers/tts.js:73 — tts.handleSingleModelTts has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 10, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · videoGeneration.handleVideoCreate (cognitive 36) · ×1
  • videoGeneration.handleVideoCreate (cognitive 36) src/sse/handlers/videoGeneration.js:112 — videoGeneration.handleVideoCreate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 14, loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · restoreToolNames (cognitive 36) · ×1
  • restoreToolNames (cognitive 36) open-sse/utils/opencodeFingerprint.js:447 — 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 (a function literal at line 476, a function literal at line 468, a function literal at line 498, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · RequestDetailsTab (cognitive 36) · ×1
  • RequestDetailsTab (cognitive 36) src/app/(dashboard)/dashboard/usage/components/RequestDetailsTab.js:86 — RequestDetailsTab has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 21, ternaries 10, if/else 3, error handling 2. Of this number, 25 points are the body's own statements and 11 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.
D2 · Cognitive Complexity · parseResponse (cognitive 36) · ×1
  • parseResponse (cognitive 36) open-sse/handlers/imageProviders/codex.js:402 — parseResponse has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 9, loops 1 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 14). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gemini.convertOpenAIContentToParts (cognitive 35) · ×1
  • gemini.convertOpenAIContentToParts (cognitive 35) open-sse/translator/formats/gemini.js:67 — 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.
D2 · Cognitive Complexity · gemini-to-openai.geminiToOpenAIRequest (cognitive 35) · ×1
  • gemini-to-openai.geminiToOpenAIRequest (cognitive 35) open-sse/translator/request/gemini-to-openai.js:9 — gemini-to-openai.geminiToOpenAIRequest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gitLog.gitLog (cognitive 35) · ×1
  • 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). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.transformOpenAISSEToGeminiSSE (cognitive 35) · ×1
  • route.transformOpenAISSEToGeminiSSE (cognitive 35) REDACTED:433 — 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.
D2 · Cognitive Complexity · chat.handleChat (cognitive 35) · ×1
  • chat.handleChat (cognitive 35) src/sse/handlers/chat.js:37 — chat.handleChat has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 10, ternaries 3 (5 pts), error handling 1 (nesting depth added 7). Of this number, 30 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.
D2 · Cognitive Complexity · embeddings.handleEmbeddings (cognitive 35) · ×1
  • embeddings.handleEmbeddings (cognitive 35) src/sse/handlers/embeddings.js:33 — embeddings.handleEmbeddings has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (28 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.
D2 · Cognitive Complexity · proxyAccountRequest (cognitive 35) · ×1
  • proxyAccountRequest (cognitive 35) REDACTED: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.
D2 · Cognitive Complexity · rewriteQoderMessageAttachments (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · claude.fixToolUseOrdering (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · WindsurfExecutor.transformToSSE (cognitive 34) · ×1
  • 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 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 · route.POST (cognitive 34) · ×1
  • route.POST (cognitive 34) REDACTED:84 — route.POST has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 12, 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.
D2 · Cognitive Complexity · route.forwardGeminiNativeRequest (cognitive 34) · ×1
  • route.forwardGeminiNativeRequest (cognitive 34) REDACTED:239 — route.forwardGeminiNativeRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 34) · ×1
  • (anonymous) (cognitive 34) src/app/(dashboard)/dashboard/providers/[id]/page.js:317 — (anonymous) has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 14, 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.
D2 · Cognitive Complexity · normalizeGrokCliInputItem (cognitive 34) · ×1
  • normalizeGrokCliInputItem (cognitive 34) REDACTED: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.
D2 · Cognitive Complexity · providerModels.getModelUpstreamId (cognitive 33) · ×1
  • providerModels.getModelUpstreamId (cognitive 33) open-sse/config/providerModels.js:95 — providerModels.getModelUpstreamId has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 14, ternaries 8 (10 pts), if/else 6 (9 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 · AntigravityExecutor.parseError (cognitive 33) · ×1
  • AntigravityExecutor.parseError (cognitive 33) open-sse/executors/antigravity.js:119 — AntigravityExecutor.parseError has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (2 pts), ternaries 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.
D2 · Cognitive Complexity · claude.capCacheControlBlocks (cognitive 33) · ×1
  • 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 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.
D2 · Cognitive Complexity · usageTracking.extractUsage (cognitive 33) · ×1
  • usageTracking.extractUsage (cognitive 33) open-sse/utils/usageTracking.js:239 — usageTracking.extractUsage has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 24, 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.
D2 · Cognitive Complexity · qoder.wrapQoderSSE (cognitive 33) · ×1
  • qoder.wrapQoderSSE (cognitive 33) REDACTED:475 — qoder.wrapQoderSSE has cognitive complexity 33 (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). To reduce it, split the body into named stages: move each independent 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 (qoder.wrapQoderSSE::processLine) 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.
D2 · Cognitive Complexity · codexStt.transcribeCodex (cognitive 33) · ×1
  • codexStt.transcribeCodex (cognitive 33) open-sse/handlers/codexStt.js:41 — codexStt.transcribeCodex has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 10, ternaries 4 (6 pts), error handling 2, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · copilotModels.resolveCopilotModels (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 33) · ×1
  • (anonymous) (cognitive 33) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:106 — (anonymous) has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 14, if/else 8 (14 pts), error handling 3, ternaries 1 (2 pts) (nesting depth added 7). Of this number, 24 points are the body's own statements and 9 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.
D2 · Cognitive Complexity · transformOpenAISSEToGeminiSSE · ×1
  • transformOpenAISSEToGeminiSSE::transform (cognitive 33) REDACTED:442 — 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.
D2 · Cognitive Complexity · reconcileToolPair (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · fetchClaudeUsageRaw (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · cli.killAllAppProcesses (cognitive 32) · ×1
  • cli.killAllAppProcesses (cognitive 32) REDACTED:285 — cli.killAllAppProcesses has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 8, error handling 4 (7 pts) (nesting depth added 10). None of this is in the body itself: all 32 points belong to 4 function literals inside it that branch (lines 286, 301, 327, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cli.killProxyByPidFile (cognitive 32) · ×1
  • cli.killProxyByPidFile (cognitive 32) REDACTED:390 — 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.
D2 · Cognitive Complexity · webTools.findBareJsonCandidates (cognitive 32) · ×1
  • webTools.findBareJsonCandidates (cognitive 32) open-sse/translator/webTools.js:270 — webTools.findBareJsonCandidates has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · claude-to-kiro.claudeToKiroRequest (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · domCapture.waitForGeminiReply (cognitive 32) · ×1
  • domCapture.waitForGeminiReply (cognitive 32) open-sse/executors/gemini-web/domCapture.js:50 — domCapture.waitForGeminiReply has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 8, ternaries 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bypassHandler.handleBypassRequest (cognitive 32) · ×1
  • 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 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.
D2 · Cognitive Complexity · sseToJsonHandler.chatCompletionToResponses (cognitive 32) · ×1
  • sseToJsonHandler.chatCompletionToResponses (cognitive 32) open-sse/handlers/chatCore/sseToJsonHandler.js:55 — 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.
D2 · Cognitive Complexity · route.GET (cognitive 32) · ×1
  • route.GET (cognitive 32) src/app/api/providers/[id]/models/route.js:565 — 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.
D2 · Cognitive Complexity · manager.stopServer (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · imageGeneration.handleSingleModelImage (cognitive 32) · ×1
  • imageGeneration.handleSingleModelImage (cognitive 32) src/sse/handlers/imageGeneration.js:97 — imageGeneration.handleSingleModelImage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 11, loops 1 (nesting depth added 10). Of this number, 29 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · search.handleSingleProviderSearch (cognitive 32) · ×1
  • search.handleSingleProviderSearch (cognitive 32) src/sse/handlers/search.js:99 — 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.
D2 · Cognitive Complexity · parseCommandCodeError (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · grok-web-tools.buildGrokMessage (cognitive 31) · ×1
  • grok-web-tools.buildGrokMessage (cognitive 31) open-sse/executors/grok-web-tools.js:226 — grok-web-tools.buildGrokMessage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 2 (5 pts), boolean chains 4, loops 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grok-web.extractContent (cognitive 31) · ×1
  • grok-web.extractContent (cognitive 31) REDACTED:167 — grok-web.extractContent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 3, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kimi.getKimiUsage (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · BulkImportGrokCliModal.BulkImportGrokCliModal (cognitive 31) · ×1
  • 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 items inside it that branch (processFiles, handleSubmit, handleClose, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · route.fetchAll (cognitive 31) · ×1
  • route.fetchAll (cognitive 31) REDACTED: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.
D2 · Cognitive Complexity · route.PUT (cognitive 31) · ×1
  • route.PUT (cognitive 31) src/app/api/providers/[id]/route.js:81 — route.PUT has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · tailscale.startDaemonWithPassword (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · AddCustomEmbeddingModal.AddCustomEmbeddingModal (cognitive 31) · ×1
  • 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 items inside it that branch (handleSubmit, a function literal at line 23, renderValidationResult, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ComboFormModal.ComboFormModal (cognitive 31) · ×1
  • ComboFormModal.ComboFormModal (cognitive 31) src/shared/components/ComboFormModal.js:53 — ComboFormModal.ComboFormModal has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 11, if/else 10, ternaries 8 (10 pts) (nesting depth added 2). Of this number, 17 points are the body's own statements and 14 belong to 11 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · wrapQoderSSE · ×1
  • wrapQoderSSE::start (cognitive 31) REDACTED:572 — 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.
D2 · Cognitive Complexity · getMiniMaxCodeUsage (cognitive 31) · ×1
  • getMiniMaxCodeUsage (cognitive 31) open-sse/services/minimaxCodeUsage.js:203 — getMiniMaxCodeUsage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 6 (8 pts), boolean chains 6, error handling 3 (5 pts), loops 1 (2 pts), other 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · CodeBuddyExecutor.parseError (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · CodeBuddyIntlExecutor.parseError (cognitive 30) · ×1
  • CodeBuddyIntlExecutor.parseError (cognitive 30) open-sse/executors/codebuddy-intl.js:69 — 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.
D2 · Cognitive Complexity · openai-to-kiro.openaiToKiroRequest (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · queue.walkObjects (cognitive 30) · ×1
  • queue.walkObjects (cognitive 30) open-sse/shared/qoder/queue.js:81 — queue.walkObjects has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (7 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.
D2 · Cognitive Complexity · CompatibleModelsSection.CompatibleModelsSection (cognitive 30) · ×1
  • CompatibleModelsSection.CompatibleModelsSection (cognitive 30) src/app/(dashboard)/dashboard/providers/[id]/CompatibleModelsSection.js:74 — CompatibleModelsSection.CompatibleModelsSection has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 9, ternaries 5, error handling 3, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (handleImport, handleAdd, handleTestModel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · route.comboSeatLimits (cognitive 30) · ×1
  • route.comboSeatLimits (cognitive 30) REDACTED:290 — 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.
D2 · Cognitive Complexity · EditConnectionModal.EditConnectionModal · ×1
  • EditConnectionModal.EditConnectionModal::handleSubmit (cognitive 30) src/shared/components/EditConnectionModal.js:139 — EditConnectionModal.EditConnectionModal::handleSubmit has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 8 (10 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · countCacheControlBlocks (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Sidebar (cognitive 30) · ×1
  • Sidebar (cognitive 30) src/shared/components/Sidebar.js:42 — 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 25 function items inside it that branch (a function literal at line 268, a function literal at line 91, isActive, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · mergeChunksToResponse (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · xaiVideo.run (cognitive 29) · ×1
  • 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 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.
D2 · Cognitive Complexity · index.pollForToken (cognitive 29) · ×1
  • index.pollForToken (cognitive 29) src/lib/oauth/providers/index.js:173 — 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.
D2 · Cognitive Complexity · kiroConversation.validateKiroConversation (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · qoder.buildQoderRequestBody (cognitive 29) · ×1
  • qoder.buildQoderRequestBody (cognitive 29) REDACTED:242 — qoder.buildQoderRequestBody has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, ternaries 4 (7 pts), error handling 1 (nesting depth added 7). Of this number, 20 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.
D2 · Cognitive Complexity · KiroExecutor.runIntegrityRecovery (cognitive 29) · ×1
  • KiroExecutor.runIntegrityRecovery (cognitive 29) open-sse/executors/kiro.js:444 — 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.
D2 · Cognitive Complexity · route.POST (cognitive 29) · ×1
  • route.POST (cognitive 29) src/app/api/cli-tools/hermes-settings/route.js:193 — route.POST has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, ternaries 6 (7 pts), error handling 1, loops 1 (nesting depth added 3). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
D2 · Cognitive Complexity · appUpdater.collectAppPids (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · Header.getPageInfo (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · fetch.handleSingleProviderFetch (cognitive 29) · ×1
  • fetch.handleSingleProviderFetch (cognitive 29) src/sse/handlers/fetch.js:119 — 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.
D2 · Cognitive Complexity · handleImportQoderModels (cognitive 29) · ×1
  • handleImportQoderModels (cognitive 29) src/app/(dashboard)/dashboard/providers/[id]/page.js:607 — handleImportQoderModels has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 8, loops 2 (3 pts), error handling 1 (nesting depth added 7). Of this number, 28 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.
D2 · Cognitive Complexity · socksFetch (cognitive 29) · ×1
  • socksFetch (cognitive 29) REDACTED: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.
D2 · Cognitive Complexity · execute (cognitive 29) · ×1
  • execute (cognitive 29) open-sse/executors/muse-web.js:481 — execute has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 10, error handling 6 (9 pts), if/else 6 (8 pts), ternaries 1 (2 pts) (nesting depth added 6). Of this number, 22 points are the body's own statements and 7 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runImageConversation (cognitive 29) · ×1
  • runImageConversation (cognitive 29) open-sse/executors/chatgpt-web/imageGen.js:77 — runImageConversation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 4 (7 pts), boolean chains 5, loops 4, ternaries 1 (nesting depth added 7). None of this is in the body itself: all 29 points belong to 8 function items inside it that branch (a function literal at line 82, (anonymous)::readBody, (anonymous)::addUnique, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · uc-web (cognitive 29) · ×1
  • uc-web (cognitive 29) open-sse/services/webIdentity.js:178 — uc-web has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4 (6 pts), boolean chains 4, error handling 2 (3 pts), other 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.
D2 · Cognitive Complexity · build-cli.buildCliPackage (cognitive 28) · ×1
  • build-cli.buildCliPackage (cognitive 28) cli/scripts/build-cli.js:182 — 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). Of this number, 26 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · gemini.normalizeGeminiContents (cognitive 28) · ×1
  • gemini.normalizeGeminiContents (cognitive 28) open-sse/translator/formats/gemini.js:565 — gemini.normalizeGeminiContents has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 9, loops 1 (nesting depth added 8). Of this number, 21 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent 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 · AntigravityExecutor.cloakTools (cognitive 28) · ×1
  • AntigravityExecutor.cloakTools (cognitive 28) open-sse/executors/antigravity.js:493 — 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.
D2 · Cognitive Complexity · imageGen.downloadGeneratedImage (cognitive 28) · ×1
  • imageGen.downloadGeneratedImage (cognitive 28) open-sse/executors/chatgpt-web/imageGen.js:305 — imageGen.downloadGeneratedImage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 10). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 308, 344). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · openai.filterToOpenAIFormat (cognitive 28) · ×1
  • 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). Of this number, 26 points are the body's own statements and 2 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · server.passthroughHttp2 (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · NoAuthProxyCard.NoAuthProxyCard (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · transcribeElevenLabs (cognitive 28) · ×1
  • transcribeElevenLabs (cognitive 28) open-sse/handlers/sttCore.js:144 — transcribeElevenLabs has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 10, boolean chains 5, other 2 (nesting depth added 4). Of this number, 27 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · streamEvents (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · onboardUser (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · MediaProviderKindPage (cognitive 28) · ×1
  • 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 (a function literal at line 159, handleCreateCombo, a function literal at line 149, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · codexToolSchema.stripNode (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · uc-web.aspectFor (cognitive 27) · ×1
  • uc-web.aspectFor (cognitive 27) open-sse/executors/uc-web.js:247 — uc-web.aspectFor has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 6, loops 1 (3 pts), ternaries 1 (nesting depth added 11). Of this number, 24 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolDeduper.dedupeTools (cognitive 27) · ×1
  • toolDeduper.dedupeTools (cognitive 27) open-sse/utils/toolDeduper.js:80 — toolDeduper.dedupeTools has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · systemInject.injectClaudeSystem (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · combo.isZeroContentResponse (cognitive 27) · ×1
  • combo.isZeroContentResponse (cognitive 27) open-sse/services/combo.js:301 — combo.isZeroContentResponse has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (11 pts), ternaries 2 (4 pts) (nesting depth added 6). 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.
D2 · Cognitive Complexity · kiro.getKiroUsage (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · cursor.getCursorUsage (cognitive 27) · ×1
  • cursor.getCursorUsage (cognitive 27) open-sse/services/usage/cursor.js:174 — cursor.getCursorUsage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, ternaries 2 (5 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.PATCH (cognitive 27) · ×1
  • route.PATCH (cognitive 27) REDACTED: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.
D2 · Cognitive Complexity · mimoLoginSession.parseSetCookie (cognitive 27) · ×1
  • mimoLoginSession.parseSetCookie (cognitive 27) REDACTED: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.
D2 · Cognitive Complexity · zedCredentials.readLinuxCredentials (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · cloudflared.spawnQuickTunnel (cognitive 27) · ×1
  • 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 items inside it that branch (a function literal at line 374, a function literal at line 338, a function literal at line 313, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) · ×1
  • (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.
D2 · Cognitive Complexity · inspectFirstPartyAsset (cognitive 27) · ×1
  • inspectFirstPartyAsset (cognitive 27) REDACTED:219 — inspectFirstPartyAsset has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 4 (5 pts), other 5, ternaries 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getQoderUsage (cognitive 27) · ×1
  • getQoderUsage (cognitive 27) open-sse/services/usage/misc.js:305 — getQoderUsage has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 19, if/else 4, 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.
D2 · Cognitive Complexity · acquireViaDesktopPhases (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · DELETE (cognitive 27) · ×1
  • DELETE (cognitive 27) src/app/api/cli-tools/hermes-settings/route.js:270 — DELETE has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, error handling 3 (4 pts), loops 1, other 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.
D2 · Cognitive Complexity · awsEventStream.parseEventFrame (cognitive 26) · ×1
  • awsEventStream.parseEventFrame (cognitive 26) open-sse/utils/awsEventStream.js:38 — awsEventStream.parseEventFrame has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 2). Of this number, 25 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.
D2 · Cognitive Complexity · webTools.replacePythonLiterals (cognitive 26) · ×1
  • webTools.replacePythonLiterals (cognitive 26) open-sse/translator/webTools.js:203 — webTools.replacePythonLiterals has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 1, loops 1 (nesting depth added 11). Of this number, 22 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.
D2 · Cognitive Complexity · ls.ls (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · embeddingsCore.handleEmbeddingsCore (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · combo.handleFusionChat (cognitive 26) · ×1
  • combo.handleFusionChat (cognitive 26) open-sse/services/combo.js:820 — 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.
D2 · Cognitive Complexity · minimaxCodeUsage.getMiniMaxCodeMembership (cognitive 26) · ×1
  • minimaxCodeUsage.getMiniMaxCodeMembership (cognitive 26) open-sse/services/minimaxCodeUsage.js:117 — minimaxCodeUsage.getMiniMaxCodeMembership has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 5 (9 pts), boolean chains 4, error handling 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.ComboFormModal (cognitive 26) · ×1
  • page.ComboFormModal (cognitive 26) src/app/(dashboard)/dashboard/combos/page.js:1180 — 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 items inside it that branch (handleDragEnd, fetchModalData, validateName, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ModelsCard.ModelsCard (cognitive 26) · ×1
  • ModelsCard.ModelsCard (cognitive 26) src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:113 — 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 items inside it that branch (a function literal at line 125, handleTestModel, handleSetAlias, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · route.normalizeOverride (cognitive 26) · ×1
  • route.normalizeOverride (cognitive 26) REDACTED: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.
D2 · Cognitive Complexity · coworkPlugins.buildManagedMcpServers (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · ComboCard (cognitive 26) · ×1
  • ComboCard (cognitive 26) src/app/(dashboard)/dashboard/combos/page.js:658 — ComboCard has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 17, ternaries 8, other 1. Of this number, 20 points are the body's own statements and 6 belong to 15 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.
D2 · Cognitive Complexity · peekFirstQoderFrame (cognitive 26) · ×1
  • peekFirstQoderFrame (cognitive 26) REDACTED:411 — 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.
D2 · Cognitive Complexity · execute (cognitive 26) · ×1
  • execute (cognitive 26) REDACTED:360 — execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, error handling 2 (4 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.
D2 · Cognitive Complexity · parseToolCallsFromText (cognitive 26) · ×1
  • parseToolCallsFromText (cognitive 26) open-sse/translator/webTools.js:427 — parseToolCallsFromText has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), ternaries 4 (7 pts), loops 2, 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.
D2 · Cognitive Complexity · xaiVideo.parseArgs (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · thoughtSignatureStore.getGeminiThoughtSignature (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · streamHelpers.ensureStreamToolCallIds (cognitive 25) · ×1
  • streamHelpers.ensureStreamToolCallIds (cognitive 25) open-sse/utils/streamHelpers.js:84 — streamHelpers.ensureStreamToolCallIds has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kiroConversation.normalizeTurns (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · devin-cli.resolveWorkspaceCwd · ×1
  • devin-cli.resolveWorkspaceCwd::scanMessages (cognitive 25) open-sse/executors/devin-cli.js:213 — devin-cli.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.
D2 · Cognitive Complexity · sse.createQoderSseCoalescer.handleInner (cognitive 25) · ×1
  • sse.createQoderSseCoalescer.handleInner (cognitive 25) open-sse/shared/qoder/sse.js:149 — sse.createQoderSseCoalescer.handleInner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · systemoneRouter.extractPromptState (cognitive 25) · ×1
  • systemoneRouter.extractPromptState (cognitive 25) open-sse/services/systemoneRouter.js:27 — systemoneRouter.extractPromptState has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiKeySelect.ApiKeySelect (cognitive 25) · ×1
  • 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 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.
D2 · Cognitive Complexity · CustomConfigCard.CustomConfigCard (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · route.POST (cognitive 25) · ×1
  • route.POST (cognitive 25) REDACTED:112 — route.POST has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, ternaries 3 (4 pts), error handling 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.GET (cognitive 25) · ×1
  • route.GET (cognitive 25) REDACTED: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.
D2 · Cognitive Complexity · route.PATCH (cognitive 25) · ×1
  • route.PATCH (cognitive 25) REDACTED: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.
D2 · Cognitive Complexity · usageRepo.getActiveRequests (cognitive 25) · ×1
  • usageRepo.getActiveRequests (cognitive 25) src/lib/db/repos/usageRepo.js:198 — 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.
D2 · Cognitive Complexity · requestDetailsRepo.flushToDatabase (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · stdioSseBridge.collapseRepeated (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · modelSearchFilter.matchesSearch (cognitive 25) · ×1
  • modelSearchFilter.matchesSearch (cognitive 25) REDACTED:111 — modelSearchFilter.matchesSearch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, loops 2 (4 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.
D2 · Cognitive Complexity · renderModelsSection (cognitive 25) · ×1
  • renderModelsSection (cognitive 25) src/app/(dashboard)/dashboard/providers/[id]/page.js:1190 — 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.
D2 · Cognitive Complexity · trackPendingRequest (cognitive 25) · ×1
  • trackPendingRequest (cognitive 25) src/lib/db/repos/usageRepo.js:154 — 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.
D2 · Cognitive Complexity · transformRequest (cognitive 25) · ×1
  • transformRequest (cognitive 25) open-sse/executors/opencode.js:421 — transformRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 9 (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.
D2 · Cognitive Complexity · gemini.cleanJSONSchemaForAntigravity (cognitive 24) · ×1
  • gemini.cleanJSONSchemaForAntigravity (cognitive 24) open-sse/translator/formats/gemini.js:439 — 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). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 2 function items inside it that branch (cleanupRequired, addPlaceholders). 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.
D2 · Cognitive Complexity · openai-to-commandcode.toContentBlocks (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · grok-web-tools.adaptArguments (cognitive 24) · ×1
  • grok-web-tools.adaptArguments (cognitive 24) open-sse/executors/grok-web-tools.js:294 — grok-web-tools.adaptArguments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PerplexityWebExecutor.execute (cognitive 24) · ×1
  • PerplexityWebExecutor.execute (cognitive 24) REDACTED: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.
D2 · Cognitive Complexity · headroom.collectToolOutputText (cognitive 24) · ×1
  • headroom.collectToolOutputText (cognitive 24) open-sse/rtk/headroom.js:109 — headroom.collectToolOutputText has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 5 (11 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (headroom.collectToolOutputText::visit) 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.
D2 · Cognitive Complexity · zed.parseZedAuthenticatedUserUsage (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · SttExampleCard.SttExampleCard · ×1
  • SttExampleCard.SttExampleCard::handleRun (cognitive 24) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:78 — SttExampleCard.SttExampleCard::handleRun has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 11, 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. This shape REPEATS in the file: one other method here (SttExampleCard.SttExampleCard) 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.
D2 · Cognitive Complexity · EditCompatibleNodeModal.EditCompatibleNodeModal (cognitive 24) · ×1
  • 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 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.
D2 · Cognitive Complexity · route.probeMcp (cognitive 24) · ×1
  • route.probeMcp (cognitive 24) REDACTED: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.
D2 · Cognitive Complexity · route.POST (cognitive 24) · ×1
  • route.POST (cognitive 24) REDACTED: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.
D2 · Cognitive Complexity · Header.Header (cognitive 24) · ×1
  • Header.Header (cognitive 24) src/shared/components/Header.js:182 — Header.Header has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (7 pts), if/else 4 (5 pts), error handling 2 (nesting depth added 4). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 195, a function literal at line 247, handleLogout). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · RequestLogger.RequestLogger (cognitive 24) · ×1
  • 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 items inside it that branch (a function literal at line 81, fetchLogs, a function literal at line 15). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · buildNonStreamingResponse (cognitive 24) · ×1
  • buildNonStreamingResponse (cognitive 24) REDACTED:308 — buildNonStreamingResponse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · flattenTypeArrays (cognitive 24) · ×1
  • flattenTypeArrays (cognitive 24) open-sse/translator/formats/gemini.js:310 — flattenTypeArrays has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, 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, 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.
D2 · Cognitive Complexity · extractAnswer (cognitive 24) · ×1
  • 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 · handleRun (cognitive 24) · ×1
  • handleRun (cognitive 24) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:78 — handleRun has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 11, 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.
D2 · Cognitive Complexity · GET (cognitive 24) · ×1
  • GET (cognitive 24) REDACTED: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.
D2 · Cognitive Complexity · fetchQoderCatalogRaw (cognitive 24) · ×1
  • fetchQoderCatalogRaw (cognitive 24) open-sse/services/qoderModels.js:205 — fetchQoderCatalogRaw has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · downloadGeneratedImage (cognitive 24) · ×1
  • downloadGeneratedImage (cognitive 24) open-sse/executors/chatgpt-web/imageGenHttp.js:248 — downloadGeneratedImage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 4 (8 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kiroToClaudeNonStreaming (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · xaiVideo.pollUntilDone (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · kiroConstants.containsThinkingModeTag (cognitive 23) · ×1
  • kiroConstants.containsThinkingModeTag (cognitive 23) open-sse/config/kiroConstants.js:455 — 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.
D2 · Cognitive Complexity · chatHttp.finishedAssistantText (cognitive 23) · ×1
  • chatHttp.finishedAssistantText (cognitive 23) open-sse/executors/chatgpt-web/chatHttp.js:127 — chatHttp.finishedAssistantText has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · gemini-to-openai.convertGeminiContent (cognitive 23) · ×1
  • gemini-to-openai.convertGeminiContent (cognitive 23) open-sse/translator/request/gemini-to-openai.js:76 — gemini-to-openai.convertGeminiContent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queue.parseQoderQueueInfo (cognitive 23) · ×1
  • queue.parseQoderQueueInfo (cognitive 23) open-sse/shared/qoder/queue.js:118 — queue.parseQoderQueueInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, loops 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.
D2 · Cognitive Complexity · kiro.inspectSSEChunk (cognitive 23) · ×1
  • kiro.inspectSSEChunk (cognitive 23) open-sse/executors/kiro.js:202 — 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.
D2 · Cognitive Complexity · prompt.contentToText (cognitive 23) · ×1
  • prompt.contentToText (cognitive 23) open-sse/executors/muse-web/prompt.js:19 — prompt.contentToText has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · emptyFailover.peekStreamForContent (cognitive 23) · ×1
  • emptyFailover.peekStreamForContent (cognitive 23) open-sse/services/emptyFailover.js:152 — emptyFailover.peekStreamForContent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (7 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent 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 · xiaomi-mimo.getXiaomiMimoUsage (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · clinepass.getClinepassUsage (cognitive 23) · ×1
  • clinepass.getClinepassUsage (cognitive 23) open-sse/services/usage/clinepass.js:54 — clinepass.getClinepassUsage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (5 pts), boolean chains 3, loops 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddCustomModelModal.AddCustomModelModal (cognitive 23) · ×1
  • AddCustomModelModal.AddCustomModelModal (cognitive 23) src/app/(dashboard)/dashboard/providers/[id]/AddCustomModelModal.js:10 — AddCustomModelModal.AddCustomModelModal has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, ternaries 7, if/else 4, error handling 1. Of this number, 12 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · route.POST (cognitive 23) · ×1
  • route.POST (cognitive 23) REDACTED:102 — route.POST has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, ternaries 5, if/else 4, error handling 3. Of this number, 16 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · route.GET (cognitive 23) · ×1
  • route.GET (cognitive 23) REDACTED:21 — route.GET has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, ternaries 3 (6 pts), if/else 4 (5 pts), error handling 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · proxy.proxy (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · modelSearchFilter.parseSearchQuery (cognitive 23) · ×1
  • modelSearchFilter.parseSearchQuery (cognitive 23) REDACTED:21 — modelSearchFilter.parseSearchQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (6 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serializeDeepSeekToolPrompt (cognitive 23) · ×1
  • serializeDeepSeekToolPrompt (cognitive 23) REDACTED:60 — serializeDeepSeekToolPrompt has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4 (5 pts), boolean chains 2, error handling 1 (2 pts), loops 1, other 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.
D2 · Cognitive Complexity · saveRequestUsage (cognitive 23) · ×1
  • saveRequestUsage (cognitive 23) src/lib/db/repos/usageRepo.js:243 — 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 258). 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.
D2 · Cognitive Complexity · parseError (cognitive 23) · ×1
  • parseError (cognitive 23) open-sse/executors/codex.js:386 — 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.
D2 · Cognitive Complexity · getGrokCliUsage (cognitive 23) · ×1
  • 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 · pollConversationImages (cognitive 23) · ×1
  • pollConversationImages (cognitive 23) open-sse/executors/chatgpt-web/imageGenHttp.js:190 — pollConversationImages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (4 pts), boolean chains 2, other 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · POST (cognitive 23) · ×1
  • POST (cognitive 23) REDACTED: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.
D2 · Cognitive Complexity · input.selectMenu (cognitive 22) · ×1
  • 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). None of this is in the body itself: all 22 points belong 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.
D2 · Cognitive Complexity · attachments.extractImageAttachmentSources (cognitive 22) · ×1
  • attachments.extractImageAttachmentSources (cognitive 22) open-sse/executors/chatgpt-web/attachments.js:99 — attachments.extractImageAttachmentSources has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (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.
D2 · Cognitive Complexity · CursorExecutor.openAgentHttp2Stream (cognitive 22) · ×1
  • CursorExecutor.openAgentHttp2Stream (cognitive 22) REDACTED:542 — 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 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.
D2 · Cognitive Complexity · index.compressKiroFormat (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · headroom.collectClaudeHeadroomMessages (cognitive 22) · ×1
  • headroom.collectClaudeHeadroomMessages (cognitive 22) open-sse/rtk/headroom.js:172 — headroom.collectClaudeHeadroomMessages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). Of this number, 13 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent 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 · headroom.collectKiroHeadroomMessages · ×1
  • headroom.collectKiroHeadroomMessages::visit (cognitive 22) open-sse/rtk/headroom.js:243 — headroom.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.
D2 · Cognitive Complexity · index.tryDedicatedProvider (cognitive 22) · ×1
  • index.tryDedicatedProvider (cognitive 22) open-sse/handlers/search/index.js:65 — index.tryDedicatedProvider has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (8 pts), if/else 3, error handling 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.CapacityAdapterCap (cognitive 22) · ×1
  • page.CapacityAdapterCap (cognitive 22) src/app/(dashboard)/dashboard/combos/page.js:904 — 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 items inside it that branch (a function literal at line 997, handleAdd, handleDeselect, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · route.applyToAllProfiles (cognitive 22) · ×1
  • route.applyToAllProfiles (cognitive 22) src/app/api/cli-tools/hermes-settings/route.js:141 — route.applyToAllProfiles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (4 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 · route.GET (cognitive 22) · ×1
  • route.GET (cognitive 22) REDACTED: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.
D2 · Cognitive Complexity · route.POST (cognitive 22) · ×1
  • route.POST (cognitive 22) REDACTED:27 — route.POST has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, ternaries 2 (4 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.refreshAndUpdateCredentials (cognitive 22) · ×1
  • route.refreshAndUpdateCredentials (cognitive 22) REDACTED:25 — 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.
D2 · Cognitive Complexity · providerCustomModels.getProviderCustomModelRows (cognitive 22) · ×1
  • providerCustomModels.getProviderCustomModelRows (cognitive 22) src/shared/utils/providerCustomModels.js:13 — 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.
D2 · Cognitive Complexity · parseDsmlBlocks (cognitive 22) · ×1
  • parseDsmlBlocks (cognitive 22) REDACTED:555 — parseDsmlBlocks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). Of this number, 21 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.
D2 · Cognitive Complexity · concealFingerprintToolNames (cognitive 22) · ×1
  • concealFingerprintToolNames (cognitive 22) open-sse/utils/opencodeFingerprint.js:153 — concealFingerprintToolNames has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · applyEnvFingerprint (cognitive 22) · ×1
  • applyEnvFingerprint (cognitive 22) open-sse/utils/opencodeFingerprint.js:367 — applyEnvFingerprint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (nesting depth added 6). 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, split the body into named stages: move each independent 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 · EditConnectionModal (cognitive 22) · ×1
  • EditConnectionModal (cognitive 22) src/shared/components/EditConnectionModal.js:12 — EditConnectionModal has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 22 (32 pts), boolean chains 31, if/else 18 (24 pts), error handling 3 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stripRemainingDataUris (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · containsPromptInResponsesInput (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · combos.handleCreateCombo (cognitive 21) · ×1
  • combos.handleCreateCombo (cognitive 21) cli/src/cli/menus/combos.js:212 — combos.handleCreateCombo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · combos.editSingleCombo (cognitive 21) · ×1
  • combos.editSingleCombo (cognitive 21) cli/src/cli/menus/combos.js:356 — 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.
D2 · Cognitive Complexity · build-cli.copyRecursive (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · kiroExternalIdp.normalizeKiroExternalIdpAuth (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · CodexExecutor._peekSseTransientError (cognitive 21) · ×1
  • CodexExecutor._peekSseTransientError (cognitive 21) open-sse/executors/codex.js:330 — 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.
D2 · Cognitive Complexity · ollama-to-openai.ollamaToOpenAIResponse (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · kimchiModels.normalizeKimchiModel (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · veoaifree-web.downloadArtifact (cognitive 21) · ×1
  • veoaifree-web.downloadArtifact (cognitive 21) open-sse/executors/veoaifree-web.js:117 — veoaifree-web.downloadArtifact has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · streamHandler.createDisconnectAwareStream (cognitive 21) · ×1
  • 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 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.
D2 · Cognitive Complexity · ssrfGuard.parseIPv6ToGroups (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · chatSearch.handleChatSearch (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · systemoneCore.handleSystemoneCore (cognitive 21) · ×1
  • systemoneCore.handleSystemoneCore (cognitive 21) open-sse/handlers/systemoneCore.js:33 — systemoneCore.handleSystemoneCore has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 3, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · accountFallback.checkFallbackError (cognitive 21) · ×1
  • accountFallback.checkFallbackError (cognitive 21) open-sse/services/accountFallback.js:29 — 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.
D2 · Cognitive Complexity · route.POST (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · route.DELETE (cognitive 21) · ×1
  • route.DELETE (cognitive 21) REDACTED:237 — 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.
D2 · Cognitive Complexity · saml.pickSamlEmail (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · requestDetailsRepo.getObservabilityConfig (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · providers.buildProviderEntry (cognitive 21) · ×1
  • providers.buildProviderEntry (cognitive 21) src/shared/constants/providers.js:13 — providers.buildProviderEntry has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 14, 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.
D2 · Cognitive Complexity · backgroundTokenRefresh.runBackgroundTokenRefreshTick (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · killLeftoverMitm (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · buildReasoningInputItem (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · resolveKiroThinkingBudget (cognitive 21) · ×1
  • resolveKiroThinkingBudget (cognitive 21) open-sse/config/kiroConstants.js:215 — 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.
D2 · Cognitive Complexity · handleSttCore (cognitive 21) · ×1
  • handleSttCore (cognitive 21) open-sse/handlers/sttCore.js:287 — handleSttCore has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 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.
D2 · Cognitive Complexity · updateProviderCredentials (cognitive 21) · ×1
  • updateProviderCredentials (cognitive 21) src/sse/services/tokenRefresh.js:167 — updateProviderCredentials has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 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.
D2 · Cognitive Complexity · parseSttBlock (cognitive 21) · ×1
  • parseSttBlock (cognitive 21) REDACTED:165 — parseSttBlock has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), other 5, 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.
D2 · Cognitive Complexity · executeExecutorDrivenVideo (cognitive 21) · ×1
  • executeExecutorDrivenVideo (cognitive 21) open-sse/handlers/videoCore.js:26 — executeExecutorDrivenVideo has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, ternaries 6 (7 pts), if/else 3, error handling 2, other 2 (nesting depth added 1). 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.
D2 · Cognitive Complexity · menuHelper.showListMenu (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · connect.parseArgs (cognitive 20) · ×1
  • connect.parseArgs (cognitive 20) REDACTED:52 — connect.parseArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, loops 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
D2 · Cognitive Complexity · capabilities.refine (cognitive 20) · ×1
  • capabilities.refine (cognitive 20) open-sse/providers/capabilities.js:778 — 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.
D2 · Cognitive Complexity · CodeBuddyIntlExecutor.transformRequest (cognitive 20) · ×1
  • CodeBuddyIntlExecutor.transformRequest (cognitive 20) open-sse/executors/codebuddy-intl.js:16 — CodeBuddyIntlExecutor.transformRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 4 (5 pts), loops 1 (nesting depth added 3). Of this number, 13 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · image.fetchImageAsBase64 (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · deepseekWebTools.salvageLeadingJsonObject (cognitive 20) · ×1
  • deepseekWebTools.salvageLeadingJsonObject (cognitive 20) REDACTED:330 — deepseekWebTools.salvageLeadingJsonObject has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GithubExecutor.executeWithResponsesEndpoint (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · grok-web-tools.defaultRequiredValue (cognitive 20) · ×1
  • grok-web-tools.defaultRequiredValue (cognitive 20) open-sse/executors/grok-web-tools.js:273 — grok-web-tools.defaultRequiredValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qoderModels.routableQoderModels (cognitive 20) · ×1
  • qoderModels.routableQoderModels (cognitive 20) open-sse/services/qoderModels.js:365 — qoderModels.routableQoderModels has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (7 pts), loops 3, ternaries 1 (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.
D2 · Cognitive Complexity · perplexity-web.buildStreamingResponse (cognitive 20) · ×1
  • perplexity-web.buildStreamingResponse (cognitive 20) REDACTED: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.
D2 · Cognitive Complexity · requestDetail.extractUsageFromResponse (cognitive 20) · ×1
  • requestDetail.extractUsageFromResponse (cognitive 20) open-sse/handlers/chatCore/requestDetail.js:24 — requestDetail.extractUsageFromResponse has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, if/else 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.
D2 · Cognitive Complexity · searchList.searchList (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · AddCompatibleModal.AddCompatibleModal (cognitive 20) · ×1
  • 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 items inside it that branch (handleSubmit, renderValidationResult, a function literal at line 54, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ProviderTopology.ProviderTopology (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · route.POST (cognitive 20) · ×1
  • route.POST (cognitive 20) REDACTED: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.
D2 · Cognitive Complexity · extractPanelText (cognitive 20) · ×1
  • extractPanelText (cognitive 20) open-sse/services/combo.js:663 — 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.
D2 · Cognitive Complexity · submitConversationRequest (cognitive 20) · ×1
  • submitConversationRequest (cognitive 20) REDACTED:818 — submitConversationRequest has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (6 pts), error handling 2 (5 pts), if/else 4 (5 pts), boolean chains 3, other 1 (nesting depth added 7). None of this is in the body itself: all 20 points belong to 2 function literals inside it that branch (lines 820, 851). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · transformToSSE · ×1
  • 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.
D2 · Cognitive Complexity · fetchProjectId (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · containsPromptInMessages (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · createDisconnectAwareStream · ×1
  • 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.
D2 · Cognitive Complexity · harvest (cognitive 20) · ×1
  • harvest (cognitive 20) open-sse/services/webLogin.js:60 — harvest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 82, 69, 61, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · runLogin (cognitive 20) · ×1
  • runLogin (cognitive 20) open-sse/services/webLogin.js:191 — runLogin has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · menuHelper.showMenuWithBack (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · capabilities.getCapabilitiesForModel (cognitive 19) · ×1
  • capabilities.getCapabilitiesForModel (cognitive 19) open-sse/providers/capabilities.js:839 — 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.
D2 · Cognitive Complexity · index.backfillCodexEmails (cognitive 19) · ×1
  • index.backfillCodexEmails (cognitive 19) src/lib/oauth/providers/index.js:232 — 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.
D2 · Cognitive Complexity · server.startZedProxy (cognitive 19) · ×1
  • 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). None of this is in the body itself: all 19 points belong 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.
D2 · Cognitive Complexity · migrate.runMigrationOnce (cognitive 19) · ×1
  • migrate.runMigrationOnce (cognitive 19) REDACTED: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.
D2 · Cognitive Complexity · cursorProtobuf.extractToolCall (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · grok-web-tools.mapNativeToolCard (cognitive 19) · ×1
  • grok-web-tools.mapNativeToolCard (cognitive 19) open-sse/executors/grok-web-tools.js:376 — grok-web-tools.mapNativeToolCard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 4. Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: 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.
D2 · Cognitive Complexity · grok-web-tools.parseClientToolCallMarkup (cognitive 19) · ×1
  • grok-web-tools.parseClientToolCallMarkup (cognitive 19) open-sse/executors/grok-web-tools.js:433 — grok-web-tools.parseClientToolCallMarkup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (5 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · grok-web.findGrokVideoUrl (cognitive 19) · ×1
  • grok-web.findGrokVideoUrl (cognitive 19) REDACTED:67 — grok-web.findGrokVideoUrl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 6). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (visit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · grok-web.readGrokNdjsonEvents (cognitive 19) · ×1
  • grok-web.readGrokNdjsonEvents (cognitive 19) REDACTED:138 — 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.
D2 · Cognitive Complexity · VertexExecutor.buildUrl (cognitive 19) · ×1
  • VertexExecutor.buildUrl (cognitive 19) open-sse/executors/vertex.js:67 — VertexExecutor.buildUrl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.renewSession (cognitive 19) · ×1
  • session.renewSession (cognitive 19) open-sse/executors/muse-web/session.js:134 — session.renewSession has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, error handling 3 (4 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · VeoAiFreeWebExecutor.generateMedia (cognitive 19) · ×1
  • VeoAiFreeWebExecutor.generateMedia (cognitive 19) open-sse/executors/veoaifree-web.js:172 — VeoAiFreeWebExecutor.generateMedia has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · headroom.collectToolOutputText · ×1
  • headroom.collectToolOutputText::visit (cognitive 19) open-sse/rtk/headroom.js:112 — headroom.collectToolOutputText::visit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), boolean chains 2, 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. This shape REPEATS in the file: one other method here (headroom.collectToolOutputText) 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.
D2 · Cognitive Complexity · pxpipe.compressWithPxpipe (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · capacityAdapter.stripHistoryForContext (cognitive 19) · ×1
  • 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 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 · commandcode.getCommandCodeUsage (cognitive 19) · ×1
  • commandcode.getCommandCodeUsage (cognitive 19) open-sse/services/usage/commandcode.js:81 — 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.
D2 · Cognitive Complexity · TtsExampleCard.TtsExampleCard · ×1
  • TtsExampleCard.TtsExampleCard::openModal (cognitive 19) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:186 — TtsExampleCard.TtsExampleCard::openModal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (TtsExampleCard.TtsExampleCard) 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.
D2 · Cognitive Complexity · pricingRepo.getPricing (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · mimoLoginSession.rewriteMimoBases (cognitive 19) · ×1
  • mimoLoginSession.rewriteMimoBases (cognitive 19) REDACTED: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.
D2 · Cognitive Complexity · tailscale.installTailscaleMac (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · tailscale.startFunnel (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · manager.enableTailscale (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · PricingModal.PricingModal (cognitive 19) · ×1
  • 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 items inside it that branch (loadPricing, handleSave, handleReset, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · UsageStats.sortData (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · keyAccess.filterModelsListForKey (cognitive 19) · ×1
  • keyAccess.filterModelsListForKey (cognitive 19) src/sse/services/keyAccess.js:180 — keyAccess.filterModelsListForKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetch.handleFetch (cognitive 19) · ×1
  • fetch.handleFetch (cognitive 19) src/sse/handlers/fetch.js:25 — fetch.handleFetch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 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.
D2 · Cognitive Complexity · refreshNousToken (cognitive 19) · ×1
  • refreshNousToken (cognitive 19) open-sse/services/tokenRefresh/providers.js:772 — refreshNousToken has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, error handling 4 (6 pts), if/else 5, ternaries 2 (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 3 function literals inside it that branch (lines 774, 792, 830). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AddApiKeyModal (cognitive 19) · ×1
  • AddApiKeyModal (cognitive 19) src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js:198 — 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.
D2 · Cognitive Complexity · enforceTypeConstraints (cognitive 19) · ×1
  • enforceTypeConstraints (cognitive 19) open-sse/translator/formats/gemini.js:404 — enforceTypeConstraints has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 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.
D2 · Cognitive Complexity · handleTest (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · acquireBrowserContext (cognitive 19) · ×1
  • acquireBrowserContext (cognitive 19) open-sse/services/browserPool.js:339 — acquireBrowserContext has cognitive complexity 19 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 5 (6 pts), boolean chains 5, ternaries 2 (nesting depth added 4). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 360, 378, 380, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MitmServerCard · ×1
  • 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.
D2 · Cognitive Complexity · migrate.importLegacyUsage (cognitive 18) · ×1
  • migrate.importLegacyUsage (cognitive 18) REDACTED: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.
D2 · Cognitive Complexity · deltaV1.parseChatGptWebEncodedItem (cognitive 18) · ×1
  • deltaV1.parseChatGptWebEncodedItem (cognitive 18) open-sse/executors/chatgpt-web/deltaV1.js:37 — deltaV1.parseChatGptWebEncodedItem has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent 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 · image.isPrivateIp (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · codex.findNestedMessage (cognitive 18) · ×1
  • codex.findNestedMessage (cognitive 18) open-sse/executors/codex.js:154 — 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.
D2 · Cognitive Complexity · windsurf.decodeDoneChunk (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · claudeMessage.openAICompletionToClaudeMessage (cognitive 18) · ×1
  • claudeMessage.openAICompletionToClaudeMessage (cognitive 18) open-sse/translator/concerns/claudeMessage.js:15 — claudeMessage.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.
D2 · Cognitive Complexity · autodetect.autoDetectFilter (cognitive 18) · ×1
  • autodetect.autoDetectFilter (cognitive 18) REDACTED: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.
D2 · Cognitive Complexity · systemoneRouter.parseSystemOneRouteAnswer (cognitive 18) · ×1
  • systemoneRouter.parseSystemOneRouteAnswer (cognitive 18) open-sse/services/systemoneRouter.js:103 — systemoneRouter.parseSystemOneRouteAnswer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codebuddy-cn.getCodeBuddyUsage (cognitive 18) · ×1
  • 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 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.
D2 · Cognitive Complexity · webLogin.findCookieValue (cognitive 18) · ×1
  • webLogin.findCookieValue (cognitive 18) open-sse/services/webLogin.js:37 — webLogin.findCookieValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.ComboDetailPage (cognitive 18) · ×1
  • page.ComboDetailPage (cognitive 18) src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:47 — page.ComboDetailPage has cognitive complexity 18 (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). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (page.ComboDetailPage::handleTest) 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.
D2 · Cognitive Complexity · ModelRow.ModelRow (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · page.getConnectionErrorTag (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · utils.sortVisibleConnections (cognitive 18) · ×1
  • 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 items inside it that branch (a function literal at line 87, a function literal at line 58, getEarliestResetTime, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ProviderLimitCard.ProviderLimitCard (cognitive 18) · ×1
  • 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 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.
D2 · Cognitive Complexity · route.POST (cognitive 18) · ×1
  • route.POST (cognitive 18) REDACTED: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.
D2 · Cognitive Complexity · route.PATCH (cognitive 18) · ×1
  • route.PATCH (cognitive 18) REDACTED: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.
D2 · Cognitive Complexity · route.GET (cognitive 18) · ×1
  • route.GET (cognitive 18) REDACTED: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 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 · appUpdater.killMitmByPidFile (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · usageRepo.aggregateEntryToDay (cognitive 18) · ×1
  • usageRepo.aggregateEntryToDay (cognitive 18) src/lib/db/repos/usageRepo.js:65 — 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.
D2 · Cognitive Complexity · events.readPxpipeEvents (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · CursorAuthModal.CursorAuthModal (cognitive 18) · ×1
  • CursorAuthModal.CursorAuthModal (cognitive 18) src/shared/components/CursorAuthModal.js:11 — CursorAuthModal.CursorAuthModal has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 7, error handling 2. Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (runAutoDetect, handleImportToken, a function literal at line 47). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · GitLabAuthModal.GitLabAuthModal (cognitive 18) · ×1
  • 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 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 18) · ×1
  • (anonymous) (cognitive 18) src/app/(dashboard)/dashboard/providers/[id]/page.js:493 — (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 511, 523, 510, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · handleRunOneByOneTest (cognitive 18) · ×1
  • handleRunOneByOneTest (cognitive 18) src/app/(dashboard)/dashboard/providers/[id]/page.js:728 — 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.
D2 · Cognitive Complexity · handleHealthCheck (cognitive 18) · ×1
  • handleHealthCheck (cognitive 18) REDACTED:288 — 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, a function literal at line 290). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · registerAttachments (cognitive 18) · ×1
  • registerAttachments (cognitive 18) REDACTED:527 — registerAttachments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 1 (4 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 8). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 529, 562, 584). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · openModal (cognitive 18) · ×1
  • openModal (cognitive 18) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:186 — 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.
D2 · Cognitive Complexity · execute (cognitive 18) · ×1
  • execute (cognitive 18) open-sse/executors/codex.js:279 — 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.
D2 · Cognitive Complexity · emitToolCall (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · handleBulkSubmit (cognitive 18) · ×1
  • handleBulkSubmit (cognitive 18) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:194 — 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.
D2 · Cognitive Complexity · convertSingleQuotedStrings (cognitive 18) · ×1
  • convertSingleQuotedStrings (cognitive 18) open-sse/translator/webTools.js:162 — convertSingleQuotedStrings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 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.
D2 · Cognitive Complexity · serializeToolsToPrompt (cognitive 18) · ×1
  • serializeToolsToPrompt (cognitive 18) open-sse/translator/webTools.js:372 — serializeToolsToPrompt has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (5 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.
D2 · Cognitive Complexity · renderServerLogin (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · openaiToClaudeRequestForAntigravity (cognitive 18) · ×1
  • openaiToClaudeRequestForAntigravity (cognitive 18) open-sse/translator/request/openai-to-claude.js:368 — 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 383, 396, 401, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · transformRequest (cognitive 18) · ×1
  • transformRequest (cognitive 18) open-sse/executors/opencode-zen.js:296 — 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.
D2 · Cognitive Complexity · runHeavyStartup (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · normalizeXquik (cognitive 18) · ×1
  • normalizeXquik (cognitive 18) open-sse/handlers/search/normalizers.js:215 — normalizeXquik has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 13, boolean chains 5. Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 218, 230). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · handleFetchCore (cognitive 18) · ×1
  • handleFetchCore (cognitive 18) open-sse/handlers/fetch/index.js:94 — handleFetchCore has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 7, 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.
D2 · Cognitive Complexity · renderGuideSteps (cognitive 18) · ×1
  • 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 (a function literal at line 153, renderIcon, a function literal at line 173, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · handleSearch (cognitive 18) · ×1
  • handleSearch (cognitive 18) src/sse/handlers/search.js:24 — handleSearch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 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.
D2 · Cognitive Complexity · format.getRelativeTime (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · settings.showSettingsMenu (cognitive 17) · ×1
  • 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. None of this is in the body itself: all 17 points belong 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.
D2 · Cognitive Complexity · providers.refreshKiroToken (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · AntigravityExecutor.parseRetryHeaders (cognitive 17) · ×1
  • AntigravityExecutor.parseRetryHeaders (cognitive 17) open-sse/executors/antigravity.js:395 — 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.
D2 · Cognitive Complexity · openai-to-vertex.postProcessForVertex (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · openai-to-commandcode.toNativeImageBlock (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · cursor.decompressPayload (cognitive 17) · ×1
  • cursor.decompressPayload (cognitive 17) REDACTED:290 — 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.
D2 · Cognitive Complexity · deepseek-pow-hash.findDeepSeekPowNonce (cognitive 17) · ×1
  • deepseek-pow-hash.findDeepSeekPowNonce (cognitive 17) open-sse/lib/deepseek-pow-hash.js:92 — deepseek-pow-hash.findDeepSeekPowNonce has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · webCookieAuth.parseJsonCookiesToHeader (cognitive 17) · ×1
  • webCookieAuth.parseJsonCookiesToHeader (cognitive 17) open-sse/utils/webCookieAuth.js:25 — webCookieAuth.parseJsonCookiesToHeader has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · GithubExecutor.executeWithMessagesEndpoint (cognitive 17) · ×1
  • 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 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.
D2 · Cognitive Complexity · GrokCliExecutor.buildHeaders (cognitive 17) · ×1
  • GrokCliExecutor.buildHeaders (cognitive 17) REDACTED: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.
D2 · Cognitive Complexity · qoder.wrapQoderSSE · ×1
  • qoder.wrapQoderSSE::processLine (cognitive 17) REDACTED:507 — qoder.wrapQoderSSE::processLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 3, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (qoder.wrapQoderSSE) 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.
D2 · Cognitive Complexity · opencode-go.normalizeResponsesTools (cognitive 17) · ×1
  • opencode-go.normalizeResponsesTools (cognitive 17) open-sse/executors/opencode-go.js:52 — opencode-go.normalizeResponsesTools has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (7 pts), ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · streamToJsonConverter.processSSEMessage (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · systemInject.appendToChatMessage (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · systemInject.appendToResponsesMessage (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · systemInject.injectGeminiSystem (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · prefetch.collectImageRefs · ×1
  • prefetch.collectImageRefs::pushOpenAI (cognitive 17) open-sse/translator/concerns/prefetch.js:21 — prefetch.collectImageRefs::pushOpenAI has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 1 (4 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.
D2 · Cognitive Complexity · emptyFailover.inspectClaudeEvent (cognitive 17) · ×1
  • emptyFailover.inspectClaudeEvent (cognitive 17) open-sse/services/emptyFailover.js:56 — emptyFailover.inspectClaudeEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grokCliModels.parseGrokCliModels (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · opencode-go.getOpenCodeGoUsage (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · opencode-zen.getOpenCodeZenUsage (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · glm.parseGlmQuotaResponse (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · BasicChatPageClient.BasicChatPageClient (cognitive 17) · ×1
  • BasicChatPageClient.BasicChatPageClient (cognitive 17) src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:169 — BasicChatPageClient.BasicChatPageClient has cognitive complexity 17 (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). To reduce it, split the body into named stages: move each independent 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 (BasicChatPageClient.BasicChatPageClient::sendMessage) 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.
D2 · Cognitive Complexity · page.ComboDetailPage · ×1
  • page.ComboDetailPage::handleTest (cognitive 17) src/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js:172 — page.ComboDetailPage::handleTest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, boolean chains 5, error handling 3 (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. This shape REPEATS in the file: one other method here (page.ComboDetailPage) 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.
D2 · Cognitive Complexity · BulkImportCodexModal.BulkImportCodexModal (cognitive 17) · ×1
  • 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 items inside it that branch (handleSubmit, handleClose). 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.
D2 · Cognitive Complexity · ModelAvailabilityBadge.ModelAvailabilityBadge (cognitive 17) · ×1
  • 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 items inside it that branch (handleClearCooldown, a function literal at line 87, a function literal at line 29, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · route.normalizeMiniMaxVoices (cognitive 17) · ×1
  • route.normalizeMiniMaxVoices (cognitive 17) REDACTED:28 — route.normalizeMiniMaxVoices has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (8 pts), loops 3 (4 pts), if/else 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · route.PUT (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · route.POST (cognitive 17) · ×1
  • route.POST (cognitive 17) REDACTED: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.
D2 · Cognitive Complexity · route.buildInfo (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · saml.pickSamlDisplayName (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · comboPresets.buildClaudePresetItems (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ttsVoices.listTtsVoices (cognitive 17) · ×1
  • ttsVoices.listTtsVoices (cognitive 17) src/lib/ttsVoices.js:15 — ttsVoices.listTtsVoices has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), 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.
D2 · Cognitive Complexity · cloudflared.spawnCloudflared (cognitive 17) · ×1
  • 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). None of this is in the body itself: all 17 points belong 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.
D2 · Cognitive Complexity · tailscale.startLogin (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · KiroSocialOAuthModal.KiroSocialOAuthModal (cognitive 17) · ×1
  • 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 items inside it that branch (handleManualSubmit, a function literal at line 30, a function literal at line 27, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · quotaAutoPing.runQuotaAutoPingTick (cognitive 17) · ×1
  • quotaAutoPing.runQuotaAutoPingTick (cognitive 17) src/shared/services/quotaAutoPing.js:294 — quotaAutoPing.runQuotaAutoPingTick has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 5, if/else 3 (5 pts), error handling 2 (4 pts), loops 2 (3 pts) (nesting depth added 5). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bulkAdd.planBulkAdd (cognitive 17) · ×1
  • bulkAdd.planBulkAdd (cognitive 17) src/shared/utils/bulkAdd.js:65 — 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.
D2 · Cognitive Complexity · antigravityQuota.handleAntigravityQuotaError (cognitive 17) · ×1
  • antigravityQuota.handleAntigravityQuotaError (cognitive 17) src/sse/services/antigravityQuota.js:262 — antigravityQuota.handleAntigravityQuotaError has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), boolean chains 5, if/else 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · handleImportClineModels (cognitive 17) · ×1
  • handleImportClineModels (cognitive 17) src/app/(dashboard)/dashboard/providers/[id]/page.js:682 — 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.
D2 · Cognitive Complexity · parsePartialChatGptWebFirstPartyModuleContract (cognitive 17) · ×1
  • parsePartialChatGptWebFirstPartyModuleContract (cognitive 17) REDACTED:85 — parsePartialChatGptWebFirstPartyModuleContract has cognitive complexity 17 (threshold 15). Drivers by points: other 9, if/else 7 (8 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.
D2 · Cognitive Complexity · refreshTraeToken (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · buildProviderSpecificData (cognitive 17) · ×1
  • buildProviderSpecificData (cognitive 17) src/app/(dashboard)/dashboard/providers/[id]/AddApiKeyModal.js:92 — buildProviderSpecificData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), 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.
D2 · Cognitive Complexity · decodeCompletionChunk (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · collectCommandCodeHeadroomMessages (cognitive 17) · ×1
  • collectCommandCodeHeadroomMessages (cognitive 17) open-sse/rtk/headroom.js:287 — collectCommandCodeHeadroomMessages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), boolean chains 2, other 1, ternaries 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 2 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 · ensureArrayItems (cognitive 17) · ×1
  • ensureArrayItems (cognitive 17) open-sse/translator/formats/gemini.js:383 — ensureArrayItems has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 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.
D2 · Cognitive Complexity · extractUrlFromUploadResponse (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · cli.killCloudflaredByAppPort (cognitive 16) · ×1
  • cli.killCloudflaredByAppPort (cognitive 16) REDACTED:253 — cli.killCloudflaredByAppPort has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, ternaries 2, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 264, 260, 274). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · connect.fetchServerModels (cognitive 16) · ×1
  • connect.fetchServerModels (cognitive 16) REDACTED:199 — connect.fetchServerModels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, error handling 2, loops 1 (2 pts), ternaries 1 (nesting depth added 3). Of this number, 11 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · server.startCodexProxy (cognitive 16) · ×1
  • 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). None of this is in the body itself: all 16 points belong 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.
D2 · Cognitive Complexity · server.startXaiProxy (cognitive 16) · ×1
  • 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). None of this is in the body itself: all 16 points belong 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.
D2 · Cognitive Complexity · oauthCredentialManager.mergeRefreshedCredentials (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · gemini.flattenAnyOfOneOf (cognitive 16) · ×1
  • gemini.flattenAnyOfOneOf (cognitive 16) open-sse/translator/formats/gemini.js:279 — 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.
D2 · Cognitive Complexity · migrate.syncSchemaFromTables (cognitive 16) · ×1
  • migrate.syncSchemaFromTables (cognitive 16) REDACTED: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.
D2 · Cognitive Complexity · DefaultExecutor.buildUrl (cognitive 16) · ×1
  • DefaultExecutor.buildUrl (cognitive 16) open-sse/executors/default.js:161 — 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.
D2 · Cognitive Complexity · imageSniff.jpegDimensions (cognitive 16) · ×1
  • imageSniff.jpegDimensions (cognitive 16) open-sse/executors/chatgpt-web/imageSniff.js:45 — imageSniff.jpegDimensions has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), loops 1 (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.
D2 · Cognitive Complexity · claude-to-openai.fixMissingToolResponsesOpenAI (cognitive 16) · ×1
  • claude-to-openai.fixMissingToolResponsesOpenAI (cognitive 16) open-sse/translator/request/claude-to-openai.js:116 — 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.
D2 · Cognitive Complexity · cursor.buildAgentRunFrame (cognitive 16) · ×1
  • cursor.buildAgentRunFrame (cognitive 16) REDACTED:114 — cursor.buildAgentRunFrame has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · grok-web.parseOpenAIMessages (cognitive 16) · ×1
  • grok-web.parseOpenAIMessages (cognitive 16) REDACTED:110 — 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.
D2 · Cognitive Complexity · qoder.stableChatRecordId (cognitive 16) · ×1
  • qoder.stableChatRecordId (cognitive 16) REDACTED:188 — 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.
D2 · Cognitive Complexity · perplexity-web.parseOpenAIMessages (cognitive 16) · ×1
  • perplexity-web.parseOpenAIMessages (cognitive 16) REDACTED: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.
D2 · Cognitive Complexity · zed.wrapZedCompletionStream (cognitive 16) · ×1
  • 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 items inside it that branch (processLine, 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.
D2 · Cognitive Complexity · codex.buildSseResponse (cognitive 16) · ×1
  • codex.buildSseResponse (cognitive 16) open-sse/handlers/imageProviders/codex.js:296 — codex.buildSseResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 3, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizers.normalizeXquik.results (cognitive 16) · ×1
  • normalizers.normalizeXquik.results (cognitive 16) open-sse/handlers/search/normalizers.js:218 — normalizers.normalizeXquik.results has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · codexConfig.getCurrentCodexProviderSettings (cognitive 16) · ×1
  • codexConfig.getCurrentCodexProviderSettings (cognitive 16) src/app/(dashboard)/dashboard/cli-tools/components/codexConfig.js: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.
D2 · Cognitive Complexity · MitmPageClient.MitmPageClient (cognitive 16) · ×1
  • 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. None of this is in the body itself: all 16 points belong to 7 function items inside it that branch (fetchConnections, fetchApiKeys, fetchAliases, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ModelsCard.ModelRow (cognitive 16) · ×1
  • ModelsCard.ModelRow (cognitive 16) src/app/(dashboard)/dashboard/providers/components/ModelsCard.js:13 — 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.
D2 · Cognitive Complexity · settingsRepo.mergeWithDefaults (cognitive 16) · ×1
  • settingsRepo.mergeWithDefaults (cognitive 16) src/lib/db/repos/settingsRepo.js:79 — 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.
D2 · Cognitive Complexity · connectionsRepo.cleanupProviderConnections (cognitive 16) · ×1
  • 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). None of this is in the body itself: all 16 points belong 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.
D2 · Cognitive Complexity · mimoLoginSession.decodeSessionCookie (cognitive 16) · ×1
  • mimoLoginSession.decodeSessionCookie (cognitive 16) REDACTED: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.
D2 · Cognitive Complexity · outboundProxy.applyOutboundProxyEnv (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · events.getPxpipeStats (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · manager.enableTunnel (cognitive 16) · ×1
  • 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 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 · tailscale.ensureUserOwnedDir (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · config.extractModel (cognitive 16) · ×1
  • config.extractModel (cognitive 16) src/mitm/config.js:164 — 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.
D2 · Cognitive Complexity · manager.getPort443Owner (cognitive 16) · ×1
  • 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). None of this is in the body itself: all 16 points belong 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.
D2 · Cognitive Complexity · systemoneRouter.resolveSmartChoice (cognitive 16) · ×1
  • systemoneRouter.resolveSmartChoice (cognitive 16) src/sse/services/systemoneRouter.js:29 — systemoneRouter.resolveSmartChoice 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.
D2 · Cognitive Complexity · tts.handleTts (cognitive 16) · ×1
  • tts.handleTts (cognitive 16) src/sse/handlers/tts.js:22 — tts.handleTts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · backgroundTokenRefresh.selectConnectionsNeedingRefresh (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · buildDsmlCall (cognitive 16) · ×1
  • buildDsmlCall (cognitive 16) REDACTED:524 — buildDsmlCall has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (6 pts), other 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseFullWidthDsmlCalls (cognitive 16) · ×1
  • parseFullWidthDsmlCalls (cognitive 16) REDACTED:972 — parseFullWidthDsmlCalls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, loops 2, 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.
D2 · Cognitive Complexity · ensureFirstPartyBridge (cognitive 16) · ×1
  • ensureFirstPartyBridge (cognitive 16) REDACTED:453 — ensureFirstPartyBridge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1 (nesting depth added 2). Of this number, 8 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · buildOAuthResolver (cognitive 16) · ×1
  • buildOAuthResolver (cognitive 16) src/app/api/providers/[id]/models/route.js:101 — 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). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 101). 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.
D2 · Cognitive Complexity · convertUserInputMessage (cognitive 16) · ×1
  • convertUserInputMessage (cognitive 16) REDACTED: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.
D2 · Cognitive Complexity · buildSseResponse · ×1
  • buildSseResponse::start (cognitive 16) open-sse/handlers/imageProviders/codex.js:298 — buildSseResponse::start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 3, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · markAccountUnavailable (cognitive 16) · ×1
  • markAccountUnavailable (cognitive 16) src/sse/services/auth.js:247 — 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.
D2 · Cognitive Complexity · startSessionLogin (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · resolveZedModels (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · resolveQoderModels (cognitive 16) · ×1
  • resolveQoderModels (cognitive 16) open-sse/services/qoderModels.js:301 — 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.
D2 · Cognitive Complexity · killTray (cognitive 16) · ×1
  • killTray (cognitive 16) REDACTED:334 — 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.
D2 · Cognitive Complexity · flattenQuery (cognitive 16) · ×1
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D8 · Code Coverage · Coverage not measured · ×1
  • 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.
IC1 · Incompleteness & stubs · Skeleton type · ×1
  • Skeleton type — most members are unfinished open-sse/executors/devin-cli.js:305 — `DevinCliExecutor` has 2 unfinished members out of 4 declared members (methods and accessors, whether or not each carries a body) — a scaffolded class that was never implemented.
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.
P5 · DR & Backup · No DR/backup evidence · ×1
  • 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.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 1583 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 (+1577 more).
R10 · Code Duplication · Duplication concentrated across 6 sibling directories (57 clone groups) · ×1
  • Duplication concentrated across 6 sibling directories (57 clone groups) src/app/(dashboard)/dashboard/combos/page.js:1148 — 57 duplicated blocks under src/ have copies in at least two of the sibling directories app, i18n, lib, mitm, shared, sse — 40 of them are reported below, and 17 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 57 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 57 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 57 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 · Duplication concentrated across 12 sibling directories (39 clone groups) · ×1
  • Duplication concentrated across 12 sibling directories (39 clone groups) REDACTED:663 — 39 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) — 25 of them are reported below, and 14 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 39 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 39 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 39 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 4 sibling directories (35 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (35 clone groups) cli/src/cli/utils/launcherProcess.js:145 — 35 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, gitbook, open-sse, src — 31 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 35 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 35 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 35 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 · Duplication concentrated across 17 sibling directories (34 clone groups) · ×1
  • Duplication concentrated across 17 sibling directories (34 clone groups) src/app/api/providers/[id]/models/route.js:516 — 34 duplicated blocks under src/app/api/ have copies in at least two of the sibling directories cli-tools, combos, headroom, keys, mcp, models (+11 more sibling(s) not listed) — 20 of them are reported below, and 14 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 34 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 34 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 34 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 · Duplication concentrated across 20 sibling directories (30 clone groups) · ×1
  • Duplication concentrated across 20 sibling directories (30 clone groups) REDACTED:15 — 30 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) — 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.
R10 · Code Duplication · Duplication concentrated across 2 sibling directories (26 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (26 clone groups) src/app/(dashboard)/dashboard/providers/[id]/ModelRow.js:6 — 26 duplicated blocks under src/app/(dashboard)/dashboard/providers/ have copies in at least two of the sibling directories [id], components — 22 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 26 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 26 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 26 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 · Duplication concentrated across 7 sibling directories (24 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (24 clone groups) REDACTED:486 — 24 duplicated blocks under open-sse/ have copies in at least two of the sibling directories executors, handlers, services, shared, transformer, translator (+1 more sibling(s) not listed) — 19 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 24 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 24 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 24 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 · Duplication concentrated across 2 sibling directories (11 clone groups) · ×1
  • 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.
R10 · Code Duplication · Duplication concentrated across 10 sibling directories (9 clone groups) · ×1
  • Duplication concentrated across 10 sibling directories (9 clone groups) REDACTED:19 — 9 duplicated blocks under src/app/api/oauth/ have copies in at least two of the sibling directories [provider], codex, commandcode, cursor, gitlab, grok-cli (+4 more sibling(s) not listed) — 7 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 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 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 9 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 · Duplication concentrated across 5 sibling directories (8 clone groups) · ×1
  • 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 — 1 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 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.
R10 · Code Duplication · Duplication concentrated across 12 sibling directories (6 clone groups) · ×1
  • Duplication concentrated across 12 sibling directories (6 clone groups) REDACTED: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.
R10 · Code Duplication · Duplication concentrated across 2 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (5 clone groups) open-sse/translator/formats/responsesApi.js:84 — 5 of the duplicated blocks reported below have copies in at least two of the sibling directories formats, request under open-sse/translator/. 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 (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.
R10 · Code Duplication · Wholesale file copy (166 identical lines × 2 files) · ×1
  • 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 (145 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (145 matched lines × 2 locations) src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:258 — src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:258 · src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/SttExampleCard.js:123 — the two spans are one implementation copied and then locally edited — 731 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 (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 (138 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (138 matched lines × 2 locations) open-sse/executors/opencode-zen.js:12 — open-sse/executors/opencode-zen.js:12 · open-sse/executors/opencode.js:21 — the two spans are one implementation copied and then locally edited — 1129 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 (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 (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 (103 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (103 matched lines × 2 locations) src/sse/handlers/fetch.js:38 — src/sse/handlers/fetch.js:38 · src/sse/handlers/search.js:35 — the two spans are one implementation copied and then locally edited — 749 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) · ×1
  • Duplicated block with local edits (100 matched lines × 2 locations) REDACTED:15 — REDACTED:15 · REDACTED:15 — the two spans are one implementation copied and then locally edited — 688 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) REDACTED:10 — REDACTED:10 · REDACTED: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 (98 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (98 matched lines × 2 locations) open-sse/executors/opencode-go.js:67 — open-sse/executors/opencode-go.js:67 · open-sse/executors/opencode-zen.js:190 — the two spans are one implementation copied and then locally edited — 860 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (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 — 620 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.
R10 · Code Duplication · Duplicated block (83 lines × 2 locations) · ×1
  • 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 (79 lines × 2 locations) · ×1
  • Duplicated block (79 lines × 2 locations) REDACTED:231 — REDACTED:231 · src/shared/utils/selectableModels.js:90 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (77 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (77 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 — 532 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 · Wholesale file copy (74 identical lines × 2 files) · ×1
  • Wholesale file copy (74 identical lines × 2 files) REDACTED:3 — REDACTED:3 · REDACTED: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 (70 lines × 2 locations) · ×1
  • Duplicated block (70 lines × 2 locations) REDACTED:343 — REDACTED:343 · src/shared/utils/selectableModels.js:202 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function handleChatCore (cyclomatic 170, cognitive 208) · ×1
  • Complex function handleChatCore (cyclomatic 170, cognitive 208) open-sse/handlers/chatCore.js:64 — handleChatCore has cyclomatic complexity 170 and cognitive complexity 208; 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 testApiKeyConnection (cyclomatic 162, cognitive 170) · ×1
  • Complex function testApiKeyConnection (cyclomatic 162, cognitive 170) src/app/api/providers/[id]/test/testUtils.js:524 — testApiKeyConnection has cyclomatic complexity 162 and cognitive complexity 170; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 getUsageStats (cyclomatic 156, cognitive 264) · ×1
  • Complex function getUsageStats (cyclomatic 156, cognitive 264) src/lib/db/repos/usageRepo.js:348 — getUsageStats has cyclomatic complexity 156 and cognitive complexity 264; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function POST (cyclomatic 144, cognitive 129) · ×1
  • Complex function POST (cyclomatic 144, cognitive 129) REDACTED:93 — POST has cyclomatic complexity 144 and cognitive complexity 129; 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.
R2 · Cyclomatic Complexity · Complex function applyFormat (cyclomatic 109, cognitive 142) · ×1
  • Complex function applyFormat (cyclomatic 109, cognitive 142) open-sse/translator/concerns/thinkingUnified.js:266 — applyFormat has cyclomatic complexity 109 and cognitive complexity 142; 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 handleComboChat (cyclomatic 106, cognitive 201) · ×1
  • Complex function handleComboChat (cyclomatic 106, cognitive 201) open-sse/services/combo.js:354 — handleComboChat has cyclomatic complexity 106 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.
R2 · Cyclomatic Complexity · Complex function transform (cyclomatic 105, cognitive 237) · ×1
  • Complex function transform (cyclomatic 105, cognitive 237) open-sse/utils/stream.js:152 — transform has cyclomatic complexity 105 and cognitive complexity 237; 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 buildModelsList (cyclomatic 84, cognitive 173) · ×1
  • Complex function buildModelsList (cyclomatic 84, cognitive 173) REDACTED:330 — buildModelsList has cyclomatic complexity 84 and cognitive complexity 173; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseQuotaData (cyclomatic 80, cognitive 97) · ×1
  • Complex function parseQuotaData (cyclomatic 80, cognitive 97) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:362 — parseQuotaData has cyclomatic complexity 80 and cognitive complexity 97; 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 ProfilePage (cyclomatic 80, cognitive 77) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function pingModelByKind (cyclomatic 78, cognitive 87) · ×1
  • Complex function pingModelByKind (cyclomatic 78, cognitive 87) src/app/api/models/test/ping.js:58 — 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.
R2 · Cyclomatic Complexity · Complex function POST (cyclomatic 74, cognitive 127) · ×1
  • Complex function POST (cyclomatic 74, cognitive 127) REDACTED:317 — POST has cyclomatic complexity 74 and cognitive complexity 127; 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 (anonymous) (cyclomatic 74, cognitive 112) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function openaiResponsesToOpenAIResponse (cyclomatic 74, cognitive 88) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function openaiToGeminiBase (cyclomatic 73, cognitive 182) · ×1
  • Complex function openaiToGeminiBase (cyclomatic 73, cognitive 182) open-sse/translator/request/openai-to-gemini.js:77 — openaiToGeminiBase has cyclomatic complexity 73 and cognitive complexity 182; 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 handleForcedSSEToJson (cyclomatic 71, cognitive 86) · ×1
  • Complex function handleForcedSSEToJson (cyclomatic 71, cognitive 86) open-sse/handlers/chatCore/sseToJsonHandler.js:189 — handleForcedSSEToJson has cyclomatic complexity 71 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function translateNonStreamingResponse (cyclomatic 70, cognitive 96) · ×1
  • Complex function translateNonStreamingResponse (cyclomatic 70, cognitive 96) open-sse/handlers/chatCore/nonStreamingHandler.js:97 — 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.
R2 · Cyclomatic Complexity · Complex function ConnectionRow (cyclomatic 70, cognitive 66) · ×1
  • Complex function ConnectionRow (cyclomatic 70, cognitive 66) src/app/(dashboard)/dashboard/providers/[id]/ConnectionRow.js:10 — ConnectionRow has cyclomatic complexity 70 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseGrokCliBilling (cyclomatic 70, cognitive 56) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function startServer (cyclomatic 69, cognitive 119) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function processEvent (cyclomatic 69, cognitive 101) · ×1
  • Complex function processEvent (cyclomatic 69, cognitive 101) open-sse/executors/kiro.js:799 — 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.
R2 · Cyclomatic Complexity · Complex function prepareClaudeRequest (cyclomatic 66, cognitive 135) · ×1
  • Complex function prepareClaudeRequest (cyclomatic 66, cognitive 135) open-sse/translator/formats/claude.js:495 — prepareClaudeRequest has cyclomatic complexity 66 and cognitive complexity 135; 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 GET (cyclomatic 65, cognitive 109) · ×1
  • Complex function GET (cyclomatic 65, cognitive 109) REDACTED:95 — GET has cyclomatic complexity 65 and cognitive complexity 109; 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 APIPageClient (cyclomatic 62, cognitive 52) · ×1
  • Complex function APIPageClient (cyclomatic 62, cognitive 52) REDACTED:22 — 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.
R2 · Cyclomatic Complexity · Complex function TokenSaverClient (cyclomatic 60, cognitive 58) · ×1
  • Complex function TokenSaverClient (cyclomatic 60, cognitive 58) src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:13 — TokenSaverClient has cyclomatic complexity 60 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function claudeToOpenAIResponse (cyclomatic 57, cognitive 91) · ×1
  • Complex function claudeToOpenAIResponse (cyclomatic 57, cognitive 91) open-sse/translator/response/claude-to-openai.js:19 — claudeToOpenAIResponse has cyclomatic complexity 57 and cognitive complexity 91; 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 parseStream (cyclomatic 54, cognitive 114) · ×1
  • Complex function parseStream (cyclomatic 54, cognitive 114) open-sse/handlers/imageProviders/codex.js:187 — parseStream has cyclomatic complexity 54 and cognitive complexity 114; 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 handleImageGenerationCore (cyclomatic 54, cognitive 94) · ×1
  • Complex function handleImageGenerationCore (cyclomatic 54, cognitive 94) open-sse/handlers/imageGenerationCore.js:30 — handleImageGenerationCore has cyclomatic complexity 54 and cognitive complexity 94; 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 convertMessages (cyclomatic 53, cognitive 115) · ×1
  • Complex function convertMessages (cyclomatic 53, cognitive 115) open-sse/translator/request/openai-to-kiro.js:43 — convertMessages has cyclomatic complexity 53 and cognitive complexity 115; 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 testOAuthConnection (cyclomatic 53, cognitive 84) · ×1
  • Complex function testOAuthConnection (cyclomatic 53, cognitive 84) src/app/api/providers/[id]/test/testUtils.js:369 — testOAuthConnection has cyclomatic complexity 53 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function transformRequest (cyclomatic 53, cognitive 73) · ×1
  • Complex function transformRequest (cyclomatic 53, cognitive 73) open-sse/executors/codex.js:414 — transformRequest has cyclomatic complexity 53 and cognitive complexity 73; 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 startOAuthFlow (cyclomatic 53, cognitive 73) · ×1
  • Complex function startOAuthFlow (cyclomatic 53, cognitive 73) src/shared/components/OAuthModal.js:270 — startOAuthFlow has cyclomatic complexity 53 and cognitive complexity 73; 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 getProviderCredentials (cyclomatic 53, cognitive 52) · ×1
  • Complex function getProviderCredentials (cyclomatic 53, cognitive 52) src/sse/services/auth.js:28 — getProviderCredentials has cyclomatic complexity 53 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.
R2 · Cyclomatic Complexity · Complex function execute (cyclomatic 52, cognitive 81) · ×1
  • Complex function execute (cyclomatic 52, cognitive 81) open-sse/executors/deepseek-web.js:794 — execute has cyclomatic complexity 52 and cognitive complexity 81; 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 runConnect (cyclomatic 51, cognitive 72) · ×1
  • Complex function runConnect (cyclomatic 51, cognitive 72) REDACTED:273 — runConnect has cyclomatic complexity 51 and cognitive complexity 72; 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 commandCodeToOpenAIResponse (cyclomatic 51, cognitive 54) · ×1
  • Complex function commandCodeToOpenAIResponse (cyclomatic 51, cognitive 54) open-sse/translator/response/commandcode-to-openai.js:52 — commandCodeToOpenAIResponse has cyclomatic complexity 51 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 ProviderLimits (cyclomatic 51, cognitive 46) · ×1
  • Complex function ProviderLimits (cyclomatic 51, cognitive 46) REDACTED:156 — ProviderLimits has cyclomatic complexity 51 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 51, cognitive 44) · ×1
  • Complex function (anonymous) (cyclomatic 51, cognitive 44) REDACTED:1119 — (anonymous) has cyclomatic complexity 51 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function rewriteBlock (cyclomatic 49, cognitive 70) · ×1
  • Complex function rewriteBlock (cyclomatic 49, cognitive 70) open-sse/shared/qoder/attachments.js:158 — rewriteBlock has cyclomatic complexity 49 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function convertClaudeMessagesToKiro (cyclomatic 48, cognitive 120) · ×1
  • Complex function convertClaudeMessagesToKiro (cyclomatic 48, cognitive 120) open-sse/translator/request/claude-to-kiro.js:45 — convertClaudeMessagesToKiro has cyclomatic complexity 48 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · src/app/(dashboard)/dashboard/providers/[id]/page.js · ×1
  • src/app/(dashboard)/dashboard/providers/[id]/page.js: 1903 lines of code src/app/(dashboard)/dashboard/providers/[id]/page.js:1 — src/app/(dashboard)/dashboard/providers/[id]/page.js has 1903 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1591 lines of code REDACTED:1 — REDACTED has 1591 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1576 lines of code REDACTED:1 — REDACTED has 1576 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1321 lines of code REDACTED:1 — REDACTED has 1321 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/app/(dashboard)/dashboard/combos/page.js · ×1
  • src/app/(dashboard)/dashboard/combos/page.js: 1290 lines of code src/app/(dashboard)/dashboard/combos/page.js:1 — src/app/(dashboard)/dashboard/combos/page.js has 1290 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1255 lines of code REDACTED:1 — REDACTED has 1255 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/executors/kiro.js · ×1
  • open-sse/executors/kiro.js: 1165 lines of code open-sse/executors/kiro.js:1 — open-sse/executors/kiro.js has 1165 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1129 lines of code REDACTED:1 — REDACTED has 1129 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js · ×1
  • src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js: 1037 lines of code src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js:1 — src/app/(dashboard)/dashboard/token-saver/TokenSaverClient.js has 1037 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/executors/deepseek-web.js · ×1
  • open-sse/executors/deepseek-web.js: 1014 lines of code open-sse/executors/deepseek-web.js:1 — open-sse/executors/deepseek-web.js has 1014 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 994 lines of code REDACTED:1 — REDACTED has 994 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 992 lines of code REDACTED:1 — REDACTED has 992 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/utils/cursorProtobuf.js · ×1
  • open-sse/utils/cursorProtobuf.js: 968 lines of code open-sse/utils/cursorProtobuf.js:1 — open-sse/utils/cursorProtobuf.js has 968 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 947 lines of code REDACTED:1 — REDACTED has 947 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 936 lines of code REDACTED:1 — REDACTED has 936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/components/OAuthModal.js · ×1
  • src/shared/components/OAuthModal.js: 933 lines of code src/shared/components/OAuthModal.js:1 — src/shared/components/OAuthModal.js has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/lib/oauth/utils/server.js · ×1
  • src/lib/oauth/utils/server.js: 884 lines of code src/lib/oauth/utils/server.js:1 — src/lib/oauth/utils/server.js has 884 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js · ×1
  • src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js: 862 lines of code src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js:1 — src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js has 862 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 847 lines of code REDACTED:1 — REDACTED has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js · ×1
  • src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js: 842 lines of code src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js:1 — src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js has 842 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/providers/capabilities.js · ×1
  • open-sse/providers/capabilities.js: 833 lines of code open-sse/providers/capabilities.js:1 — open-sse/providers/capabilities.js has 833 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/services/combo.js · ×1
  • open-sse/services/combo.js: 812 lines of code open-sse/services/combo.js:1 — open-sse/services/combo.js has 812 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 806 lines of code REDACTED:1 — REDACTED has 806 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 803 lines of code REDACTED:1 — REDACTED has 803 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · cli/src/cli/menus/providers.js · ×1
  • cli/src/cli/menus/providers.js: 787 lines of code cli/src/cli/menus/providers.js:1 — cli/src/cli/menus/providers.js has 787 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/executors/devin-cli.js · ×1
  • open-sse/executors/devin-cli.js: 784 lines of code open-sse/executors/devin-cli.js:1 — open-sse/executors/devin-cli.js has 784 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 773 lines of code REDACTED:1 — REDACTED has 773 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/services/tokenRefresh/providers.js · ×1
  • open-sse/services/tokenRefresh/providers.js: 767 lines of code open-sse/services/tokenRefresh/providers.js:1 — open-sse/services/tokenRefresh/providers.js has 767 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/executors/gemini-web.js · ×1
  • open-sse/executors/gemini-web.js: 733 lines of code open-sse/executors/gemini-web.js:1 — open-sse/executors/gemini-web.js has 733 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/lib/db/repos/usageRepo.js · ×1
  • src/lib/db/repos/usageRepo.js: 723 lines of code src/lib/db/repos/usageRepo.js:1 — src/lib/db/repos/usageRepo.js has 723 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js · ×1
  • src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js: 721 lines of code src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js:1 — src/app/(dashboard)/dashboard/cli-tools/components/GenericCliToolCard.js has 721 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/app/api/providers/[id]/models/route.js · ×1
  • src/app/api/providers/[id]/models/route.js: 680 lines of code src/app/api/providers/[id]/models/route.js:1 — src/app/api/providers/[id]/models/route.js has 680 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/translator/formats/claude.js · ×1
  • open-sse/translator/formats/claude.js: 675 lines of code open-sse/translator/formats/claude.js:1 — open-sse/translator/formats/claude.js has 675 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js · ×1
  • src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js: 670 lines of code src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js:1 — src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/TtsExampleCard.js has 670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 665 lines of code REDACTED:1 — REDACTED has 665 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 647 lines of code REDACTED:1 — REDACTED has 647 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 641 lines of code REDACTED:1 — REDACTED has 641 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js · ×1
  • src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js: 630 lines of code src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js:1 — src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/components/GenericExampleCard.js has 630 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · open-sse/executors/muse-web.js · ×1
  • open-sse/executors/muse-web.js: 625 lines of code open-sse/executors/muse-web.js:1 — open-sse/executors/muse-web.js has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · cli/src/cli/menus/cliTools.js · ×1
  • cli/src/cli/menus/cliTools.js: 624 lines of code cli/src/cli/menus/cliTools.js:1 — cli/src/cli/menus/cliTools.js has 624 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R4 · Test Coverage · This test file cannot be loaded · ×1
  • This test file cannot be loaded tests/unit/embeddings.cloud.test.js:65 — 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:65 — 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.
R7 · Dead Code · Dead file (~318 LoC) · ×1
  • Dead file (~318 LoC) src/lib/oauth/services/antigravity.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~239 LoC) · ×1
  • Dead file (~239 LoC) src/lib/oauth/services/gemini.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~225 LoC) · ×1
  • Dead file (~225 LoC) src/lib/oauth/services/github.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~201 LoC) · ×1
  • Dead file (~201 LoC) src/lib/oauth/services/iflow.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~187 LoC) · ×1
  • Dead file (~187 LoC) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~144 LoC) · ×1
  • Dead file (~144 LoC) src/lib/oauth/services/codex.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~135 LoC) · ×1
  • Dead file (~135 LoC) src/lib/oauth/services/claude.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~134 LoC) · ×1
  • Dead file (~134 LoC) open-sse/providers/registry/opencode-zen.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~133 LoC) · ×1
  • Dead file (~133 LoC) src/lib/oauth/services/kimchi.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~132 LoC) · ×1
  • Dead file (~132 LoC) src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaProgressBar.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~122 LoC) · ×1
  • Dead file (~122 LoC) src/lib/oauth/services/openai.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~107 LoC) · ×1
  • Dead file (~107 LoC) open-sse/providers/registry/nous.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~105 LoC) · ×1
  • Dead file (~105 LoC) open-sse/providers/registry/github.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~102 LoC) · ×1
  • Dead file (~102 LoC) open-sse/providers/registry/opencode-go.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~97 LoC) · ×1
  • Dead file (~97 LoC) open-sse/providers/registry/grok-cli.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~94 LoC) · ×1
  • Dead file (~94 LoC) open-sse/providers/registry/xiaomi-mimo.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~93 LoC) · ×1
  • Dead file (~93 LoC) open-sse/providers/registry/glm.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~85 LoC) · ×1
  • Dead file (~85 LoC) open-sse/providers/registry/openai.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~84 LoC) · ×1
  • Dead file (~84 LoC) open-sse/providers/registry/minimax.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~82 LoC) · ×1
  • Dead file (~82 LoC) open-sse/providers/registry/codebuddy-intl.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~81 LoC) · ×1
  • Dead file (~81 LoC) open-sse/providers/registry/uc-web.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~76 LoC) · ×1
  • Dead file (~76 LoC) open-sse/providers/registry/trae.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~74 LoC) · ×1
  • Dead file (~74 LoC) open-sse/providers/registry/deepseek.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~73 LoC) · ×1
  • Dead file (~73 LoC) open-sse/providers/registry/selfhosted-embedding.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~72 LoC) · ×1
  • Dead file (~72 LoC) open-sse/providers/registry/clinepass.js — no import path from any entry point (264 application, 11 tooling, 477 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
R7 · Dead Code · Dead file (~69 LoC) · ×1
  • Dead file (~69 LoC) open-sse/providers/registry/muse.js — no import path from any entry point (264 application, 11 tooling, 477 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
R8 · Dependency Hygiene · Unlisted import 'got-scraping' · ×1
  • Unlisted import 'got-scraping' REDACTED:59 — 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.
R8 · Dependency Hygiene · Unused dependency 'monaco-editor' · ×1
  • 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.
R8 · Dependency Hygiene · Unused dependency 'playwright-core' · ×1
  • Unused dependency 'playwright-core' — 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.
R8 · Dependency Hygiene · Unused dependency 'node-forge' · ×1
  • Unused dependency 'node-forge' — Declared in cli/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.
R8 · Dependency Hygiene · Unused dependency 'react' · ×1
  • Unused dependency 'react' — Declared in cli/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.
X14 · Bypassable address classification · IP classification is bypassable through an IPv4-in-IPv6 embedding · ×1
  • IP classification is bypassable through an IPv4-in-IPv6 embedding open-sse/executors/veoaifree-web.js:33 — This function unwraps IPv4-MAPPED IPv6 (`::ffff:`, line 24) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 33 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) src/shared/utils/ssrfGuard.js:185 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Minor — 284 finding(s)
D24 · Comment Value · redundant comment · ×62
  • redundant comment REDACTED:429 — "Normalize Responses input" repeats the code it sits on: 3 of its 3 words (normalize, responses, input) are already in `const normalized = normalizeResponsesInput(body.input);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/services/compact.js:62 — "Return 503 with last error" repeats the code it sits on: 4 of its 4 words (return, 503, last, error) are already in `return new Response(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/services/model.js:78 — "Or object { provider, model }" repeats the code it sits on: 3 of its 3 words (object, provider, model) are already in `if (typeof resolved === "object" && resolved.provider && resolved.model)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/services/provider.js:134 — "Get target format for provider" repeats the code it sits on: 4 of its 4 words (get, target, format, provider) are already in `export function getTargetFormat(provider, credentials = null)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/services/usage/antigravity-weekly.js:59 — "Groups may live at data.groups or data.quotaSummary.groups" repeats the code it sits on: 4 of its 5 words (groups, data, quota, summary) are already in `const groups = Array.isArray(data.groups)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/concerns/toolCall.js:64 — "Validate tool_use_id in tool_result blocks" repeats the code it sits on: 5 of its 6 words (tool, use, id, result, blocks) are already in `if (block.type === "tool_result" && block.tool_use_id && !TOOL_ID_PATTERN.test(block.tool_use_id))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/concerns/toolCall.js:138 — "Check if next message has tool_result" repeats the code it sits on: 4 of its 5 words (check, next, tool, result) are already in `if (nextMsg && !hasToolResults(nextMsg, toolCallIds))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/formats/gemini.js:46 — 6 comments in this file only repeat the code they sit on (lines 46, 66, 138, 148, 182, 309), for example "Default safety settings". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/index.js:68 — "Translate request: source -> openai -> target" repeats the code it sits on: 4 of its 5 words (translate, request, source, target) are already in `export function translateRequest(sourceFormat, targetFormat, model, body, stream = true, credentials = null, provider = …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/index.js:183 — "Translate response chunk: target -> openai -> source" repeats the code it sits on: 5 of its 6 words (translate, response, chunk, target, source) are already in `export function translateResponse(targetFormat, sourceFormat, chunk, state)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/request/claude-to-openai.js:293 — "Convert tool choice" repeats the code it sits on: 3 of its 3 words (convert, tool, choice) are already in `function convertToolChoice(choice)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/request/gemini-to-openai.js:145 — "Extract text from Gemini content" repeats the code it sits on: 4 of its 4 words (extract, text, gemini, content) are already in `function extractGeminiText(content)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/request/openai-to-claude.js:249 — "Get content blocks from single message" repeats the code it sits on: 4 of its 5 words (get, content, blocks, message) are already in `function getContentBlocksFromMessage(msg, toolNameMap = new Map())`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/request/openai-to-gemini.js:365 — "Keep safetySettings for Gemini CLI" repeats the code it sits on: 4 of its 5 words (safety, settings, gemini, cli) are already in `envelope.request.safetySettings = geminiCLI.safetySettings;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/request/openai-to-kiro.js:140 — "Check for tool_result blocks" repeats the code it sits on: 4 of its 4 words (check, tool, result, blocks) are already in `const toolResultBlocks = msg.content.filter(c => c.type === CLAUDE_BLOCK.TOOL_RESULT);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/translator/response/claude-to-openai.js:129 — "prompt_tokens = input_tokens + cache_read + cache_creation (all prompt-side tokens)" repeats the code it sits on: 6 of its 7 words (prompt, tokens, input, cache, read, creation) are already in `const promptTokens = inputTokens + cacheReadTokens + cacheCreationTokens;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/utils/bypassHandler.js:187 — "Create OpenAI streaming chunks" repeats the code it sits on: 5 of its 5 words (create, open, ai, streaming, chunks) are already in `const openaiChunks = createOpenAIStreamingChunks(openaiResponse);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/utils/clientDetector.js:35 — "Claude Code / Claude CLI" repeats the code it sits on: 3 of its 3 words (claude, code, cli) are already in `if (ua.includes("claude-cli") || ua.includes("claude-code") || xApp === "cli") return "claude";`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/utils/requestLogger.js:60 — "Write JSON file" repeats the code it sits on: 3 of its 3 words (write, json, file) are already in `function writeJsonFile(sessionPath, filename, data)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment open-sse/utils/stream.js:422 — "Translate: targetFormat -> openai -> sourceFormat" repeats the code it sits on: 4 of its 5 words (translate, target, format, source) are already in `const translated = translateResponse(targetFormat, sourceFormat, parsed, state);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:90 — "hasProviderSpecificData" repeats the code it sits on: 3 of its 3 words (provider, specific, data) are already in `if (line.includes("hasProviderSpecificData: true")) extra.hasProviderSpecificData = true;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js:18 — "MediaProviderDetailPage" repeats the code it sits on: 4 of its 4 words (media, provider, detail, page) are already in `export default function MediaProviderDetailPage()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaProgressBar.js:35 — "Format reset time display" repeats the code it sits on: 4 of its 4 words (format, reset, time, display) are already in `const formatResetTimeDisplay = (resetTime) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:183 — "Write new settings" repeats the code it sits on: 3 of its 3 words (write, new, settings) are already in `await fs.writeFile(settingsPath, JSON.stringify(newSettings, null, 2));`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:113 — "Register the session with the private key for decryption" repeats the code it sits on: 4 of its 5 words (register, session, private, key) are already in `registerXiaomiMimoSession({ state, privateKeyDer });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 37 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate REDACTED:42 — `!Array.isArray(accounts) || accounts.length === 0` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:400 — `!Array.isArray(messages) || messages.length === 0` appears character-identically in 3 files — REDACTED, REDACTED, open-sse/shared/qoder/attachments.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/systemoneRouter.js:145 — `!Array.isArray(models) || models.length <= 1` appears character-identically in 2 files — open-sse/services/systemoneRouter.js, src/sse/services/systemoneRouter.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/cursorModels.js:224 — `!Array.isArray(models) || models.length === 0` appears character-identically in 2 files — open-sse/services/cursorModels.js, src/lib/comboPresets.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:163 — `!Array.isArray(out.input) || out.input.length === 0` appears character-identically in 2 files — 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 REDACTED:185 — `!Array.isArray(tools) || tools.length === 0` appears character-identically in 5 files — REDACTED, REDACTED, open-sse/translator/request/openai-to-commandcode.js, open-sse/translator/webTools.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 REDACTED:16 — `!accessToken || typeof accessToken !== "string"` appears character-identically in 4 files — REDACTED, REDACTED, REDACTED, src/lib/oauth/services/cursor.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/cursor.js:175 — `!accessToken || typeof accessToken !== "string" || !accessToken.trim()` appears character-identically in 2 files — open-sse/services/usage/cursor.js, open-sse/services/usage/zed.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/commandcode.js:82 — `!apiKey || typeof apiKey !== "string" || !apiKey.trim()` appears character-identically in 8 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/executors/codex.js:452 — `!body.input || (Array.isArray(body.input) && body.input.length === 0)` appears character-identically in 2 files — open-sse/executors/codex.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/concerns/toolCall.js:28 — `!body.messages || !Array.isArray(body.messages)` appears character-identically in 2 files — open-sse/translator/concerns/toolCall.js, open-sse/translator/formats/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/handlers/systemoneCore.js:68 — `!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 REDACTED:122 — `!bundledPath || !fs.existsSync(bundledPath)` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/app/(dashboard)/dashboard/providers/[id]/EditCompatibleNodeModal.js:119 — `!checkKey || validating || !formData.baseUrl.trim()` appears character-identically in 2 files — src/app/(dashboard)/dashboard/providers/[id]/EditCompatibleNodeModal.js, src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.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/request/antigravity-to-openai.js:123 — `!content.parts || !Array.isArray(content.parts)` appears character-identically in 2 files — open-sse/translator/request/antigravity-to-openai.js, open-sse/translator/request/gemini-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 REDACTED:259 — `!credentials || credentials.allRateLimited` appears character-identically in 11 files — REDACTED, src/sse/handlers/chat.js, src/sse/handlers/embeddings.js, src/sse/handlers/fetch.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/opencode-go.js:71 — `!data?.usage || typeof data.usage !== "object"` appears character-identically in 2 files — open-sse/services/usage/opencode-go.js, open-sse/services/usage/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/(dashboard)/dashboard/providers/components/ConnectionsCard.js:261 — `!formData.apiKey || validating || saving` appears character-identically in 2 files — src/app/(dashboard)/dashboard/providers/components/ConnectionsCard.js, src/shared/components/EditConnectionModal.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]/EditCompatibleNodeModal.js:37 — `!formData.name.trim() || !formData.prefix.trim() || !formData.baseUrl.trim()` appears character-identically in 3 files — src/app/(dashboard)/dashboard/providers/[id]/EditCompatibleNodeModal.js, src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.js, src/shared/components/AddCustomEmbeddingModal.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/components/AddCompatibleModal.js:197 — `!formData.name.trim() || !formData.prefix.trim() || !formData.baseUrl.trim() || submitting` appears character-identically in 2 files — src/app/(dashboard)/dashboard/providers/components/AddCompatibleModal.js, src/shared/components/AddCustomEmbeddingModal.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 REDACTED:338 — `!getModelKind(m) || getModelKind(m) === "llm"` appears character-identically in 2 files — REDACTED, src/shared/utils/selectableModels.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:739 — `!input || typeof input !== "object" || Array.isArray(input)` appears character-identically in 2 files — open-sse/executors/kiro.js, src/shared/utils/keyAccess.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/shared/components/ChangelogModal.js:45 — `!isOpen || typeof document === "undefined"` appears character-identically in 2 files — src/shared/components/ChangelogModal.js, src/shared/components/DonateModal.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, REDACTED, 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.
  • + 15 more in this group — see findings.md.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×40
  • Hand-rolled JSON/XML parsing via regex REDACTED:69 — 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:672 — 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/lib/oauth/utils/zedCredentials.js:242 — 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/lib/oauth/utils/zedCredentials.js:243 — 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.
  • Hand-rolled JSON/XML parsing via regex src/app/landing/components/GetStarted.js:75 — 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/landing/components/GetStarted.js:76 — 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 REDACTED:969 — 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:970 — 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:972 — 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:973 — 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:1036 — 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:1037 — 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:1098 — 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:264 — 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:266 — 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:267 — 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:1098 — 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:1110 — 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:1111 — 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:1112 — 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.
  • + 15 more in this group — see findings.md.
P2 · Observability · Console output used as the logging channel · ×39
  • Console output used as the logging channel src/proxy.js:36 — `src/proxy.js` reports through `console.*` at line 36 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/proxy.js:51 — `src/proxy.js` reports through `console.*` at line 51 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/proxy.js:56 — `src/proxy.js` reports through `console.*` at line 56 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/sse/services/auth.js:291 — `src/sse/services/auth.js` reports through `console.*` at line 291 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/bootstrap.js:11 — `src/shared/services/bootstrap.js` reports through `console.*` at line 11 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:75 — `src/shared/services/initializeApp.js` reports through `console.*` at line 75 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:78 — `src/shared/services/initializeApp.js` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:89 — `src/shared/services/initializeApp.js` reports through `console.*` at line 89 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:90 — `src/shared/services/initializeApp.js` reports through `console.*` at line 90 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:96 — `src/shared/services/initializeApp.js` reports through `console.*` at line 96 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:97 — `src/shared/services/initializeApp.js` reports through `console.*` at line 97 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:113 — `src/shared/services/initializeApp.js` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:120 — `src/shared/services/initializeApp.js` reports through `console.*` at line 120 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:142 — `src/shared/services/initializeApp.js` reports through `console.*` at line 142 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:149 — `src/shared/services/initializeApp.js` reports through `console.*` at line 149 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:151 — `src/shared/services/initializeApp.js` reports through `console.*` at line 151 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:154 — `src/shared/services/initializeApp.js` reports through `console.*` at line 154 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:156 — `src/shared/services/initializeApp.js` reports through `console.*` at line 156 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:159 — `src/shared/services/initializeApp.js` reports through `console.*` at line 159 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:185 — `src/shared/services/initializeApp.js` reports through `console.*` at line 185 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:190 — `src/shared/services/initializeApp.js` reports through `console.*` at line 190 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:194 — `src/shared/services/initializeApp.js` reports through `console.*` at line 194 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:197 — `src/shared/services/initializeApp.js` reports through `console.*` at line 197 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:219 — `src/shared/services/initializeApp.js` reports through `console.*` at line 219 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/shared/services/initializeApp.js:221 — `src/shared/services/initializeApp.js` reports through `console.*` at line 221 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • + 14 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×38
  • Silent fallback default in catch REDACTED: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:90 — `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 REDACTED:217 — `missingSharedLibs` 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 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 REDACTED:157 — `collectChatGptWebFirstPartyAssetCandidates` 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 open-sse/translator/webTools.js:357 — `toArgumentsString` 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/utils/geminiCookies.js:12 — `cookiePairsFromJson` 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/executors/gemini-web.js:415 — `testConnection` 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 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/translator/concerns/claudeMessage.js:10 — `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:20 — `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/browserProfileCache.js:36 — `directorySize` 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/services/usage/antigravity-weekly.js:154 — `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/services/webLogin.js:122 — `listWebLoginProfiles` 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 — `createStore.read` 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.
  • + 13 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned file · ×26
  • Orphaned file src/app/(dashboard)/dashboard/pxpipe/PxpipeClient.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file cli/src/cli/commands/xaiVideo.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/lib/auth/saml.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/shared/components/PricingModal.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/lib/oauth/services/xai.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/lib/auth/oidc.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/app/dashboard/settings/pricing/page.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file open-sse/services/oauthCredentialManager.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/lib/oauth/kiroExternalIdp.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file open-sse/handlers/imageProviders/cloudflareAi.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file open-sse/rtk/pxpipe.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/lib/pxpipe/install.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/app/(dashboard)/dashboard/cli-tools/components/EndpointPresetControl.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file open-sse/services/grokCliModels.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/lib/pxpipe/events.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file open-sse/executors/iflow.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/app/api/auth/oidc/callback/route.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/lib/pxpipe/loader.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/lib/oauth/constants/xai.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 1 more in this group — see findings.md.
D10 · Test Quality · Mock-dominated test · ×8
  • Mock-dominated test: logs why Headroom was skipped on chat completions tests/unit/headroom-chat-core.test.js:61 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: scrubs credentials and query strings from Headroom fetch errors tests/unit/headroom-chat-core.test.js:97 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: masks credentials and query strings in Headroom endpoint diagnostics tests/unit/headroom-chat-core.test.js:130 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: sends Headroom-compressed messages to the %s executor tests/unit/headroom-chat-core.test.js:163 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 7 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: preserves Claude PDFs and tool results through Headroom to the %s executor tests/unit/headroom-chat-core.test.js:255 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: does not warn about healthy message compression when tools dominate the body tests/unit/headroom-chat-core.test.js:294 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: warns when Headroom reports savings but messages barely shrink tests/unit/headroom-chat-core.test.js:338 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: bypasses token savers when requested by the client tests/unit/headroom-chat-core.test.js:380 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
M4 · Documentation accuracy · README/code drift · ×5
  • README/code drift i18n/README.fa_IR.md:20 — i18n/README.fa_IR.md links to `./i18n/README.vi.md`, but `i18n/i18n/README.vi.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift i18n/README.fa_IR.md:20 — i18n/README.fa_IR.md links to `./i18n/README.zh-CN.md`, but `i18n/i18n/README.zh-CN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift i18n/README.fa_IR.md:20 — i18n/README.fa_IR.md links to `./i18n/README.ja-JP.md`, but `i18n/i18n/README.ja-JP.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift i18n/README.fa_IR.md:20 — i18n/README.fa_IR.md links to `./i18n/README.ru.md`, but `i18n/i18n/README.ru.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift i18n/README.fa_IR.md:20 — i18n/README.fa_IR.md links to `./i18n/README.fa_IR.md`, but `i18n/i18n/README.fa_IR.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
D16 · Bus Factor · Off-boarding risk · ×3
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 44 significant file(s) lose their only recent owner: open-sse/executors/devin-cli.js, REDACTED, src/shared/components/Sidebar.js, src/app/(dashboard)/dashboard/cli-tools/components/JcodeToolCard.js, src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.js, REDACTED, src/app/(dashboard)/dashboard/cli-tools/components/KiloToolCard.js, REDACTED (+36 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 5 significant file(s) lose their only recent owner: src/shared/components/ZedAuthModal.js, src/lib/oauth/utils/zedCredentials.js, open-sse/services/usage/zed.js, src/lib/comboPresets.js, REDACTED. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: cli/src/cli/commands/connectTools.js, REDACTED, cli/src/cli/commands/show.js. Pair on, review, or document these before any departure.
X7 · Silent fallback defaults · Pending state with no failure state · ×2
  • Pending state with no failure state src/app/dashboard/settings/pricing/page.js:141 — The view draws `Loading pricing data...` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state src/app/(dashboard)/dashboard/usage/components/UsageChart.js:82 — The view draws `Loading...` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies open-sse/executors/chatgpt-web.js:37 — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 16 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 (73 single-owned of 644 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 644 of the 1108 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (2 file(s)), anonymized user #6 (2 file(s)), anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (1 file(s)) (+10 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/app/(dashboard)/dashboard/usage/components/TopModelsChart.js, src/app/(dashboard)/dashboard/usage/components/ProviderBarChart.js, REDACTED, REDACTED, src/lib/network/netlifyRelay.js, REDACTED, src/app/(dashboard)/dashboard/providers/[id]/BulkImportCodexModal.js, REDACTED (+13 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found package.json:10 — 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/`. ADRs are expected here because `package.json` makes this repository a deployable product (line 10).
D21 · Naming Consistency · `sessionID` spells `ID` where 352 names in the project spell it `Id` · ×1
  • `sessionID` spells `ID` where 352 names in the project spell it `Id` open-sse/executors/iflow.js:29 — 352 of 356 names in project 9router-app spell the token `Id` (352 of 356; unit: names in project 9router-app containing `Id`). Peers: client.loadRawMachineId (REDACTED:37); client.getProviderById (REDACTED:185); client.getComboById (REDACTED:328); combos.showComboDetail(comboId) (cli/src/cli/menus/combos.js:159); providers.getAuthType(providerId) (cli/src/cli/menus/providers.js:169). Rename to `sessionId`. [rule N6]
D21 · Naming Consistency · `userID` spells `ID` where 352 names in the project spell it `Id` · ×1
  • `userID` spells `ID` where 352 names in the project spell it `Id` open-sse/services/minimaxCodeUsage.js:117 — 352 of 356 names in project 9router-app spell the token `Id` (352 of 356; unit: names in project 9router-app containing `Id`). Peers: client.loadRawMachineId (REDACTED:37); client.getProviderById (REDACTED:185); client.getComboById (REDACTED:328); combos.showComboDetail(comboId) (cli/src/cli/menus/combos.js:159); providers.getAuthType(providerId) (cli/src/cli/menus/providers.js:169). Rename to `userId`. [rule N6]
D21 · Naming Consistency · `tierID` spells `ID` where 352 names in the project spell it `Id` · ×1
  • `tierID` spells `ID` where 352 names in the project spell it `Id` open-sse/services/projectId.js:201 — 352 of 356 names in project 9router-app spell the token `Id` (352 of 356; unit: names in project 9router-app containing `Id`). Peers: client.loadRawMachineId (REDACTED:37); client.getProviderById (REDACTED:185); client.getComboById (REDACTED:328); combos.showComboDetail(comboId) (cli/src/cli/menus/combos.js:159); providers.getAuthType(providerId) (cli/src/cli/menus/providers.js:169). Rename to `tierId`. [rule N6]
D21 · Naming Consistency · `generateFakeUserID` spells `ID` where 352 names in the project spell it `Id` · ×1
  • `generateFakeUserID` spells `ID` where 352 names in the project spell it `Id` open-sse/utils/claudeCloaking.js:27 — 352 of 356 names in project 9router-app spell the token `Id` (352 of 356; unit: names in project 9router-app containing `Id`). Peers: client.loadRawMachineId (REDACTED:37); client.getProviderById (REDACTED:185); client.getComboById (REDACTED:328); combos.showComboDetail(comboId) (cli/src/cli/menus/combos.js:159); providers.getAuthType(providerId) (cli/src/cli/menus/providers.js:169). Rename to `generateFakeUserId`. [rule N6]
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)` (156072 LoC, 872 module-visible types across 277 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
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 26 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/app/(dashboard)/dashboard/pxpipe/PxpipeClient.js, cli/src/cli/commands/xaiVideo.js, REDACTED, src/lib/auth/saml.js, src/shared/components/PricingModal.js, src/lib/oauth/services/xai.js, src/lib/auth/oidc.js, src/app/dashboard/settings/pricing/page.js (and 18 more) (27 orphaned of 644 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 644 of the 1108 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
IC1 · Incompleteness & stubs · Empty method body · ×1
  • Empty method body open-sse/utils/requestLogger.js:233 — `logResponse` has an empty body — confirm it's an intentional no-op and not an unfinished method.
M2 · Architecture documentation · No ADRs · ×1
  • 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.
P2 · Observability · Logging is not universal · ×1
  • 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`.
P3 · Security & performance tooling · No SAST · ×1
  • 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 3 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.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation package.json:22 — `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 67/296 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×1
  • Diagnostic log message is built whether or not it is wanted src/sse/services/auth.js:75 — `debug` at line 75 is called with an argument built by `join(",")` (line 75), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Minor — 20 finding(s)
D10 · Test Quality · Skipped (documented) · ×16
  • 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
  • Skipped (documented): inject a reasoning placeholder into Responses `input` items for DeepSeek models — tests/unit/opencode-go-deepseek-thinking-injection.test.js:105 — 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): 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): 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): 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): 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): 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 is_error flag is preserved tests/translator/bugs-openai-bridge.test.js:61 — 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): 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): assistant reasoning_content becomes a thinking block tests/translator/bugs-toClaude-context.test.js:25 — 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:43 — 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:54 — 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
D24 · Comment Value · doc comments repeat the names · ×3
  • doc comments repeat the names REDACTED:173 — 13 of 116 documented parameters and 27 of 143 summaries in `9router` only repeat the member or parameter name (e.g. "Get all providers" for `getProviders`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names open-sse/executors/chatgpt-web/chatHttp.js:153 — 15 of 340 documented parameters and 6 of 985 summaries in `9router-app` only repeat the member or parameter name (e.g. "Run one chat turn over HTTP." for `runChatGptWebHttpTurn`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names tests/unit/embeddings.cloud.test.js:104 — 0 of 0 documented parameters and 1 of 20 summaries in `9router-tests` only repeat the member or parameter name (e.g. "Make a Request object" for `makeRequest`). Delete the restating tags, or add what the name does not say.
D12 · Dependency Hygiene · Dependency hygiene PARTLY measured · ×1
  • 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: 44 production declaration(s) plus 12 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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-a4b00fe751d0401b9ee2524749477172/history.json --exit-code 0 --source .27artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-a4b00fe751d0401b9ee2524749477172/tree.json --exit-code 0 --source .9artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .387artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0—
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .8artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—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`, `REDACTED`, `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.0—
D37 · Vulnerability-disclosure Policydisclosure—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.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1dd43-ed10-79c4-9025-0698fb0ec268 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md