Public report of Wei-Shaw/claude-relay-service, 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, 05:14 UTC · Survey ID cd_c09150e3dca34021ac6a8c4b07193f47

Wei-Shaw/claude-relay-service

Measured 15 November 2026, 05:12 UTC, at code version 71117dd

CAI score 27out of 100 At risk 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: 151,108 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 0.9 person-years · Weakest lens: Code Health, 12

Findings by how serious they are

218 critical 1750 serious 300 minor

3 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, 05:12 UTC

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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

81of 81 dimensions measured by tools.
2220of 2268 findings point to an exact file and line, so you can open each one in the code. The other 48 concern the repository as a whole, such as missing documentation.
81dimensions across 7 lenses, read from 151,108 lines of product code in 2 projects.
Chapters

Executive summary

Wei-Shaw/claude-relay-service is rated At risk because critical security findings are open. It scores 27 out of 100, which the At risk rating leaves unchanged.

Code Health, at 12, is the weakest lens and counts most in the score. The best first step is replacing the two exposed passwords or keys and switching the old ones off, worth about 4 points. Adding type checking would lift Code Health itself, worth about 2 points. Raising Code Health to 70 would lift the score to about 40.

Sixty-one known security holes in the packages the code depends on can be used by attackers. Thirty-eight weaknesses in the code could be used by an attacker, and fifteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Updating the vulnerable packages, fixing the weaknesses the scanner points to and pinning each tool to an exact version would close these risks. Loading the key from a secret store instead of the code would fix the five encryption keys written into the code, and the five passwords or keys in the code's history and the two passwords or keys in the code need replacing, with the old ones switched off. The 25 controls that only work with a mouse need to work with the keyboard, or to become a real button.

The product code is 151,108 lines, about €140,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.
Code Health 12 · counts for 46%Production Readiness 30 · counts for 25%Accessibility 35 · counts for 14%Maturity 58 · counts for 8%Security and Compliance 58 · counts for 4%Performance 60 · counts for 2%Architecture 73 · counts for 1%

If Code Health rose from 12 to 70, the lowest score rated Strong, the score would rise from 27 to about 40.

Code composition: what the lines of code are
Product code 95%Tests 5%
New since the last survey: 365 findings

These 365 critical or serious findings weren't in the previous survey, on 30 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: 1487 findings

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

  • Cyclomatic Complexity · data-transfer-enhanced.importData (cyclomatic 96) scripts/data-transfer-enhanced.js
  • Cyclomatic Complexity · data-transfer-enhanced.exportData (cyclomatic 80) scripts/data-transfer-enhanced.js
  • Cyclomatic Complexity · fix-usage-stats.fixUsageStats (cyclomatic 56) scripts/fix-usage-stats.js
  • Cyclomatic Complexity · data-transfer.formatCSVValue (cyclomatic 48) scripts/data-transfer.js
  • Cyclomatic Complexity · data-transfer.importData (cyclomatic 43) scripts/data-transfer.js
  • Cyclomatic Complexity · data-transfer.exportData (cyclomatic 42) scripts/data-transfer.js
  • Cyclomatic Complexity · data-transfer-enhanced.exportUsageStats (cyclomatic 33) scripts/data-transfer-enhanced.js
  • Cyclomatic Complexity · data-transfer-enhanced.importUsageStats (cyclomatic 33) scripts/data-transfer-enhanced.js
  • Cyclomatic Complexity · openaiAccountService.selectAvailableAccount (cyclomatic 24) REDACTED
  • Cyclomatic Complexity · debug-redis-keys.debugRedisKeys (cyclomatic 23) scripts/debug-redis-keys.js
  • Cyclomatic Complexity · migrate-usage-index.migrate (cyclomatic 18) scripts/migrate-usage-index.js
  • Cyclomatic Complexity · data-transfer-enhanced.sanitizeData (cyclomatic 17) scripts/data-transfer-enhanced.js
  • Cyclomatic Complexity · reset-request-detail-retention-hours.resetRequestDetailRetentionHours (cyclomatic 17) scripts/reset-request-detail-retention-hours.js
  • Cognitive Complexity · data-transfer-enhanced.importData (cognitive 254) scripts/data-transfer-enhanced.js
  • Cognitive Complexity · data-transfer-enhanced.exportData (cognitive 196) scripts/data-transfer-enhanced.js
  • Cognitive Complexity · data-transfer.importData (cognitive 95) scripts/data-transfer.js
  • Cognitive Complexity · fix-usage-stats.fixUsageStats (cognitive 92) scripts/fix-usage-stats.js
  • Cognitive Complexity · data-transfer.exportData (cognitive 76) scripts/data-transfer.js
  • Cognitive Complexity · data-transfer-enhanced.importUsageStats (cognitive 65) scripts/data-transfer-enhanced.js
  • Cognitive Complexity · data-transfer-enhanced.exportUsageStats (cognitive 51) scripts/data-transfer-enhanced.js
  • Cognitive Complexity · data-transfer.formatCSVValue (cognitive 35) scripts/data-transfer.js
  • Cognitive Complexity · migrate-usage-index.migrate (cognitive 33) scripts/migrate-usage-index.js
  • Cognitive Complexity · LogSessionAnalyzer.displayResults (cognitive 30) REDACTED
  • Cognitive Complexity · openaiAccountService.selectAvailableAccount (cognitive 29) REDACTED
  • Cognitive Complexity · debug-redis-keys.debugRedisKeys (cognitive 29) scripts/debug-redis-keys.js
  • Cognitive Complexity · LogSessionAnalyzer.analyzeLogFile (cognitive 27) REDACTED
  • Cognitive Complexity · data-transfer-enhanced.sanitizeData (cognitive 25) scripts/data-transfer-enhanced.js
  • Cognitive Complexity · LogSessionAnalyzer.updateRedisSessionWindows (cognitive 22) REDACTED
  • Cognitive Complexity · migrate-apikey-expiry.migrateApiKeys (cognitive 18) scripts/migrate-apikey-expiry.js
  • Cognitive Complexity · reset-request-detail-retention-hours.resetRequestDetailRetentionHours (cognitive 18) scripts/reset-request-detail-retention-hours.js
  • God Classes · FunctionTooLong: data-transfer-enhanced.importData scripts/data-transfer-enhanced.js
  • God Classes · FunctionTooLong: data-transfer-enhanced.exportData scripts/data-transfer-enhanced.js
  • God Classes · FileTooLong: scripts/data-transfer-enhanced.js scripts/data-transfer-enhanced.js
  • God Classes · FunctionTooLong: data-transfer.importData scripts/data-transfer.js
  • God Classes · FunctionTooLong: fix-usage-stats.fixUsageStats scripts/fix-usage-stats.js
  • God Classes · FunctionTooLong: data-transfer.exportData scripts/data-transfer.js
  • REDACTED Scanning · Leaked secret: hardcoded-credential scripts/data-transfer-enhanced.js
  • REDACTED Scanning · Leaked secret: hardcoded-credential scripts/data-transfer-enhanced.js
  • REDACTED Scanning · Leaked secret: hardcoded-credential scripts/data-transfer-enhanced.js
  • REDACTED Scanning · Leaked secret: hardcoded-credential scripts/data-transfer-enhanced.js
  • REDACTED Scanning · Leaked secret: hardcoded-credential scripts/data-transfer.js
  • REDACTED Scanning · Leaked secret: hardcoded-credential scripts/data-transfer.js
  • REDACTED Scanning · Leaked secret: hardcoded-crypto-key src/services/account/openaiResponsesAccountService.js
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: src/services/scheduler/unifiedClaudeScheduler.js src/services/scheduler/unifiedClaudeScheduler.js
  • Churn × Complexity Hotspots · Hotspot: web/admin-spa/src/components/accounts/OAuthFlow.vue web/admin-spa/src/components/accounts/OAuthFlow.vue
  • Secrets (history) · High secret: REDACTED scripts/data-transfer-enhanced.js
  • Secrets (history) · High secret: REDACTED scripts/data-transfer-enhanced.js
  • Static Analysis (SAST) · Medium: watchdog-regex-match-index-beyond-capture-groups-js src/routes/admin/usageStats.js
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Code Duplication · Duplicated block (53 lines × 2 locations) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue
  • Code Duplication · Duplicated block (52 lines × 2 locations) src/routes/admin/usageStats.js
  • Code Duplication · Duplicated block (52 lines × 2 locations) src/services/anthropicGeminiBridgeService.js
  • Code Duplication · Duplicated block (49 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (49 lines × 2 locations) web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue
  • Code Duplication · Duplicated block (48 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (47 lines × 2 locations) src/services/scheduler/unifiedClaudeScheduler.js
  • Code Duplication · Duplicated block (46 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (46 lines × 3 locations) src/services/account/azureOpenaiAccountService.js
  • Code Duplication · Duplicated block (46 lines × 2 locations) web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue
  • Code Duplication · Duplicated block with local edits (46 matched lines × 2 locations) web/admin-spa/src/components/apistats/StatsOverview.vue
  • Code Duplication · Duplicated block (45 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (44 matched lines × 2 locations) src/utils/anthropicRequestDump.js
  • Code Duplication · Duplicated block (43 lines × 2 locations) src/routes/admin/usageStats.js
  • Code Duplication · Duplicated block (43 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (42 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (42 lines × 2 locations) src/routes/admin/usageStats.js
  • Code Duplication · Duplicated block (41 lines × 2 locations) src/routes/admin/usageStats.js
  • Code Duplication · Duplicated block (41 lines × 2 locations) src/services/account/ccrAccountService.js
  • Code Duplication · Duplicated block (41 lines × 2 locations) src/services/account/ccrAccountService.js
  • Code Duplication · Duplicated block (39 lines × 2 locations) src/services/relay/bedrockRelayService.js
  • Code Duplication · Duplicated block with local edits (39 matched lines × 2 locations) src/services/weeklyClaudeCostInitService.js
  • Code Duplication · Duplicated block (39 lines × 2 locations) web/admin-spa/src/views/AccountsView.vue
  • Code Duplication · Duplicated block (38 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (38 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (38 lines × 2 locations) src/routes/admin/usageStats.js
  • Code Duplication · Duplicated block with local edits (38 matched lines × 2 locations) src/services/accountGroupService.js
  • Code Duplication · Duplicated block with local edits (38 matched lines × 2 locations) src/services/relay/bedrockRelayService.js
  • Code Duplication · Duplicated block (38 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (37 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (37 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (37 lines × 2 locations) web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue
  • Code Duplication · Duplicated block (37 lines × 2 locations) web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue
  • 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) src/services/scheduler/unifiedClaudeScheduler.js
  • Code Duplication · Duplicated block (35 lines × 4 locations) REDACTED
  • Code Duplication · Duplicated block (35 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (35 lines × 2 locations) src/services/account/claudeAccountService.js
  • Code Duplication · Duplicated block (35 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (34 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (33 matched lines × 2 locations) src/services/scheduler/unifiedClaudeScheduler.js
  • Code Duplication · Duplicated block (33 lines × 6 locations) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue
  • Code Duplication · Duplicated block (32 lines × 2 locations) src/services/relay/bedrockRelayService.js
  • Code Duplication · Duplicated block (32 lines × 2 locations) web/admin-spa/src/components/common/ActionDropdown.vue
Rebuild cost: about €140,000 · Estimate
Cost to rebuild€45,000 to €230,000, for 748 to 2,372 hours of work, about 0.9 person-years for 1 to 2 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 27. 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: 151,108 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 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2).
Raises the score by about 4 points · Low effort · REDACTED Scanning
2
Resolve the 8 Low coverage finding(s) in Code Coverage — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 2 points · Low effort · Code Coverage
3
Resolve the 21 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (21).
Raises the score by about 4 points · Medium effort · Dependency Hygiene

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.

Files that change often carry extra risk · Combined risk
One file is changed often and is hard to read, which makes it the likeliest place for a mistake. It also has under half its code tested, or was written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to this file therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (5 files) · Code Coverage (8 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: REDACTED
What to do: Add tests to these files and have a second person review every change to them, starting with REDACTED.
Where the investment is most exposed · Value at risk
This code would cost about €140,000 to build again, about 0.9 person-years of work. Its weakest lens is Code Health, at 12 (Critical). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 2 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 4 points for low effort, because it clears the 2 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 5.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 8,227 lines over the last 90 days, which is about 33,365 lines a year. At that pace, the extra work comes to an estimated 5 to 30 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.

94 modules, with 5 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; 54 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 (global)2 scripts3 scripts.analyze-log-sessions4 scripts.manage5 src.app6 src.cli7 src.handlers8 src.middleware9 src.models10 src.models.redis11 src.routes12 src.routes.admin13 src.routes.azureOpenaiRoutes14 src.services15 src.services.account16 src.services.account.accountBalanceService17 src.services.account.azureOpenaiAccountService18 src.services.account.bedrockAccountService19 src.services.account.ccrAccountService20 src.services.account.claudeAccountService21 src.services.account.claudeConsoleAccountService22 src.services.account.droidAccountService23 src.services.account.geminiApiAccountService24 src.services.account.grokAccountService25 src.services.account.openaiResponsesAccountService26 src.services.accountGroupService27 src.services.accountNameCacheService28 src.services.accountTestSchedulerService29 src.services.apiKeyIndexService30 src.services.apiKeyService31 src.services.balanceProviders32 src.services.balanceProviders.baseBalanceProvider33 src.services.balanceScriptService34 src.services.billingEventPublisher35 src.services.claudeCodeHeadersService36 src.services.balanceProviders.claudeBalanceProvider37 src.services.balanceProviders.claudeConsoleBalanceProvider38 src.services.balanceProviders.geminiBalanceProvider39 src.services.balanceProviders.genericBalanceProvider40 src.services.balanceProviders.openaiResponsesBalanceProvider
1 (global)
2 scripts
3 scripts.analyze-log-sessions
4 scripts.manage
5 src.app
6 src.cli
7 src.handlers
8 src.middleware
9 src.models
10 src.models.redis
11 src.routes
12 src.routes.admin
13 src.routes.azureOpenaiRoutes
14 src.services
15 src.services.account
16 src.services.account.accountBalanceService
17 src.services.account.azureOpenaiAccountService
18 src.services.account.bedrockAccountService
19 src.services.account.ccrAccountService
20 src.services.account.claudeAccountService
21 src.services.account.claudeConsoleAccountService
22 src.services.account.droidAccountService
23 src.services.account.geminiApiAccountService
24 src.services.account.grokAccountService
25 src.services.account.openaiResponsesAccountService
26 src.services.accountGroupService
27 src.services.accountNameCacheService
28 src.services.accountTestSchedulerService
29 src.services.apiKeyIndexService
30 src.services.apiKeyService
31 src.services.balanceProviders
32 src.services.balanceProviders.baseBalanceProvider
33 src.services.balanceScriptService
34 src.services.billingEventPublisher
35 src.services.claudeCodeHeadersService
36 src.services.balanceProviders.claudeBalanceProvider1
37 src.services.balanceProviders.claudeConsoleBalanceProvider1
38 src.services.balanceProviders.geminiBalanceProvider1
39 src.services.balanceProviders.genericBalanceProvider1
40 src.services.balanceProviders.openaiResponsesBalanceProvider1
Uses a module listed above itPart of a loopThe module itself
1 (global)2 scripts3 scripts.analyze-log-sessions4 scripts.manage5 src.app6 src.cli7 src.handlers8 src.middleware9 src.models10 src.models.redis11 src.routes12 src.routes.admin13 src.routes.azureOpenaiRoutes14 src.services15 src.services.account16 src.services.account.accountBalanceService17 src.services.account.azureOpenaiAccountService18 src.services.account.bedrockAccountService19 src.services.account.ccrAccountService20 src.services.account.claudeAccountService21 src.services.account.claudeConsoleAccountService22 src.services.account.droidAccountService23 src.services.account.geminiApiAccountService24 src.services.account.grokAccountService25 src.services.account.openaiResponsesAccountService26 src.services.accountGroupService27 src.services.accountNameCacheService28 src.services.accountTestSchedulerService29 src.services.apiKeyIndexService30 src.services.apiKeyService31 src.services.balanceProviders32 src.services.balanceProviders.baseBalanceProvider33 src.services.balanceScriptService34 src.services.billingEventPublisher35 src.services.claudeCodeHeadersService36 src.services.balanceProviders.claudeBalanceProvider37 src.services.balanceProviders.claudeConsoleBalanceProvider38 src.services.balanceProviders.geminiBalanceProvider39 src.services.balanceProviders.genericBalanceProvider40 src.services.balanceProviders.openaiResponsesBalanceProvider(global)1scripts2scripts.analyze-log-sessions3scripts.manage4src.app5src.cli6src.handlers7src.middleware8src.models9src.models.redis10src.routes11src.routes.admin12src.routes.azureOpenaiRoutes13src.services14src.services.account15src.services.account.accountBalanceService16src.services.account.azureOpenaiAccountService17src.services.account.bedrockAccountService18src.services.account.ccrAccountService19src.services.account.claudeAccountService20src.services.account.claudeConsoleAccountService21src.services.account.droidAccountService22src.services.account.geminiApiAccountService23src.services.account.grokAccountService24src.services.account.openaiResponsesAccountService25src.services.accountGroupService26src.services.accountNameCacheService27src.services.accountTestSchedulerService28src.services.apiKeyIndexService29src.services.apiKeyService30src.services.balanceProviders31src.services.balanceProviders.baseBalanceProvider32src.services.balanceScriptService33src.services.billingEventPublisher34src.services.claudeCodeHeadersService35src.services.balanceProviders.claudeBalanceProvider36src.services.balanceProviders.claudeConsoleBalanceProvider37src.services.balanceProviders.geminiBalanceProvider38src.services.balanceProviders.genericBalanceProvider39src.services.balanceProviders.openaiResponsesBalanceProvider4011111+54 more modules (most-connected shown)

At a glance — Code Health · 12% · Critical · gated by D1, D2, R1, R10, R2, R3, R7, X4 ·

At a glance — Architecture · 73% · Adequate · gated by D26 ·

At a glance — Maturity · 58% · Adequate · gated by M2 ·

At a glance — Readiness · 30% · Weak · gated by R4, P3, P5, P7 ·

At a glance — Security · 58% · Adequate · gated by D29, D36 ·

At a glance — Accessibility · 35% · Weak · gated by AC1, AC2, AC4 ·

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 — Injection367High / Critical
A03:2025 — Software Supply Chain Failures94High / Critical
A02:2025 — Security Misconfiguration9High / Critical
A07:2025 — Authentication Failures8High / Critical
A01:2025 — Broken Access Control2Medium

Roadmap

Top priorities: Resolve the 21 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (21); Bring the 136 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with handleMessagesRequest (cyclomatic 225), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cyclomatic 177), openaiRoutes.handleResponses (cyclomatic 148); Bring the 187 bodies over 30 down to 30 or less in Cognitive Complexity — start with handleMessagesRequest (cognitive 406), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cognitive 320), _makeClaudeConsoleStreamRequest (cognitive 302).

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

Do thisHelpsEffortDimension
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2).+4.1 ptsLowREDACTED Scanning
Resolve the 8 Low coverage finding(s) in Code Coverage — start with REDACTED, REDACTED, REDACTED.+2.0 ptsLowCode Coverage
Resolve the 21 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (21).+4.2 ptsMediumDependency Hygiene
Bring the 136 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with handleMessagesRequest (cyclomatic 225), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cyclomatic 177), openaiRoutes.handleResponses (cyclomatic 148).+4.1 ptsHighCyclomatic Complexity
Bring the 187 bodies over 30 down to 30 or less in Cognitive Complexity — start with handleMessagesRequest (cognitive 406), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cognitive 320), _makeClaudeConsoleStreamRequest (cognitive 302).+4.1 ptsHighCognitive Complexity
Resolve the 6 Outdated (npm) finding(s) in Dependency Hygiene — start with package.json (6).+1.6 ptsLowDependency Hygiene
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.+2.5 ptsMediumType Safety
Resolve the 40 finding(s) in Cyclomatic Complexity.+2.5 ptsMediumCyclomatic Complexity

File quality

Per-file score 0–10 — a quality signature. Of 147 files carrying findings, judged against the Production bar: 16% slop · 72% mixed · 12% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.1SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.1SlopSecrets (history): High secret: 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 — 218

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

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

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

Could not be resolved — 3

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 81 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 81 dimensions across the health lenses
D1D2D3D4D5D6D8D10D11D12D13D14D15D16D19D20D21D24D26D27D28D29D30D31D32D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX4C2GD1IC1M1M2M3M4P1P10P2P3P4P5P6P7PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X12X14X16X2X21X23X24X28X29X3X30X4

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, 2220 of 2268 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 01a1dd9e-daf0-7909-b89f-5eafcfcb27e0.

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.

  • D8 Code 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. 11 test file(s) failed while being loaded here, so none of their cases ran (typically a native addon or generated module the package's install scripts build, which the analyzer's scripts-off install does not run). The 10 production file(s) those files import that read under half covered are unmeasured in this run, not untested, so their figures are left out of the per-file rows and the 34.2% rather than published as low coverage. You can widen what we reach: optional: commit the lcov report of a run where those test files load, and their modules are read from it.
  • 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's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
  • AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 309 further occurrence(s) are not listed individually; the score already reflects all 349.
  • AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 77 further occurrence(s) are not listed individually; the score already reflects all 117.
  • 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 DockerCompose (REDACTED). compose up failed (exit 1 — a container did not start, exited, or never became healthy) — time="2026-11-15T05:13:16Z" level=warning msg="The \"JWT_SECRET\" variable is not set. Defaulting to a blank string." time="2026-11-15T05:13:16Z" level=warning msg="The \"ENCRYPTION_KEY\" variable is not set. Defaulting to a blank string." container .-claude-relay-1 is unhealthy; 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 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.
  • P1 CI/CD gates — 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. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • 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. 640 further occurrence(s) are not listed individually; the score already reflects all 680.
  • 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. 557 further occurrence(s) are not listed individually; the score already reflects all 597.
  • 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. 64 further occurrence(s) are not listed individually; the score already reflects all 104.
  • 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. 124 further occurrence(s) are not listed individually; the score already reflects all 164.
  • 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. 61 further occurrence(s) are not listed individually; the score already reflects all 101.
  • 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. 123 further occurrence(s) are not listed individually; the score already reflects all 163.
  • 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. 3 further occurrence(s) are not listed individually; the score already reflects all 43.
  • X23 Unguarded diagnostic materialisation — 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. 13 further occurrence(s) are not listed individually; the score already reflects all 53.
  • 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. 126 further occurrence(s) are not listed individually; the score already reflects all 166.
  • X4 Structured logging — 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. 1606 further occurrence(s) are not listed individually; the score already reflects all 1646.
  • X5 Nullable reference types — 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 MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Vue components is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • 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.
  • D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

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

598 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was handleMessagesRequest at 225. A further 4 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 (anonymous)::parseUsage at 23 — they are counted neither in the figure above nor in this dimension's score.

(anonymous) (cyclomatic 17) · ×7REDACTED:52
(anonymous) (cyclomatic 16) · ×6REDACTED:848
(anonymous)::getEffectiveGranularity::loadDashboardData (cyclomatic 47) · ×5web/admin-spa/src/stores/dashboard.js:235
(anonymous) (cyclomatic 21) · ×5REDACTED:860
(anonymous) (cyclomatic 34) · ×4REDACTED:161

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

What to do

  1. Bring the 136 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with handleMessagesRequest (cyclomatic 225), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cyclomatic 177), openaiRoutes.handleResponses (cyclomatic 148). — 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 136 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

702 method(s) exceeded the cognitive complexity threshold of 15; the worst was handleMessagesRequest at 406.

(anonymous)::getEffectiveGranularity::loadDashboardData (cognitive 44) · ×6web/admin-spa/src/stores/dashboard.js:235
(anonymous) (cognitive 19) · ×5REDACTED:15
(anonymous) (cognitive 17) · ×5REDACTED:52
(anonymous) (cognitive 28) · ×4REDACTED:791
(anonymous) (cognitive 27) · ×4REDACTED:182

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

What to do

  1. Bring the 187 bodies over 30 down to 30 or less in Cognitive Complexity — start with handleMessagesRequest (cognitive 406), ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cognitive 320), _makeClaudeConsoleStreamRequest (cognitive 302). — 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 187 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 Classes7.6 / 10Strong✓ 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 7.6 / 10 · rule-coverage 100% · ceiling Prevented

153 god class(es) detected.

FunctionTooLong: api.handleMessagesRequest · ×52REDACTED:137
FileTooLong: REDACTED · ×37REDACTED
MethodTooLong: UnifiedClaudeScheduler._getAllAvailableAccounts · ×34src/services/scheduler/unifiedClaudeScheduler.js:515
ClassTooLong: ClaudeRelayService · ×24REDACTED:33
TooManyMethods: RedisClient · ×6REDACTED:141

What to do

  1. Resolve the 52 FunctionTooLong finding(s) in God Classes — start with usageStats.js (8), REDACTED (6), REDACTED (5). — One of this dimension's main actionable groups (52 warning-level).
  2. Resolve the 37 FileTooLong finding(s) in God Classes — start with REDACTED, usageStats.js, REDACTED. — One of this dimension's main actionable groups (37 warning-level).
  3. Resolve the 34 MethodTooLong finding(s) in God Classes — start with apiKeyService.js (7), unifiedClaudeScheduler.js (4), REDACTED (4). — One of this dimension's main actionable groups (34 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 151,108) 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

2 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)8.4 / 10Strong✓ 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 8.4 / 10 · rule-coverage 100% · ceiling Verified

7 of 53 classes have LCOM4 above 3.

Low cohesion: ApiKeyService (LCOM4 14) · ×7src/services/apiKeyService.js:170

What to do

  1. Resolve the 7 Low cohesion finding(s) in Cohesion (LCOM4) — start with apiKeyService.js, claudeAccountService.js, costRankService.js. — One of this dimension's main actionable groups (7 warning-level).

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

D8 · Code Coverage7.0 / 10Adequate✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

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

Line coverage 34.2% — 8 file(s) below 50%. Measured from the JavaScript/TypeScript suite (jest via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root).

Low coverage: REDACTED · ×8REDACTED:1

What to do

  1. Resolve the 8 Low coverage finding(s) in Code Coverage — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (8 warning-level).

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

D10 · Test Quality10.0 / 10Exemplary✓ 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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 352 tests.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

0 flaky across 1 measured tier(s). JavaScript/TypeScript (jest via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root (239 tests)): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene5.9 / 10Adequate✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

32 outdated direct production npm dependency(ies) of 36 graded, 0 pinning defect(s), across 2 package.json (2 of them the product) and 3 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 5 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.

Deprecated: ldapjs · ×6package.json:67
Deprecated: @humanwhocodes/config-array · ×21REDACTED:1518
Outdated (npm): commander · ×6package.json:57
Outdated (npm): @aws-sdk/client-bedrock-runtime · ×26

What to do

  1. Resolve the 21 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (21). — One of this dimension's main actionable groups (21 recommendation-level).
  2. Resolve the 6 Deprecated finding(s) in Dependency Hygiene — start with package.json (6). — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 6 Outdated (npm) finding(s) in Dependency Hygiene — start with package.json (6). — One of this dimension's main actionable groups (6 recommendation-level).

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

D13 · REDACTED Scanning5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 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 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).

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

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

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

0 of 397 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 397 package(s) this repository's committed lockfile installs for a consumer — its 36 production, optional and peer dependency(ies), across 2 product package.json manifest(s), and everything those install in turn. Its 26 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. 1 of them publish no licence this pass can read on registry.npmjs.org — an absent field, `UNLICENSED`, or a `SEE LICENSE IN <file>` pointer into a tarball this pass does not download; that is missing data, not a violation, and none of them is charged. This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots7.7 / 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.7 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: web/admin-spa/src/components/accounts/AccountForm.vue (6×172=1032); REDACTED (5×56=280); REDACTED (4×44=176)

Hotspot: web/admin-spa/src/components/accounts/AccountForm.vue · ×5web/admin-spa/src/components/accounts/AccountForm.vue:5492

What to do

  1. Resolve the 5 Hotspot finding(s) in Churn × Complexity Hotspots — start with AccountForm.vue, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 warning-level).

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

D16 · Bus Factor9.2 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

17 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/services/requestDetailService.js. Counted over 234 of the 267 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×2
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

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. 5 document(s) read across 2 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:7

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 Consistency9.6 / 10Exemplary✓ 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 9.6 / 10 · rule-coverage 100% · ceiling Verified

2 naming inconsistencies among 543 declarations measured against a convention their peers follow.

`effectiveClientID` spells `ID` where 541 names in the project spell it `Id`src/utils/grokHelper.js:631
`clientID` spells `ID` where 541 names in the project spell it `Id`src/utils/grokHelper.js:784

✓ On the Gold path — maintain.

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

D24 · Comment Value10.0 0.1 / 10Critical○ Nothing flagged

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 0.1 / 10 · rule-coverage 1% · ceiling Documented

0 of 75 judged comments only repeat the code they sit on (0.0 %). 8202 comment(s) in another language or script were not judged.

doc comments repeat the namessrc/utils/modelHelper.js:95

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

D26 · Project Cohesion0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 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

37 % 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)5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Documented

5 finding(s): 0 critical, 5 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. 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

367 finding(s): 0 critical, 59 high, 308 medium, 0 low. 15 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 12 file(s) — `scripts/data-transfer-enhanced.js`, `scripts/manage.sh` (line 372), `REDACTED`, `REDACTED`, `REDACTED`, … (+7 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 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

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

What to do

  1. Resolve the 20 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (20 issue-level).
  2. Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 issue-level).
  3. No action in Static Analysis (SAST) — all 15 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (15 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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 0.0 / 10 · rule-coverage 100% · ceiling Documented

88 finding(s): 4 critical, 57 high, 22 medium, 5 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 57 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (39), REDACTED (18). — One of this dimension's main actionable groups (57 issue-level).
  2. Resolve the 21 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (12), REDACTED (9). — One of this dimension's main actionable groups (21 warning-level).
  3. Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 issue-level).

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

D31 · IaC & Container Security8.3 / 10Adequategated by 4 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.3 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED

What to do

  1. Resolve the 4 High IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 warning-level).

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

D32 · Data Compliance (PII/GDPR)8.1 / 10Strong✓ Tool-verified

What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.

Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using our own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.

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

2 finding(s): 0 critical, 0 high, 2 medium, 0 low.

REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).

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

D34 · Knowledge Freshness7.2 / 10Adequategated by 15 critical findings✓ 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 7.2 / 10 · rule-coverage 100% · ceiling Documented

66 of 234 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/services/relay/droidRelayService.js. Counted over 234 of the 267 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×15src/services/relay/droidRelayService.js:1
Orphaned file · ×51REDACTED:1
Further orphaned files (smaller)

What to do

  1. Resolve the 51 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED, ApiKeyUsageRecordsView.vue, UserUsageStatsModal.vue. — One of this dimension's main actionable groups (51 recommendation-level).
  2. Resolve the 15 Orphaned knowledge finding(s) in Knowledge Freshness — start with droidRelayService.js, QuotaCardsView.vue, ccrRelayService.js. — One of this dimension's main actionable groups (15 issue-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 Coupling8.9 / 10Strong✓ 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 8.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: CreateApiKeyModal.vue↔EditApiKeyModal.vue 88%; accounts.js↔AccountsView.vue 73%; UsageDetailModal.vue↔ApiKeysView.vue 67%

Change coupling: accounts.js ↔ AccountsView.vue · ×9web/admin-spa/src/stores/accounts.js:1
Change-coupling hub: EditApiKeyModal.vue → apiKeyService.js, BatchEditApiKeyModal.vue, CreateApiKeyModal.vue, AccountSelector.vue, ApiKeysView.vue · ×2web/admin-spa/src/components/apikeys/EditApiKeyModal.vue

What to do

  1. Resolve the 9 Change coupling finding(s) in Change Coupling — start with accounts.js, UsageDetailModal.vue, REDACTED. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with EditApiKeyModal.vue, apiKeyService.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 & Signing0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

0/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. — One of this dimension's main actionable groups (1 recommendation-level).

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

D37 · Vulnerability-disclosure Policy4.0 / 10Weak✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (REDACTED or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a REDACTED (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (REDACTED) is present but lists no reporting contact.

REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Vulnerability-disclosure Policy — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d37_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 dependency in any ecosystem this repository declares is published as malicious.

✓ 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 0 platform declaration(s) and 27 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.

AC1 · Text alternatives1.7 / 10Critical✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×6) — web/admin-spa/src/components/dashboard/ModelDistribution.vue:26, web/admin-spa/src/components/dashboard/UsageTrend.vue:32, web/admin-spa/src/views/DashboardView.vue:595, …

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels3.6 / 10Weak✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×14) — web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:16, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:20, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:26, …
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×9) — web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:17, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:23, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:27, …
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×4) — web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:37, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:43, web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:69, …
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×13) — web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:36, web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:27, web/admin-spa/src/components/accounts/AccountForm.vue:18, …

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure6.2 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×11) — web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:37, web/admin-spa/src/components/apikeys/NewApiKeyModal.vue:39, web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue:323, …

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics2.2 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×25) — web/admin-spa/src/components/accounts/AccountForm.vue:76, web/admin-spa/src/components/accounts/AccountForm.vue:107, web/admin-spa/src/components/accounts/AccountForm.vue:147, …

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety4.5 / 10Weak✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. (×37) — web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:29, web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:36, web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:83, …
  • <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — web/admin-spa/src/components/admin/ChangeRoleModal.vue:0, web/admin-spa/src/components/admin/UserUsageStatsModal.vue:0
  • <div> moves — its inline style sets `animation: shine 2.8s infinite` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — web/admin-spa/src/components/apikeys/LimitProgressBar.vue:66

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition9.3 / 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.

  • Here who is asking is taken from the 'permissions' form field (const{name, description, tokenLimit, expiresAt, claudeAccountId, claudeConsoleAccountId…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — REDACTED:1509
  • Here who is asking is taken from the 'permissions' form field (const{baseName, count, description, tokenLimit, expiresAt, claudeAccountId, claudeConso…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — REDACTED:1769
  • Here who may pass is decided by the 'permissions' form field (if(updates.permissions!==undefined)) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — REDACTED:1901
  • Here who is asking is taken from the 'permissions' form field (const{name, tokenLimit, concurrencyLimit, rateLimitWindow, rateLimitRequests, rateLimit…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — REDACTED:2143
  • Here who is asking is taken from the 'permissions' form field (const responseData = {id:keyId, name:fullKeyData.name, description:fullKeyData.descript…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — REDACTED:476
  • Here who is asking is taken from the 'account' request header (const{accessToken, accountType, proxy, account} = authResult) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — REDACTED:1016
  • Here who may pass is decided by the 'username' cookie (if(!sessionData.username||!sessionData.loginTime)) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. (×3) — REDACTED:177, REDACTED:296, REDACTED:354
  • 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. — REDACTED:197

What to do

  • Keep who is signed in on the server: give the browser only a long random session id (express-session, iron-session, a sessions table), or sign the cookie (cookie-parser with a secret and req.signedCookies, a verified JWT), and look the user up from that — never from an id, role or token claim the browser sends unchecked.
  • 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 & stubs7.4 / 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.

  • `initializeCacheMonitoring` 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:638
  • `initialize` 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/services/modelService.js:16
  • The `if` and its `else` contain the same statements, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body. — src/services/openaiToClaude.js:469
  • `useFallbackPricing` 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/services/pricingService.js:315
  • The guard above `return 'anthropic';` also returns `'anthropic'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/services/relay/droidRelayService.js:50
  • Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition. — src/services/scheduler/unifiedClaudeScheduler.js:1632
  • `updateUserApiKeyCount` 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:315
  • The guard above `return '/api-stats';` also returns `'/api-stats'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — web/admin-spa/src/router/index.js:31

What to do

  • Remove the dead code that looks live: delete dead if(false) branches, which read as logic that runs, and either do the real async work or drop the async keyword from fake-async functions, which promise work they never wait for.
M1 · Documentation (README)9.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.

M2 · Architecture documentation0.0 / 10Critical✓ 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.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

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.
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
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 accuracy8.0 / 10Strong✓ 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.

  • README_EN.md links to `docs/preview.md`, but `docs/preview.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_EN.md:85

What to do

  • Reconcile the README with reality: README_EN.md links to `docs/preview.md`, but `docs/preview.md` does not exist.
P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified

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.

What to do

  • Run the test suite in CI via an explicit runner step (`npm test` for the toolchain this pipeline already uses) and gate merges on it.
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability8.0 / 10Strong✓ 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.

  • `src/utils/costCalculator.js` reports through `console.*` at line 368 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/utils/costCalculator.js:368
  • `src/utils/costCalculator.js` reports through `console.*` at line 376 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/utils/costCalculator.js:376
  • `src/utils/lruCache.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/utils/lruCache.js:89
  • `src/utils/lruCache.js` reports through `console.*` at line 102 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/utils/lruCache.js:102
  • `src/utils/lruCache.js` reports through `console.*` at line 128 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/utils/lruCache.js:128
  • `src/utils/runtimeAddon.js` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/utils/runtimeAddon.js:114
  • `src/utils/runtimeAddon.js` reports through `console.*` at line 116 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/utils/runtimeAddon.js:116
  • `REDACTED` reports through `console.*` at line 3014 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:3014
  • `REDACTED` reports through `console.*` at line 3081 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:3081
  • `REDACTED` reports through `console.*` at line 3171 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:3171

What to do

  • 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. — REDACTED:4
  • `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:51

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 & Rollback8.0 / 10Strong✓ 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.

  • Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.

What to do

  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
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.

  • `axios(` 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. (×5) — REDACTED:551, REDACTED:892, REDACTED:1521, …
  • `axios.post(` 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. — REDACTED:161
  • `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. (×2) — src/services/balanceProviders/geminiBalanceProvider.js:216, src/services/balanceProviders/geminiBalanceProvider.js:229

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.existsSync` in `callback to app.use` 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:168
  • `fs.existsSync` in `initialize` 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:265, src/services/pricingService.js:50
  • `fs.existsSync` in `app.get("/admin-next/*")` 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:307
  • `fs.statSync` in `app.get("/admin-next/*")` 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:307
  • `fs.existsSync` in `app.get("/health")` 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:395
  • `fs.readFileSync` in `app.get("/health")` 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:396
  • `fs.existsSync` in `initializeAdmin` 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:483
  • `fs.readFileSync` in `initializeAdmin` 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:489
  • `fs.readFileSync` in `router.get("/check-updates")` 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:98
  • `fs.existsSync` in `router.post("/auth/login")` 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:39
  • `fs.readFileSync` in `router.post("/auth/login")` 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:41
  • `fs.existsSync` in `router.post("/auth/change-password")` 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:213
  • `fs.readFileSync` in `router.post("/auth/change-password")` 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:221
  • `fs.writeFileSync` in `router.post("/auth/change-password")` 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:230
  • `fs.mkdirSync` in `initialize` 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/services/pricingService.js:51
  • `fs.existsSync` in `loadPricingData` 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/services/pricingService.js:294
  • `fs.readFileSync` in `loadPricingData` 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/services/pricingService.js:295
  • `fs.statSync` in `loadPricingData` 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/services/pricingService.js:298
  • `fs.existsSync` in `useFallbackPricing` 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/services/pricingService.js:317
  • `fs.readFileSync` in `useFallbackPricing` 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/services/pricingService.js:321
  • `fs.writeFileSync` in `useFallbackPricing` 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/services/pricingService.js:327
  • `fs.existsSync` in `reloadPricingData` 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/services/pricingService.js:836
  • `fs.readFileSync` in `reloadPricingData` 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/services/pricingService.js:845
  • `zlib.gunzipSync` in `res.on("end")` 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:1798
  • `zlib.inflateSync` in `res.on("end")` 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:1805

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 · 321 plain JS — the untyped files are REDACTED, REDACTED, config/models.js, config/pricingSource.js, REDACTED, scripts/check-redis-keys.js (+315 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 Duplication1.5 / 10Critical✓ 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.

  • 46 duplicated blocks under src/ have copies in at least two of the sibling directories handlers, middleware, models, routes, services, utils (+1 more sibling(s) not listed) — 39 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 46 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 46 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 46 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:154
  • 29 duplicated blocks under web/admin-spa/src/ have copies in at least two of the sibling directories components, stores, utils, views — 23 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 29 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 29 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 29 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. — web/admin-spa/src/components/apistats/StatsOverview.vue:478
  • 14 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, scripts, src, web — 8 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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:35
  • 12 duplicated blocks under web/admin-spa/src/components/ have copies in at least two of the sibling directories accounts, admin, apikeys, apistats, user — 9 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 12 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216
  • 6 duplicated blocks under src/services/ have copies in at least two of the sibling directories account, balanceProviders, relay, scheduler — 2 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 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/services/account/claudeAccountService.js:2899
  • src/services/relay/ccrRelayService.js:59 · REDACTED:69 — the two spans are one implementation copied and then locally edited — 2434 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/services/relay/ccrRelayService.js:59
  • REDACTED:10 · REDACTED:19 — the two spans are one implementation copied and then locally edited — 2065 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
  • REDACTED:17 · REDACTED:20 — the two spans are one implementation copied and then locally edited — 1955 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:17
  • REDACTED:566 · REDACTED:530 — the two spans are one implementation copied and then locally edited — 1200 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:566
  • REDACTED:211 · REDACTED:107 — the two spans are one implementation copied and then locally edited — 1474 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:211
  • src/services/account/azureOpenaiAccountService.js:117 · REDACTED:457 — the two spans are one implementation copied and then locally edited — 1146 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/services/account/azureOpenaiAccountService.js:117
  • REDACTED:341 · REDACTED:291 — the two spans are one implementation copied and then locally edited — 1132 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:341
  • src/services/account/geminiApiAccountService.js:365 · src/services/account/openaiResponsesAccountService.js:326 — the two spans are one implementation copied and then locally edited — 1056 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/services/account/geminiApiAccountService.js:365
  • src/services/scheduler/unifiedClaudeScheduler.js:1318 · src/services/scheduler/unifiedOpenAIScheduler.js:636 — the two spans are one implementation copied and then locally edited — 778 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/services/scheduler/unifiedClaudeScheduler.js:1318
  • src/services/account/ccrAccountService.js:567 · src/services/account/claudeConsoleAccountService.js:1244 — the two spans are one implementation copied and then locally edited — 840 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/services/account/ccrAccountService.js:567
  • REDACTED:21 · REDACTED:47 — the two spans are one implementation copied and then locally edited — 864 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:21
  • REDACTED:106 · REDACTED:576 — the two spans are one implementation copied and then locally edited — 805 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:106
  • src/services/account/geminiApiAccountService.js:54 · src/services/account/openaiResponsesAccountService.js:68 — 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/services/account/geminiApiAccountService.js:54
  • web/admin-spa/src/views/AccountUsageRecordsView.vue:309 · web/admin-spa/src/views/ApiKeyUsageRecordsView.vue:302 — the two spans are one implementation copied and then locally edited — 859 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. — web/admin-spa/src/views/AccountUsageRecordsView.vue:309
  • src/utils/oauthHelper.js:167 · src/utils/oauthHelper.js:387 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/utils/oauthHelper.js:167
  • src/services/account/claudeConsoleAccountService.js:543 · src/services/account/claudeConsoleAccountService.js:845 — the two spans are one implementation copied and then locally edited — 574 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/services/account/claudeConsoleAccountService.js:543
  • REDACTED:289 · REDACTED:1001 — the two spans are one implementation copied and then locally edited — 428 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:289
  • REDACTED:2213 · REDACTED:2508 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2213
  • src/services/scheduler/droidScheduler.js:41 · src/services/scheduler/grokScheduler.js:21 — the two spans are one implementation copied and then locally edited — 472 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/services/scheduler/droidScheduler.js:41
  • REDACTED:1549 · REDACTED:1792 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:1549
  • src/services/account/claudeAccountService.js:1235 · src/services/account/claudeConsoleAccountService.js:1104 — the two spans are one implementation copied and then locally edited — 431 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/services/account/claudeAccountService.js:1235
  • web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:195 · web/admin-spa/src/components/apikeys/NewApiKeyModal.vue:149 — the two spans are one implementation copied and then locally edited — 321 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. — web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:195
  • REDACTED:33 · REDACTED:161 — 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. — REDACTED:33
  • web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216 · web/admin-spa/src/components/apikeys/ExpiryEditModal.vue:293 — 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. — web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216
  • scripts/data-transfer-enhanced.js:832 · scripts/data-transfer.js:446 — 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. — scripts/data-transfer-enhanced.js:832
  • web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1011 · web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1059 — 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. — web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1011
  • REDACTED:1555 · REDACTED:59 — the two spans are one implementation copied and then locally edited — 339 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:1555
  • src/routes/admin/usageStats.js:1493 · src/routes/admin/usageStats.js:1671 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/routes/admin/usageStats.js:1493
  • src/routes/admin/usageStats.js:1928 · src/routes/admin/usageStats.js:2118 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/routes/admin/usageStats.js:1928
  • REDACTED:283 · REDACTED:442 — the two spans are one implementation copied and then locally edited — 264 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:283
  • REDACTED:789 · REDACTED:1502 — 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. — REDACTED:789
  • src/utils/anthropicResponseDump.js:15 · src/utils/antigravityUpstreamResponseDump.js:16 — the two spans are one implementation copied and then locally edited — 313 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/utils/anthropicResponseDump.js:15
  • REDACTED:217 · REDACTED:348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:217
  • REDACTED:1399 · REDACTED:3380 — 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. — REDACTED:1399
  • REDACTED:104 · REDACTED:226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:104

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.6 / 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.

  • web/admin-spa/src/main.js:4 imports element-plus/dist/locale/zh-cn.mjs, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/admin-spa/src/main.js:4

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 Complexity0.0 / 10Critical✓ 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.

  • createAccount has cyclomatic complexity 172 and cognitive complexity 230; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/admin-spa/src/components/accounts/AccountForm.vue:5492
  • handleMessagesRequest has cyclomatic complexity 157 and cognitive complexity 282; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:137
  • updateAccount has cyclomatic complexity 155 and cognitive complexity 207; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/admin-spa/src/components/accounts/AccountForm.vue:5940
  • createAccount has cyclomatic complexity 130 and cognitive complexity 158; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:458
  • updateAccount has cyclomatic complexity 122 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. — REDACTED:836
  • handleResponses has cyclomatic complexity 119 and cognitive complexity 167; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:293
  • (anonymous) has cyclomatic complexity 119 and cognitive complexity 148; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:101
  • handleOAuthSuccess has cyclomatic complexity 115 and cognitive complexity 143; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/admin-spa/src/components/accounts/AccountForm.vue:5236
  • relayRequest has cyclomatic complexity 111 and cognitive complexity 210; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:480
  • authenticateApiKey has cyclomatic complexity 109 and cognitive complexity 183; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:440
  • (anonymous) has cyclomatic complexity 106 and cognitive complexity 139; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:2108
  • _getAllAvailableAccounts has cyclomatic complexity 102 and cognitive complexity 194; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/services/scheduler/unifiedClaudeScheduler.js:515
  • (anonymous) has cyclomatic complexity 101 and cognitive complexity 211; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/routes/admin/usageStats.js:1247
  • importData has cyclomatic complexity 96 and cognitive complexity 253; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — scripts/data-transfer-enhanced.js:835
  • (anonymous) has cyclomatic complexity 96 and cognitive complexity 194; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/routes/admin/usageStats.js:1825
  • relayRequest has cyclomatic complexity 94 and cognitive complexity 149; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:23
  • handleRequest has cyclomatic complexity 91 and cognitive complexity 186; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:68
  • recordUsageWithDetails has cyclomatic complexity 85 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/services/apiKeyService.js:1862
  • (anonymous) has cyclomatic complexity 83 and cognitive complexity 98; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/routes/admin/usageStats.js:2708
  • handleAnthropicMessagesToGemini has cyclomatic complexity 81 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. — src/services/anthropicGeminiBridgeService.js:1859
  • (anonymous) has cyclomatic complexity 81 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/routes/admin/usageStats.js:3066
  • (anonymous) has cyclomatic complexity 81 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:1472
  • exportData has cyclomatic complexity 80 and cognitive complexity 196; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — scripts/data-transfer-enhanced.js:478
  • (anonymous) has cyclomatic complexity 79 and cognitive complexity 145; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/routes/admin/usageStats.js:539
  • getAllApiKeysFast has cyclomatic complexity 77 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 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/services/apiKeyService.js:1052
  • relayRequest has cyclomatic complexity 76 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. — src/services/relay/ccrRelayService.js:16
  • (anonymous) has cyclomatic complexity 76 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/routes/admin/usageStats.js:933
  • buildGeminiRequestFromOpenAI has cyclomatic complexity 74 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:557
  • cleanJsonSchemaForGemini has cyclomatic complexity 74 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/utils/geminiSchemaCleaner.js:87
  • (anonymous) has cyclomatic complexity 72 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:38
  • _getAllAvailableAccounts has cyclomatic complexity 69 and cognitive complexity 137; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/services/scheduler/unifiedGeminiScheduler.js:224
  • calculateKeyStats has cyclomatic complexity 68 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:1073
  • convertAnthropicMessagesToGeminiContents has cyclomatic complexity 63 and cognitive complexity 198; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/services/anthropicGeminiBridgeService.js:1026
  • handleImages has cyclomatic complexity 63 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:971
  • (anonymous) has cyclomatic complexity 60 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/routes/admin/usageStats.js:2286
  • calculateCost has cyclomatic complexity 59 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/services/pricingService.js:513
  • (anonymous) has cyclomatic complexity 58 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:93
  • (anonymous) has cyclomatic complexity 58 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/admin-spa/src/views/ApiKeysView.vue:4530
  • (anonymous) has cyclomatic complexity 58 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1655
  • (anonymous) has cyclomatic complexity 56 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. — src/services/anthropicGeminiBridgeService.js:2715
R3 · Large Files0.0 / 10Critical✓ 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.

  • web/admin-spa/src/components/accounts/AccountForm.vue has 6637 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/accounts/AccountForm.vue:1
  • web/admin-spa/src/views/AccountsView.vue has 5419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/AccountsView.vue:1
  • REDACTED has 4835 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
  • web/admin-spa/src/views/ApiKeysView.vue has 4687 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/ApiKeysView.vue:1
  • REDACTED has 3288 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/services/account/claudeAccountService.js has 3131 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/services/account/claudeAccountService.js:1
  • web/admin-spa/src/views/SettingsView.vue has 3078 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/SettingsView.vue:1
  • src/routes/admin/usageStats.js has 3013 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/routes/admin/usageStats.js:1
  • src/services/anthropicGeminiBridgeService.js has 2812 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/services/anthropicGeminiBridgeService.js:1
  • REDACTED has 2721 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/services/apiKeyService.js has 2572 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/services/apiKeyService.js:1
  • REDACTED has 2495 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 1863 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 1755 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/services/scheduler/unifiedClaudeScheduler.js has 1751 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/services/scheduler/unifiedClaudeScheduler.js:1
  • web/admin-spa/src/views/DashboardView.vue has 1713 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/DashboardView.vue:1
  • web/admin-spa/src/components/apikeys/EditApiKeyModal.vue has 1699 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1
  • REDACTED has 1656 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
  • web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue has 1568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1
  • REDACTED has 1470 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/services/requestDetailService.js has 1430 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/services/requestDetailService.js:1
  • src/services/account/claudeConsoleAccountService.js has 1403 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/services/account/claudeConsoleAccountService.js:1
  • REDACTED has 1387 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/services/relay/droidRelayService.js has 1354 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/services/relay/droidRelayService.js:1
  • REDACTED has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 1271 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
  • web/admin-spa/src/components/accounts/OAuthFlow.vue has 1221 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/accounts/OAuthFlow.vue:1
  • web/admin-spa/src/views/RequestDetailsView.vue has 1174 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/RequestDetailsView.vue:1
  • web/admin-spa/src/views/ApiStatsView.vue has 1131 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/ApiStatsView.vue:1
  • REDACTED has 1092 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 1045 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
  • web/admin-spa/src/views/QuotaCardsView.vue has 1006 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/views/QuotaCardsView.vue:1
  • src/services/scheduler/unifiedOpenAIScheduler.js has 903 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/services/scheduler/unifiedOpenAIScheduler.js:1
  • web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue:1
  • src/services/relay/ccrRelayService.js has 875 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/services/relay/ccrRelayService.js:1
  • REDACTED has 873 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 830 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 829 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/utils/grokHelper.js has 825 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/utils/grokHelper.js:1
  • REDACTED has 818 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

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — web/admin-spa/src/components/accounts/AccountForm.vue:1, web/admin-spa/src/views/AccountsView.vue:1, web/admin-spa/src/views/ApiKeysView.vue:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness6.7 / 10Adequate✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

  • 33 outdated package(s); JS/npm CVEs scored in D30
R6 · Tooling6.7 / 10Adequate✓ 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.

  • test ✓ · lint ✓ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
R7 · Dead Code0.0 / 10Critical✓ 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 25 application, 25 tooling and 33 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (25 application, 25 tooling, 33 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 (×34) — web/admin-spa/src/components/accounts/AccountForm.vue, web/admin-spa/src/views/AccountsView.vue, web/admin-spa/src/views/ApiKeysView.vue, …
  • no import path from any entry point (25 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — 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 (×4) — web/admin-spa/src/components/accounts/OAuthFlow.vue, web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue, web/admin-spa/src/components/accounts/GroupManagementModal.vue, …
  • no import path from any entry point (25 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/layout/MainLayout.vue) — 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 — web/admin-spa/src/components/layout/AppHeader.vue

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 Hygiene8.5 / 10Strong✓ 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.

  • 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.
  • Declared in web/admin-spa/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 Imports4.6 / 10Weak✓ 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.

  • REDACTED → src/services/accountNameCacheService.js → src/services/account/azureOpenaiAccountService.js → REDACTED (one verified cycle inside a mutually-dependent group of 22 files) — REDACTED:943
  • src/services/apiKeyService.js → REDACTED → src/services/apiKeyService.js — src/services/apiKeyService.js:426

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture6.0 / 10Adequate✓ 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.

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.

  • `azureOpenaiSalt` is the key-derivation salt, 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/services/account/azureOpenaiAccountService.js:13
  • `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. 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. (×4) — src/services/account/claudeAccountService.js:61, src/services/account/claudeConsoleAccountService.js:14, src/services/account/geminiApiAccountService.js:13, …
  • This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price. (×6) — src/services/account/azureOpenaiAccountService.js:28, src/services/account/claudeAccountService.js:1348, src/services/account/claudeConsoleAccountService.js:1197, …

What to do

  • 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. This repository constructs key or salt material fixed at compile time at 5 sites, not one: `src/services/account/azureOpenaiAccountService.js:13` (key-derivation salt, default `azureOpenaiSalt`), `src/services/account/claudeAccountService.js:61` (key-derivation salt, `ENCRYPTION_SALT`), `src/services/account/claudeConsoleAccountService.js:14` (key-derivation salt, `ENCRYPTION_SALT`), `src/services/account/geminiApiAccountService.js:13` (key-derivation salt, `ENCRYPTION_SALT`), `src/services/account/openaiResponsesAccountService.js:13` (key-derivation salt, `ENCRYPTION_SALT`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Raise the cost parameter to current guidance — PBKDF2 at 1,300,000 (HMAC-SHA1), 600,000 (SHA-256) or 210,000 (SHA-512) iterations; scrypt at N=2^17, r=8, p=1; bcrypt at a work factor of 10 or more — or move to a memory-hard KDF (Argon2id, scrypt) where the platform offers one. Read the parameter from configuration and tune it to roughly 100 ms per derivation on the slowest hardware that must run it, so the price can be raised again without shipping new code. This repository constructs a key derivation priced below the floor at 6 sites, not one: `src/services/account/azureOpenaiAccountService.js:28` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/services/account/claudeAccountService.js:1348` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/services/account/claudeConsoleAccountService.js:1197` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/services/account/geminiApiAccountService.js:610` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/services/account/openaiResponsesAccountService.js:657` (scrypt, N=16,384 (r=8, p=1), Node's default), `src/utils/commonHelper.js:29` (scrypt, N=16,384 (r=8, p=1), Node's default). 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.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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.

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.

X2 · Cancellation propagation5.0 / 10Weak✓ 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 8/50 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.
  • `login` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — web/admin-spa/src/stores/user.js:25
  • `logout` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — web/admin-spa/src/stores/user.js:55
  • `getUserProfile` awaits `axios.get(…)` 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: `axios.get(url, { signal })`. — web/admin-spa/src/stores/user.js:102
  • `getUserApiKeys` awaits `axios.get(…)` 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: `axios.get(url, { signal })`. — web/admin-spa/src/stores/user.js:127
  • `createApiKey` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — web/admin-spa/src/stores/user.js:142
  • `deleteApiKey` awaits `axios.delete(…)` 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: `axios.delete(url, { signal })`. — web/admin-spa/src/stores/user.js:153
  • `getUserUsageStats` awaits `axios.get(…)` 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: `axios.get(url, { signal })`. — web/admin-spa/src/stores/user.js:164
  • `exchangeAuthorizationCode` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — src/utils/grokHelper.js:748
  • `refreshAccessToken` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — src/utils/grokHelper.js:784
  • `exchangeCodeForTokens` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — src/utils/oauthHelper.js:156
  • `exchangeSetupTokenCode` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — src/utils/oauthHelper.js:375
  • `getOrganizationInfo` awaits `axios.get(…)` 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: `axios.get(url, { signal })`. — src/utils/oauthHelper.js:614
  • `authorizeWithCookie` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — src/utils/oauthHelper.js:707
  • `startDeviceAuthorization` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — src/utils/workosOAuthHelper.js:30
  • `pollDeviceAuthorization` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — src/utils/workosOAuthHelper.js:104
  • `fetchAvailableModels` awaits `axios(…)` 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: `axios(url, { signal })`. — src/services/antigravityClient.js:483
  • `countTokens` awaits `axios(…)` 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: `axios(url, { signal })`. (×3) — src/services/antigravityClient.js:529, src/services/relay/geminiRelayService.js:443, REDACTED:1530
  • `execute` awaits `axios(…)` 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: `axios(url, { signal })`. — src/services/balanceScriptService.js:62
  • `handleAzureOpenAIRequest` awaits `axios(…)` 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: `axios(url, { signal })`. — src/services/relay/azureOpenaiRelayService.js:16
  • `_makeCcrStreamRequest` awaits `axios(…)` 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: `axios(url, { signal })`. — src/services/relay/ccrRelayService.js:561
  • `_makeClaudeConsoleStreamRequest` awaits `axios(…)` 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: `axios(url, { signal })`. — REDACTED:744
  • `_makeClaudeRequest` awaits `https.request(…)` 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: `https.request(url, { signal })`. — REDACTED:1727
  • `_makeClaudeStreamRequestWithUsageCapture` awaits `https.request(…)` 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: `https.request(url, { signal })`. — REDACTED:2154
  • `relayRequest` awaits `axios(…)` 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: `axios(url, { signal })`. — src/services/relay/droidRelayService.js:184
  • `_handleStreamRequest` awaits `https.request(…)` 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: `https.request(url, { signal })`. — src/services/relay/droidRelayService.js:415
  • `sendGeminiRequest` holds an AbortSignal but calls `axios(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `axios(…, { signal })`. — src/services/relay/geminiRelayService.js:229
  • `getAvailableModels` awaits `axios(…)` 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: `axios(url, { signal })`. — src/services/relay/geminiRelayService.js:382
  • `makeRequest` awaits `axios(…)` 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: `axios(url, { signal })`. — src/services/balanceProviders/baseBalanceProvider.js:38
  • `queryBalance` 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/services/balanceProviders/geminiBalanceProvider.js:191
  • `refreshAccountToken` awaits `axios.post(…)` 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: `axios.post(url, { signal })`. — src/services/account/claudeAccountService.js:263
  • `fetchOAuthUsage` awaits `axios.get(…)` 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: `axios.get(url, { signal })`. — src/services/account/claudeAccountService.js:2078
  • `fetchAndUpdateAccountProfile` awaits `axios.get(…)` 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: `axios.get(url, { signal })`. — src/services/account/claudeAccountService.js:2329
  • `_refreshTokensWithWorkOS` awaits `axios(…)` 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: `axios(url, { signal })`. — REDACTED:337
  • `_fetchFactoryOrgIds` awaits `axios(…)` 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: `axios(url, { signal })`. — REDACTED:411
  • `forwardToCodeAssist` awaits `axios(…)` 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: `axios(url, { signal })`. — REDACTED:1222
  • `loadCodeAssist` awaits `axios(…)` 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: `axios(url, { signal })`. — REDACTED:1260
  • `onboardUser` awaits `axios(…)` 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: `axios(url, { signal })`. — REDACTED:1396

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 materialisation5.5 / 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 313 is called with an argument built by `Object.keys(entries[0])` (line 316), 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. — REDACTED:313
  • `debug` at line 560 is called with an argument built by `Object.keys(ldapEntry || { })` (line 563), 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. — REDACTED:560
  • `debug` at line 107 is called with an argument built by `JSON.stringify(processedBody)` (line 116), 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/services/relay/azureOpenaiRelayService.js:107
  • `debug` at line 119 is called with an argument built by `Object.keys(requestHeaders)` (line 122), 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/services/relay/azureOpenaiRelayService.js:119
  • `debug` at line 127 is called with an argument built by `Object.keys(processedBody)` (line 130), 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/services/relay/azureOpenaiRelayService.js:127
  • `debug` at line 142 is called with an argument built by `Object.keys(response.headers || { })` (line 146), 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/services/relay/azureOpenaiRelayService.js:142
  • `debug` at line 621 is called with an argument built by `Object.keys(responseData || { })` (line 622), 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/services/relay/azureOpenaiRelayService.js:621
  • `debug` at line 98 is called with an argument built by `JSON.stringify(account.supportedModels)` (line 98), 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/services/relay/ccrRelayService.js:98
  • `debug` at line 161 is called with an argument built by `JSON.stringify(options)` (line 161), 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/services/relay/ccrRelayService.js:161
  • `debug` at line 162 is called with an argument built by `JSON.stringify(clientHeaders)` (line 162), 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/services/relay/ccrRelayService.js:162
  • `debug` at line 166 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 166), 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/services/relay/ccrRelayService.js:166
  • `debug` at line 208 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 209), 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/services/relay/ccrRelayService.js:208
  • `debug` at line 221 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 223), 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/services/relay/ccrRelayService.js:221
  • `debug` at line 253 is called with an argument built by `JSON.stringify(response.headers)` (line 253), 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/services/relay/ccrRelayService.js:253
  • `debug` at line 255 is called with an argument built by `JSON.stringify(response.data)` (line 256), 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/services/relay/ccrRelayService.js:255
  • `debug` at line 258 is called with an argument built by `JSON.stringify(response.data)` (line 259), 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/services/relay/ccrRelayService.js:258
  • `debug` at line 584 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 584), 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/services/relay/ccrRelayService.js:584
  • `debug` at line 817 is called with an argument built by `JSON.stringify(collectedUsage)` (line 817), 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/services/relay/ccrRelayService.js:817
  • `debug` at line 139 is called with an argument built by `JSON.stringify(account.supportedModels)` (line 139), 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. — REDACTED:139
  • `debug` at line 204 is called with an argument built by `JSON.stringify(options)` (line 204), 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. — REDACTED:204
  • `debug` at line 205 is called with an argument built by `JSON.stringify(clientHeaders)` (line 205), 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. — REDACTED:205
  • `debug` at line 209 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 209), 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. — REDACTED:209
  • `debug` at line 251 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 252), 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. — REDACTED:251
  • `debug` at line 264 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 266), 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. — REDACTED:264
  • `debug` at line 296 is called with an argument built by `JSON.stringify(response.headers)` (line 296), 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. — REDACTED:296
  • `debug` at line 298 is called with an argument built by `JSON.stringify(response.data)` (line 299), 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. — REDACTED:298
  • `debug` at line 324 is called with an argument built by `JSON.stringify(response.data)` (line 325), 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. — REDACTED:324
  • `debug` at line 767 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 767), 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. — REDACTED:767
  • `debug` at line 2783 is called with an argument built by `JSON.stringify(currentUsageData.cache_creation)` (line 2785), 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. — REDACTED:2783
  • `debug` at line 2789 is called with an argument built by `JSON.stringify(currentUsageData)` (line 2791), 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. — REDACTED:2789
  • `debug` at line 2803 is called with an argument built by `JSON.stringify(currentUsageData)` (line 2805), 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. — REDACTED:2803
  • `debug` at line 520 is called with an argument built by `JSON.stringify(requestBody, null, 2)` (line 520), 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/services/relay/geminiRelayService.js:520
  • `debug` at line 99 is called with an argument built by `JSON.stringify(accountData, null, 2)` (line 99), 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/services/account/ccrAccountService.js:99
  • `debug` at line 205 is called with an argument built by `Object.keys(accountData)` (line 205), 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/services/account/ccrAccountService.js:205
  • `debug` at line 218 is called with an argument built by `JSON.stringify(parsedModels)` (line 218), 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/services/account/ccrAccountService.js:218
  • `debug` at line 234 is called with an argument built by `JSON.stringify(accountData.supportedModels)` (line 235), 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/services/account/ccrAccountService.js:234
  • `debug` at line 253 is called with an argument built by `Object.keys(updates)` (line 254), 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/services/account/ccrAccountService.js:253
  • `debug` at line 256 is called with an argument built by `JSON.stringify(updates, null, 2)` (line 256), 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/services/account/ccrAccountService.js:256
  • `debug` at line 274 is called with an argument built by `JSON.stringify(updates.supportedModels)` (line 274), 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/services/account/ccrAccountService.js:274
  • `debug` at line 2321 is called with an argument built by `Object.keys(updates)` (line 2323), 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/services/account/claudeAccountService.js:2321

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 unescaped4.6 / 10Weak✓ 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.

  • `title` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/admin-spa/src/utils/tools.js:52
  • `message.replace(/\n/g,'<br>')` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/admin-spa/src/utils/tools.js:53

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 element7.1 / 10Strong✓ Tool-verified

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

  • This loop runs once per element of `data`, and the statement it guards acts on the element it is on — `d`. The test deciding whether that statement runs does not: `labelField === 'hour'` reads `data[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1068, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — web/admin-spa/src/views/DashboardView.vue:1075
  • This loop runs once per element of `data`, and the statement it guards acts on the element it is on — `d`. The test deciding whether that statement runs does not: `labelField === 'hour'` reads `data[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1336, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — web/admin-spa/src/views/DashboardView.vue:1345
  • This loop runs once per element of `trend`, and the statement it guards acts on the element it is on — `item`. The test deciding whether that statement runs does not: `labelField === 'hour'` reads `trend[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1528, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — web/admin-spa/src/views/DashboardView.vue:1536

What to do

  • Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
X3 · Exception handling5.5 / 10Adequate✓ 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. (×27) — web/admin-spa/src/views/AccountsView.vue:3831, web/admin-spa/src/views/AccountsView.vue:4749, web/admin-spa/src/views/ApiKeysView.vue:2627, …
  • `.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. (×12) — src/utils/safeRotatingAppend.js:66, src/utils/upstreamErrorHelper.js:322, src/utils/upstreamErrorHelper.js:373, …
  • `catch (e)` 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/services/openaiToClaude.js:152

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.

X4 · Structured logging3.2 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. 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 `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `info` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:62
  • `info` at line 125 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:125
  • `info` at line 256 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:256
  • `info` at line 274 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:274
  • `info` at line 507 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:507
  • `info` at line 610 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:610
  • `info` at line 613 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:613
  • `info` at line 616 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:616
  • `info` at line 617 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:617
  • `info` at line 618 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:618
  • `info` at line 624 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:624
  • `info` at line 657 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:657
  • `info` at line 664 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:664
  • `info` at line 699 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:699
  • `info` at line 708 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:708
  • `error` at line 781 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:781
  • `info` at line 786 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:786
  • `warn` at line 789 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:789
  • `info` at line 836 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:836
  • `info` at line 901 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:901
  • `warn` at line 38 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:38
  • `warn` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:62
  • `error` at line 69 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:69
  • `warn` at line 97 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:97
  • `debug` at line 103 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:103
  • `debug` at line 107 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. (×2) — src/validators/clientValidator.js:107, src/validators/clients/claudeCodeValidator.js:107
  • `error` at line 124 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clientValidator.js:124
  • `error` at line 90 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:90
  • `warn` at line 94 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:94
  • `debug` at line 143 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:143
  • `debug` at line 173 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:173
  • `debug` at line 185 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:185
  • `debug` at line 192 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/claudeCodeValidator.js:192
  • `debug` at line 50 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:50
  • `debug` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:62
  • `debug` at line 69 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:69
  • `debug` at line 77 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:77
  • `debug` at line 87 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:87
  • `debug` at line 94 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/validators/clients/codexCliValidator.js:94

What to do

  • Interpolated log message defeats structured logging

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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 Health12%Critical — gated by D1, D2, R1, R10, R2, R3, R7, X4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture73%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity58%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness30%Weak — gated by R4, P3, P5, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security58%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility35%Weak — gated by AC1, AC2, AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 31 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 45 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AX1 Captive dependencies — Not 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 — compose up failed (exit 1 — a container did not start, exited, or never became healthy) — time="2026-11-15T05:13:16Z" level=warning msg="The \"JWT_SECRET\" variable is not set. Defaulting to a blank string." time="2026-11-15T05:13:16Z" level=warning msg="The \"ENCRYPTION_KEY\" variable is not set. Defaulting to a blank string." container .-claude-relay-1 is unhealthy; 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.
  • 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 — API consistency is measured on C# only; the exposed JavaScript surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • 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
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 30 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for 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.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X19 Unrestored process-global state — 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.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 218 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×57
  • 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
  • + 32 more in this group — see findings.md.
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
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×17
  • Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:76 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:107 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:147 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:178 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/accounts/AccountForm.vue:209 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/apistats/StatsOverview.vue:63 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:4 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:70 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:88 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:103 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:138 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:175 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:214 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/AccountSelector.vue:253 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/CustomDropdown.vue:4 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/CustomDropdown.vue:41 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> web/admin-spa/src/components/common/ToastNotification.vue:4 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×15
  • Orphaned knowledge src/services/relay/droidRelayService.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.
  • Orphaned knowledge web/admin-spa/src/views/QuotaCardsView.vue: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.
  • Orphaned knowledge src/services/relay/ccrRelayService.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.
  • Orphaned knowledge web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue: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.
  • Orphaned knowledge src/services/relay/bedrockRelayService.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.
  • Orphaned knowledge src/services/account/ccrAccountService.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.
  • Orphaned knowledge REDACTED: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.
  • Orphaned knowledge REDACTED: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.
  • Orphaned knowledge src/services/account/accountBalanceService.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.
  • Orphaned knowledge web/admin-spa/src/views/UserManagementView.vue: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.
  • Orphaned knowledge src/services/quotaCardService.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.
  • Orphaned knowledge web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue: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.
  • Orphaned knowledge src/services/codexToOpenAI.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.
  • Orphaned knowledge src/services/apiKeyIndexService.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.
  • Orphaned knowledge web/admin-spa/src/views/AccountUsageRecordsView.vue: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.
AC2 · Forms & labels · <label> that labels no control · ×14
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:16 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:20 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:26 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:30 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:36 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:40 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:79 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:113 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountForm.vue:68 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountForm.vue:649 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountForm.vue:718 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/AccountForm.vue:735 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/CcrAccountForm.vue:29 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/admin-spa/src/components/accounts/CcrAccountForm.vue:44 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels · <button> with no accessible text · ×13
  • <button> with no accessible text web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:36 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:27 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/AccountForm.vue:18 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue:28 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue:54 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:279 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:348 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:355 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:365 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:372 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/CcrAccountForm.vue:18 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/GroupManagementModal.vue:18 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/admin-spa/src/components/accounts/GroupManagementModal.vue:163 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC2 · Forms & labels · <input> without a programmatic label · ×10
  • <input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:17 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:23 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:27 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:33 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:37 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:43 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:116 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/AccountForm.vue:721 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:118 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/admin-spa/src/components/accounts/CcrAccountForm.vue:32 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
S1 · Web-Security Posture · Cryptographic key material is a compile-time constant · ×5
  • Cryptographic key material is a compile-time constant src/services/account/azureOpenaiAccountService.js:13 — `azureOpenaiSalt` is the key-derivation salt, 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.
  • Cryptographic key material is a compile-time constant src/services/account/claudeAccountService.js:61 — `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. 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.
  • Cryptographic key material is a compile-time constant src/services/account/claudeConsoleAccountService.js:14 — `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. 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.
  • Cryptographic key material is a compile-time constant src/services/account/geminiApiAccountService.js:13 — `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. 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.
  • Cryptographic key material is a compile-time constant src/services/account/openaiResponsesAccountService.js:13 — `ENCRYPTION_SALT` is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. 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.
D28 · Secrets (history) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <textarea> without a programmatic label · ×3
  • <textarea> without a programmatic label web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue:69 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label web/admin-spa/src/components/accounts/AccountForm.vue:738 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label web/admin-spa/src/components/accounts/CcrAccountForm.vue:47 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics · Click handler on a non-interactive <th> · ×3
  • Click handler on a non-interactive <th> web/admin-spa/src/components/settings/ModelPricingSection.vue:77 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <th> web/admin-spa/src/components/settings/ModelPricingSection.vue:87 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <th> web/admin-spa/src/components/settings/ModelPricingSection.vue:97 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <code> · ×2
  • Click handler on a non-interactive <code> web/admin-spa/src/views/QuotaCardsView.vue:256 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <code> web/admin-spa/src/views/QuotaCardsView.vue:432 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics · Click handler on a non-interactive <span> · ×2
  • Click handler on a non-interactive <span> web/admin-spa/src/views/QuotaCardsView.vue:441 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <span> web/admin-spa/src/views/QuotaCardsView.vue:450 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D13 · REDACTED Scanning · Leaked secret · ×2
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <h4> · ×1
  • Click handler on a non-interactive <h4> web/admin-spa/src/components/apistats/ModelUsageStats.vue:30 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D28 · Secrets (history) · High secret · ×1
  • REDACTED
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
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) REDACTED:943 — REDACTED → src/services/accountNameCacheService.js → src/services/account/azureOpenaiAccountService.js → REDACTED (one verified cycle inside a mutually-dependent group of 22 files)
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) src/services/apiKeyService.js:426 — src/services/apiKeyService.js → REDACTED → src/services/apiKeyService.js
Serious — 1750 finding(s)
D29 · Static Analysis (SAST) · REDACTED · ×265
  • 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
  • + 240 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×52
  • FunctionTooLong: api.handleMessagesRequest REDACTED:137 — FunctionTooLong — handleMessagesRequest runs 856 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 756 over it, 8.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: anthropicGeminiBridgeService.handleAnthropicMessagesToGemini src/services/anthropicGeminiBridgeService.js:1859 — FunctionTooLong — handleAnthropicMessagesToGemini runs 791 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 691 over it, 7.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: auth.authenticateApiKey REDACTED:440 — FunctionTooLong — authenticateApiKey runs 557 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 457 over it, 5.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dashboard.useDashboardStore web/admin-spa/src/stores/dashboard.js:7 — FunctionTooLong — useDashboardStore runs 532 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 432 over it, 5.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: openaiRoutes.handleResponses REDACTED:293 — FunctionTooLong — handleResponses runs 433 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 333 over it, 4.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: apistats.useApiStatsStore web/admin-spa/src/stores/apistats.js:6 — FunctionTooLong — useApiStatsStore runs 398 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 298 over it, 3.98× 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: usageStats.router.get("/account-usage-trend") src/routes/admin/usageStats.js:1247 — FunctionTooLong — router.get("/account-usage-trend") runs 397 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 297 over it, 3.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: openaiGeminiRoutes.router.post("/v1/chat/completions") REDACTED:192 — FunctionTooLong — router.post("/v1/chat/completions") runs 331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 231 over it, 3.31× 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: geminiHandlers.handleStandardStreamGenerateContent REDACTED:2506 — FunctionTooLong — handleStandardStreamGenerateContent runs 326 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 226 over it, 3.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: apiStats.router.post("/api/user-stats") REDACTED:101 — FunctionTooLong — router.post("/api/user-stats") runs 319 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 219 over it, 3.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: usageStats.router.get("/api-keys-usage-trend") src/routes/admin/usageStats.js:1825 — FunctionTooLong — router.get("/api-keys-usage-trend") runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: usageStats.router.get("/usage-costs") src/routes/admin/usageStats.js:2286 — FunctionTooLong — router.get("/usage-costs") runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× 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: accounts.useAccountsStore web/admin-spa/src/stores/accounts.js:22 — FunctionTooLong — useAccountsStore runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 178 over it, 2.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: geminiHandlers.handleMessages REDACTED:395 — FunctionTooLong — handleMessages runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× 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: usageStats.router.get("/usage-trend") src/routes/admin/usageStats.js:539 — FunctionTooLong — router.get("/usage-trend") runs 268 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 168 over it, 2.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: sync.router.get("/sync/export-accounts") REDACTED:93 — FunctionTooLong — router.get("/sync/export-accounts") runs 267 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× 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: usageStats.router.get("/api-keys/:keyId/usage-records") src/routes/admin/usageStats.js:2708 — FunctionTooLong — router.get("/api-keys/:keyId/usage-records") runs 261 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 161 over it, 2.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openaiRoutes.handleImages REDACTED:971 — FunctionTooLong — handleImages runs 261 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 161 over it, 2.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: geminiHandlers.handleStreamGenerateContent REDACTED:1806 — FunctionTooLong — handleStreamGenerateContent runs 254 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openaiClaudeRoutes.handleChatCompletion REDACTED:186 — FunctionTooLong — handleChatCompletion runs 238 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: usageStats.router.get("/accounts/:accountId/usage-records") src/routes/admin/usageStats.js:3066 — FunctionTooLong — router.get("/accounts/:accountId/usage-records") runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: apiKeys.router.put("/api-keys/:keyId") REDACTED:2108 — FunctionTooLong — router.put("/api-keys/:keyId") runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: usageStats.router.get("/api-keys/:keyId/model-stats") src/routes/admin/usageStats.js:933 — FunctionTooLong — router.get("/api-keys/:keyId/model-stats") runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: usageStats.router.get("/accounts/:accountId/usage-history") src/routes/admin/usageStats.js:247 — FunctionTooLong — router.get("/accounts/:accountId/usage-history") runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× 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: azureOpenaiRelayService.handleStreamResponse src/services/relay/azureOpenaiRelayService.js:270 — FunctionTooLong — handleStreamResponse runs 206 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 106 over it, 2.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.
  • + 27 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file web/admin-spa/src/components/accounts/AccountForm.vue: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 web/admin-spa/src/views/AccountsView.vue: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 web/admin-spa/src/views/ApiKeysView.vue: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/routes/admin/usageStats.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 web/admin-spa/src/views/SettingsView.vue: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/services/anthropicGeminiBridgeService.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 web/admin-spa/src/components/apikeys/EditApiKeyModal.vue: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 web/admin-spa/src/views/DashboardView.vue: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 web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue: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/services/relay/droidRelayService.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 web/admin-spa/src/components/accounts/OAuthFlow.vue: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 web/admin-spa/src/views/QuotaCardsView.vue: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 web/admin-spa/src/views/RequestDetailsView.vue: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 web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue: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/services/relay/ccrRelayService.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/utils/oauthHelper.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 web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue: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 web/admin-spa/src/views/ApiStatsView.vue: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.
  • + 15 more in this group — see findings.md.
X2 · Cancellation propagation · Async function without AbortSignal · ×39
  • Async function without AbortSignal: login web/admin-spa/src/stores/user.js:25 — `login` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: logout web/admin-spa/src/stores/user.js:55 — `logout` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: getUserProfile web/admin-spa/src/stores/user.js:102 — `getUserProfile` awaits `axios.get(…)` 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: `axios.get(url, { signal })`.
  • Async function without AbortSignal: getUserApiKeys web/admin-spa/src/stores/user.js:127 — `getUserApiKeys` awaits `axios.get(…)` 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: `axios.get(url, { signal })`.
  • Async function without AbortSignal: createApiKey web/admin-spa/src/stores/user.js:142 — `createApiKey` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: deleteApiKey web/admin-spa/src/stores/user.js:153 — `deleteApiKey` awaits `axios.delete(…)` 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: `axios.delete(url, { signal })`.
  • Async function without AbortSignal: getUserUsageStats web/admin-spa/src/stores/user.js:164 — `getUserUsageStats` awaits `axios.get(…)` 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: `axios.get(url, { signal })`.
  • Async function without AbortSignal: exchangeAuthorizationCode src/utils/grokHelper.js:748 — `exchangeAuthorizationCode` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: refreshAccessToken src/utils/grokHelper.js:784 — `refreshAccessToken` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: exchangeCodeForTokens src/utils/oauthHelper.js:156 — `exchangeCodeForTokens` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: exchangeSetupTokenCode src/utils/oauthHelper.js:375 — `exchangeSetupTokenCode` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: getOrganizationInfo src/utils/oauthHelper.js:614 — `getOrganizationInfo` awaits `axios.get(…)` 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: `axios.get(url, { signal })`.
  • Async function without AbortSignal: authorizeWithCookie src/utils/oauthHelper.js:707 — `authorizeWithCookie` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: startDeviceAuthorization src/utils/workosOAuthHelper.js:30 — `startDeviceAuthorization` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: pollDeviceAuthorization src/utils/workosOAuthHelper.js:104 — `pollDeviceAuthorization` awaits `axios.post(…)` 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: `axios.post(url, { signal })`.
  • Async function without AbortSignal: fetchAvailableModels src/services/antigravityClient.js:483 — `fetchAvailableModels` awaits `axios(…)` 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: `axios(url, { signal })`.
  • Async function without AbortSignal: countTokens src/services/antigravityClient.js:529 — `countTokens` awaits `axios(…)` 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: `axios(url, { signal })`.
  • Async function without AbortSignal: execute src/services/balanceScriptService.js:62 — `execute` awaits `axios(…)` 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: `axios(url, { signal })`.
  • Async function without AbortSignal: handleAzureOpenAIRequest src/services/relay/azureOpenaiRelayService.js:16 — `handleAzureOpenAIRequest` awaits `axios(…)` 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: `axios(url, { signal })`.
  • Async function without AbortSignal: _makeCcrStreamRequest src/services/relay/ccrRelayService.js:561 — `_makeCcrStreamRequest` awaits `axios(…)` 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: `axios(url, { signal })`.
  • Async function without AbortSignal: _makeClaudeConsoleStreamRequest REDACTED:744 — `_makeClaudeConsoleStreamRequest` awaits `axios(…)` 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: `axios(url, { signal })`.
  • Async function without AbortSignal: _makeClaudeRequest REDACTED:1727 — `_makeClaudeRequest` awaits `https.request(…)` 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: `https.request(url, { signal })`.
  • Async function without AbortSignal: _makeClaudeStreamRequestWithUsageCapture REDACTED:2154 — `_makeClaudeStreamRequestWithUsageCapture` awaits `https.request(…)` 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: `https.request(url, { signal })`.
  • Async function without AbortSignal: relayRequest src/services/relay/droidRelayService.js:184 — `relayRequest` awaits `axios(…)` 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: `axios(url, { signal })`.
  • Async function without AbortSignal: _handleStreamRequest src/services/relay/droidRelayService.js:415 — `_handleStreamRequest` awaits `https.request(…)` 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: `https.request(url, { signal })`.
  • + 14 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×39
  • Swallowed exception (empty catch) web/admin-spa/src/views/AccountsView.vue:3831 — 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) web/admin-spa/src/views/AccountsView.vue:4749 — 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) web/admin-spa/src/views/ApiKeysView.vue:2627 — 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) web/admin-spa/src/stores/dashboard.js:103 — 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) web/admin-spa/src/components/accounts/AccountForm.vue:4910 — 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) web/admin-spa/src/components/accounts/AccountForm.vue:6918 — 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) web/admin-spa/src/components/accounts/OAuthFlow.vue:970 — 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:398 — 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/utils/antigravityUpstreamResponseDump.js:125 — 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/utils/commonHelper.js:336 — 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/utils/commonHelper.js:341 — 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/utils/grokHelper.js:680 — 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: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) REDACTED:272 — 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/utils/safeRotatingAppend.js:66 — `.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/utils/upstreamErrorHelper.js:322 — `.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/utils/upstreamErrorHelper.js:373 — `.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/utils/upstreamErrorHelper.js:488 — 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/utils/upstreamErrorHelper.js:493 — `.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/services/accountGroupService.js:590 — `.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/services/accountGroupService.js:592 — 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/services/accountNameCacheService.js:68 — 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/services/accountNameCacheService.js:73 — 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/services/anthropicGeminiBridgeService.js:2525 — 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/services/anthropicGeminiBridgeService.js:2547 — 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 · ×37
  • FileTooLong: REDACTED REDACTED — FileTooLong — 3424 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 74% of them inside a single declaration: QUEUE_STATS_TTL_SECONDS (130-4049). The bar is 500 significant lines; this is 2924 over it, 6.85× 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: admin/usageStats.js src/routes/admin/usageStats.js — FileTooLong — 2334 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 1500 significant lines; this is 834 over it, 1.56× 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 — 2277 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 99% of them inside a single declaration: ClaudeRelayService (33-3666). The bar is 1500 significant lines; this is 777 over it, 1.52× 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: account/claudeAccountService.js src/services/account/claudeAccountService.js — FileTooLong — 2216 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 99% of them inside a single declaration: ClaudeAccountService (42-3583). The bar is 1500 significant lines; this is 716 over it, 1.48× 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: services/apiKeyService.js src/services/apiKeyService.js — FileTooLong — 1927 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 94% of them inside a single declaration: ApiKeyService (170-2866). The bar is 500 significant lines; this is 1427 over it, 3.85× 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 — 1901 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 1401 over it, 3.80× 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: services/anthropicGeminiBridgeService.js src/services/anthropicGeminiBridgeService.js — FileTooLong — 1817 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 1317 over it, 3.63× 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 — 1762 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 1262 over it, 3.52× 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 — 1226 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: handleMessagesRequest (137-1468). The bar is 500 significant lines; this is 726 over it, 2.45× 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 — 1206 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 706 over it, 2.41× 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 — 1181 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 681 over it, 2.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: services/requestDetailService.js src/services/requestDetailService.js — FileTooLong — 1125 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 62% of them inside a single declaration: RequestDetailService (634-1624). The bar is 500 significant lines; this is 625 over it, 2.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: scheduler/unifiedClaudeScheduler.js src/services/scheduler/unifiedClaudeScheduler.js — FileTooLong — 1114 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: UnifiedClaudeScheduler (43-1922). The bar is 500 significant lines; this is 614 over it, 2.23× 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 — 1071 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 571 over it, 2.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1004 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: DroidAccountService (17-1560). The bar is 500 significant lines; this is 504 over it, 2.01× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: account/claudeConsoleAccountService.js src/services/account/claudeConsoleAccountService.js — FileTooLong — 983 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ClaudeConsoleAccountService (10-1630). The bar is 500 significant lines; this is 483 over it, 1.97× 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 — 958 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ClaudeConsoleRelayService (17-1532). The bar is 500 significant lines; this is 458 over it, 1.92× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: relay/droidRelayService.js src/services/relay/droidRelayService.js — FileTooLong — 954 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: DroidRelayService (21-1571). The bar is 500 significant lines; this is 454 over it, 1.91× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 939 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 439 over it, 1.88× 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 — 792 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 292 over it, 1.58× 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 — 752 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 252 over it, 1.50× 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 — 632 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 132 over it, 1.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: scheduler/unifiedOpenAIScheduler.js src/services/scheduler/unifiedOpenAIScheduler.js — FileTooLong — 620 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: UnifiedOpenAIScheduler (9-1013). The bar is 500 significant lines; this is 120 over it, 1.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: relay/ccrRelayService.js src/services/relay/ccrRelayService.js — FileTooLong — 613 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CcrRelayService (10-967). The bar is 500 significant lines; this is 113 over it, 1.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: utils/grokHelper.js src/utils/grokHelper.js — FileTooLong — 604 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 104 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.
  • + 12 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×34
  • MethodTooLong: UnifiedClaudeScheduler._getAllAvailableAccounts src/services/scheduler/unifiedClaudeScheduler.js:515 — MethodTooLong — _getAllAvailableAccounts runs 310 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 210 over it, 3.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: Application.initialize REDACTED:50 — MethodTooLong — initialize runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.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.
  • MethodTooLong: OpenAIResponsesRelayService.handleRequest REDACTED:68 — MethodTooLong — handleRequest runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.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.
  • MethodTooLong: DroidAccountService.createAccount REDACTED:458 — MethodTooLong — createAccount runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DroidAccountService.updateAccount REDACTED:836 — MethodTooLong — updateAccount runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.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.
  • MethodTooLong: RedisClient.incrementTokenUsage REDACTED:1068 — MethodTooLong — incrementTokenUsage runs 227 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 127 over it, 2.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.
  • MethodTooLong: ApiKeyService.recordUsageWithDetails src/services/apiKeyService.js:1862 — MethodTooLong — recordUsageWithDetails runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: UnifiedClaudeScheduler.selectAccountForApiKey src/services/scheduler/unifiedClaudeScheduler.js:180 — MethodTooLong — selectAccountForApiKey runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.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.
  • MethodTooLong: DroidRelayService._handleStreamRequest src/services/relay/droidRelayService.js:415 — MethodTooLong — _handleStreamRequest runs 191 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 91 over it, 1.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WeeklyClaudeCostInitService.backfillCurrentWeekClaudeCosts src/services/weeklyClaudeCostInitService.js:69 — MethodTooLong — backfillCurrentWeekClaudeCosts runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: UnifiedGeminiScheduler._getAllAvailableAccounts src/services/scheduler/unifiedGeminiScheduler.js:224 — MethodTooLong — _getAllAvailableAccounts runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ApiKeyService.generateApiKey src/services/apiKeyService.js:176 — MethodTooLong — generateApiKey runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.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.
  • MethodTooLong: ApiKeyService.getAllApiKeysFast src/services/apiKeyService.js:1052 — MethodTooLong — getAllApiKeysFast runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.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.
  • MethodTooLong: UnifiedOpenAIScheduler.selectAccountForApiKey src/services/scheduler/unifiedOpenAIScheduler.js:122 — MethodTooLong — selectAccountForApiKey runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× 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: RedisClient.incrementAccountUsage REDACTED:1381 — MethodTooLong — incrementAccountUsage runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ClaudeAccountService.createAccount src/services/account/claudeAccountService.js:81 — MethodTooLong — createAccount runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PricingService.calculateCost src/services/pricingService.js:513 — MethodTooLong — calculateCost runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BedrockRelayService.handleStreamRequest src/services/relay/bedrockRelayService.js:243 — MethodTooLong — handleStreamRequest runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OpenAIResponsesRelayService._handleStreamResponse REDACTED:476 — MethodTooLong — _handleStreamResponse runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.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: GrokRelayService.handleRequest REDACTED:43 — MethodTooLong — handleRequest runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ApiKeyService.getAllApiKeys src/services/apiKeyService.js:867 — MethodTooLong — getAllApiKeys runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RedisClient.migrateUsageIndex REDACTED:202 — MethodTooLong — migrateUsageIndex runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: ClaudeAccountService.updateAccount src/services/account/claudeAccountService.js:740 — MethodTooLong — updateAccount runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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: ApiKeyService.validateApiKey src/services/apiKeyService.js:360 — MethodTooLong — validateApiKey runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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: ClaudeAccountService.refreshAccountToken src/services/account/claudeAccountService.js:263 — MethodTooLong — refreshAccountToken runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 9 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×26
  • Sync-over-async blocking REDACTED:168 — `fs.existsSync` in `callback to app.use` 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:265 — `fs.existsSync` in `initialize` 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:307 — `fs.existsSync` in `app.get("/admin-next/*")` 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:307 — `fs.statSync` in `app.get("/admin-next/*")` 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:395 — `fs.existsSync` in `app.get("/health")` 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:396 — `fs.readFileSync` in `app.get("/health")` 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:483 — `fs.existsSync` in `initializeAdmin` 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:489 — `fs.readFileSync` in `initializeAdmin` 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:98 — `fs.readFileSync` in `router.get("/check-updates")` 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:39 — `fs.existsSync` in `router.post("/auth/login")` 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:41 — `fs.readFileSync` in `router.post("/auth/login")` 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:213 — `fs.existsSync` in `router.post("/auth/change-password")` 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:221 — `fs.readFileSync` in `router.post("/auth/change-password")` 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:230 — `fs.writeFileSync` in `router.post("/auth/change-password")` 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 src/services/pricingService.js:50 — `fs.existsSync` in `initialize` 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 src/services/pricingService.js:51 — `fs.mkdirSync` in `initialize` 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 src/services/pricingService.js:294 — `fs.existsSync` in `loadPricingData` 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 src/services/pricingService.js:295 — `fs.readFileSync` in `loadPricingData` 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 src/services/pricingService.js:298 — `fs.statSync` in `loadPricingData` 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 src/services/pricingService.js:317 — `fs.existsSync` in `useFallbackPricing` 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 src/services/pricingService.js:321 — `fs.readFileSync` in `useFallbackPricing` 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 src/services/pricingService.js:327 — `fs.writeFileSync` in `useFallbackPricing` 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 src/services/pricingService.js:836 — `fs.existsSync` in `reloadPricingData` 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 src/services/pricingService.js:845 — `fs.readFileSync` in `reloadPricingData` 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:1798 — `zlib.gunzipSync` in `res.on("end")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • + 1 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×24
  • ClassTooLong: ClaudeRelayService REDACTED:33 — ClassTooLong — 2247 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 1847 over it, 5.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ClaudeAccountService src/services/account/claudeAccountService.js:42 — ClassTooLong — 2186 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 400 significant lines; this is 1786 over it, 5.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ApiKeyService src/services/apiKeyService.js:170 — ClassTooLong — 1817 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 1417 over it, 4.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: UnifiedClaudeScheduler src/services/scheduler/unifiedClaudeScheduler.js:43 — ClassTooLong — 1094 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 694 over it, 2.74× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DroidAccountService REDACTED:17 — ClassTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 594 over it, 2.49× 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: ClaudeConsoleAccountService src/services/account/claudeConsoleAccountService.js:10 — ClassTooLong — 974 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 574 over it, 2.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: ClaudeConsoleRelayService REDACTED:17 — ClassTooLong — 942 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 542 over it, 2.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: DroidRelayService src/services/relay/droidRelayService.js:21 — ClassTooLong — 939 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 539 over it, 2.35× 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: RequestDetailService src/services/requestDetailService.js:634 — ClassTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 295 over it, 1.74× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: UnifiedOpenAIScheduler src/services/scheduler/unifiedOpenAIScheduler.js:9 — ClassTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 212 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CcrRelayService src/services/relay/ccrRelayService.js:10 — ClassTooLong — 604 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 204 over it, 1.51× 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: CcrAccountService src/services/account/ccrAccountService.js:8 — ClassTooLong — 574 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 174 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: AccountBalanceService src/services/account/accountBalanceService.js:7 — ClassTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 147 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PricingService src/services/pricingService.js:8 — ClassTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 138 over it, 1.35× 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: Application REDACTED:44 — ClassTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 138 over it, 1.35× 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: OpenAIResponsesRelayService REDACTED:47 — ClassTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 132 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: UnifiedGeminiScheduler src/services/scheduler/unifiedGeminiScheduler.js:22 — ClassTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 112 over it, 1.28× 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: BedrockAccountService REDACTED:10 — ClassTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 109 over it, 1.27× 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: GrokAccountService src/services/account/grokAccountService.js:16 — ClassTooLong — 479 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 79 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BedrockRelayService src/services/relay/bedrockRelayService.js:12 — ClassTooLong — 479 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 79 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WebhookService src/services/webhookService.js:11 — ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 74 over it, 1.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LdapService REDACTED:6 — ClassTooLong — 423 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 23 over it, 1.06× 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: QuotaCardService src/services/quotaCardService.js:10 — ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 21 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CodexToOpenAIConverter src/services/codexToOpenAI.js:6 — ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 18 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium CVE · ×21
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×19
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.8 · ×12
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:83 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:96 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/accounts/AccountForm.vue:33 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/accounts/AccountForm.vue:48 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:100 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/accounts/OAuthFlow.vue:64 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/apikeys/ExpiryEditModal.vue:112 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/apikeys/ExpiryEditModal.vue:125 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/apikeys/TagManagementModal.vue:149 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/settings/ModelPricingSection.vue:50 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/tutorial/DroidCliTutorial.vue:11 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.8:1) web/admin-spa/src/components/tutorial/NodeInstallTutorial.vue:6 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D29 · Static Analysis (SAST) · REDACTED · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
C2 · Access Controls · Anyone can act as another user by changing what their browser sends · ×9
  • Anyone can act as another user by changing what their browser sends REDACTED:1509 — Here who is asking is taken from the 'permissions' form field (const{name, description, tokenLimit, expiresAt, claudeAccountId, claudeConsoleAccountId…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends REDACTED:1769 — Here who is asking is taken from the 'permissions' form field (const{baseName, count, description, tokenLimit, expiresAt, claudeAccountId, claudeConso…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends REDACTED:1901 — Here who may pass is decided by the 'permissions' form field (if(updates.permissions!==undefined)) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends REDACTED:2143 — Here who is asking is taken from the 'permissions' form field (const{name, tokenLimit, concurrencyLimit, rateLimitWindow, rateLimitRequests, rateLimit…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends REDACTED:476 — Here who is asking is taken from the 'permissions' form field (const responseData = {id:keyId, name:fullKeyData.name, description:fullKeyData.descript…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends REDACTED:1016 — Here who is asking is taken from the 'account' request header (const{accessToken, accountType, proxy, account} = authResult) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends REDACTED:177 — Here who may pass is decided by the 'username' cookie (if(!sessionData.username||!sessionData.loginTime)) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends REDACTED:296 — Here who may pass is decided by the 'username' cookie (if(!sessionData.username||!sessionData.loginTime)) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends REDACTED:354 — Here who may pass is decided by the 'username' cookie (if(!sessionData.username||!sessionData.loginTime)) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
D35 · Change Coupling · Change coupling · ×9
  • Change coupling: accounts.js ↔ AccountsView.vue web/admin-spa/src/stores/accounts.js:1 — `web/admin-spa/src/stores/accounts.js` and `web/admin-spa/src/views/AccountsView.vue` change together 73% of the time (8 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 8 shared commits counted here, the most recent 3 are `bae39d54` feat: 支持Gemini-Api接入; `2fc84a6a` feat: 新增Droid cli支持; `08946c67` feat: 新增 OpenAI-Responses 账户管理功能和独立自动停止标记机制 — run `git show` on any of them.
  • Change coupling: UsageDetailModal.vue ↔ ApiKeysView.vue web/admin-spa/src/components/apikeys/UsageDetailModal.vue:1 — `web/admin-spa/src/components/apikeys/UsageDetailModal.vue` and `web/admin-spa/src/views/ApiKeysView.vue` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 `c0c944f9` mod: 补充API KEY详情页进度条; `9fe2918a` feat: keep API key stats modal and add timeline entry point; `92ec3ffc` feat: API Keys页面恢复今日时间选项并设为默认 — run `git show` on any of them.
  • Change coupling: REDACTED ↔ AccountForm.vue REDACTED:1 — `REDACTED` and `web/admin-spa/src/components/accounts/AccountForm.vue` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 `201d95c8` [fix] Droid: dynamic x-api-provider and custom User-Agent support (at that commit the file was still `src/services/droidAccountService.js`); `1f9afc78` feat: 添加Droid账户API Key管理功能 (at that commit the file was still `src/services/droidAccountService.js`); `0b261084` feat: droid apikey异常自动移除 (at that commit the file was still `src/services/droidAccountService.js`) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ LimitConfig.vue REDACTED:1 — `REDACTED` and `web/admin-spa/src/components/apistats/LimitConfig.vue` change together 64% of the time (7 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 7 shared commits counted here, the most recent 3 are `955b2af0` feat: add per-API-key weekly cost reset day/hour configuration; `baafebbf` fix: correct API key cost calculation and UI display issues; `f9c397cc` feat: api-stats页面增加周限总限查询 — run `git show` on any of them.
  • Change coupling: CreateApiKeyModal.vue ↔ ApiKeysView.vue web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1 — `web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue` and `web/admin-spa/src/views/ApiKeysView.vue` change together 59% of the time (20 of the 34 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 20 shared commits counted here, the most recent 3 are `53553c7e` fix: 修复gemini api类型账户绑定显示问题; `dea69641` fix: 修复apikeys页面部分bug; `42db2718` feat: droid平台账户数据统计及调度能力 — run `git show` on any of them.
  • Change coupling: BatchEditApiKeyModal.vue ↔ CreateApiKeyModal.vue web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue:1 — `web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue` and `web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `48c14f4e` fix: 移除1m模型限制和配套的apikey功能; `5d345691` feat: 支持按 API Key 控制 1M 上下文窗口访问; `955b2af0` feat: add per-API-key weekly cost reset day/hour configuration — run `git show` on any of them.
  • Change coupling: AccountUsageDetailModal.vue ↔ AccountsView.vue web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue:1 — `web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue` and `web/admin-spa/src/views/AccountsView.vue` 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 `c7701b80` feat(grok): show SuperGrok Heavy quota and fix OAuth account test; `37a95023` feat(grok): show rolling 5h/1d/7d/30d usage for custom-relay accounts; `9b0d0bee` fix: 账户时间线入口与路由修复 - 移除账户列表下拉/卡片的时间线入口,仅保留详情弹窗顶部按钮 - ActionDropdow… — run `git show` on any of them.
  • Change coupling: geminiRoutes.js ↔ standardGeminiRoutes.js src/routes/geminiRoutes.js:1 — `src/routes/geminiRoutes.js` and `src/routes/standardGeminiRoutes.js` 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `a4dcfb84` refactor: 重构gemini转部分; `bae39d54` feat: 支持Gemini-Api接入; `9eccc7da` 实现SSE心跳机制和非阻塞响应结束 — run `git show` on any of them.
  • Change coupling: AccountForm.vue ↔ AccountSelector.vue web/admin-spa/src/components/accounts/AccountForm.vue:1 — `web/admin-spa/src/components/accounts/AccountForm.vue` and `web/admin-spa/src/components/common/AccountSelector.vue` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `bae39d54` feat: 支持Gemini-Api接入; `42db2718` feat: droid平台账户数据统计及调度能力; `08946c67` feat: 新增 OpenAI-Responses 账户管理功能和独立自动停止标记机制 — run `git show` on any of them.
D8 · Code Coverage · Low coverage · ×8
  • Low coverage: REDACTED REDACTED:1 — 31.0% line coverage (183/591).
  • Low coverage: REDACTED REDACTED:1 — 20.1% line coverage (73/364).
  • Low coverage: REDACTED REDACTED:1 — 8.3% line coverage (88/1059).
  • Low coverage: REDACTED REDACTED:1 — 15.3% line coverage (29/190).
  • Low coverage: REDACTED REDACTED:1 — 4.7% line coverage (27/573).
  • Low coverage: src/services/scheduler/unifiedOpenAIScheduler.js src/services/scheduler/unifiedOpenAIScheduler.js:1 — 4.3% line coverage (19/444).
  • Low coverage: src/utils/errorSanitizer.js src/utils/errorSanitizer.js:1 — 5.2% line coverage (4/77).
  • Low coverage: src/utils/streamHelper.js src/utils/streamHelper.js:1 — 10.0% line coverage (1/10).
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×8
  • Outbound HTTP without resilience REDACTED:551 — `axios(` 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 REDACTED:892 — `axios(` 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 REDACTED:1521 — `axios(` 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 REDACTED:2360 — `axios(` 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 REDACTED:2682 — `axios(` 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 REDACTED:161 — `axios.post(` 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 src/services/balanceProviders/geminiBalanceProvider.js:216 — `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 src/services/balanceProviders/geminiBalanceProvider.js:229 — `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.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (2.3 · ×7
  • Low contrast Tailwind colour pair (2.3:1) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:88 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (2.3:1) web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue:135 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (2.3:1) web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:194 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (2.3:1) web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:177 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (2.3:1) web/admin-spa/src/components/layout/AppHeader.vue:89 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (2.3:1) web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue:11 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (2.3:1) web/admin-spa/src/components/tutorial/GeminiCliTutorial.vue:11 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 17) · ×7
  • (anonymous) (cyclomatic 17) REDACTED:52 — (anonymous) 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.
  • (anonymous) (cyclomatic 17) REDACTED:1736 — (anonymous) 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.
  • (anonymous) (cyclomatic 17) REDACTED:536 — (anonymous) 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 2 function literals inside it that branch (lines 543, 592). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
  • (anonymous) (cyclomatic 17) REDACTED:301 — (anonymous) has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous) (cyclomatic 17) REDACTED:459 — (anonymous) has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous) (cyclomatic 17) REDACTED:93 — (anonymous) has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous) (cyclomatic 17) web/admin-spa/src/router/index.js:188 — (anonymous) 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×7
  • Low cohesion: ApiKeyService (LCOM4 14) src/services/apiKeyService.js:170 — ApiKeyService's methods fall into 14 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 14 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ClaudeAccountService (LCOM4 13) src/services/account/claudeAccountService.js:42 — ClaudeAccountService's methods fall into 13 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: CostRankService (LCOM4 7) src/services/costRankService.js:66 — CostRankService's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ClaudeConsoleAccountService (LCOM4 6) src/services/account/claudeConsoleAccountService.js:10 — ClaudeConsoleAccountService's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: CcrAccountService (LCOM4 4) src/services/account/ccrAccountService.js:8 — CcrAccountService's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UserMessageQueueService (LCOM4 4) src/services/userMessageQueueService.js:26 — UserMessageQueueService's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ClaudeConsoleRelayService (LCOM4 4) REDACTED:17 — ClaudeConsoleRelayService's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AC1 · Text alternatives · <canvas> without a text alternative · ×6
  • <canvas> without a text alternative web/admin-spa/src/components/dashboard/ModelDistribution.vue:26 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative web/admin-spa/src/components/dashboard/UsageTrend.vue:32 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative web/admin-spa/src/views/DashboardView.vue:595 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative web/admin-spa/src/views/DashboardView.vue:685 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative web/admin-spa/src/views/DashboardView.vue:732 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative web/admin-spa/src/views/DashboardView.vue:784 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (4.4 · ×6
  • Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:29 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue:36 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue:28 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue:54 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/apistats/StatsOverview.vue:285 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.4:1) web/admin-spa/src/components/common/UnifiedTestModal.vue:44 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 16) · ×6
  • (anonymous) (cyclomatic 16) REDACTED:848 — (anonymous) 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.
  • (anonymous) (cyclomatic 16) REDACTED:1383 — (anonymous) 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 one function literal inside it that branches (line 1411). 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.
  • (anonymous) (cyclomatic 16) REDACTED:118 — (anonymous) 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.
  • (anonymous) (cyclomatic 16) REDACTED:293 — (anonymous) 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. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) 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.
  • (anonymous) (cyclomatic 16) REDACTED:479 — (anonymous) has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 552, 517, 516). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) 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.
  • (anonymous) (cyclomatic 16) REDACTED:192 — (anonymous) 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.
D12 · Dependency Hygiene · Deprecated · ×6
  • Deprecated: ldapjs package.json:67 — ldapjs 3.0.7, declared in package.json, is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". Replace it with the package or version that message names, or record why this one must stay.
  • Deprecated: string-similarity package.json:74 — string-similarity 4.0.4, declared in package.json, is marked deprecated by its publisher: "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.". Replace it with the package or version that message names, or record why this one must stay.
  • Deprecated: uuid package.json:76 — uuid 9.0.1, declared in package.json, is marked deprecated by its publisher: "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).". Replace it with the package or version that message names, or record why this one must stay.
  • Deprecated: eslint package.json:82 — eslint 8.57.1, declared in package.json, is marked deprecated by its publisher: "This version is no longer supported. Please see https://eslint.org/version-support for other options.". Replace it with the package or version that message names, or record why this one must stay.
  • Deprecated: supertest package.json:89 — supertest 6.3.4, declared in package.json, is marked deprecated by its publisher: "Please upgrade to supertest v7.1.3+, see release notes at https://github.com/forwardemail/supertest/releases/tag/v7.1.3 - maintenance is supported by Forward Email @ https://forwardemail.net". Replace it with the package or version that message names, or record why this one must stay.
  • Deprecated: eslint web/admin-spa/package.json:30 — eslint 8.57.1, declared in web/admin-spa/package.json, is marked deprecated by its publisher: "This version is no longer supported. Please see https://eslint.org/version-support for other options.". Replace it with the package or version that message names, or record why this one must stay.
D2 · Cognitive Complexity · (anonymous) · ×6
  • (anonymous)::getEffectiveGranularity::loadDashboardData (cognitive 44) web/admin-spa/src/stores/dashboard.js:235 — (anonymous)::getEffectiveGranularity::loadDashboardData has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 38, if/else 3, ternaries 1 (2 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.
  • (anonymous)::countAccountStats (cognitive 21) REDACTED:84 — (anonymous)::countAccountStats has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 3 (6 pts), if/else 4 (5 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::getEffectiveGranularity::loadAccountUsageTrend (cognitive 21) web/admin-spa/src/stores/dashboard.js:458 — (anonymous)::getEffectiveGranularity::loadAccountUsageTrend has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 3 (6 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.
  • (anonymous)::getEffectiveGranularity::loadApiKeysTrend (cognitive 19) web/admin-spa/src/stores/dashboard.js:409 — (anonymous)::getEffectiveGranularity::loadApiKeysTrend has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 pts), boolean chains 5, 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.
  • (anonymous)::setTrendGranularity (cognitive 17) web/admin-spa/src/stores/dashboard.js:614 — (anonymous)::setTrendGranularity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous)::refreshChartsData (cognitive 16) web/admin-spa/src/stores/dashboard.js:668 — (anonymous)::refreshChartsData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyMethods · ×6
  • TooManyMethods: RedisClient REDACTED:141 — TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ClaudeAccountService src/services/account/claudeAccountService.js:42 — TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ClaudeRelayService REDACTED:33 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ApiKeyService src/services/apiKeyService.js:170 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ClaudeConsoleAccountService src/services/account/claudeConsoleAccountService.js:10 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WebhookService src/services/webhookService.js:11 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× 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.
S1 · Web-Security Posture · Password key derivation is priced too cheaply · ×6
  • Password key derivation is priced too cheaply src/services/account/azureOpenaiAccountService.js:28 — This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
  • Password key derivation is priced too cheaply src/services/account/claudeAccountService.js:1348 — This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
  • Password key derivation is priced too cheaply src/services/account/claudeConsoleAccountService.js:1197 — This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
  • Password key derivation is priced too cheaply src/services/account/geminiApiAccountService.js:610 — This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
  • Password key derivation is priced too cheaply src/services/account/openaiResponsesAccountService.js:657 — This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
  • Password key derivation is priced too cheaply src/utils/commonHelper.js:29 — This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (4.1 · ×5
  • Low contrast Tailwind colour pair (4.1:1) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:77 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.1:1) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:129 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.1:1) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:142 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.1:1) web/admin-spa/src/components/apikeys/TagManagementModal.vue:37 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.1:1) web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue:93 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D1 · Cyclomatic Complexity · (anonymous) · ×5
  • (anonymous)::getEffectiveGranularity::loadDashboardData (cyclomatic 47) web/admin-spa/src/stores/dashboard.js:235 — (anonymous)::getEffectiveGranularity::loadDashboardData has cyclomatic complexity 47 (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.
  • (anonymous)::parseUsage (cyclomatic 26) REDACTED:79 — (anonymous)::parseUsage 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.
  • (anonymous)::parseUsage (cyclomatic 26) REDACTED:90 — (anonymous)::parseUsage 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.
  • (anonymous)::countAccountStats (cyclomatic 18) REDACTED:84 — (anonymous)::countAccountStats 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.
  • (anonymous)::getEffectiveGranularity::loadAccountUsageTrend (cyclomatic 16) web/admin-spa/src/stores/dashboard.js:458 — (anonymous)::getEffectiveGranularity::loadAccountUsageTrend 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 · (anonymous) (cyclomatic 21) · ×5
  • (anonymous) (cyclomatic 21) REDACTED:860 — (anonymous) has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous) (cyclomatic 21) REDACTED:112 — (anonymous) 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.
  • (anonymous) (cyclomatic 21) REDACTED:717 — (anonymous) has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous) (cyclomatic 21) REDACTED:219 — (anonymous) has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous) (cyclomatic 21) REDACTED:110 — (anonymous) 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×5
  • Hotspot: web/admin-spa/src/components/accounts/AccountForm.vue web/admin-spa/src/components/accounts/AccountForm.vue:5492 — web/admin-spa/src/components/accounts/AccountForm.vue changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 172 in createAccount at line 5492. 4 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-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 09:50:59 +00:00' --until='2026-11-05 09:50:59 +00:00' --full-history --no-merges -- web/admin-spa/src/components/accounts/AccountForm.vue`: 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:115 — REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in unified.routeToBackend at line 115. 4 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-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 09:50:59 +00:00' --until='2026-11-05 09:50:59 +00: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:43 — REDACTED changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in GrokRelayService.handleRequest at line 43. 3 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-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 09:50:59 +00:00' --until='2026-11-05 09:50:59 +00: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/utils/grokHelper.js src/utils/grokHelper.js:211 — src/utils/grokHelper.js changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in grokHelper.isBlockedHost at line 211. 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-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 09:50:59 +00:00' --until='2026-11-05 09:50:59 +00:00' --full-history --no-merges -- src/utils/grokHelper.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/services/account/claudeAccountService.js src/services/account/claudeAccountService.js:2177 — src/services/account/claudeAccountService.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ClaudeAccountService.buildClaudeUsageSnapshot at line 2177. 1 of those changes was a fix/bug commit, and the other 1 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-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 09:50:59 +00:00' --until='2026-11-05 09:50:59 +00:00' --full-history --no-merges -- src/services/account/claudeAccountService.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.
D2 · Cognitive Complexity · (anonymous) (cognitive 19) · ×5
  • (anonymous) (cognitive 19) REDACTED:15 — (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 19) REDACTED:106 — (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, 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.
  • (anonymous) (cognitive 19) REDACTED:112 — (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 5, 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.
  • (anonymous) (cognitive 19) REDACTED:155 — (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 19) REDACTED:230 — (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (3 pts), error handling 2 (nesting depth added 6). Of this number, 16 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 · (anonymous) (cognitive 17) · ×5
  • (anonymous) (cognitive 17) REDACTED:52 — (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 6, boolean chains 5 (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.
  • (anonymous) (cognitive 17) REDACTED:137 — (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, error handling 2, 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.
  • (anonymous) (cognitive 17) REDACTED:959 — (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 17) REDACTED:209 — (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4, boolean chains 3, error handling 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.
  • (anonymous) (cognitive 17) REDACTED:536 — (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2 (3 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 2 function literals inside it that branch (lines 543, 592). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC3 · Page structure · Heading level jumps from h4 to h6 · ×4
  • Heading level jumps from h4 to h6 web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue:323 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h4 to h6 web/admin-spa/src/components/tutorial/CodexTutorial.vue:26 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h4 to h6 web/admin-spa/src/components/tutorial/DroidCliTutorial.vue:36 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h4 to h6 web/admin-spa/src/components/tutorial/GeminiCliTutorial.vue:144 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure · Heading level jumps from h1 to h3 · ×4
  • Heading level jumps from h1 to h3 web/admin-spa/src/components/user/UserApiKeysManager.vue:202 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 web/admin-spa/src/components/user/UserUsageStats.vue:173 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 web/admin-spa/src/views/UserDashboardView.vue:269 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 web/admin-spa/src/views/UserManagementView.vue:227 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 34) · ×4
  • (anonymous) (cyclomatic 34) REDACTED:161 — (anonymous) has cyclomatic complexity 34 (threshold 15). Of this number, 31 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.
  • (anonymous) (cyclomatic 34) REDACTED:292 — (anonymous) has cyclomatic complexity 34 (threshold 15). Of this number, 31 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.
  • (anonymous) (cyclomatic 34) REDACTED:177 — (anonymous) has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous) (cyclomatic 34) REDACTED:320 — (anonymous) 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 · (anonymous) (cyclomatic 19) · ×4
  • (anonymous) (cyclomatic 19) REDACTED:90 — (anonymous) has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • (anonymous) (cyclomatic 19) REDACTED:393 — (anonymous) has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • (anonymous) (cyclomatic 19) REDACTED:68 — (anonymous) 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. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) 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.
  • (anonymous) (cyclomatic 19) REDACTED:144 — (anonymous) 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. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) 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 · (anonymous) (cyclomatic 18) · ×4
  • (anonymous) (cyclomatic 18) REDACTED:137 — (anonymous) 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.
  • (anonymous) (cyclomatic 18) REDACTED:106 — (anonymous) 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.
  • (anonymous) (cyclomatic 18) REDACTED:182 — (anonymous) 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.
  • (anonymous) (cyclomatic 18) web/admin-spa/src/stores/apistats.js:6 — (anonymous) has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 44, 77). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 28) · ×4
  • (anonymous) (cognitive 28) REDACTED:791 — (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, ternaries 2 (3 pts), loops 2, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 820, 924). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
  • (anonymous) (cognitive 28) REDACTED:423 — (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 28) REDACTED:393 — (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 2 (5 pts), error handling 3 (4 pts) (nesting depth added 10). Of this number, 16 points are the body's own statements and 12 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.
  • (anonymous) (cognitive 28) REDACTED:118 — (anonymous) has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 17, if/else 7 (8 pts), ternaries 2, 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 27) · ×4
  • (anonymous) (cognitive 27) REDACTED:182 — (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, loops 1 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 27) REDACTED:68 — (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (8 pts), boolean chains 6, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 27) REDACTED:459 — (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (6 pts), boolean chains 4, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 27) web/admin-spa/src/router/index.js:188 — (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 16) · ×4
  • (anonymous) (cognitive 16) REDACTED:1383 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, 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 1411). 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.
  • (anonymous) (cognitive 16) REDACTED:92 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 3, if/else 3, error handling 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.
  • (anonymous) (cognitive 16) REDACTED:293 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), error handling 2 (3 pts), ternaries 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 16) REDACTED:479 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), error handling 4 (nesting depth added 1). 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 517, 552, 516). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Fake-async · ×4
  • Fake-async — async method never awaits REDACTED:638 — `initializeCacheMonitoring` 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/services/modelService.js:16 — `initialize` 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/services/pricingService.js:315 — `useFallbackPricing` 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:315 — `updateUserApiKeyCount` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×3
  • Animation without a prefers-reduced-motion guard web/admin-spa/src/components/admin/ChangeRoleModal.vue — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/admin-spa/src/components/admin/UserUsageStatsModal.vue — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/admin-spa/src/components/apikeys/LimitProgressBar.vue:66 — <div> moves — its inline style sets `animation: shine 2.8s infinite` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
D2 · Cognitive Complexity · (anonymous) (cognitive 36) · ×3
  • (anonymous) (cognitive 36) REDACTED:161 — (anonymous) has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). Of this number, 33 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.
  • (anonymous) (cognitive 36) REDACTED:292 — (anonymous) has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 9). Of this number, 33 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.
  • (anonymous) (cognitive 36) REDACTED:13 — (anonymous) has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 16, ternaries 5 (9 pts), if/else 5 (7 pts), loops 3, error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 20 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 · (anonymous) (cognitive 26) · ×3
  • (anonymous) (cognitive 26) REDACTED:717 — (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, 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.
  • (anonymous) (cognitive 26) REDACTED:23 — (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 16, ternaries 4 (7 pts), loops 3 (4 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 26) REDACTED:219 — (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, 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 · (anonymous) (cognitive 24) · ×3
  • (anonymous) (cognitive 24) REDACTED:590 — (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts), error handling 2, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 713, 658, 697, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
  • (anonymous) (cognitive 24) REDACTED:90 — (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 24) REDACTED:273 — (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (3 pts), boolean chains 2, error handling 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 · (anonymous) (cognitive 21) · ×3
  • (anonymous) (cognitive 21) REDACTED:2460 — (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, 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.
  • (anonymous) (cognitive 21) REDACTED:17 — (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 21) REDACTED:20 — (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
X29 · Per-element action decided by a fixed element · Per-element action decided by a fixed element · ×3
  • Per-element action decided by a fixed element web/admin-spa/src/views/DashboardView.vue:1075 — This loop runs once per element of `data`, and the statement it guards acts on the element it is on — `d`. The test deciding whether that statement runs does not: `labelField === 'hour'` reads `data[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1068, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
  • Per-element action decided by a fixed element web/admin-spa/src/views/DashboardView.vue:1345 — This loop runs once per element of `data`, and the statement it guards acts on the element it is on — `d`. The test deciding whether that statement runs does not: `labelField === 'hour'` reads `data[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1336, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
  • Per-element action decided by a fixed element web/admin-spa/src/views/DashboardView.vue:1536 — This loop runs once per element of `trend`, and the statement it guards acts on the element it is on — `item`. The test deciding whether that statement runs does not: `labelField === 'hour'` reads `trend[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1528, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
AC3 · Page structure · Heading level jumps from h3 to h5 · ×2
  • Heading level jumps from h3 to h5 web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:37 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 web/admin-spa/src/components/apikeys/NewApiKeyModal.vue:39 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (2.1 · ×2
  • Low contrast Tailwind colour pair (2.1:1) web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue:184 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (2.1:1) web/admin-spa/src/components/settings/ModelPricingSection.vue:22 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.4 · ×2
  • Low contrast Tailwind colour pair (3.4:1) web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:568 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (3.4:1) web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:603 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D1 · Cyclomatic Complexity · usageStats.router.get("/api-keys/ · ×2
  • usageStats.router.get("/api-keys/:keyId/usage-records") (cyclomatic 118) src/routes/admin/usageStats.js:2708 — usageStats.router.get("/api-keys/:keyId/usage-records") has cyclomatic complexity 118 (threshold 15). Of this number, 82 points are the body's own statements and 36 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.
  • usageStats.router.get("/api-keys/:keyId/model-stats") (cyclomatic 76) src/routes/admin/usageStats.js:933 — usageStats.router.get("/api-keys/:keyId/model-stats") has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent 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 · usageStats.router.get("/accounts/ · ×2
  • usageStats.router.get("/accounts/:accountId/usage-records") (cyclomatic 103) src/routes/admin/usageStats.js:3066 — usageStats.router.get("/accounts/:accountId/usage-records") has cyclomatic complexity 103 (threshold 15). Of this number, 79 points are the body's own statements and 24 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.
  • usageStats.router.get("/accounts/:accountId/usage-history") (cyclomatic 56) src/routes/admin/usageStats.js:247 — usageStats.router.get("/accounts/:accountId/usage-history") has cyclomatic complexity 56 (threshold 15). Of this number, 43 points are the body's own statements and 13 belong to one function item 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 · (anonymous) (cyclomatic 24) · ×2
  • (anonymous) (cyclomatic 24) REDACTED:211 — (anonymous) 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.
  • (anonymous) (cyclomatic 24) REDACTED:23 — (anonymous) 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.
D2 · Cognitive Complexity · usageStats.router.get("/api-keys/ · ×2
  • usageStats.router.get("/api-keys/:keyId/usage-records") (cognitive 134) src/routes/admin/usageStats.js:2708 — usageStats.router.get("/api-keys/:keyId/usage-records") has cognitive complexity 134 (threshold 15). Drivers by points: boolean chains 59, if/else 28 (47 pts), ternaries 16 (19 pts), loops 5 (6 pts), error handling 2 (3 pts) (nesting depth added 24). Of this number, 97 points are the body's own statements and 37 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.
  • usageStats.router.get("/api-keys/:keyId/model-stats") (cognitive 122) src/routes/admin/usageStats.js:933 — usageStats.router.get("/api-keys/:keyId/model-stats") has cognitive complexity 122 (threshold 15). Drivers by points: if/else 27 (61 pts), boolean chains 44, loops 6 (12 pts), error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 42). 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 · usageStats.router.get("/accounts/ · ×2
  • usageStats.router.get("/accounts/:accountId/usage-records") (cognitive 127) src/routes/admin/usageStats.js:3066 — usageStats.router.get("/accounts/:accountId/usage-records") has cognitive complexity 127 (threshold 15). Drivers by points: boolean chains 52, if/else 18 (45 pts), ternaries 16 (19 pts), loops 5 (8 pts), error handling 2 (3 pts) (nesting depth added 34). Of this number, 103 points are the body's own statements and 24 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.
  • usageStats.router.get("/accounts/:accountId/usage-history") (cognitive 53) src/routes/admin/usageStats.js:247 — usageStats.router.get("/accounts/:accountId/usage-history") has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 25, if/else 10 (17 pts), ternaries 6, error handling 2, loops 2, match/switch 1 (nesting depth added 7). Of this number, 38 points are the body's own statements and 15 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.
D2 · Cognitive Complexity · routeToBackend · ×2
  • routeToBackend::end (cognitive 38) REDACTED:200 — routeToBackend::end has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (9 pts), error handling 1 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 26). 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.
  • routeToBackend::write (cognitive 28) REDACTED:148 — routeToBackend::write has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (7 pts), error handling 1 (4 pts), boolean chains 1, ternaries 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 · (anonymous) (cognitive 34) · ×2
  • (anonymous) (cognitive 34) REDACTED:211 — (anonymous) has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 8, loops 1 (3 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 34) REDACTED:412 — (anonymous) has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (6 pts), error handling 3 (5 pts), boolean chains 3, 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 · handleAnthropicMessagesToGemini · ×2
  • handleAnthropicMessagesToGemini::finalize (cognitive 29) src/services/anthropicGeminiBridgeService.js:2573 — handleAnthropicMessagesToGemini::finalize has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (7 pts), boolean chains 6, error handling 2 (5 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • handleAnthropicMessagesToGemini::flushPendingToolCallById (cognitive 16) src/services/anthropicGeminiBridgeService.js:2532 — handleAnthropicMessagesToGemini::flushPendingToolCallById has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · (anonymous) (cognitive 25) · ×2
  • (anonymous) (cognitive 25) REDACTED:301 — (anonymous) has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 1 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 25) REDACTED:192 — (anonymous) has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (3 pts), boolean chains 2, error handling 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 · (anonymous) (cognitive 22) · ×2
  • (anonymous) (cognitive 22) REDACTED:1477 — (anonymous) has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (6 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 22) REDACTED:93 — (anonymous) has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, ternaries 2 (4 pts), error handling 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 · (anonymous) (cognitive 20) · ×2
  • (anonymous) (cognitive 20) REDACTED:20 — (anonymous) has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • (anonymous) (cognitive 20) web/admin-spa/src/stores/apistats.js:6 — (anonymous) has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 3 (nesting depth added 1). None of this is in the body itself: all 20 points belong to 2 function literals inside it that branch (lines 44, 77). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D32 · Data Compliance (PII/GDPR) · REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×2
  • Change-coupling hub: EditApiKeyModal.vue → apiKeyService.js, BatchEditApiKeyModal.vue, CreateApiKeyModal.vue, AccountSelector.vue, ApiKeysView.vue web/admin-spa/src/components/apikeys/EditApiKeyModal.vue — `web/admin-spa/src/components/apikeys/EditApiKeyModal.vue` changes together with 5 other files — `src/services/apiKeyService.js`, `web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue`, `web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue`, `web/admin-spa/src/components/common/AccountSelector.vue`, `web/admin-spa/src/views/ApiKeysView.vue` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 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 5.
  • Change-coupling hub: apiKeyService.js → BatchEditApiKeyModal.vue, CreateApiKeyModal.vue, UsageDetailModal.vue src/services/apiKeyService.js — `src/services/apiKeyService.js` changes together with 3 other files — `web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue`, `web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue`, `web/admin-spa/src/components/apikeys/UsageDetailModal.vue` — 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 · Both branches are identical · ×2
  • Both branches are identical — the condition decides nothing src/services/openaiToClaude.js:469 — The `if` and its `else` contain the same statements, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body.
  • Both branches are identical — the condition decides nothing src/services/scheduler/unifiedClaudeScheduler.js:1632 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
IC1 · Incompleteness & stubs · Guard cannot change the result · ×2
  • Guard cannot change the result — returns what the code already falls through to src/services/relay/droidRelayService.js:50 — The guard above `return 'anthropic';` also returns `'anthropic'`, 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 web/admin-spa/src/router/index.js:31 — The guard above `return '/api-stats';` also returns `'/api-stats'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
R10 · Code Duplication · Duplicated block (72 lines × 2 locations) · ×2
  • Duplicated block (72 lines × 2 locations) REDACTED:33 — REDACTED:33 · REDACTED:161 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (72 lines × 2 locations) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216 — web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216 · web/admin-spa/src/components/apikeys/ExpiryEditModal.vue:293 — 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 (61 lines × 2 locations) · ×2
  • Duplicated block (61 lines × 2 locations) src/routes/admin/usageStats.js:1493 — src/routes/admin/usageStats.js:1493 · src/routes/admin/usageStats.js:1671 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (61 lines × 2 locations) src/routes/admin/usageStats.js:1928 — src/routes/admin/usageStats.js:1928 · src/routes/admin/usageStats.js:2118 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (58 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (58 matched lines × 2 locations) REDACTED:283 — REDACTED:283 · REDACTED:442 — the two spans are one implementation copied and then locally edited — 264 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (58 matched lines × 2 locations) src/utils/anthropicResponseDump.js:15 — src/utils/anthropicResponseDump.js:15 · src/utils/antigravityUpstreamResponseDump.js:16 — the two spans are one implementation copied and then locally edited — 313 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 (57 lines × 2 locations) · ×2
  • Duplicated block (57 lines × 2 locations) REDACTED:217 — REDACTED:217 · REDACTED:348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (57 lines × 2 locations) REDACTED:1399 — REDACTED:1399 · REDACTED:3380 — 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.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×2
  • Untrusted text written into markup unescaped web/admin-spa/src/utils/tools.js:52 — `title` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/admin-spa/src/utils/tools.js:53 — `message.replace(/\n/g,'<br>')` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
AC3 · Page structure · Heading level jumps from h2 to h4 · ×1
  • Heading level jumps from h2 to h4 web/admin-spa/src/views/SettingsView.vue:999 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (2.4 · ×1
  • Low contrast Tailwind colour pair (2.4:1) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue:37 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (2.5 · ×1
  • Low contrast Tailwind colour pair (2.5:1) web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:653 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (2.9 · ×1
  • Low contrast Tailwind colour pair (2.9:1) web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue:308 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D1 · Cyclomatic Complexity · handleMessagesRequest (cyclomatic 225) · ×1
  • handleMessagesRequest (cyclomatic 225) REDACTED:137 — handleMessagesRequest has cyclomatic complexity 225 (threshold 15). Of this number, 157 points are the body's own statements and 68 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 · ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cyclomatic 177) · ×1
  • ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cyclomatic 177) REDACTED:2154 — ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture has cyclomatic complexity 177 (threshold 15). Most of this is not in the body itself: 2 of the 177 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 2216, 2712, 2857, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · openaiRoutes.handleResponses (cyclomatic 148) · ×1
  • openaiRoutes.handleResponses (cyclomatic 148) REDACTED:293 — openaiRoutes.handleResponses has cyclomatic complexity 148 (threshold 15). Of this number, 119 points are the body's own statements and 29 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 · _makeClaudeConsoleStreamRequest (cyclomatic 143) · ×1
  • _makeClaudeConsoleStreamRequest (cyclomatic 143) REDACTED:744 — _makeClaudeConsoleStreamRequest has cyclomatic complexity 143 (threshold 15). Most of this is not in the body itself: 1 of the 143 points is its own statement and the rest belongs to 22 function items inside it that branch (a function literal at line 1003, a function literal at line 839, a function literal at line 1171, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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.router.get("/account-usage-trend") (cyclomatic 134) · ×1
  • usageStats.router.get("/account-usage-trend") (cyclomatic 134) src/routes/admin/usageStats.js:1247 — usageStats.router.get("/account-usage-trend") has cyclomatic complexity 134 (threshold 15). Of this number, 119 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 · (anonymous) (cyclomatic 134) · ×1
  • (anonymous) (cyclomatic 134) src/routes/admin/usageStats.js:1247 — (anonymous) has cyclomatic complexity 134 (threshold 15). Of this number, 101 points are the body's own statements and 33 belong to 19 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 · DroidAccountService.createAccount (cyclomatic 131) · ×1
  • DroidAccountService.createAccount (cyclomatic 131) REDACTED:458 — DroidAccountService.createAccount has cyclomatic complexity 131 (threshold 15). To reduce it, separate the cases: extract each independent 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 · DroidAccountService.updateAccount (cyclomatic 130) · ×1
  • DroidAccountService.updateAccount (cyclomatic 130) REDACTED:836 — DroidAccountService.updateAccount has cyclomatic complexity 130 (threshold 15). Of this number, 123 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · apiStats.router.post("/api/user-stats") (cyclomatic 128) · ×1
  • apiStats.router.post("/api/user-stats") (cyclomatic 128) REDACTED:101 — apiStats.router.post("/api/user-stats") has cyclomatic complexity 128 (threshold 15). Of this number, 119 points are the body's own statements and 9 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 · (anonymous) (cyclomatic 128) · ×1
  • (anonymous) (cyclomatic 128) REDACTED:101 — (anonymous) has cyclomatic complexity 128 (threshold 15). Of this number, 119 points are the body's own statements and 9 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 · relayRequest (cyclomatic 124) · ×1
  • relayRequest (cyclomatic 124) REDACTED:480 — relayRequest has cyclomatic complexity 124 (threshold 15). Of this number, 111 points are the body's own statements and 13 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 · authenticateApiKey (cyclomatic 119) · ×1
  • authenticateApiKey (cyclomatic 119) REDACTED:440 — authenticateApiKey has cyclomatic complexity 119 (threshold 15). Of this number, 109 points are the body's own statements and 10 belong to 19 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 · (anonymous) (cyclomatic 119) · ×1
  • (anonymous) (cyclomatic 119) src/routes/admin/usageStats.js:2708 — (anonymous) has cyclomatic complexity 119 (threshold 15). Of this number, 83 points are the body's own statements and 36 belong to 15 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 · sanitizeMaxTokens (cyclomatic 117) · ×1
  • sanitizeMaxTokens (cyclomatic 117) REDACTED:944 — sanitizeMaxTokens has cyclomatic complexity 117 (threshold 15). Most of this is not in the body itself: 2 of the 117 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 1319, a function literal at line 1529, a function literal at line 1013, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · apiKeys.router.put("/api-keys/ · ×1
  • apiKeys.router.put("/api-keys/:keyId") (cyclomatic 108) REDACTED:2108 — apiKeys.router.put("/api-keys/:keyId") has cyclomatic complexity 108 (threshold 15). Of this number, 107 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 · (anonymous) (cyclomatic 108) · ×1
  • (anonymous) (cyclomatic 108) REDACTED:2108 — (anonymous) has cyclomatic complexity 108 (threshold 15). Of this number, 106 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 · (anonymous) (cyclomatic 105) · ×1
  • (anonymous) (cyclomatic 105) src/routes/admin/usageStats.js:3066 — (anonymous) has cyclomatic complexity 105 (threshold 15). Of this number, 81 points are the body's own statements and 24 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 · sync.router.get("/sync/export-accounts") (cyclomatic 103) · ×1
  • sync.router.get("/sync/export-accounts") (cyclomatic 103) REDACTED:93 — sync.router.get("/sync/export-accounts") has cyclomatic complexity 103 (threshold 15). Of this number, 58 points are the body's own statements and 45 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 103) · ×1
  • (anonymous) (cyclomatic 103) REDACTED:93 — (anonymous) has cyclomatic complexity 103 (threshold 15). Of this number, 58 points are the body's own statements and 45 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 · UnifiedClaudeScheduler._getAllAvailableAccounts (cyclomatic 102) · ×1
  • UnifiedClaudeScheduler._getAllAvailableAccounts (cyclomatic 102) src/services/scheduler/unifiedClaudeScheduler.js:515 — UnifiedClaudeScheduler._getAllAvailableAccounts has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent 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 · usageStats.router.get("/api-keys-usage-trend") (cyclomatic 96) · ×1
  • usageStats.router.get("/api-keys-usage-trend") (cyclomatic 96) src/routes/admin/usageStats.js:1825 — usageStats.router.get("/api-keys-usage-trend") has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent 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 96) · ×1
  • (anonymous) (cyclomatic 96) src/routes/admin/usageStats.js:1825 — (anonymous) has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent 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 · relayRequest (cyclomatic 96) · ×1
  • relayRequest (cyclomatic 96) REDACTED:23 — relayRequest has cyclomatic complexity 96 (threshold 15). Of this number, 94 points are the body's own statements and 2 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 · handleRequest (cyclomatic 93) · ×1
  • handleRequest (cyclomatic 93) REDACTED:68 — handleRequest has cyclomatic complexity 93 (threshold 15). Of this number, 91 points are the body's own statements and 2 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openaiRoutes.handleImages (cyclomatic 90) · ×1
  • openaiRoutes.handleImages (cyclomatic 90) REDACTED:971 — openaiRoutes.handleImages has cyclomatic complexity 90 (threshold 15). Of this number, 63 points are the body's own statements and 27 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 · openaiGeminiRoutes.router.post("/v1/chat/completions") (cyclomatic 89) · ×1
  • openaiGeminiRoutes.router.post("/v1/chat/completions") (cyclomatic 89) REDACTED:192 — openaiGeminiRoutes.router.post("/v1/chat/completions") has cyclomatic complexity 89 (threshold 15). Of this number, 52 points are the body's own statements and 37 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 · (anonymous) (cyclomatic 89) · ×1
  • (anonymous) (cyclomatic 89) REDACTED:192 — (anonymous) has cyclomatic complexity 89 (threshold 15). Of this number, 52 points are the body's own statements and 37 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 · recordUsageWithDetails (cyclomatic 85) · ×1
  • recordUsageWithDetails (cyclomatic 85) src/services/apiKeyService.js:1862 — recordUsageWithDetails has cyclomatic complexity 85 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · apiKeys.router.post("/api-keys") (cyclomatic 82) · ×1
  • apiKeys.router.post("/api-keys") (cyclomatic 82) REDACTED:1472 — apiKeys.router.post("/api-keys") has cyclomatic complexity 82 (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 · (anonymous) (cyclomatic 82) · ×1
  • (anonymous) (cyclomatic 82) REDACTED:1472 — (anonymous) has cyclomatic complexity 82 (threshold 15). Of this number, 81 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 · anthropicGeminiBridgeService.handleAnthropicMessagesToGemini (cyclomatic 81) · ×1
  • anthropicGeminiBridgeService.handleAnthropicMessagesToGemini (cyclomatic 81) src/services/anthropicGeminiBridgeService.js:1859 — anthropicGeminiBridgeService.handleAnthropicMessagesToGemini has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent 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 (anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs) 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 · usageStats.router.get("/usage-trend") (cyclomatic 79) · ×1
  • usageStats.router.get("/usage-trend") (cyclomatic 79) src/routes/admin/usageStats.js:539 — usageStats.router.get("/usage-trend") has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 79) · ×1
  • (anonymous) (cyclomatic 79) src/routes/admin/usageStats.js:539 — (anonymous) has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · geminiSchemaCleaner.cleanJsonSchemaForGemini (cyclomatic 78) · ×1
  • geminiSchemaCleaner.cleanJsonSchemaForGemini (cyclomatic 78) src/utils/geminiSchemaCleaner.js:87 — geminiSchemaCleaner.cleanJsonSchemaForGemini has cyclomatic complexity 78 (threshold 15). Of this number, 74 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 · relayRequest (cyclomatic 78) · ×1
  • relayRequest (cyclomatic 78) src/services/relay/ccrRelayService.js:16 — relayRequest has cyclomatic complexity 78 (threshold 15). Of this number, 76 points are the body's own statements and 2 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ApiKeyService.getAllApiKeysFast (cyclomatic 77) · ×1
  • ApiKeyService.getAllApiKeysFast (cyclomatic 77) src/services/apiKeyService.js:1052 — ApiKeyService.getAllApiKeysFast has cyclomatic complexity 77 (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 · (anonymous) (cyclomatic 76) · ×1
  • (anonymous) (cyclomatic 76) src/routes/admin/usageStats.js:933 — (anonymous) has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent 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 · unified.buildGeminiRequestFromOpenAI (cyclomatic 74) · ×1
  • unified.buildGeminiRequestFromOpenAI (cyclomatic 74) REDACTED:557 — unified.buildGeminiRequestFromOpenAI has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent 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 72) · ×1
  • (anonymous) (cyclomatic 72) REDACTED:38 — (anonymous) has cyclomatic complexity 72 (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 · claudeRelayConfig.router.put("/claude-relay-config") (cyclomatic 71) · ×1
  • claudeRelayConfig.router.put("/claude-relay-config") (cyclomatic 71) REDACTED:38 — claudeRelayConfig.router.put("/claude-relay-config") has cyclomatic complexity 71 (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 · UnifiedGeminiScheduler._getAllAvailableAccounts (cyclomatic 69) · ×1
  • UnifiedGeminiScheduler._getAllAvailableAccounts (cyclomatic 69) src/services/scheduler/unifiedGeminiScheduler.js:224 — UnifiedGeminiScheduler._getAllAvailableAccounts 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 · handleStreamGenerateContent (cyclomatic 68) · ×1
  • handleStreamGenerateContent (cyclomatic 68) REDACTED:1806 — handleStreamGenerateContent has cyclomatic complexity 68 (threshold 15). Of this number, 36 points are the body's own statements and 32 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 · calculateKeyStats (cyclomatic 68) · ×1
  • calculateKeyStats (cyclomatic 68) REDACTED:1073 — calculateKeyStats has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent 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 · usageStats.router.get("/usage-costs") (cyclomatic 64) · ×1
  • usageStats.router.get("/usage-costs") (cyclomatic 64) src/routes/admin/usageStats.js:2286 — usageStats.router.get("/usage-costs") has cyclomatic complexity 64 (threshold 15). Of this number, 60 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 · (anonymous) (cyclomatic 64) · ×1
  • (anonymous) (cyclomatic 64) src/routes/admin/usageStats.js:2286 — (anonymous) has cyclomatic complexity 64 (threshold 15). Of this number, 60 points are the body's own statements and 4 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 · _makeCcrStreamRequest (cyclomatic 64) · ×1
  • _makeCcrStreamRequest (cyclomatic 64) src/services/relay/ccrRelayService.js:561 — _makeCcrStreamRequest has cyclomatic complexity 64 (threshold 15). Most of this is not in the body itself: 1 of the 64 points is its own statement and the rest belongs to 19 function items inside it that branch (a function literal at line 638, a function literal at line 765, a function literal at line 573, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents (cyclomatic 63) · ×1
  • anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents (cyclomatic 63) src/services/anthropicGeminiBridgeService.js:1026 — anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · handleMessages (cyclomatic 62) · ×1
  • handleMessages (cyclomatic 62) REDACTED:395 — handleMessages has cyclomatic complexity 62 (threshold 15). Of this number, 42 points are the body's own statements and 20 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 · azureOpenaiRelayService.handleStreamResponse (cyclomatic 61) · ×1
  • azureOpenaiRelayService.handleStreamResponse (cyclomatic 61) src/services/relay/azureOpenaiRelayService.js:270 — azureOpenaiRelayService.handleStreamResponse has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 2 of the 61 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 470, 322, 408, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · PricingService.calculateCost (cyclomatic 59) · ×1
  • PricingService.calculateCost (cyclomatic 59) src/services/pricingService.js:513 — PricingService.calculateCost has cyclomatic complexity 59 (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 · apiKeys.router.put("/api-keys/batch") (cyclomatic 58) · ×1
  • apiKeys.router.put("/api-keys/batch") (cyclomatic 58) REDACTED:1882 — apiKeys.router.put("/api-keys/batch") has cyclomatic complexity 58 (threshold 15). Of this number, 56 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 · (anonymous) (cyclomatic 58) · ×1
  • (anonymous) (cyclomatic 58) REDACTED:1882 — (anonymous) has cyclomatic complexity 58 (threshold 15). Of this number, 56 points are the body's own statements and 2 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 · WebhookConfigService.validatePlatformConfig (cyclomatic 56) · ×1
  • WebhookConfigService.validatePlatformConfig (cyclomatic 56) src/services/webhookConfigService.js:109 — WebhookConfigService.validatePlatformConfig has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · unified.routeToBackend (cyclomatic 56) · ×1
  • unified.routeToBackend (cyclomatic 56) REDACTED:115 — unified.routeToBackend has cyclomatic complexity 56 (threshold 15). Of this number, 22 points are the body's own statements and 34 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 56) · ×1
  • (anonymous) (cyclomatic 56) src/routes/admin/usageStats.js:247 — (anonymous) has cyclomatic complexity 56 (threshold 15). Of this number, 43 points are the body's own statements and 13 belong to one function item 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 · backfillCurrentWeekClaudeCosts (cyclomatic 53) · ×1
  • backfillCurrentWeekClaudeCosts (cyclomatic 53) src/services/weeklyClaudeCostInitService.js:69 — backfillCurrentWeekClaudeCosts 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.
D1 · Cyclomatic Complexity · UnifiedClaudeScheduler._isAccountAvailable (cyclomatic 51) · ×1
  • UnifiedClaudeScheduler._isAccountAvailable (cyclomatic 51) src/services/scheduler/unifiedClaudeScheduler.js:1047 — UnifiedClaudeScheduler._isAccountAvailable has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · generateApiKey (cyclomatic 51) · ×1
  • generateApiKey (cyclomatic 51) src/services/apiKeyService.js:176 — generateApiKey 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.
D1 · Cyclomatic Complexity · ApiKeyService.getAllApiKeys (cyclomatic 49) · ×1
  • ApiKeyService.getAllApiKeys (cyclomatic 49) src/services/apiKeyService.js:867 — ApiKeyService.getAllApiKeys has cyclomatic complexity 49 (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 · geminiHandlers.handleStandardStreamGenerateContent (cyclomatic 49) · ×1
  • geminiHandlers.handleStandardStreamGenerateContent (cyclomatic 49) REDACTED:2506 — geminiHandlers.handleStandardStreamGenerateContent has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock) 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 · handleRequest (cyclomatic 49) · ×1
  • handleRequest (cyclomatic 49) REDACTED:43 — handleRequest has cyclomatic complexity 49 (threshold 15). Of this number, 47 points are the body's own statements and 2 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 · ClaudeRelayService.relayStreamRequestWithUsageCapture (cyclomatic 48) · ×1
  • ClaudeRelayService.relayStreamRequestWithUsageCapture (cyclomatic 48) REDACTED:1883 — ClaudeRelayService.relayStreamRequestWithUsageCapture has cyclomatic complexity 48 (threshold 15). Of this number, 42 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openaiAccounts.router.put("/ · ×1
  • openaiAccounts.router.put("/:id") (cyclomatic 48) REDACTED:479 — openaiAccounts.router.put("/:id") 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 · (anonymous) (cyclomatic 48) · ×1
  • (anonymous) (cyclomatic 48) REDACTED:479 — (anonymous) 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 · api.router.post("/v1/messages/count_tokens") (cyclomatic 47) · ×1
  • api.router.post("/v1/messages/count_tokens") (cyclomatic 47) REDACTED:1673 — api.router.post("/v1/messages/count_tokens") has cyclomatic complexity 47 (threshold 15). Of this number, 35 points are the body's own statements and 12 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 · dashboard.useDashboardStore.loadDashboardData (cyclomatic 47) · ×1
  • dashboard.useDashboardStore.loadDashboardData (cyclomatic 47) web/admin-spa/src/stores/dashboard.js:235 — dashboard.useDashboardStore.loadDashboardData has cyclomatic complexity 47 (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 · initialize (cyclomatic 47) · ×1
  • initialize (cyclomatic 47) REDACTED:50 — initialize has cyclomatic complexity 47 (threshold 15). Of this number, 18 points are the body's own statements and 29 belong to 16 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 · (anonymous) (cyclomatic 47) · ×1
  • (anonymous) (cyclomatic 47) REDACTED:1673 — (anonymous) has cyclomatic complexity 47 (threshold 15). Of this number, 35 points are the body's own statements and 12 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 · BedrockRelayService.handleStreamRequest (cyclomatic 46) · ×1
  • BedrockRelayService.handleStreamRequest (cyclomatic 46) src/services/relay/bedrockRelayService.js:243 — BedrockRelayService.handleStreamRequest has cyclomatic complexity 46 (threshold 15). Of this number, 44 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 · ApiKeyService.validateApiKey (cyclomatic 46) · ×1
  • ApiKeyService.validateApiKey (cyclomatic 46) src/services/apiKeyService.js:360 — ApiKeyService.validateApiKey has cyclomatic complexity 46 (threshold 15). Of this number, 43 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · UnifiedClaudeScheduler.selectAccountForApiKey (cyclomatic 46) · ×1
  • UnifiedClaudeScheduler.selectAccountForApiKey (cyclomatic 46) src/services/scheduler/unifiedClaudeScheduler.js:180 — UnifiedClaudeScheduler.selectAccountForApiKey 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 · geminiHandlers.handleStandardGenerateContent (cyclomatic 46) · ×1
  • geminiHandlers.handleStandardGenerateContent (cyclomatic 46) REDACTED:2212 — geminiHandlers.handleStandardGenerateContent 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 · DroidRelayService._handleStreamRequest (cyclomatic 46) · ×1
  • DroidRelayService._handleStreamRequest (cyclomatic 46) src/services/relay/droidRelayService.js:415 — DroidRelayService._handleStreamRequest has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 464, 542, 597, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · apiStats.router.post("/api/batch-stats") (cyclomatic 45) · ×1
  • apiStats.router.post("/api/batch-stats") (cyclomatic 45) REDACTED:590 — apiStats.router.post("/api/batch-stats") has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 8 of the 45 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 713, 658, 697). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · (anonymous) (cyclomatic 45) · ×1
  • (anonymous) (cyclomatic 45) REDACTED:590 — (anonymous) has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 8 of the 45 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 713, 658, 697, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · relayRequest (cyclomatic 45) · ×1
  • relayRequest (cyclomatic 45) src/services/relay/droidRelayService.js:184 — relayRequest has cyclomatic complexity 45 (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 · ClaudeAccountService.updateAccount (cyclomatic 43) · ×1
  • ClaudeAccountService.updateAccount (cyclomatic 43) src/services/account/claudeAccountService.js:740 — ClaudeAccountService.updateAccount 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 · ClaudeConsoleRelayService.relayStreamRequestWithUsageCapture (cyclomatic 43) · ×1
  • ClaudeConsoleRelayService.relayStreamRequestWithUsageCapture (cyclomatic 43) REDACTED:491 — ClaudeConsoleRelayService.relayStreamRequestWithUsageCapture has cyclomatic complexity 43 (threshold 15). Of this number, 38 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 · anthropicGeminiBridgeService.convertAnthropicToolsToGeminiTools · ×1
  • anthropicGeminiBridgeService.convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations (cyclomatic 43) src/services/anthropicGeminiBridgeService.js:779 — anthropicGeminiBridgeService.convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations 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 · geminiHandlers.handleGenerateContent (cyclomatic 43) · ×1
  • geminiHandlers.handleGenerateContent (cyclomatic 43) REDACTED:1563 — geminiHandlers.handleGenerateContent has cyclomatic complexity 43 (threshold 15). Of this number, 42 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 · buildRequestFromOpenAI (cyclomatic 43) · ×1
  • buildRequestFromOpenAI (cyclomatic 43) src/services/codexToOpenAI.js:393 — buildRequestFromOpenAI 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 · SessionHelper.generateSessionHash (cyclomatic 42) · ×1
  • SessionHelper.generateSessionHash (cyclomatic 42) src/utils/sessionHelper.js:12 — SessionHelper.generateSessionHash 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 · OpenAIResponsesRelayService._handleStreamResponse (cyclomatic 41) · ×1
  • OpenAIResponsesRelayService._handleStreamResponse (cyclomatic 41) REDACTED:476 — OpenAIResponsesRelayService._handleStreamResponse has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 1 of the 41 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 584, parseSSEForUsage, a function literal at line 556, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · RedisClient.getApiKeysPaginated (cyclomatic 40) · ×1
  • RedisClient.getApiKeysPaginated (cyclomatic 40) REDACTED:856 — RedisClient.getApiKeysPaginated has cyclomatic complexity 40 (threshold 15). Of this number, 25 points are the body's own statements and 15 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 · anthropicGeminiBridgeService.normalizeAnthropicMessages (cyclomatic 40) · ×1
  • anthropicGeminiBridgeService.normalizeAnthropicMessages (cyclomatic 40) src/services/anthropicGeminiBridgeService.js:568 — anthropicGeminiBridgeService.normalizeAnthropicMessages has cyclomatic complexity 40 (threshold 15). Of this number, 20 points are the body's own statements and 20 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 · backfillSingleKey (cyclomatic 40) · ×1
  • backfillSingleKey (cyclomatic 40) src/services/weeklyClaudeCostInitService.js:309 — backfillSingleKey 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 · relayStreamRequestWithUsageCapture (cyclomatic 40) · ×1
  • relayStreamRequestWithUsageCapture (cyclomatic 40) src/services/relay/ccrRelayService.js:373 — relayStreamRequestWithUsageCapture has cyclomatic complexity 40 (threshold 15). Of this number, 36 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 · UnifiedClaudeScheduler._isModelSupportedByAccount (cyclomatic 39) · ×1
  • UnifiedClaudeScheduler._isModelSupportedByAccount (cyclomatic 39) src/services/scheduler/unifiedClaudeScheduler.js:49 — UnifiedClaudeScheduler._isModelSupportedByAccount 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 · webhook.router.post("/test") (cyclomatic 39) · ×1
  • webhook.router.post("/test") (cyclomatic 39) REDACTED:116 — webhook.router.post("/test") has cyclomatic complexity 39 (threshold 15). Of this number, 34 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 · CostInitService.initializeApiKeyCosts (cyclomatic 39) · ×1
  • CostInitService.initializeApiKeyCosts (cyclomatic 39) src/services/costInitService.js:140 — CostInitService.initializeApiKeyCosts 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 · (anonymous) (cyclomatic 39) · ×1
  • (anonymous) (cyclomatic 39) REDACTED:116 — (anonymous) has cyclomatic complexity 39 (threshold 15). Of this number, 34 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 · UnifiedClaudeScheduler.selectAccountFromGroup (cyclomatic 38) · ×1
  • UnifiedClaudeScheduler.selectAccountFromGroup (cyclomatic 38) src/services/scheduler/unifiedClaudeScheduler.js:1529 — UnifiedClaudeScheduler.selectAccountFromGroup has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnifiedOpenAIScheduler.selectAccountForApiKey (cyclomatic 38) · ×1
  • UnifiedOpenAIScheduler.selectAccountForApiKey (cyclomatic 38) src/services/scheduler/unifiedOpenAIScheduler.js:122 — UnifiedOpenAIScheduler.selectAccountForApiKey has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · buildAntigravityQuota (cyclomatic 38) · ×1
  • buildAntigravityQuota (cyclomatic 38) src/services/balanceProviders/geminiBalanceProvider.js:61 — buildAntigravityQuota has cyclomatic complexity 38 (threshold 15). Of this number, 24 points are the body's own statements and 14 belong to 5 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 · handleAzureOpenAIRequest (cyclomatic 38) · ×1
  • handleAzureOpenAIRequest (cyclomatic 38) src/services/relay/azureOpenaiRelayService.js:16 — handleAzureOpenAIRequest 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 · RedisClient.getAccountSessionWindowUsage (cyclomatic 37) · ×1
  • RedisClient.getAccountSessionWindowUsage (cyclomatic 37) REDACTED:3892 — RedisClient.getAccountSessionWindowUsage 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 · ApiKeyService.validateApiKeyForStats (cyclomatic 37) · ×1
  • ApiKeyService.validateApiKeyForStats (cyclomatic 37) src/services/apiKeyService.js:559 — ApiKeyService.validateApiKeyForStats 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.
D1 · Cyclomatic Complexity · apiStats.router.post("/api/user-model-stats") (cyclomatic 37) · ×1
  • apiStats.router.post("/api/user-model-stats") (cyclomatic 37) REDACTED:1319 — apiStats.router.post("/api/user-model-stats") 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 · migrateUsageIndex (cyclomatic 37) · ×1
  • migrateUsageIndex (cyclomatic 37) REDACTED:202 — migrateUsageIndex 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 · openaiAccountService.createAccount (cyclomatic 36) · ×1
  • openaiAccountService.createAccount (cyclomatic 36) REDACTED:437 — openaiAccountService.createAccount has cyclomatic complexity 36 (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 · UnifiedOpenAIScheduler._getAllAvailableAccounts (cyclomatic 36) · ×1
  • UnifiedOpenAIScheduler._getAllAvailableAccounts (cyclomatic 36) src/services/scheduler/unifiedOpenAIScheduler.js:356 — UnifiedOpenAIScheduler._getAllAvailableAccounts 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 · handleChatCompletion (cyclomatic 36) · ×1
  • handleChatCompletion (cyclomatic 36) REDACTED:186 — handleChatCompletion 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 · geminiAccountService.updateAccount (cyclomatic 35) · ×1
  • geminiAccountService.updateAccount (cyclomatic 35) REDACTED:602 — geminiAccountService.updateAccount 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 · ClaudeAccountService.selectAccountForApiKey (cyclomatic 34) · ×1
  • ClaudeAccountService.selectAccountForApiKey (cyclomatic 34) src/services/account/claudeAccountService.js:1072 — ClaudeAccountService.selectAccountForApiKey has cyclomatic complexity 34 (threshold 15). Of this number, 25 points are the body's own statements and 9 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 · ClaudeConsoleAccountService.updateAccount (cyclomatic 34) · ×1
  • ClaudeConsoleAccountService.updateAccount (cyclomatic 34) src/services/account/claudeConsoleAccountService.js:299 — ClaudeConsoleAccountService.updateAccount 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 · geminiAccountService.createAccount (cyclomatic 34) · ×1
  • geminiAccountService.createAccount (cyclomatic 34) REDACTED:444 — geminiAccountService.createAccount has cyclomatic complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · openaiAccountService.refreshAccountToken (cyclomatic 34) · ×1
  • openaiAccountService.refreshAccountToken (cyclomatic 34) REDACTED:271 — openaiAccountService.refreshAccountToken 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 · DroidAccountService.refreshAccessToken (cyclomatic 34) · ×1
  • DroidAccountService.refreshAccessToken (cyclomatic 34) REDACTED:1213 — DroidAccountService.refreshAccessToken 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 · openaiAccounts.router.post("/") (cyclomatic 34) · ×1
  • openaiAccounts.router.post("/") (cyclomatic 34) REDACTED:320 — openaiAccounts.router.post("/") 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 · AccountNameCacheService.refresh (cyclomatic 33) · ×1
  • AccountNameCacheService.refresh (cyclomatic 33) src/services/accountNameCacheService.js:41 — AccountNameCacheService.refresh has cyclomatic complexity 33 (threshold 15). Of this number, 26 points are the body's own statements and 7 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 · ClaudeRelayService._processRequestBody (cyclomatic 33) · ×1
  • ClaudeRelayService._processRequestBody (cyclomatic 33) REDACTED:1196 — ClaudeRelayService._processRequestBody has cyclomatic complexity 33 (threshold 15). Of this number, 28 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 · apiKeys.router.get("/api-keys") (cyclomatic 33) · ×1
  • apiKeys.router.get("/api-keys") (cyclomatic 33) REDACTED:177 — apiKeys.router.get("/api-keys") has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dashboard.router.get("/model-stats") (cyclomatic 33) · ×1
  • dashboard.router.get("/model-stats") (cyclomatic 33) REDACTED:407 — dashboard.router.get("/model-stats") has cyclomatic complexity 33 (threshold 15). Of this number, 29 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 · QuotaCardService.redeemCard (cyclomatic 33) · ×1
  • QuotaCardService.redeemCard (cyclomatic 33) src/services/quotaCardService.js:293 — QuotaCardService.redeemCard 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.
D1 · Cyclomatic Complexity · azureOpenaiRoutes.router.post("/chat/completions") (cyclomatic 33) · ×1
  • azureOpenaiRoutes.router.post("/chat/completions") (cyclomatic 33) REDACTED:161 — azureOpenaiRoutes.router.post("/chat/completions") 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, name the conditions: bind each compound test to a 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 (azureOpenaiRoutes.router.post("/responses")) 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 · azureOpenaiRoutes.router.post("/responses") (cyclomatic 33) · ×1
  • azureOpenaiRoutes.router.post("/responses") (cyclomatic 33) REDACTED:292 — azureOpenaiRoutes.router.post("/responses") 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, name the conditions: bind each compound test to a 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 (azureOpenaiRoutes.router.post("/chat/completions")) 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 · (anonymous) (cyclomatic 33) · ×1
  • (anonymous) (cyclomatic 33) REDACTED:407 — (anonymous) has cyclomatic complexity 33 (threshold 15). Of this number, 29 points are the body's own statements and 4 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 · DroidRelayService._parseOpenAIUsageFromSSE (cyclomatic 32) · ×1
  • DroidRelayService._parseOpenAIUsageFromSSE (cyclomatic 32) src/services/relay/droidRelayService.js:756 — DroidRelayService._parseOpenAIUsageFromSSE 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 · DroidRelayService._processRequestBody (cyclomatic 32) · ×1
  • DroidRelayService._processRequestBody (cyclomatic 32) src/services/relay/droidRelayService.js:1135 — DroidRelayService._processRequestBody has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · batchGetAccountGroupsByIndex (cyclomatic 32) · ×1
  • batchGetAccountGroupsByIndex (cyclomatic 32) src/services/accountGroupService.js:521 — batchGetAccountGroupsByIndex has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _getAccountBalanceForAccount (cyclomatic 32) · ×1
  • _getAccountBalanceForAccount (cyclomatic 32) src/services/account/accountBalanceService.js:283 — _getAccountBalanceForAccount has cyclomatic complexity 32 (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 · openaiAccountService.refreshAccessToken (cyclomatic 31) · ×1
  • openaiAccountService.refreshAccessToken (cyclomatic 31) REDACTED:117 — openaiAccountService.refreshAccessToken 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 · ApiKeyService._resolveAccountByUsageRecord (cyclomatic 31) · ×1
  • ApiKeyService._resolveAccountByUsageRecord (cyclomatic 31) src/services/apiKeyService.js:2222 — ApiKeyService._resolveAccountByUsageRecord has cyclomatic complexity 31 (threshold 15). Of this number, 28 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 · GeminiToOpenAIConverter._convertGeminiChunkToOpenAI (cyclomatic 31) · ×1
  • GeminiToOpenAIConverter._convertGeminiChunkToOpenAI (cyclomatic 31) src/services/geminiToOpenAI.js:198 — GeminiToOpenAIConverter._convertGeminiChunkToOpenAI 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 · apiStats.router.post("/api/batch-model-stats") (cyclomatic 31) · ×1
  • apiStats.router.post("/api/batch-model-stats") (cyclomatic 31) REDACTED:791 — apiStats.router.post("/api/batch-model-stats") has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 820). 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 · azureOpenaiRelayService.extractUsageDataRobust (cyclomatic 31) · ×1
  • azureOpenaiRelayService.extractUsageDataRobust (cyclomatic 31) src/services/relay/azureOpenaiRelayService.js:620 — azureOpenaiRelayService.extractUsageDataRobust has cyclomatic complexity 31 (threshold 15). Of this number, 21 points are the body's own statements and 10 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 · (anonymous) (cyclomatic 31) · ×1
  • (anonymous) (cyclomatic 31) REDACTED:791 — (anonymous) has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 820, 924). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · logger.safeStringify (cyclomatic 30) · ×1
  • logger.safeStringify (cyclomatic 30) REDACTED:10 — logger.safeStringify has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 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 · UnifiedGeminiScheduler.selectAccountFromGroup (cyclomatic 30) · ×1
  • UnifiedGeminiScheduler.selectAccountFromGroup (cyclomatic 30) src/services/scheduler/unifiedGeminiScheduler.js:699 — UnifiedGeminiScheduler.selectAccountFromGroup 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 · UnifiedOpenAIScheduler.selectAccountFromGroup (cyclomatic 30) · ×1
  • UnifiedOpenAIScheduler.selectAccountFromGroup (cyclomatic 30) src/services/scheduler/unifiedOpenAIScheduler.js:818 — UnifiedOpenAIScheduler.selectAccountFromGroup 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 · GeminiToOpenAIConverter.convertResponse (cyclomatic 30) · ×1
  • GeminiToOpenAIConverter.convertResponse (cyclomatic 30) src/services/geminiToOpenAI.js:97 — GeminiToOpenAIConverter.convertResponse has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 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.
D1 · Cyclomatic Complexity · _captureRequestDetail (cyclomatic 30) · ×1
  • _captureRequestDetail (cyclomatic 30) src/services/apiKeyService.js:2145 — _captureRequestDetail 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 · ProxyHelper.createProxyAgent (cyclomatic 29) · ×1
  • ProxyHelper.createProxyAgent (cyclomatic 29) src/utils/proxyHelper.js:21 — ProxyHelper.createProxyAgent 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 · ClaudeAccountService._normalizeExtInfo (cyclomatic 29) · ×1
  • ClaudeAccountService._normalizeExtInfo (cyclomatic 29) src/services/account/claudeAccountService.js:3456 — ClaudeAccountService._normalizeExtInfo 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 · antigravityClient.normalizeAntigravityEnvelope (cyclomatic 29) · ×1
  • antigravityClient.normalizeAntigravityEnvelope (cyclomatic 29) src/services/antigravityClient.js:188 — antigravityClient.normalizeAntigravityEnvelope 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 · claudeConsoleAccounts.router.post("/claude-console-accounts") (cyclomatic 29) · ×1
  • claudeConsoleAccounts.router.post("/claude-console-accounts") (cyclomatic 29) REDACTED:118 — claudeConsoleAccounts.router.post("/claude-console-accounts") has cyclomatic complexity 29 (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 · openaiGeminiRoutes.convertMessagesToGemini (cyclomatic 29) · ×1
  • openaiGeminiRoutes.convertMessagesToGemini (cyclomatic 29) REDACTED:40 — openaiGeminiRoutes.convertMessagesToGemini has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 3 function items inside it that branch (extractTextContent, a function literal at line 59, a function literal at line 98). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · updateIndex (cyclomatic 29) · ×1
  • updateIndex (cyclomatic 29) src/services/apiKeyIndexService.js:305 — updateIndex 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 · (anonymous) (cyclomatic 29) · ×1
  • (anonymous) (cyclomatic 29) REDACTED:118 — (anonymous) has cyclomatic complexity 29 (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 · createAccount (cyclomatic 29) · ×1
  • createAccount (cyclomatic 29) src/services/account/grokAccountService.js:71 — createAccount has cyclomatic complexity 29 (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 · anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent (cyclomatic 28) · ×1
  • anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent (cyclomatic 28) src/services/anthropicGeminiBridgeService.js:1623 — anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent has cyclomatic complexity 28 (threshold 15). Of this number, 14 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 · (anonymous) (cyclomatic 28) · ×1
  • (anonymous) (cyclomatic 28) REDACTED:423 — (anonymous) 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 · sanitizeMaxTokens (cyclomatic 28) · ×1
  • sanitizeMaxTokens (cyclomatic 28) REDACTED:457 — sanitizeMaxTokens has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 460, a function literal at line 559, a function literal at line 533, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · antigravityClient.normalizeAntigravityThinking (cyclomatic 27) · ×1
  • antigravityClient.normalizeAntigravityThinking (cyclomatic 27) src/services/antigravityClient.js:123 — antigravityClient.normalizeAntigravityThinking has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ServiceRatesService.getServiceFromModel (cyclomatic 27) · ×1
  • ServiceRatesService.getServiceFromModel (cyclomatic 27) src/services/serviceRatesService.js:146 — ServiceRatesService.getServiceFromModel 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 · OpenAIResponsesRelayService._handle429Error (cyclomatic 27) · ×1
  • OpenAIResponsesRelayService._handle429Error (cyclomatic 27) REDACTED:804 — OpenAIResponsesRelayService._handle429Error 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 · geminiApiAccounts.router.post("/gemini-api-accounts/ · ×1
  • geminiApiAccounts.router.post("/gemini-api-accounts/:accountId/test") (cyclomatic 27) REDACTED:460 — geminiApiAccounts.router.post("/gemini-api-accounts/:accountId/test") has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 559, a function literal at line 533, safeWrite, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · droidAccounts.router.put("/droid-accounts/ · ×1
  • droidAccounts.router.put("/droid-accounts/:id") (cyclomatic 27) REDACTED:351 — droidAccounts.router.put("/droid-accounts/:id") has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · BalanceScriptService.execute (cyclomatic 27) · ×1
  • BalanceScriptService.execute (cyclomatic 27) src/services/balanceScriptService.js:62 — BalanceScriptService.execute 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 · azureOpenaiRoutes.router.post("/embeddings") (cyclomatic 27) · ×1
  • azureOpenaiRoutes.router.post("/embeddings") (cyclomatic 27) REDACTED:423 — azureOpenaiRoutes.router.post("/embeddings") 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) REDACTED:351 — (anonymous) has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts (cyclomatic 26) · ×1
  • ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts (cyclomatic 26) src/services/account/claudeAccountService.js:3275 — ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts 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 · RedisClient.batchGetAccountDailyCost (cyclomatic 26) · ×1
  • RedisClient.batchGetAccountDailyCost (cyclomatic 26) REDACTED:2021 — RedisClient.batchGetAccountDailyCost 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 · ApiKeyService.updateApiKey (cyclomatic 26) · ×1
  • ApiKeyService.updateApiKey (cyclomatic 26) src/services/apiKeyService.js:1328 — ApiKeyService.updateApiKey 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 · errorSanitizer.mapToErrorCode (cyclomatic 26) · ×1
  • errorSanitizer.mapToErrorCode (cyclomatic 26) src/utils/errorSanitizer.js:75 — errorSanitizer.mapToErrorCode 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 · DroidScheduler.selectAccount (cyclomatic 26) · ×1
  • DroidScheduler.selectAccount (cyclomatic 26) src/services/scheduler/droidScheduler.js:97 — DroidScheduler.selectAccount has cyclomatic complexity 26 (threshold 15). Of this number, 21 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 · LdapService.authenticateUserCredentials (cyclomatic 26) · ×1
  • LdapService.authenticateUserCredentials (cyclomatic 26) REDACTED:514 — LdapService.authenticateUserCredentials has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _normalizeUsageSnapshot (cyclomatic 26) · ×1
  • _normalizeUsageSnapshot (cyclomatic 26) src/services/relay/droidRelayService.js:896 — _normalizeUsageSnapshot has cyclomatic complexity 26 (threshold 15). 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, name the conditions: bind each compound test to a 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 · handleStreamResponse (cyclomatic 26) · ×1
  • handleStreamResponse (cyclomatic 26) src/services/relay/geminiRelayService.js:109 — handleStreamResponse 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 · GrokAccountService.updateAccount (cyclomatic 25) · ×1
  • GrokAccountService.updateAccount (cyclomatic 25) src/services/account/grokAccountService.js:289 — GrokAccountService.updateAccount 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 · CostCalculator.buildLegacyCostResult (cyclomatic 25) · ×1
  • CostCalculator.buildLegacyCostResult (cyclomatic 25) src/utils/costCalculator.js:199 — CostCalculator.buildLegacyCostResult 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 · ClaudeRelayService._enforceCacheControlLimit (cyclomatic 25) · ×1
  • ClaudeRelayService._enforceCacheControlLimit (cyclomatic 25) REDACTED:1466 — ClaudeRelayService._enforceCacheControlLimit 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 6 function items inside it that branch (removeCacheControlFromMessages, removeCacheControlFromSystem, countCacheControlBlocks, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · rateLimitHelper.updateRateLimitCounters (cyclomatic 25) · ×1
  • rateLimitHelper.updateRateLimitCounters (cyclomatic 25) src/utils/rateLimitHelper.js:12 — rateLimitHelper.updateRateLimitCounters 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 · CodexToOpenAIConverter.convertResponse (cyclomatic 25) · ×1
  • CodexToOpenAIConverter.convertResponse (cyclomatic 25) src/services/codexToOpenAI.js:84 — CodexToOpenAIConverter.convertResponse 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 · claudeAccounts.router.post("/claude-accounts") (cyclomatic 25) · ×1
  • claudeAccounts.router.post("/claude-accounts") (cyclomatic 25) REDACTED:606 — claudeAccounts.router.post("/claude-accounts") 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 · apiStats.router.post("/api-key/test-openai") (cyclomatic 25) · ×1
  • apiStats.router.post("/api-key/test-openai") (cyclomatic 25) REDACTED:1165 — apiStats.router.post("/api-key/test-openai") 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 2 function literals inside it that branch (lines 1258, 1238). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · (anonymous) (cyclomatic 25) · ×1
  • (anonymous) (cyclomatic 25) REDACTED:606 — (anonymous) 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 · ClaudeAccountService.createAccount (cyclomatic 24) · ×1
  • ClaudeAccountService.createAccount (cyclomatic 24) src/services/account/claudeAccountService.js:81 — ClaudeAccountService.createAccount 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 · requestDetailHelper.sanitizeValue (cyclomatic 24) · ×1
  • requestDetailHelper.sanitizeValue (cyclomatic 24) REDACTED:385 — requestDetailHelper.sanitizeValue 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 · auth.requestLogger (cyclomatic 24) · ×1
  • auth.requestLogger (cyclomatic 24) REDACTED:1765 — auth.requestLogger has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 1795). 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 · UnifiedGeminiScheduler.selectAccountForApiKey (cyclomatic 24) · ×1
  • UnifiedGeminiScheduler.selectAccountForApiKey (cyclomatic 24) src/services/scheduler/unifiedGeminiScheduler.js:55 — UnifiedGeminiScheduler.selectAccountForApiKey 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 · anthropicGeminiBridgeService.canEnableAntigravityThinking (cyclomatic 24) · ×1
  • anthropicGeminiBridgeService.canEnableAntigravityThinking (cyclomatic 24) src/services/anthropicGeminiBridgeService.js:1221 — anthropicGeminiBridgeService.canEnableAntigravityThinking has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic (cyclomatic 24) · ×1
  • anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic (cyclomatic 24) src/services/anthropicGeminiBridgeService.js:1300 — anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic 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 · claudeConsoleAccounts.router.put("/claude-console-accounts/ · ×1
  • claudeConsoleAccounts.router.put("/claude-console-accounts/:accountId") (cyclomatic 24) REDACTED:211 — claudeConsoleAccounts.router.put("/claude-console-accounts/:accountId") 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 · dashboard.router.get("/dashboard") (cyclomatic 24) · ×1
  • dashboard.router.get("/dashboard") (cyclomatic 24) REDACTED:23 — dashboard.router.get("/dashboard") has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (dashboard.router.get("/dashboard")::countAccountStats) 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 · refreshAccountToken (cyclomatic 24) · ×1
  • refreshAccountToken (cyclomatic 24) src/services/account/claudeAccountService.js:263 — refreshAccountToken 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 · selectAvailableAccount (cyclomatic 24) · ×1
  • selectAvailableAccount (cyclomatic 24) REDACTED:829 — selectAvailableAccount has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sendGeminiRequest (cyclomatic 24) · ×1
  • sendGeminiRequest (cyclomatic 24) src/services/relay/geminiRelayService.js:229 — sendGeminiRequest 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 · ClaudeAccountService.getAllAccounts (cyclomatic 23) · ×1
  • ClaudeAccountService.getAllAccounts (cyclomatic 23) src/services/account/claudeAccountService.js:546 — ClaudeAccountService.getAllAccounts has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 552). 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 · geminiAccountService.selectAvailableAccount (cyclomatic 23) · ×1
  • geminiAccountService.selectAvailableAccount (cyclomatic 23) REDACTED:849 — geminiAccountService.selectAvailableAccount has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BedrockRelayService.handleNonStreamRequest (cyclomatic 23) · ×1
  • BedrockRelayService.handleNonStreamRequest (cyclomatic 23) src/services/relay/bedrockRelayService.js:108 — BedrockRelayService.handleNonStreamRequest 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 · GeminiApiAccountService.getAllAccounts (cyclomatic 23) · ×1
  • GeminiApiAccountService.getAllAccounts (cyclomatic 23) src/services/account/geminiApiAccountService.js:201 — GeminiApiAccountService.getAllAccounts 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 · BillingEventPublisher.publishBillingEvent (cyclomatic 23) · ×1
  • BillingEventPublisher.publishBillingEvent (cyclomatic 23) src/services/billingEventPublisher.js:24 — BillingEventPublisher.publishBillingEvent 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 · ClaudeCodeValidator.hasClaudeCodeSystemPrompt (cyclomatic 23) · ×1
  • ClaudeCodeValidator.hasClaudeCodeSystemPrompt (cyclomatic 23) src/validators/clients/claudeCodeValidator.js:51 — ClaudeCodeValidator.hasClaudeCodeSystemPrompt 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 · anthropicGeminiBridgeService.handleAnthropicMessagesToGemini · ×1
  • anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs (cyclomatic 23) src/services/anthropicGeminiBridgeService.js:2486 — anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs 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 (anthropicGeminiBridgeService.handleAnthropicMessagesToGemini) 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 · anthropicGeminiBridgeService.handleAnthropicCountTokensToGemini (cyclomatic 23) · ×1
  • anthropicGeminiBridgeService.handleAnthropicCountTokensToGemini (cyclomatic 23) src/services/anthropicGeminiBridgeService.js:3008 — anthropicGeminiBridgeService.handleAnthropicCountTokensToGemini has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · GrokScheduler.selectAccount (cyclomatic 23) · ×1
  • GrokScheduler.selectAccount (cyclomatic 23) src/services/scheduler/grokScheduler.js:69 — GrokScheduler.selectAccount has cyclomatic complexity 23 (threshold 15). Of this number, 18 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 · geminiApiAccounts.router.get("/gemini-api-accounts") · ×1
  • geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage (cyclomatic 23) REDACTED:79 — geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage 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. This shape REPEATS in the file: one other method here (geminiApiAccounts.router.get("/gemini-api-accounts")) 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 · openaiResponsesAccounts.router.get("/openai-responses-accounts") · ×1
  • openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage (cyclomatic 23) REDACTED:90 — openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage 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. This shape REPEATS in the file: one other method here (openaiResponsesAccounts.router.get("/openai-responses-accounts")) 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 · droidAccounts.router.get("/droid-accounts") · ×1
  • droidAccounts.router.get("/droid-accounts")::parseUsage (cyclomatic 23) REDACTED:200 — droidAccounts.router.get("/droid-accounts")::parseUsage 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. This shape REPEATS in the file: one other method here (droidAccounts.router.get("/droid-accounts")) 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 · grokAccounts.router.get("/grok-accounts") · ×1
  • grokAccounts.router.get("/grok-accounts")::parseUsage (cyclomatic 23) REDACTED:188 — grokAccounts.router.get("/grok-accounts")::parseUsage 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 · usageStats.getUsageDataByIndex (cyclomatic 23) · ×1
  • usageStats.getUsageDataByIndex (cyclomatic 23) src/routes/admin/usageStats.js:23 — usageStats.getUsageDataByIndex has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 63, 26, 43, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · antigravityRelayService.handleStreamResponse (cyclomatic 22) · ×1
  • antigravityRelayService.handleStreamResponse (cyclomatic 22) src/services/relay/antigravityRelayService.js:32 — antigravityRelayService.handleStreamResponse 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 · geminiHandlers.handleCountTokens (cyclomatic 22) · ×1
  • geminiHandlers.handleCountTokens (cyclomatic 22) REDACTED:1439 — geminiHandlers.handleCountTokens 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 · apiStats.router.post("/api-key/test-gemini") (cyclomatic 22) · ×1
  • apiStats.router.post("/api-key/test-gemini") (cyclomatic 22) REDACTED:1013 — apiStats.router.post("/api-key/test-gemini") has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · handleAnthropicMessagesToGemini · ×1
  • handleAnthropicMessagesToGemini::finalize (cyclomatic 22) src/services/anthropicGeminiBridgeService.js:2573 — handleAnthropicMessagesToGemini::finalize 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 · rebuildIndexes (cyclomatic 22) · ×1
  • rebuildIndexes (cyclomatic 22) src/services/apiKeyIndexService.js:146 — rebuildIndexes 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 · recordUsage (cyclomatic 22) · ×1
  • recordUsage (cyclomatic 22) src/services/apiKeyService.js:1669 — recordUsage has cyclomatic complexity 22 (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 · ClaudeAccountService.selectAvailableAccount (cyclomatic 21) · ×1
  • ClaudeAccountService.selectAvailableAccount (cyclomatic 21) src/services/account/claudeAccountService.js:969 — ClaudeAccountService.selectAvailableAccount has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent 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 · openaiAccountService.updateAccount (cyclomatic 21) · ×1
  • openaiAccountService.updateAccount (cyclomatic 21) REDACTED:573 — openaiAccountService.updateAccount 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 · CcrAccountService.updateAccount (cyclomatic 21) · ×1
  • CcrAccountService.updateAccount (cyclomatic 21) src/services/account/ccrAccountService.js:242 — CcrAccountService.updateAccount 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 · redis.redisClient.migrateGlobalStats (cyclomatic 21) · ×1
  • redis.redisClient.migrateGlobalStats (cyclomatic 21) REDACTED:5302 — redis.redisClient.migrateGlobalStats 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 one function literal inside it that branches (line 5325). 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 · requestDetailHelper.extractPreviewReasoningInfo (cyclomatic 21) · ×1
  • requestDetailHelper.extractPreviewReasoningInfo (cyclomatic 21) REDACTED:289 — requestDetailHelper.extractPreviewReasoningInfo 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 · OpenAIToClaudeConverter._convertStreamEvent (cyclomatic 21) · ×1
  • OpenAIToClaudeConverter._convertStreamEvent (cyclomatic 21) src/services/openaiToClaude.js:410 — OpenAIToClaudeConverter._convertStreamEvent 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 · UnifiedOpenAIScheduler._isAccountAvailable (cyclomatic 21) · ×1
  • UnifiedOpenAIScheduler._isAccountAvailable (cyclomatic 21) src/services/scheduler/unifiedOpenAIScheduler.js:522 — UnifiedOpenAIScheduler._isAccountAvailable 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 · apiKeys.getApiKeysSortedByCostCustom (cyclomatic 21) · ×1
  • apiKeys.getApiKeysSortedByCostCustom (cyclomatic 21) REDACTED:517 — apiKeys.getApiKeysSortedByCostCustom has cyclomatic complexity 21 (threshold 15). Of this number, 18 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 · apiKeys.router.get("/accounts/binding-counts") (cyclomatic 21) · ×1
  • apiKeys.router.get("/accounts/binding-counts") (cyclomatic 21) REDACTED:860 — apiKeys.router.get("/accounts/binding-counts") 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 · claudeAccounts.router.put("/claude-accounts/ · ×1
  • claudeAccounts.router.put("/claude-accounts/:accountId") (cyclomatic 21) REDACTED:717 — claudeAccounts.router.put("/claude-accounts/:accountId") 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 · ccrAccounts.router.post("/") (cyclomatic 21) · ×1
  • ccrAccounts.router.post("/") (cyclomatic 21) REDACTED:112 — ccrAccounts.router.post("/") 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 · geminiApiAccounts.router.put("/gemini-api-accounts/ · ×1
  • geminiApiAccounts.router.put("/gemini-api-accounts/:id") (cyclomatic 21) REDACTED:219 — geminiApiAccounts.router.put("/gemini-api-accounts/:id") 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 · openaiAccounts.router.post("/exchange-code") (cyclomatic 21) · ×1
  • openaiAccounts.router.post("/exchange-code") (cyclomatic 21) REDACTED:110 — openaiAccounts.router.post("/exchange-code") 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 · waitForConcurrencySlot (cyclomatic 21) · ×1
  • waitForConcurrencySlot (cyclomatic 21) REDACTED:248 — waitForConcurrencySlot has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · _sumModelCostsByKeysPattern (cyclomatic 21) · ×1
  • _sumModelCostsByKeysPattern (cyclomatic 21) src/services/account/accountBalanceService.js:575 — _sumModelCostsByKeysPattern has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ClaudeAccountService.fetchAndUpdateAccountProfile (cyclomatic 20) · ×1
  • ClaudeAccountService.fetchAndUpdateAccountProfile (cyclomatic 20) src/services/account/claudeAccountService.js:2329 — ClaudeAccountService.fetchAndUpdateAccountProfile 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 · ClaudeAccountService.updateSessionWindowStatus (cyclomatic 20) · ×1
  • ClaudeAccountService.updateSessionWindowStatus (cyclomatic 20) src/services/account/claudeAccountService.js:3049 — ClaudeAccountService.updateSessionWindowStatus 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 · BedrockAccountService.updateAccount (cyclomatic 20) · ×1
  • BedrockAccountService.updateAccount (cyclomatic 20) REDACTED:280 — BedrockAccountService.updateAccount 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 · grokHelper.isBlockedHost (cyclomatic 20) · ×1
  • grokHelper.isBlockedHost (cyclomatic 20) src/utils/grokHelper.js:211 — grokHelper.isBlockedHost 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 · PricingService.getModelPricing (cyclomatic 20) · ×1
  • PricingService.getModelPricing (cyclomatic 20) src/services/pricingService.js:355 — PricingService.getModelPricing 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 · RedisClient.getKeyIdsWithModels (cyclomatic 20) · ×1
  • RedisClient.getKeyIdsWithModels (cyclomatic 20) REDACTED:1584 — RedisClient.getKeyIdsWithModels 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 · RedisClient._sumModelCostsForAccountDays (cyclomatic 20) · ×1
  • RedisClient._sumModelCostsForAccountDays (cyclomatic 20) REDACTED:2184 — RedisClient._sumModelCostsForAccountDays 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 · RedisClient.getTodayStats (cyclomatic 20) · ×1
  • RedisClient.getTodayStats (cyclomatic 20) REDACTED:2931 — RedisClient.getTodayStats 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 · redis.redisClient.batchGetApiKeyStats (cyclomatic 20) · ×1
  • redis.redisClient.batchGetApiKeyStats (cyclomatic 20) REDACTED:4988 — redis.redisClient.batchGetApiKeyStats 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 · CcrRelayService._parseSSELineForUsage (cyclomatic 20) · ×1
  • CcrRelayService._parseSSELineForUsage (cyclomatic 20) src/services/relay/ccrRelayService.js:887 — CcrRelayService._parseSSELineForUsage 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 · auth.errorHandler (cyclomatic 20) · ×1
  • auth.errorHandler (cyclomatic 20) REDACTED:1925 — auth.errorHandler 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 · geminiHandlers.handleStandardStreamGenerateContent · ×1
  • geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock (cyclomatic 20) REDACTED:2801 — geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock 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. This shape REPEATS in the file: one other method here (geminiHandlers.handleStandardStreamGenerateContent) 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 · openaiRoutes.getOpenAIAuthToken (cyclomatic 20) · ×1
  • openaiRoutes.getOpenAIAuthToken (cyclomatic 20) REDACTED:178 — openaiRoutes.getOpenAIAuthToken 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 · apiKeys.getApiKeysSortedByCostPrecomputed (cyclomatic 20) · ×1
  • apiKeys.getApiKeysSortedByCostPrecomputed (cyclomatic 20) REDACTED:409 — apiKeys.getApiKeysSortedByCostPrecomputed has cyclomatic complexity 20 (threshold 15). Of this number, 18 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 · geminiBalanceProvider.normalizeQuotaCategory (cyclomatic 20) · ×1
  • geminiBalanceProvider.normalizeQuotaCategory (cyclomatic 20) src/services/balanceProviders/geminiBalanceProvider.js:27 — geminiBalanceProvider.normalizeQuotaCategory 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 · startCleanupTasks (cyclomatic 20) · ×1
  • startCleanupTasks (cyclomatic 20) REDACTED:674 — startCleanupTasks has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 714, 676, 801, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · authenticateAdmin (cyclomatic 20) · ×1
  • authenticateAdmin (cyclomatic 20) REDACTED:1360 — authenticateAdmin 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 · exchangeCodeForTokens (cyclomatic 20) · ×1
  • exchangeCodeForTokens (cyclomatic 20) src/utils/oauthHelper.js:156 — exchangeCodeForTokens 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 · exchangeSetupTokenCode (cyclomatic 20) · ×1
  • exchangeSetupTokenCode (cyclomatic 20) src/utils/oauthHelper.js:375 — exchangeSetupTokenCode 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 · (anonymous) (cyclomatic 20) · ×1
  • (anonymous) (cyclomatic 20) REDACTED:412 — (anonymous) has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: (anonymous)::parseUsage (cyclomatic 23) 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 · modelHelper.isOpus45OrNewer (cyclomatic 19) · ×1
  • modelHelper.isOpus45OrNewer (cyclomatic 19) src/utils/modelHelper.js:98 — modelHelper.isOpus45OrNewer 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 · ClaudeAccountService.buildClaudeUsageSnapshot (cyclomatic 19) · ×1
  • ClaudeAccountService.buildClaudeUsageSnapshot (cyclomatic 19) src/services/account/claudeAccountService.js:2177 — ClaudeAccountService.buildClaudeUsageSnapshot has cyclomatic complexity 19 (threshold 15). Of this number, 15 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 · ClaudeConsoleAccountService.getAllAccounts (cyclomatic 19) · ×1
  • ClaudeConsoleAccountService.getAllAccounts (cyclomatic 19) src/services/account/claudeConsoleAccountService.js:169 — ClaudeConsoleAccountService.getAllAccounts 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 · antigravityUpstreamDump.dumpAntigravityUpstreamRequest (cyclomatic 19) · ×1
  • antigravityUpstreamDump.dumpAntigravityUpstreamRequest (cyclomatic 19) src/utils/antigravityUpstreamDump.js:67 — antigravityUpstreamDump.dumpAntigravityUpstreamRequest has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · geminiAccountService.fetchAvailableModelsAntigravity (cyclomatic 19) · ×1
  • geminiAccountService.fetchAvailableModelsAntigravity (cyclomatic 19) REDACTED:97 — geminiAccountService.fetchAvailableModelsAntigravity has cyclomatic complexity 19 (threshold 15). Of this number, 14 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 · DroidAccountService._refreshTokensWithWorkOS (cyclomatic 19) · ×1
  • DroidAccountService._refreshTokensWithWorkOS (cyclomatic 19) REDACTED:337 — DroidAccountService._refreshTokensWithWorkOS 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 · ClaudeRelayService._transformToolNamesInRequestBody (cyclomatic 19) · ×1
  • ClaudeRelayService._transformToolNamesInRequestBody (cyclomatic 19) REDACTED:309 — ClaudeRelayService._transformToolNamesInRequestBody has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (transformName, a function literal at line 336, a function literal at line 353, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · ClaudeRelayService._makeClaudeRequest (cyclomatic 19) · ×1
  • ClaudeRelayService._makeClaudeRequest (cyclomatic 19) REDACTED:1727 — ClaudeRelayService._makeClaudeRequest has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1761, 1788, 1839). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · ClaudeRelayService.testAccountConnectionSync (cyclomatic 19) · ×1
  • ClaudeRelayService.testAccountConnectionSync (cyclomatic 19) REDACTED:3517 — ClaudeRelayService.testAccountConnectionSync has cyclomatic complexity 19 (threshold 15). 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 literal inside it that branches (line 3537). 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 · auth.authenticateUserOrAdmin (cyclomatic 19) · ×1
  • auth.authenticateUserOrAdmin (cyclomatic 19) REDACTED:1560 — auth.authenticateUserOrAdmin 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 · geminiHandlers.buildGeminiApiUrl (cyclomatic 19) · ×1
  • geminiHandlers.buildGeminiApiUrl (cyclomatic 19) REDACTED:88 — geminiHandlers.buildGeminiApiUrl 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 · geminiHandlers.handleLoadCodeAssist (cyclomatic 19) · ×1
  • geminiHandlers.handleLoadCodeAssist (cyclomatic 19) REDACTED:1123 — geminiHandlers.handleLoadCodeAssist 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 · geminiHandlers.handleOnboardUser (cyclomatic 19) · ×1
  • geminiHandlers.handleOnboardUser (cyclomatic 19) REDACTED:1225 — geminiHandlers.handleOnboardUser 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 · accountGroups.router.get("/ · ×1
  • accountGroups.router.get("/:groupId/members") (cyclomatic 19) REDACTED:90 — accountGroups.router.get("/:groupId/members") 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 · claudeAccounts.router.get("/claude-accounts") (cyclomatic 19) · ×1
  • claudeAccounts.router.get("/claude-accounts") (cyclomatic 19) REDACTED:393 — claudeAccounts.router.get("/claude-accounts") has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong 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 · droidAccounts.router.post("/droid-accounts/exchange-code") (cyclomatic 19) · ×1
  • droidAccounts.router.post("/droid-accounts/exchange-code") (cyclomatic 19) REDACTED:68 — droidAccounts.router.post("/droid-accounts/exchange-code") 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 · droidAccounts.router.get("/droid-accounts") (cyclomatic 19) · ×1
  • droidAccounts.router.get("/droid-accounts") (cyclomatic 19) REDACTED:144 — droidAccounts.router.get("/droid-accounts") 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. This shape REPEATS in the file: one other method here (droidAccounts.router.get("/droid-accounts")::parseUsage) 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 · browserFallback.browserFallbackMiddleware (cyclomatic 19) · ×1
  • browserFallback.browserFallbackMiddleware (cyclomatic 19) src/middleware/browserFallback.js:7 — browserFallback.browserFallbackMiddleware has cyclomatic complexity 19 (threshold 15). Of this number, 14 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 · _scanTagsFallback (cyclomatic 19) · ×1
  • _scanTagsFallback (cyclomatic 19) REDACTED:681 — _scanTagsFallback 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 · _normalizeRecord (cyclomatic 19) · ×1
  • _normalizeRecord (cyclomatic 19) src/services/requestDetailService.js:697 — _normalizeRecord 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 · _makeClaudeStreamRequestWithUsageCapture · ×1
  • _makeClaudeStreamRequestWithUsageCapture::(anonymous)::(anonymous)::handleErrorResponse (cyclomatic 19) REDACTED:2475 — _makeClaudeStreamRequestWithUsageCapture::(anonymous)::(anonymous)::handleErrorResponse 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 · azureOpenaiAccountService.createAccount (cyclomatic 18) · ×1
  • azureOpenaiAccountService.createAccount (cyclomatic 18) src/services/account/azureOpenaiAccountService.js:113 — azureOpenaiAccountService.createAccount 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 · BedrockAccountService.getAccount (cyclomatic 18) · ×1
  • BedrockAccountService.getAccount (cyclomatic 18) REDACTED:109 — BedrockAccountService.getAccount 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 · BedrockAccountService.testAccountConnection (cyclomatic 18) · ×1
  • BedrockAccountService.testAccountConnection (cyclomatic 18) REDACTED:528 — BedrockAccountService.testAccountConnection 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 · RedisClient.getUsageStats · ×1
  • RedisClient.getUsageStats::handleLegacyData (cyclomatic 18) REDACTED:1720 — RedisClient.getUsageStats::handleLegacyData 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 · requestDetailHelper.extractAnthropicReasoningInfo (cyclomatic 18) · ×1
  • requestDetailHelper.extractAnthropicReasoningInfo (cyclomatic 18) REDACTED:147 — requestDetailHelper.extractAnthropicReasoningInfo 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 · RequestDetailService._findRequestTimestampInRange (cyclomatic 18) · ×1
  • RequestDetailService._findRequestTimestampInRange (cyclomatic 18) src/services/requestDetailService.js:998 — RequestDetailService._findRequestTimestampInRange 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 · ClaudeCodeValidator.validate (cyclomatic 18) · ×1
  • ClaudeCodeValidator.validate (cyclomatic 18) src/validators/clients/claudeCodeValidator.js:128 — ClaudeCodeValidator.validate 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 · requestIdentityService.resolveAccountId (cyclomatic 18) · ×1
  • requestIdentityService.resolveAccountId (cyclomatic 18) src/services/requestIdentityService.js:205 — requestIdentityService.resolveAccountId 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 · CodexCliValidator.validate (cyclomatic 18) · ×1
  • CodexCliValidator.validate (cyclomatic 18) src/validators/clients/codexCliValidator.js:35 — CodexCliValidator.validate 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 · geminiRelayService.countTokens (cyclomatic 18) · ×1
  • geminiRelayService.countTokens (cyclomatic 18) src/services/relay/geminiRelayService.js:443 — geminiRelayService.countTokens 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 · ccrAccounts.router.put("/ · ×1
  • ccrAccounts.router.put("/:accountId") (cyclomatic 18) REDACTED:182 — ccrAccounts.router.put("/:accountId") 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 · azureOpenaiAccounts.router.post("/azure-openai-accounts") (cyclomatic 18) · ×1
  • azureOpenaiAccounts.router.post("/azure-openai-accounts") (cyclomatic 18) REDACTED:106 — azureOpenaiAccounts.router.post("/azure-openai-accounts") 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 · grokAccounts.router.post("/grok-accounts/ · ×1
  • grokAccounts.router.post("/grok-accounts/:accountId/test") (cyclomatic 18) REDACTED:412 — grokAccounts.router.post("/grok-accounts/:accountId/test") 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 · dashboard.router.get("/dashboard") · ×1
  • dashboard.router.get("/dashboard")::countAccountStats (cyclomatic 18) REDACTED:84 — dashboard.router.get("/dashboard")::countAccountStats 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 (dashboard.router.get("/dashboard")) 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 · QuotaCardService.createCard (cyclomatic 18) · ×1
  • QuotaCardService.createCard (cyclomatic 18) src/services/quotaCardService.js:88 — QuotaCardService.createCard 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 · web.router.post("/auth/change-password") (cyclomatic 18) · ×1
  • web.router.post("/auth/change-password") (cyclomatic 18) REDACTED:137 — web.router.post("/auth/change-password") 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 · DroidRelayService._parseAnthropicUsageFromSSE (cyclomatic 18) · ×1
  • DroidRelayService._parseAnthropicUsageFromSSE (cyclomatic 18) src/services/relay/droidRelayService.js:706 — DroidRelayService._parseAnthropicUsageFromSSE 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 · RateLimitCleanupService.cleanupClaudeAccounts (cyclomatic 18) · ×1
  • RateLimitCleanupService.cleanupClaudeAccounts (cyclomatic 18) src/services/rateLimitCleanupService.js:211 — RateLimitCleanupService.cleanupClaudeAccounts 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 · handleChatCompletion · ×1
  • handleChatCompletion::usageCallback (cyclomatic 18) REDACTED:280 — handleChatCompletion::usageCallback 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 · request · ×1
  • request::attemptRequest (cyclomatic 18) src/services/antigravityClient.js:366 — request::attemptRequest 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 · setAccountRateLimited (cyclomatic 18) · ×1
  • setAccountRateLimited (cyclomatic 18) REDACTED:942 — setAccountRateLimited 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 · _handleBedrockError (cyclomatic 18) · ×1
  • _handleBedrockError (cyclomatic 18) src/services/relay/bedrockRelayService.js:762 — _handleBedrockError 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 · _handleStreamRequest · ×1
  • _handleStreamRequest::(anonymous)::handleStreamError (cyclomatic 18) src/services/relay/droidRelayService.js:464 — _handleStreamRequest::(anonymous)::handleStreamError 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 · ClaudeAccountService.updateSessionWindow (cyclomatic 17) · ×1
  • ClaudeAccountService.updateSessionWindow (cyclomatic 17) src/services/account/claudeAccountService.js:1874 — ClaudeAccountService.updateSessionWindow 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 · azureOpenaiAccountService.updateAccount (cyclomatic 17) · ×1
  • azureOpenaiAccountService.updateAccount (cyclomatic 17) src/services/account/azureOpenaiAccountService.js:205 — azureOpenaiAccountService.updateAccount 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 · azureOpenaiAccountService.selectAvailableAccount (cyclomatic 17) · ×1
  • azureOpenaiAccountService.selectAvailableAccount (cyclomatic 17) src/services/account/azureOpenaiAccountService.js:386 — azureOpenaiAccountService.selectAvailableAccount has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent 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 · CcrAccountService.getAllAccounts (cyclomatic 17) · ×1
  • CcrAccountService.getAllAccounts (cyclomatic 17) src/services/account/ccrAccountService.js:134 — CcrAccountService.getAllAccounts 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 · grokQuota.formatWindow (cyclomatic 17) · ×1
  • grokQuota.formatWindow (cyclomatic 17) src/utils/grokQuota.js:351 — grokQuota.formatWindow 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 · CostCalculator.buildDetailedPricingResult (cyclomatic 17) · ×1
  • CostCalculator.buildDetailedPricingResult (cyclomatic 17) src/utils/costCalculator.js:144 — CostCalculator.buildDetailedPricingResult 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 · RedisClient._parseApiKeyData (cyclomatic 17) · ×1
  • RedisClient._parseApiKeyData (cyclomatic 17) REDACTED:768 — RedisClient._parseApiKeyData 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 · RedisClient.incrementTokenUsage (cyclomatic 17) · ×1
  • RedisClient.incrementTokenUsage (cyclomatic 17) REDACTED:1068 — RedisClient.incrementTokenUsage 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 · RedisClient.getAccountDailyCostFallback (cyclomatic 17) · ×1
  • RedisClient.getAccountDailyCostFallback (cyclomatic 17) REDACTED:2114 — RedisClient.getAccountDailyCostFallback 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 · ClaudeRelayService._createTestStreamTransformer (cyclomatic 17) · ×1
  • ClaudeRelayService._createTestStreamTransformer (cyclomatic 17) REDACTED:3380 — ClaudeRelayService._createTestStreamTransformer has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 3383). 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 · ClaudeConsoleRelayService._createTestStreamTransformer (cyclomatic 17) · ×1
  • ClaudeConsoleRelayService._createTestStreamTransformer (cyclomatic 17) REDACTED:1399 — ClaudeConsoleRelayService._createTestStreamTransformer has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 1402). 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 · geminiHandlers.handleRetrieveUserQuota (cyclomatic 17) · ×1
  • geminiHandlers.handleRetrieveUserQuota (cyclomatic 17) REDACTED:1340 — geminiHandlers.handleRetrieveUserQuota 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 · apiKeys.router.post("/api-keys/batch") (cyclomatic 17) · ×1
  • apiKeys.router.post("/api-keys/batch") (cyclomatic 17) REDACTED:1736 — apiKeys.router.post("/api-keys/batch") 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 · oauthHelper.getOrganizationInfo (cyclomatic 17) · ×1
  • oauthHelper.getOrganizationInfo (cyclomatic 17) src/utils/oauthHelper.js:614 — oauthHelper.getOrganizationInfo 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 · claudeAccounts.router.get("/claude-accounts/usage") (cyclomatic 17) · ×1
  • claudeAccounts.router.get("/claude-accounts/usage") (cyclomatic 17) REDACTED:536 — claudeAccounts.router.get("/claude-accounts/usage") 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 2 function literals inside it that branch (lines 543, 592). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · geminiAccounts.router.put("/ · ×1
  • geminiAccounts.router.put("/:accountId") (cyclomatic 17) REDACTED:301 — geminiAccounts.router.put("/:accountId") 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 · openaiResponsesAccounts.router.post("/openai-responses-accounts/ · ×1
  • openaiResponsesAccounts.router.post("/openai-responses-accounts/:accountId/test") (cyclomatic 17) REDACTED:459 — openaiResponsesAccounts.router.post("/openai-responses-accounts/:accountId/test") 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 · BalanceScriptService.mapExtractorResult (cyclomatic 17) · ×1
  • BalanceScriptService.mapExtractorResult (cyclomatic 17) src/services/balanceScriptService.js:177 — BalanceScriptService.mapExtractorResult 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 · system.router.get("/check-updates") (cyclomatic 17) · ×1
  • system.router.get("/check-updates") (cyclomatic 17) REDACTED:93 — system.router.get("/check-updates") 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 · apiStats.router.post("/api/redeem-card") (cyclomatic 17) · ×1
  • apiStats.router.post("/api/redeem-card") (cyclomatic 17) REDACTED:1529 — apiStats.router.post("/api/redeem-card") 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 · DroidRelayService._handleUpstreamClientError (cyclomatic 17) · ×1
  • DroidRelayService._handleUpstreamClientError (cyclomatic 17) src/services/relay/droidRelayService.js:1361 — DroidRelayService._handleUpstreamClientError 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 · userRoutes.router.post("/login") (cyclomatic 17) · ×1
  • userRoutes.router.post("/login") (cyclomatic 17) REDACTED:52 — userRoutes.router.post("/login") 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 · GeminiBalanceProvider.queryBalance (cyclomatic 17) · ×1
  • GeminiBalanceProvider.queryBalance (cyclomatic 17) src/services/balanceProviders/geminiBalanceProvider.js:191 — GeminiBalanceProvider.queryBalance 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 · index.router.beforeEach() (cyclomatic 17) · ×1
  • index.router.beforeEach() (cyclomatic 17) web/admin-spa/src/router/index.js:188 — index.router.beforeEach() 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 · handleGeminiUpstreamError (cyclomatic 17) · ×1
  • handleGeminiUpstreamError (cyclomatic 17) REDACTED:27 — handleGeminiUpstreamError 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 · migrateAlltimeModelStats (cyclomatic 17) · ×1
  • migrateAlltimeModelStats (cyclomatic 17) REDACTED:379 — migrateAlltimeModelStats 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 · queryWithIndex (cyclomatic 17) · ×1
  • queryWithIndex (cyclomatic 17) src/services/apiKeyIndexService.js:432 — queryWithIndex has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 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 · handleStreamResponse · ×1
  • handleStreamResponse::(anonymous)::parseSSEForUsage (cyclomatic 17) src/services/relay/azureOpenaiRelayService.js:322 — handleStreamResponse::(anonymous)::parseSSEForUsage 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 · ApiKeyIndexService.addToIndex (cyclomatic 16) · ×1
  • ApiKeyIndexService.addToIndex (cyclomatic 16) src/services/apiKeyIndexService.js:255 — ApiKeyIndexService.addToIndex 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 · ClaudeAccountService.updateClaudeUsageSnapshot (cyclomatic 16) · ×1
  • ClaudeAccountService.updateClaudeUsageSnapshot (cyclomatic 16) src/services/account/claudeAccountService.js:2259 — ClaudeAccountService.updateClaudeUsageSnapshot 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 · geminiAccountService.refreshAccountToken (cyclomatic 16) · ×1
  • geminiAccountService.refreshAccountToken (cyclomatic 16) REDACTED:996 — geminiAccountService.refreshAccountToken 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 · openaiAccountService.getAllAccounts (cyclomatic 16) · ×1
  • openaiAccountService.getAllAccounts (cyclomatic 16) REDACTED:682 — openaiAccountService.getAllAccounts 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 · grokHelper.isBlockedIPv4 (cyclomatic 16) · ×1
  • grokHelper.isBlockedIPv4 (cyclomatic 16) src/utils/grokHelper.js:185 — grokHelper.isBlockedIPv4 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 · RedisClient.getAccountDailyCost (cyclomatic 16) · ×1
  • RedisClient.getAccountDailyCost (cyclomatic 16) REDACTED:1959 — RedisClient.getAccountDailyCost 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 · RequestDetailService._resolveAccountInfo (cyclomatic 16) · ×1
  • RequestDetailService._resolveAccountInfo (cyclomatic 16) src/services/requestDetailService.js:928 — RequestDetailService._resolveAccountInfo 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 · geminiHandlers.normalizeAxiosStreamError (cyclomatic 16) · ×1
  • geminiHandlers.normalizeAxiosStreamError (cyclomatic 16) REDACTED:322 — geminiHandlers.normalizeAxiosStreamError 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 · GrokRelayService._handleStreamResponse (cyclomatic 16) · ×1
  • GrokRelayService._handleStreamResponse (cyclomatic 16) REDACTED:248 — GrokRelayService._handleStreamResponse has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function items inside it that branch (parseSSEForUsage, recordUsageOnce, a function literal at line 307, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · apiKeys.router.post("/api-keys/batch-last-usage") (cyclomatic 16) · ×1
  • apiKeys.router.post("/api-keys/batch-last-usage") (cyclomatic 16) REDACTED:1383 — apiKeys.router.post("/api-keys/batch-last-usage") 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 one function literal inside it that branches (line 1411). 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 · bedrockAccounts.router.post("/") (cyclomatic 16) · ×1
  • bedrockAccounts.router.post("/") (cyclomatic 16) REDACTED:118 — bedrockAccounts.router.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.
D1 · Cyclomatic Complexity · geminiApiAccounts.router.get("/gemini-api-accounts") (cyclomatic 16) · ×1
  • geminiApiAccounts.router.get("/gemini-api-accounts") (cyclomatic 16) REDACTED:13 — geminiApiAccounts.router.get("/gemini-api-accounts") has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage) 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 · openaiResponsesAccounts.router.get("/openai-responses-accounts") (cyclomatic 16) · ×1
  • openaiResponsesAccounts.router.get("/openai-responses-accounts") (cyclomatic 16) REDACTED:24 — openaiResponsesAccounts.router.get("/openai-responses-accounts") has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage) 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 · openaiResponsesAccounts.router.put("/openai-responses-accounts/ · ×1
  • openaiResponsesAccounts.router.put("/openai-responses-accounts/:id") (cyclomatic 16) REDACTED:192 — openaiResponsesAccounts.router.put("/openai-responses-accounts/:id") 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 · workosOAuthHelper.pollDeviceAuthorization (cyclomatic 16) · ×1
  • workosOAuthHelper.pollDeviceAuthorization (cyclomatic 16) src/utils/workosOAuthHelper.js:104 — workosOAuthHelper.pollDeviceAuthorization 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 · droidAccounts.router.post("/droid-accounts") (cyclomatic 16) · ×1
  • droidAccounts.router.post("/droid-accounts") (cyclomatic 16) REDACTED:293 — droidAccounts.router.post("/droid-accounts") 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 · droidAccounts.router.get("/droid-accounts/ · ×1
  • droidAccounts.router.get("/droid-accounts/:id") (cyclomatic 16) REDACTED:479 — droidAccounts.router.get("/droid-accounts/:id") has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 552, 517). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · AccountBalanceService._getBalanceFromScript (cyclomatic 16) · ×1
  • AccountBalanceService._getBalanceFromScript (cyclomatic 16) src/services/account/accountBalanceService.js:439 — AccountBalanceService._getBalanceFromScript 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 · LdapService.extractDN (cyclomatic 16) · ×1
  • LdapService.extractDN (cyclomatic 16) REDACTED:58 — LdapService.extractDN 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 · LdapService.extractUserInfo (cyclomatic 16) · ×1
  • LdapService.extractUserInfo (cyclomatic 16) REDACTED:445 — LdapService.extractUserInfo has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · userRoutes.router.get("/quota-info") (cyclomatic 16) · ×1
  • userRoutes.router.get("/quota-info") (cyclomatic 16) REDACTED:848 — userRoutes.router.get("/quota-info") 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 · RateLimitCleanupService.cleanupClaudeConsoleAccounts (cyclomatic 16) · ×1
  • RateLimitCleanupService.cleanupClaudeConsoleAccounts (cyclomatic 16) src/services/rateLimitCleanupService.js:306 — RateLimitCleanupService.cleanupClaudeConsoleAccounts 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 · unstableUpstreamHelper.normalizeErrorPayload (cyclomatic 16) · ×1
  • unstableUpstreamHelper.normalizeErrorPayload (cyclomatic 16) src/utils/unstableUpstreamHelper.js:17 — unstableUpstreamHelper.normalizeErrorPayload 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 · dashboard.useDashboardStore.loadAccountUsageTrend (cyclomatic 16) · ×1
  • dashboard.useDashboardStore.loadAccountUsageTrend (cyclomatic 16) web/admin-spa/src/stores/dashboard.js:458 — dashboard.useDashboardStore.loadAccountUsageTrend 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 · theme.useThemeStore.applyColorScheme (cyclomatic 16) · ×1
  • theme.useThemeStore.applyColorScheme (cyclomatic 16) web/admin-spa/src/stores/theme.js:230 — theme.useThemeStore.applyColorScheme has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · headerValue (cyclomatic 16) · ×1
  • headerValue (cyclomatic 16) src/utils/grokQuota.js:55 — headerValue 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 · getAllTempUnavailable (cyclomatic 16) · ×1
  • getAllTempUnavailable (cyclomatic 16) src/utils/upstreamErrorHelper.js:429 — getAllTempUnavailable 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 · (anonymous).applyColorScheme (cyclomatic 16) · ×1
  • (anonymous).applyColorScheme (cyclomatic 16) web/admin-spa/src/stores/theme.js:230 — (anonymous).applyColorScheme has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · handleMessagesRequest (cognitive 406) · ×1
  • handleMessagesRequest (cognitive 406) REDACTED:137 — handleMessagesRequest has cognitive complexity 406 (threshold 15). Drivers by points: if/else 102 (256 pts), boolean chains 89, error handling 15 (43 pts), ternaries 8 (18 pts) (nesting depth added 192). Of this number, 282 points are the body's own statements and 124 belong to 17 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 · ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cognitive 320) · ×1
  • ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture (cognitive 320) REDACTED:2154 — ClaudeRelayService._makeClaudeStreamRequestWithUsageCapture has cognitive complexity 320 (threshold 15). Drivers by points: if/else 101 (207 pts), boolean chains 58, error handling 14 (42 pts), ternaries 4 (12 pts), loops 1 (nesting depth added 142). Most of this is not in the body itself: 1 of the 320 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 2216, 2712, 2857, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · _makeClaudeConsoleStreamRequest (cognitive 302) · ×1
  • _makeClaudeConsoleStreamRequest (cognitive 302) REDACTED:744 — _makeClaudeConsoleStreamRequest has cognitive complexity 302 (threshold 15). Drivers by points: if/else 76 (184 pts), error handling 15 (51 pts), boolean chains 41, ternaries 9 (24 pts), loops 1 (2 pts) (nesting depth added 160). None of this is in the body itself: all 302 points belong to 22 function items inside it that branch (a function literal at line 1003, a function literal at line 839, a function literal at line 1282, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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) (cognitive 247) · ×1
  • (anonymous) (cognitive 247) src/routes/admin/usageStats.js:1247 — (anonymous) has cognitive complexity 247 (threshold 15). Drivers by points: if/else 38 (115 pts), boolean chains 62, loops 17 (41 pts), ternaries 12 (28 pts), error handling 1 (nesting depth added 117). Of this number, 211 points are the body's own statements and 36 belong to 19 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 · relayRequest (cognitive 225) · ×1
  • relayRequest (cognitive 225) REDACTED:480 — relayRequest has cognitive complexity 225 (threshold 15). Drivers by points: if/else 59 (116 pts), error handling 15 (42 pts), ternaries 14 (33 pts), boolean chains 31, loops 2, other 1 (nesting depth added 103). Of this number, 210 points are the body's own statements and 15 belong to 12 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · usageStats.router.get("/account-usage-trend") (cognitive 221) · ×1
  • usageStats.router.get("/account-usage-trend") (cognitive 221) src/routes/admin/usageStats.js:1247 — usageStats.router.get("/account-usage-trend") has cognitive complexity 221 (threshold 15). Drivers by points: if/else 38 (115 pts), boolean chains 62, loops 17 (41 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 102). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · authenticateApiKey (cognitive 214) · ×1
  • authenticateApiKey (cognitive 214) REDACTED:440 — authenticateApiKey has cognitive complexity 214 (threshold 15). Drivers by points: if/else 51 (117 pts), error handling 16 (54 pts), boolean chains 41, ternaries 1 (2 pts) (nesting depth added 105). Of this number, 183 points are the body's own statements and 31 belong to 19 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 · handleResponses (cognitive 205) · ×1
  • handleResponses (cognitive 205) REDACTED:293 — handleResponses has cognitive complexity 205 (threshold 15). Drivers by points: if/else 69 (102 pts), boolean chains 50, error handling 12 (24 pts), ternaries 11 (24 pts), loops 4 (5 pts) (nesting depth added 59). Of this number, 167 points are the body's own statements and 38 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents (cognitive 198) · ×1
  • anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents (cognitive 198) src/services/anthropicGeminiBridgeService.js:1026 — anthropicGeminiBridgeService.convertAnthropicMessagesToGeminiContents has cognitive complexity 198 (threshold 15). Drivers by points: if/else 27 (112 pts), ternaries 10 (55 pts), boolean chains 21, error handling 1 (6 pts), loops 2 (4 pts) (nesting depth added 137). 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 · usageStats.router.get("/api-keys-usage-trend") (cognitive 194) · ×1
  • usageStats.router.get("/api-keys-usage-trend") (cognitive 194) src/routes/admin/usageStats.js:1825 — usageStats.router.get("/api-keys-usage-trend") has cognitive complexity 194 (threshold 15). Drivers by points: if/else 32 (105 pts), boolean chains 51, loops 16 (37 pts), error handling 1 (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch 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 194) · ×1
  • (anonymous) (cognitive 194) src/routes/admin/usageStats.js:1825 — (anonymous) has cognitive complexity 194 (threshold 15). Drivers by points: if/else 32 (105 pts), boolean chains 51, loops 16 (37 pts), error handling 1 (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _getAllAvailableAccounts (cognitive 194) · ×1
  • _getAllAvailableAccounts (cognitive 194) src/services/scheduler/unifiedClaudeScheduler.js:515 — _getAllAvailableAccounts has cognitive complexity 194 (threshold 15). Drivers by points: if/else 59 (143 pts), boolean chains 33, loops 5 (8 pts), error handling 2 (6 pts), ternaries 1 (4 pts) (nesting depth added 94). 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 · handleRequest (cognitive 188) · ×1
  • handleRequest (cognitive 188) REDACTED:68 — handleRequest has cognitive complexity 188 (threshold 15). Drivers by points: if/else 37 (88 pts), error handling 13 (49 pts), boolean chains 34, ternaries 5 (13 pts), loops 1 (4 pts) (nesting depth added 98). Of this number, 186 points are the body's own statements and 2 belong to 11 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 · updateAccount (cognitive 178) · ×1
  • updateAccount (cognitive 178) REDACTED:836 — updateAccount has cognitive complexity 178 (threshold 15). Drivers by points: if/else 57 (89 pts), ternaries 19 (43 pts), boolean chains 38, error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 60). Of this number, 170 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · apiStats.router.post("/api/user-stats") (cognitive 165) · ×1
  • apiStats.router.post("/api/user-stats") (cognitive 165) REDACTED:101 — apiStats.router.post("/api/user-stats") has cognitive complexity 165 (threshold 15). Drivers by points: boolean chains 79, if/else 31 (63 pts), error handling 8 (12 pts), ternaries 6 (7 pts), loops 2 (4 pts) (nesting depth added 39). Of this number, 151 points are the body's own statements and 14 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 · (anonymous) (cognitive 161) · ×1
  • (anonymous) (cognitive 161) REDACTED:101 — (anonymous) has cognitive complexity 161 (threshold 15). Drivers by points: boolean chains 72, if/else 31 (63 pts), error handling 8 (12 pts), ternaries 8 (10 pts), loops 2 (4 pts) (nesting depth added 40). Of this number, 148 points are the body's own statements and 13 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 · createAccount (cognitive 159) · ×1
  • createAccount (cognitive 159) REDACTED:458 — createAccount has cognitive complexity 159 (threshold 15). Drivers by points: if/else 32 (69 pts), boolean chains 54, ternaries 17 (29 pts), error handling 4 (7 pts) (nesting depth added 52). Of this number, 158 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 · usageStats.router.get("/usage-trend") (cognitive 157) · ×1
  • usageStats.router.get("/usage-trend") (cognitive 157) src/routes/admin/usageStats.js:539 — usageStats.router.get("/usage-trend") has cognitive complexity 157 (threshold 15). Drivers by points: if/else 27 (85 pts), boolean chains 41, loops 12 (30 pts), error handling 1 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch 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 155) · ×1
  • (anonymous) (cognitive 155) REDACTED:192 — (anonymous) has cognitive complexity 155 (threshold 15). Drivers by points: if/else 39 (83 pts), boolean chains 35, error handling 8 (19 pts), ternaries 5 (16 pts), loops 1 (2 pts) (nesting depth added 67). Of this number, 70 points are the body's own statements and 85 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 · openaiGeminiRoutes.router.post("/v1/chat/completions") (cognitive 153) · ×1
  • openaiGeminiRoutes.router.post("/v1/chat/completions") (cognitive 153) REDACTED:192 — openaiGeminiRoutes.router.post("/v1/chat/completions") has cognitive complexity 153 (threshold 15). Drivers by points: if/else 39 (83 pts), boolean chains 35, error handling 8 (19 pts), ternaries 4 (14 pts), loops 1 (2 pts) (nesting depth added 66). Of this number, 68 points are the body's own statements and 85 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 · relayRequest (cognitive 151) · ×1
  • relayRequest (cognitive 151) REDACTED:23 — relayRequest has cognitive complexity 151 (threshold 15). Drivers by points: if/else 42 (56 pts), ternaries 22 (50 pts), error handling 11 (26 pts), boolean chains 19 (nesting depth added 57). Of this number, 149 points are the body's own statements and 2 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 · (anonymous) (cognitive 145) · ×1
  • (anonymous) (cognitive 145) src/routes/admin/usageStats.js:539 — (anonymous) has cognitive complexity 145 (threshold 15). Drivers by points: if/else 27 (85 pts), loops 12 (30 pts), boolean chains 29, error handling 1 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sanitizeMaxTokens (cognitive 142) · ×1
  • sanitizeMaxTokens (cognitive 142) REDACTED:944 — sanitizeMaxTokens has cognitive complexity 142 (threshold 15). Drivers by points: if/else 49 (72 pts), boolean chains 43, error handling 15 (20 pts), ternaries 2 (4 pts), loops 3 (nesting depth added 30). Most of this is not in the body itself: 1 of the 142 points is its own statement and the rest belongs to 23 function items inside it that branch (a function literal at line 1319, a function literal at line 1529, a function literal at line 1258, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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) (cognitive 142) · ×1
  • (anonymous) (cognitive 142) REDACTED:2108 — (anonymous) has cognitive complexity 142 (threshold 15). Drivers by points: if/else 64 (96 pts), boolean chains 40, error handling 3 (6 pts) (nesting depth added 35). Of this number, 139 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _getAllAvailableAccounts (cognitive 137) · ×1
  • _getAllAvailableAccounts (cognitive 137) src/services/scheduler/unifiedGeminiScheduler.js:224 — _getAllAvailableAccounts has cognitive complexity 137 (threshold 15). Drivers by points: if/else 29 (96 pts), boolean chains 27, ternaries 5 (11 pts), loops 2 (3 pts) (nesting depth added 74). 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 · (anonymous) (cognitive 135) · ×1
  • (anonymous) (cognitive 135) src/routes/admin/usageStats.js:2708 — (anonymous) has cognitive complexity 135 (threshold 15). Drivers by points: boolean chains 59, if/else 28 (47 pts), ternaries 16 (19 pts), loops 5 (6 pts), error handling 2 (3 pts), other 1 (nesting depth added 24). Of this number, 98 points are the body's own statements and 37 belong to 15 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 · apiKeys.router.put("/api-keys/ · ×1
  • apiKeys.router.put("/api-keys/:keyId") (cognitive 131) REDACTED:2108 — apiKeys.router.put("/api-keys/:keyId") has cognitive complexity 131 (threshold 15). Drivers by points: if/else 64 (96 pts), boolean chains 29, error handling 3 (6 pts) (nesting depth added 35). Of this number, 129 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 · buildGeminiRequestFromOpenAI (cognitive 128) · ×1
  • buildGeminiRequestFromOpenAI (cognitive 128) REDACTED:557 — buildGeminiRequestFromOpenAI has cognitive complexity 128 (threshold 15). Drivers by points: if/else 47 (79 pts), boolean chains 17, ternaries 3 (12 pts), loops 5 (11 pts), error handling 2 (9 pts) (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 · (anonymous) (cognitive 128) · ×1
  • (anonymous) (cognitive 128) src/routes/admin/usageStats.js:3066 — (anonymous) has cognitive complexity 128 (threshold 15). Drivers by points: boolean chains 52, if/else 18 (45 pts), ternaries 16 (19 pts), loops 5 (8 pts), error handling 2 (3 pts), other 1 (nesting depth added 34). Of this number, 104 points are the body's own statements and 24 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 · (anonymous) (cognitive 126) · ×1
  • (anonymous) (cognitive 126) REDACTED:93 — (anonymous) has cognitive complexity 126 (threshold 15). Drivers by points: boolean chains 60, if/else 23 (38 pts), ternaries 10 (13 pts), error handling 6 (12 pts), loops 3 (nesting depth added 24). Of this number, 75 points are the body's own statements and 51 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 · sync.router.get("/sync/export-accounts") (cognitive 124) · ×1
  • sync.router.get("/sync/export-accounts") (cognitive 124) REDACTED:93 — sync.router.get("/sync/export-accounts") has cognitive complexity 124 (threshold 15). Drivers by points: boolean chains 59, if/else 23 (38 pts), error handling 6 (12 pts), ternaries 9 (12 pts), loops 3 (nesting depth added 24). Of this number, 74 points are the body's own statements and 50 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 · openaiRoutes.handleImages (cognitive 121) · ×1
  • openaiRoutes.handleImages (cognitive 121) REDACTED:971 — openaiRoutes.handleImages has cognitive complexity 121 (threshold 15). Drivers by points: if/else 33 (52 pts), boolean chains 33, ternaries 8 (21 pts), error handling 7 (14 pts), loops 1 (nesting depth added 39). Of this number, 78 points are the body's own statements and 43 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 · relayRequest (cognitive 117) · ×1
  • relayRequest (cognitive 117) src/services/relay/ccrRelayService.js:16 — relayRequest has cognitive complexity 117 (threshold 15). Drivers by points: if/else 35 (49 pts), ternaries 11 (24 pts), error handling 9 (23 pts), boolean chains 21 (nesting depth added 41). Of this number, 115 points are the body's own statements and 2 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 · handleMessages (cognitive 116) · ×1
  • handleMessages (cognitive 116) REDACTED:395 — handleMessages has cognitive complexity 116 (threshold 15). Drivers by points: if/else 29 (59 pts), boolean chains 25, error handling 7 (20 pts), loops 2 (6 pts), ternaries 3 (6 pts) (nesting depth added 50). Of this number, 64 points are the body's own statements and 52 belong to 7 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · azureOpenaiRelayService.handleStreamResponse (cognitive 112) · ×1
  • azureOpenaiRelayService.handleStreamResponse (cognitive 112) src/services/relay/azureOpenaiRelayService.js:270 — azureOpenaiRelayService.handleStreamResponse has cognitive complexity 112 (threshold 15). Drivers by points: if/else 41 (84 pts), boolean chains 11, error handling 5 (8 pts), loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 51). Most of this is not in the body itself: 1 of the 112 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 322, 470, 408, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · handleAnthropicMessagesToGemini (cognitive 112) · ×1
  • handleAnthropicMessagesToGemini (cognitive 112) src/services/anthropicGeminiBridgeService.js:1859 — handleAnthropicMessagesToGemini has cognitive complexity 112 (threshold 15). Drivers by points: if/else 103 (188 pts), boolean chains 73, ternaries 24 (39 pts), error handling 14 (28 pts), loops 4 (5 pts) (nesting depth added 115). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backfillCurrentWeekClaudeCosts (cognitive 111) · ×1
  • backfillCurrentWeekClaudeCosts (cognitive 111) src/services/weeklyClaudeCostInitService.js:69 — backfillCurrentWeekClaudeCosts has cognitive complexity 111 (threshold 15). Drivers by points: if/else 17 (53 pts), loops 12 (26 pts), boolean chains 17, ternaries 2 (8 pts), error handling 3 (6 pts), other 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch 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.router.get("/usage-costs") (cognitive 107) · ×1
  • usageStats.router.get("/usage-costs") (cognitive 107) src/routes/admin/usageStats.js:2286 — usageStats.router.get("/usage-costs") has cognitive complexity 107 (threshold 15). Drivers by points: if/else 24 (56 pts), boolean chains 33, loops 7 (16 pts), error handling 1, ternaries 1 (nesting depth added 41). Of this number, 103 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cleanJsonSchemaForGemini (cognitive 107) · ×1
  • cleanJsonSchemaForGemini (cognitive 107) src/utils/geminiSchemaCleaner.js:87 — cleanJsonSchemaForGemini has cognitive complexity 107 (threshold 15). Drivers by points: if/else 32 (55 pts), boolean chains 33, ternaries 7 (10 pts), loops 4 (9 pts) (nesting depth added 31). Of this number, 104 points are the body's own statements and 3 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 · _makeCcrStreamRequest (cognitive 107) · ×1
  • _makeCcrStreamRequest (cognitive 107) src/services/relay/ccrRelayService.js:561 — _makeCcrStreamRequest has cognitive complexity 107 (threshold 15). Drivers by points: if/else 36 (60 pts), error handling 9 (25 pts), boolean chains 15, ternaries 3 (6 pts), loops 1 (nesting depth added 43). None of this is in the body itself: all 107 points belong to 19 function items inside it that branch (a function literal at line 638, a function literal at line 765, a function literal at line 573, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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) (cognitive 106) · ×1
  • (anonymous) (cognitive 106) src/routes/admin/usageStats.js:933 — (anonymous) has cognitive complexity 106 (threshold 15). Drivers by points: if/else 27 (61 pts), boolean chains 28, loops 6 (12 pts), error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 42). 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 · apiKeys.router.put("/api-keys/batch") (cognitive 102) · ×1
  • apiKeys.router.put("/api-keys/batch") (cognitive 102) REDACTED:1882 — apiKeys.router.put("/api-keys/batch") has cognitive complexity 102 (threshold 15). Drivers by points: if/else 40 (79 pts), boolean chains 8, error handling 3 (6 pts), match/switch 1 (4 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 48). Of this number, 94 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 102) · ×1
  • (anonymous) (cognitive 102) REDACTED:1882 — (anonymous) has cognitive complexity 102 (threshold 15). Drivers by points: if/else 40 (79 pts), boolean chains 8, error handling 3 (6 pts), match/switch 1 (4 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 48). Of this number, 94 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 · ApiKeyService.getAllApiKeysFast (cognitive 101) · ×1
  • ApiKeyService.getAllApiKeysFast (cognitive 101) src/services/apiKeyService.js:1052 — ApiKeyService.getAllApiKeysFast has cognitive complexity 101 (threshold 15). Drivers by points: boolean chains 54, if/else 22 (34 pts), error handling 4 (10 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, name the conditions: bind each compound test to a 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 · selectAccountForApiKey (cognitive 100) · ×1
  • selectAccountForApiKey (cognitive 100) src/services/scheduler/unifiedOpenAIScheduler.js:122 — selectAccountForApiKey has cognitive complexity 100 (threshold 15). Drivers by points: if/else 31 (78 pts), ternaries 3 (15 pts), boolean chains 6, error handling 1 (nesting depth added 59). 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 · (anonymous) (cognitive 97) · ×1
  • (anonymous) (cognitive 97) src/routes/admin/usageStats.js:2286 — (anonymous) has cognitive complexity 97 (threshold 15). Drivers by points: if/else 24 (56 pts), boolean chains 23, loops 7 (16 pts), error handling 1, ternaries 1 (nesting depth added 41). Of this number, 93 points are the body's own statements and 4 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 · WebhookConfigService.validatePlatformConfig (cognitive 96) · ×1
  • WebhookConfigService.validatePlatformConfig (cognitive 96) src/services/webhookConfigService.js:109 — WebhookConfigService.validatePlatformConfig has cognitive complexity 96 (threshold 15). Drivers by points: if/else 33 (76 pts), boolean chains 9, ternaries 3 (8 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 49). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · api.router.post("/v1/messages/count_tokens") (cognitive 94) · ×1
  • api.router.post("/v1/messages/count_tokens") (cognitive 94) REDACTED:1673 — api.router.post("/v1/messages/count_tokens") has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (67 pts), boolean chains 12, error handling 4 (10 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 47). Of this number, 79 points are the body's own statements and 15 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 · (anonymous) (cognitive 94) · ×1
  • (anonymous) (cognitive 94) REDACTED:1673 — (anonymous) has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (67 pts), boolean chains 12, error handling 4 (10 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 47). Of this number, 79 points are the body's own statements and 15 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 · UnifiedClaudeScheduler._isModelSupportedByAccount (cognitive 92) · ×1
  • UnifiedClaudeScheduler._isModelSupportedByAccount (cognitive 92) src/services/scheduler/unifiedClaudeScheduler.js:49 — UnifiedClaudeScheduler._isModelSupportedByAccount has cognitive complexity 92 (threshold 15). Drivers by points: if/else 18 (42 pts), ternaries 9 (39 pts), boolean chains 7, error handling 1 (4 pts) (nesting depth added 57). 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 · handleStreamGenerateContent (cognitive 91) · ×1
  • handleStreamGenerateContent (cognitive 91) REDACTED:1806 — handleStreamGenerateContent has cognitive complexity 91 (threshold 15). Drivers by points: if/else 28 (37 pts), ternaries 10 (21 pts), boolean chains 20, error handling 7 (12 pts), loops 1 (nesting depth added 25). Of this number, 46 points are the body's own statements and 45 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 · recordUsageWithDetails (cognitive 87) · ×1
  • recordUsageWithDetails (cognitive 87) src/services/apiKeyService.js:1862 — recordUsageWithDetails has cognitive complexity 87 (threshold 15). Drivers by points: boolean chains 48, if/else 16 (24 pts), other 8, error handling 5 (6 pts), ternaries 1 (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · selectAccountForApiKey (cognitive 87) · ×1
  • selectAccountForApiKey (cognitive 87) src/services/scheduler/unifiedClaudeScheduler.js:180 — selectAccountForApiKey has cognitive complexity 87 (threshold 15). Drivers by points: if/else 39 (74 pts), boolean chains 11, error handling 1, ternaries 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedClaudeScheduler.selectAccountFromGroup (cognitive 86) · ×1
  • UnifiedClaudeScheduler.selectAccountFromGroup (cognitive 86) src/services/scheduler/unifiedClaudeScheduler.js:1529 — UnifiedClaudeScheduler.selectAccountFromGroup has cognitive complexity 86 (threshold 15). Drivers by points: if/else 27 (70 pts), boolean chains 7, ternaries 3 (7 pts), error handling 1, loops 1 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · handleRequest (cognitive 85) · ×1
  • handleRequest (cognitive 85) REDACTED:43 — handleRequest has cognitive complexity 85 (threshold 15). Drivers by points: if/else 20 (39 pts), error handling 7 (24 pts), boolean chains 16, ternaries 3 (6 pts) (nesting depth added 39). Of this number, 83 points are the body's own statements and 2 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 · BedrockRelayService.handleStreamRequest (cognitive 83) · ×1
  • BedrockRelayService.handleStreamRequest (cognitive 83) src/services/relay/bedrockRelayService.js:243 — BedrockRelayService.handleStreamRequest has cognitive complexity 83 (threshold 15). Drivers by points: if/else 20 (42 pts), ternaries 8 (23 pts), boolean chains 10, error handling 4 (7 pts), loops 1 (nesting depth added 40). Of this number, 80 points are the body's own statements and 3 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 · apiKeys.calculateKeyStats (cognitive 83) · ×1
  • apiKeys.calculateKeyStats (cognitive 83) REDACTED:1073 — apiKeys.calculateKeyStats has cognitive complexity 83 (threshold 15). Drivers by points: if/else 27 (47 pts), boolean chains 25, loops 7 (10 pts), error handling 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 · UnifiedClaudeScheduler._isAccountAvailable (cognitive 82) · ×1
  • UnifiedClaudeScheduler._isAccountAvailable (cognitive 82) src/services/scheduler/unifiedClaudeScheduler.js:1047 — UnifiedClaudeScheduler._isAccountAvailable has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (70 pts), boolean chains 7, error handling 3 (5 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openaiClaudeRoutes.handleChatCompletion (cognitive 81) · ×1
  • openaiClaudeRoutes.handleChatCompletion (cognitive 81) REDACTED:186 — openaiClaudeRoutes.handleChatCompletion has cognitive complexity 81 (threshold 15). Drivers by points: if/else 24 (44 pts), boolean chains 33, error handling 3 (4 pts) (nesting depth added 21). Of this number, 52 points are the body's own statements and 29 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 · (anonymous) (cognitive 81) · ×1
  • (anonymous) (cognitive 81) REDACTED:1472 — (anonymous) has cognitive complexity 81 (threshold 15). Drivers by points: boolean chains 40, if/else 28 (33 pts), ternaries 5 (7 pts), error handling 1 (nesting depth added 7). Of this number, 80 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.
D2 · Cognitive Complexity · updateAccount (cognitive 81) · ×1
  • updateAccount (cognitive 81) src/services/account/claudeAccountService.js:740 — updateAccount has cognitive complexity 81 (threshold 15). Drivers by points: if/else 23 (40 pts), ternaries 7 (28 pts), boolean chains 9, error handling 2 (3 pts), loops 1 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · backfillSingleKey (cognitive 75) · ×1
  • backfillSingleKey (cognitive 75) src/services/weeklyClaudeCostInitService.js:309 — backfillSingleKey has cognitive complexity 75 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 16, loops 5 (11 pts), ternaries 2 (8 pts), error handling 3 (7 pts), other 1 (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 · ClaudeRelayService.relayStreamRequestWithUsageCapture (cognitive 74) · ×1
  • ClaudeRelayService.relayStreamRequestWithUsageCapture (cognitive 74) REDACTED:1883 — ClaudeRelayService.relayStreamRequestWithUsageCapture has cognitive complexity 74 (threshold 15). Drivers by points: if/else 18 (31 pts), ternaries 9 (25 pts), boolean chains 12, error handling 4 (6 pts) (nesting depth added 31). Of this number, 68 points are the body's own statements and 6 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 · convertAnthropicToolsToGeminiTools · ×1
  • convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations (cognitive 74) src/services/anthropicGeminiBridgeService.js:779 — convertAnthropicToolsToGeminiTools::sanitizeSchemaForFunctionDeclarations has cognitive complexity 74 (threshold 15). Drivers by points: if/else 27 (58 pts), boolean chains 11, loops 2 (5 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiHandlers.handleStandardStreamGenerateContent (cognitive 73) · ×1
  • geminiHandlers.handleStandardStreamGenerateContent (cognitive 73) REDACTED:2506 — geminiHandlers.handleStandardStreamGenerateContent has cognitive complexity 73 (threshold 15). Drivers by points: if/else 48 (70 pts), boolean chains 27, error handling 8 (15 pts), ternaries 5 (8 pts), loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock) 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 · UnifiedOpenAIScheduler._getAllAvailableAccounts (cognitive 73) · ×1
  • UnifiedOpenAIScheduler._getAllAvailableAccounts (cognitive 73) src/services/scheduler/unifiedOpenAIScheduler.js:356 — UnifiedOpenAIScheduler._getAllAvailableAccounts has cognitive complexity 73 (threshold 15). Drivers by points: if/else 18 (54 pts), boolean chains 13, error handling 1 (4 pts), loops 2 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · apiKeys.router.post("/api-keys") (cognitive 72) · ×1
  • apiKeys.router.post("/api-keys") (cognitive 72) REDACTED:1472 — apiKeys.router.post("/api-keys") has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (33 pts), boolean chains 31, ternaries 5 (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.
D2 · Cognitive Complexity · DroidRelayService._handleStreamRequest (cognitive 72) · ×1
  • DroidRelayService._handleStreamRequest (cognitive 72) src/services/relay/droidRelayService.js:415 — DroidRelayService._handleStreamRequest has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (52 pts), boolean chains 20 (nesting depth added 24). None of this is in the body itself: all 72 points belong to 10 function literals inside it that branch (lines 464, 542, 622, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · (anonymous) (cognitive 72) · ×1
  • (anonymous) (cognitive 72) REDACTED:38 — (anonymous) has cognitive complexity 72 (threshold 15). Drivers by points: if/else 40 (49 pts), boolean chains 17, error handling 2 (3 pts), ternaries 1 (2 pts), other 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · claudeRelayConfig.router.put("/claude-relay-config") (cognitive 71) · ×1
  • claudeRelayConfig.router.put("/claude-relay-config") (cognitive 71) REDACTED:38 — claudeRelayConfig.router.put("/claude-relay-config") has cognitive complexity 71 (threshold 15). Drivers by points: if/else 40 (49 pts), boolean chains 17, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · relayStreamRequestWithUsageCapture (cognitive 71) · ×1
  • relayStreamRequestWithUsageCapture (cognitive 71) src/services/relay/ccrRelayService.js:373 — relayStreamRequestWithUsageCapture has cognitive complexity 71 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 7 (22 pts), boolean chains 13, error handling 4 (10 pts) (nesting depth added 33). Of this number, 67 points are the body's own statements and 4 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 · buildRequestFromOpenAI (cognitive 70) · ×1
  • buildRequestFromOpenAI (cognitive 70) src/services/codexToOpenAI.js:393 — buildRequestFromOpenAI has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 6 (13 pts), boolean chains 10, ternaries 2 (9 pts), match/switch 1 (2 pts), other 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openaiAccounts.router.put("/ · ×1
  • openaiAccounts.router.put("/:id") (cognitive 69) REDACTED:479 — openaiAccounts.router.put("/:id") has cognitive complexity 69 (threshold 15). Drivers by points: if/else 28 (50 pts), boolean chains 14, error handling 3 (5 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 · relayStreamRequestWithUsageCapture (cognitive 68) · ×1
  • relayStreamRequestWithUsageCapture (cognitive 68) REDACTED:491 — relayStreamRequestWithUsageCapture has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (24 pts), ternaries 7 (22 pts), boolean chains 13, error handling 5 (9 pts) (nesting depth added 27). Of this number, 62 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · webhook.router.post("/test") (cognitive 67) · ×1
  • webhook.router.post("/test") (cognitive 67) REDACTED:116 — webhook.router.post("/test") has cognitive complexity 67 (threshold 15). Drivers by points: if/else 25 (40 pts), error handling 5 (12 pts), ternaries 5 (10 pts), boolean chains 5 (nesting depth added 27). Of this number, 61 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 66) · ×1
  • (anonymous) (cognitive 66) REDACTED:116 — (anonymous) has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (40 pts), error handling 5 (12 pts), ternaries 5 (10 pts), boolean chains 4 (nesting depth added 27). Of this number, 60 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts (cognitive 65) · ×1
  • ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts (cognitive 65) src/services/account/claudeAccountService.js:3275 — ClaudeAccountService.checkAndRecoverFiveHourStoppedAccounts has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (41 pts), error handling 3 (9 pts), ternaries 2 (8 pts), boolean chains 6, loops 1 (nesting depth added 40). 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 · geminiHandlers.handleStandardGenerateContent (cognitive 65) · ×1
  • geminiHandlers.handleStandardGenerateContent (cognitive 65) REDACTED:2212 — geminiHandlers.handleStandardGenerateContent has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 16, error handling 4 (8 pts), ternaries 3 (6 pts) (nesting depth added 19). Of this number, 64 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 · (anonymous) (cognitive 65) · ×1
  • (anonymous) (cognitive 65) REDACTED:479 — (anonymous) has cognitive complexity 65 (threshold 15). Drivers by points: if/else 28 (50 pts), boolean chains 8, error handling 3 (5 pts), ternaries 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 · initialize (cognitive 64) · ×1
  • initialize (cognitive 64) REDACTED:50 — initialize has cognitive complexity 64 (threshold 15). Drivers by points: if/else 26 (38 pts), error handling 12 (17 pts), boolean chains 9 (nesting depth added 17). Of this number, 23 points are the body's own statements and 41 belong to 16 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 · calculateCost (cognitive 64) · ×1
  • calculateCost (cognitive 64) src/services/pricingService.js:513 — calculateCost has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 31, if/else 15 (19 pts), ternaries 10 (14 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ApiKeyService.getAllApiKeys (cognitive 63) · ×1
  • ApiKeyService.getAllApiKeys (cognitive 63) src/services/apiKeyService.js:867 — ApiKeyService.getAllApiKeys has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 27, if/else 14 (26 pts), error handling 5 (9 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionHelper.generateSessionHash (cognitive 63) · ×1
  • SessionHelper.generateSessionHash (cognitive 63) src/utils/sessionHelper.js:12 — SessionHelper.generateSessionHash has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 12, loops 4 (9 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 · refreshAccountToken (cognitive 63) · ×1
  • refreshAccountToken (cognitive 63) REDACTED:271 — refreshAccountToken has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 9, error handling 4 (8 pts), ternaries 1 (2 pts) (nesting depth added 30). 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 · migrateUsageIndex (cognitive 59) · ×1
  • migrateUsageIndex (cognitive 59) REDACTED:202 — migrateUsageIndex has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 18 (24 pts), boolean chains 3, error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · batchGetAccountGroupsByIndex (cognitive 59) · ×1
  • batchGetAccountGroupsByIndex (cognitive 59) src/services/accountGroupService.js:521 — batchGetAccountGroupsByIndex has cognitive complexity 59 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 4 (12 pts), loops 7 (12 pts), ternaries 3 (8 pts), boolean chains 6 (nesting depth added 29). Of this number, 57 points are the body's own statements and 2 belong to 8 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 · anthropicGeminiBridgeService.normalizeAnthropicMessages (cognitive 58) · ×1
  • anthropicGeminiBridgeService.normalizeAnthropicMessages (cognitive 58) src/services/anthropicGeminiBridgeService.js:568 — anthropicGeminiBridgeService.normalizeAnthropicMessages has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (45 pts), boolean chains 10, loops 3 (nesting depth added 20). Of this number, 31 points are the body's own statements and 27 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedGeminiScheduler.selectAccountFromGroup (cognitive 57) · ×1
  • UnifiedGeminiScheduler.selectAccountFromGroup (cognitive 57) src/services/scheduler/unifiedGeminiScheduler.js:699 — UnifiedGeminiScheduler.selectAccountFromGroup has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (50 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 28). 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 · DroidRelayService._processRequestBody (cognitive 57) · ×1
  • DroidRelayService._processRequestBody (cognitive 57) src/services/relay/droidRelayService.js:1135 — DroidRelayService._processRequestBody has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (45 pts), boolean chains 12 (nesting depth added 23). Of this number, 54 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 · getAllAccounts (cognitive 56) · ×1
  • getAllAccounts (cognitive 56) src/services/account/geminiApiAccountService.js:201 — getAllAccounts has cognitive complexity 56 (threshold 15). Drivers by points: if/else 7 (24 pts), error handling 2 (12 pts), boolean chains 9, ternaries 2 (9 pts), loops 2 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · relayRequest (cognitive 56) · ×1
  • relayRequest (cognitive 56) src/services/relay/droidRelayService.js:184 — relayRequest has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 16, error handling 4 (10 pts), ternaries 5 (6 pts) (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · handleGenerateContent (cognitive 55) · ×1
  • handleGenerateContent (cognitive 55) REDACTED:1563 — handleGenerateContent has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 14, if/else 12 (14 pts), error handling 3 (5 pts) (nesting depth added 15). Of this number, 52 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 · (anonymous) (cognitive 55) · ×1
  • (anonymous) (cognitive 55) src/routes/admin/usageStats.js:247 — (anonymous) has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 25, if/else 10 (17 pts), ternaries 7 (8 pts), error handling 2, loops 2, match/switch 1 (nesting depth added 8). Of this number, 40 points are the body's own statements and 15 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.
D2 · Cognitive Complexity · handleStreamResponse (cognitive 54) · ×1
  • handleStreamResponse (cognitive 54) src/services/relay/geminiRelayService.js:109 — handleStreamResponse has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (33 pts), error handling 4 (11 pts), boolean chains 7, 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 · selectAccountFromGroup (cognitive 54) · ×1
  • selectAccountFromGroup (cognitive 54) src/services/scheduler/unifiedOpenAIScheduler.js:818 — selectAccountFromGroup has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 8, error handling 1, loops 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 53) · ×1
  • (anonymous) (cognitive 53) REDACTED:177 — (anonymous) has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 9, ternaries 6 (9 pts), error handling 2 (3 pts), loops 1 (nesting depth added 18). Of this number, 49 points are the body's own statements and 4 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RedisClient.getAccountSessionWindowUsage (cognitive 51) · ×1
  • RedisClient.getAccountSessionWindowUsage (cognitive 51) REDACTED:3892 — RedisClient.getAccountSessionWindowUsage has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 16, loops 4 (5 pts), error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedGeminiScheduler.selectAccountForApiKey (cognitive 51) · ×1
  • UnifiedGeminiScheduler.selectAccountForApiKey (cognitive 51) src/services/scheduler/unifiedGeminiScheduler.js:55 — UnifiedGeminiScheduler.selectAccountForApiKey has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (37 pts), ternaries 3 (10 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · selectAccountForApiKey (cognitive 51) · ×1
  • selectAccountForApiKey (cognitive 51) src/services/account/claudeAccountService.js:1072 — selectAccountForApiKey has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 8, error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 18). Of this number, 35 points are the body's own statements and 16 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 · CostInitService.initializeApiKeyCosts (cognitive 50) · ×1
  • CostInitService.initializeApiKeyCosts (cognitive 50) src/services/costInitService.js:140 — CostInitService.initializeApiKeyCosts has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 9 (13 pts), boolean chains 11 (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 · generateApiKey (cognitive 50) · ×1
  • generateApiKey (cognitive 50) src/services/apiKeyService.js:176 — generateApiKey has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 39, other 5, ternaries 3, error handling 2, if/else 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 · apiStats.router.post("/api/user-model-stats") (cognitive 49) · ×1
  • apiStats.router.post("/api/user-model-stats") (cognitive 49) REDACTED:1319 — apiStats.router.post("/api/user-model-stats") has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 19, ternaries 1 (3 pts), error handling 1, 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 · validateApiKey (cognitive 49) · ×1
  • validateApiKey (cognitive 49) src/services/apiKeyService.js:360 — validateApiKey has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 23, if/else 12 (14 pts), error handling 6 (7 pts), ternaries 5 (nesting depth added 3). Of this number, 46 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · apiKeys.router.get("/api-keys") (cognitive 48) · ×1
  • apiKeys.router.get("/api-keys") (cognitive 48) REDACTED:177 — apiKeys.router.get("/api-keys") has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 9, ternaries 5 (6 pts), error handling 1, loops 1 (nesting depth added 15). Of this number, 46 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 · openaiAccounts.router.post("/") (cognitive 48) · ×1
  • openaiAccounts.router.post("/") (cognitive 48) REDACTED:320 — openaiAccounts.router.post("/") has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 12, error handling 3 (5 pts), 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 · (anonymous) (cognitive 48) · ×1
  • (anonymous) (cognitive 48) REDACTED:320 — (anonymous) has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 12, error handling 3 (5 pts), 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 · handleAzureOpenAIRequest (cognitive 47) · ×1
  • handleAzureOpenAIRequest (cognitive 47) src/services/relay/azureOpenaiRelayService.js:16 — handleAzureOpenAIRequest has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 17, error handling 2 (4 pts), ternaries 2 (4 pts) (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 · requestDetailHelper.sanitizeValue (cognitive 46) · ×1
  • requestDetailHelper.sanitizeValue (cognitive 46) REDACTED:385 — requestDetailHelper.sanitizeValue has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 3, ternaries 1 (3 pts), loops 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 · GeminiToOpenAIConverter._convertGeminiChunkToOpenAI (cognitive 46) · ×1
  • GeminiToOpenAIConverter._convertGeminiChunkToOpenAI (cognitive 46) src/services/geminiToOpenAI.js:198 — GeminiToOpenAIConverter._convertGeminiChunkToOpenAI has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 9, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azureOpenaiRelayService.extractUsageDataRobust (cognitive 46) · ×1
  • azureOpenaiRelayService.extractUsageDataRobust (cognitive 46) src/services/relay/azureOpenaiRelayService.js:620 — azureOpenaiRelayService.extractUsageDataRobust has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 12, loops 2 (5 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 17). Of this number, 26 points are the body's own statements and 20 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 · getApiKeysPaginated (cognitive 46) · ×1
  • getApiKeysPaginated (cognitive 46) REDACTED:856 — getApiKeysPaginated has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 13 (14 pts), boolean chains 10, error handling 1 (2 pts), loops 1 (nesting depth added 11). Of this number, 22 points are the body's own statements and 24 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · handleStreamResponse · ×1
  • handleStreamResponse::(anonymous)::parseSSEForUsage (cognitive 46) src/services/relay/azureOpenaiRelayService.js:322 — handleStreamResponse::(anonymous)::parseSSEForUsage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (36 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 30). 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 · antigravityClient.normalizeAntigravityEnvelope (cognitive 45) · ×1
  • antigravityClient.normalizeAntigravityEnvelope (cognitive 45) src/services/antigravityClient.js:188 — antigravityClient.normalizeAntigravityEnvelope has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 10, ternaries 3 (8 pts), error handling 1 (4 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuotaCardService.redeemCard (cognitive 45) · ×1
  • QuotaCardService.redeemCard (cognitive 45) src/services/quotaCardService.js:293 — QuotaCardService.redeemCard has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 13, match/switch 1 (2 pts), ternaries 1 (2 pts), 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 · updateAccount (cognitive 45) · ×1
  • updateAccount (cognitive 45) REDACTED:602 — updateAccount has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 9, ternaries 4 (8 pts), error handling 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · apiStats.router.post("/api/batch-stats") (cognitive 44) · ×1
  • apiStats.router.post("/api/batch-stats") (cognitive 44) REDACTED:590 — apiStats.router.post("/api/batch-stats") has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 30, if/else 8 (9 pts), ternaries 2 (3 pts), error handling 2 (nesting depth added 2). Most of this is not in the body itself: 6 of the 44 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 713, 658, 697). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · convertMessagesToGemini (cognitive 44) · ×1
  • convertMessagesToGemini (cognitive 44) REDACTED:40 — convertMessagesToGemini has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (nesting depth added 17). Most of this is not in the body itself: 8 of the 44 points are its own statements and the rest belongs to 3 function items inside it that branch (extractTextContent, a function literal at line 59, a function literal at line 98). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · _handle429Error (cognitive 44) · ×1
  • _handle429Error (cognitive 44) REDACTED:804 — _handle429Error has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (21 pts), error handling 4 (11 pts), boolean chains 7, loops 1 (3 pts), ternaries 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openaiAccountService.refreshAccessToken (cognitive 43) · ×1
  • openaiAccountService.refreshAccessToken (cognitive 43) REDACTED:117 — openaiAccountService.refreshAccessToken has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 8, error handling 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 · DroidRelayService._parseOpenAIUsageFromSSE (cognitive 43) · ×1
  • DroidRelayService._parseOpenAIUsageFromSSE (cognitive 43) src/services/relay/droidRelayService.js:756 — DroidRelayService._parseOpenAIUsageFromSSE has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 15, error handling 2 (4 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 · ClaudeRelayService._processRequestBody (cognitive 42) · ×1
  • ClaudeRelayService._processRequestBody (cognitive 42) REDACTED:1196 — ClaudeRelayService._processRequestBody has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 11, ternaries 1 (nesting depth added 12). Of this number, 40 points are the body's own statements and 2 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 · dashboard.router.get("/model-stats") (cognitive 42) · ×1
  • dashboard.router.get("/model-stats") (cognitive 42) REDACTED:407 — dashboard.router.get("/model-stats") has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (14 pts), ternaries 3 (6 pts), loops 4 (5 pts), error handling 1 (nesting depth added 9). Of this number, 38 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 · dashboard.useDashboardStore.loadDashboardData (cognitive 42) · ×1
  • dashboard.useDashboardStore.loadDashboardData (cognitive 42) web/admin-spa/src/stores/dashboard.js:235 — dashboard.useDashboardStore.loadDashboardData has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 38, if/else 3, 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 · updateIndex (cognitive 41) · ×1
  • updateIndex (cognitive 41) src/services/apiKeyIndexService.js:305 — updateIndex has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 8, ternaries 3 (6 pts), loops 3 (5 pts), other 2, 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 · (anonymous) (cognitive 41) · ×1
  • (anonymous) (cognitive 41) REDACTED:144 — (anonymous) has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 16, if/else 4 (8 pts), loops 7 (8 pts), ternaries 4 (8 pts), error handling 1 (nesting depth added 9). Of this number, 28 points are the body's own statements and 13 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 · createAccount (cognitive 41) · ×1
  • createAccount (cognitive 41) REDACTED:444 — createAccount has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 17, ternaries 10 (16 pts), if/else 5 (6 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _makeClaudeStreamRequestWithUsageCapture · ×1
  • _makeClaudeStreamRequestWithUsageCapture::(anonymous)::(anonymous)::handleErrorResponse (cognitive 41) REDACTED:2475 — _makeClaudeStreamRequestWithUsageCapture::(anonymous)::(anonymous)::handleErrorResponse has cognitive complexity 41 (threshold 15). Drivers by points: error handling 7 (20 pts), if/else 11 (17 pts), ternaries 1 (3 pts), boolean chains 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 · antigravityRelayService.handleStreamResponse (cognitive 40) · ×1
  • antigravityRelayService.handleStreamResponse (cognitive 40) src/services/relay/antigravityRelayService.js:32 — antigravityRelayService.handleStreamResponse has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 9, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getOpenAIAuthToken (cognitive 40) · ×1
  • getOpenAIAuthToken (cognitive 40) REDACTED:178 — getOpenAIAuthToken has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 4 (11 pts), ternaries 3 (7 pts), boolean chains 3 (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 · RedisClient.getKeyIdsWithModels (cognitive 39) · ×1
  • RedisClient.getKeyIdsWithModels (cognitive 39) REDACTED:1584 — RedisClient.getKeyIdsWithModels has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 8 (17 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _scanTagsFallback (cognitive 39) · ×1
  • _scanTagsFallback (cognitive 39) REDACTED:681 — _scanTagsFallback has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (10 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 21). 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 · createAccount (cognitive 39) · ×1
  • createAccount (cognitive 39) src/services/account/claudeAccountService.js:81 — createAccount has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 13 (24 pts), boolean chains 6, if/else 5 (6 pts), error handling 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · refreshAccessToken (cognitive 39) · ×1
  • refreshAccessToken (cognitive 39) REDACTED:1213 — refreshAccessToken has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 16, if/else 10 (16 pts), ternaries 4 (6 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 · logger.safeStringify (cognitive 38) · ×1
  • logger.safeStringify (cognitive 38) REDACTED:10 — logger.safeStringify has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (30 pts), ternaries 4 (13 pts), loops 3 (8 pts), boolean chains 5, error handling 3 (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. This shape REPEATS in the file: one other method here (logger.safeStringify::replacer) 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 · AccountNameCacheService.refresh (cognitive 38) · ×1
  • AccountNameCacheService.refresh (cognitive 38) src/services/accountNameCacheService.js:41 — AccountNameCacheService.refresh has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 14 (16 pts), if/else 6 (11 pts), boolean chains 5, error handling 3, loops 2 (3 pts) (nesting depth added 8). Of this number, 27 points are the body's own statements and 11 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 · apiStats.router.post("/api/batch-model-stats") (cognitive 38) · ×1
  • apiStats.router.post("/api/batch-model-stats") (cognitive 38) REDACTED:791 — apiStats.router.post("/api/batch-model-stats") has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 16, if/else 8 (16 pts), ternaries 2 (3 pts), loops 2, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 12 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 820). 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 · rebuildIndexes (cognitive 38) · ×1
  • rebuildIndexes (cognitive 38) src/services/apiKeyIndexService.js:146 — rebuildIndexes has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (9 pts), ternaries 3 (9 pts), boolean chains 5, error handling 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 · refreshAccountToken (cognitive 38) · ×1
  • refreshAccountToken (cognitive 38) src/services/account/claudeAccountService.js:263 — refreshAccountToken has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (20 pts), error handling 4 (11 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateAccount (cognitive 38) · ×1
  • updateAccount (cognitive 38) src/services/account/claudeConsoleAccountService.js:299 — updateAccount has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 4, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BedrockRelayService.handleNonStreamRequest (cognitive 37) · ×1
  • BedrockRelayService.handleNonStreamRequest (cognitive 37) src/services/relay/bedrockRelayService.js:108 — BedrockRelayService.handleNonStreamRequest has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 6 (9 pts), boolean chains 5, error handling 3 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · waitForConcurrencySlot (cognitive 37) · ×1
  • waitForConcurrencySlot (cognitive 37) REDACTED:248 — waitForConcurrencySlot has cognitive complexity 37 (threshold 15). Drivers by points: error handling 10 (23 pts), if/else 7 (11 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · sanitizeMaxTokens (cognitive 37) · ×1
  • sanitizeMaxTokens (cognitive 37) REDACTED:457 — sanitizeMaxTokens has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, error handling 4 (6 pts), loops 1, ternaries 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 11 function items inside it that branch (a function literal at line 460, a function literal at line 559, a function literal at line 533, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · _handleStreamRequest · ×1
  • _handleStreamRequest::(anonymous)::handleStreamError (cognitive 37) src/services/relay/droidRelayService.js:464 — _handleStreamRequest::(anonymous)::handleStreamError has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 8 (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 · geminiApiAccounts.router.post("/gemini-api-accounts/ · ×1
  • geminiApiAccounts.router.post("/gemini-api-accounts/:accountId/test") (cognitive 36) REDACTED:460 — geminiApiAccounts.router.post("/gemini-api-accounts/:accountId/test") has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, error handling 4 (6 pts), loops 1 (nesting depth added 10). Most of this is not in the body itself: 15 of the 36 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 559, a function literal at line 533, safeWrite, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · validateApiKeyForStats (cognitive 36) · ×1
  • validateApiKeyForStats (cognitive 36) src/services/apiKeyService.js:559 — validateApiKeyForStats has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 20, if/else 6 (7 pts), error handling 5 (6 pts), ternaries 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.
D2 · Cognitive Complexity · createAccount (cognitive 36) · ×1
  • createAccount (cognitive 36) REDACTED:437 — createAccount has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 19, ternaries 12 (14 pts), if/else 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.
D2 · Cognitive Complexity · openaiAccountService.getAllAccounts (cognitive 35) · ×1
  • openaiAccountService.getAllAccounts (cognitive 35) REDACTED:682 — openaiAccountService.getAllAccounts has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 3 (8 pts), boolean chains 4, error handling 1 (4 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 · RedisClient.batchGetAccountDailyCost (cognitive 35) · ×1
  • RedisClient.batchGetAccountDailyCost (cognitive 35) REDACTED:2021 — RedisClient.batchGetAccountDailyCost has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 10, loops 5 (7 pts), error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DroidScheduler.selectAccount (cognitive 35) · ×1
  • DroidScheduler.selectAccount (cognitive 35) src/services/scheduler/droidScheduler.js:97 — DroidScheduler.selectAccount has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 10). Of this number, 32 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateRateLimitCounters (cognitive 35) · ×1
  • updateRateLimitCounters (cognitive 35) src/utils/rateLimitHelper.js:12 — updateRateLimitCounters has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 11, error handling 3 (8 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 · (anonymous) (cognitive 35) · ×1
  • (anonymous) (cognitive 35) REDACTED:407 — (anonymous) has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 9, ternaries 3 (6 pts), loops 4 (5 pts), error handling 1 (nesting depth added 9). Of this number, 31 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 · buildAntigravityQuota (cognitive 35) · ×1
  • buildAntigravityQuota (cognitive 35) src/services/balanceProviders/geminiBalanceProvider.js:61 — buildAntigravityQuota has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 11, ternaries 5 (6 pts), other 2, loops 1 (nesting depth added 5). Of this number, 24 points are the body's own statements and 11 belong to 5 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 · ApiKeyService._resolveAccountByUsageRecord (cognitive 34) · ×1
  • ApiKeyService._resolveAccountByUsageRecord (cognitive 34) src/services/apiKeyService.js:2222 — ApiKeyService._resolveAccountByUsageRecord has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 11, loops 2 (3 pts) (nesting depth added 7). Of this number, 32 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 · ClaudeRelayService._enforceCacheControlLimit (cognitive 34) · ×1
  • ClaudeRelayService._enforceCacheControlLimit (cognitive 34) REDACTED:1466 — ClaudeRelayService._enforceCacheControlLimit has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 7, loops 4 (5 pts) (nesting depth added 10). Most of this is not in the body itself: 7 of the 34 points are its own statements and the rest belongs to 6 function items inside it that branch (removeCacheControlFromMessages, removeCacheControlFromSystem, countCacheControlBlocks, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · warmupInterceptor.isWarmupRequest (cognitive 34) · ×1
  • warmupInterceptor.isWarmupRequest (cognitive 34) src/utils/warmupInterceptor.js:15 — warmupInterceptor.isWarmupRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (6 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 · anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent (cognitive 34) · ×1
  • anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent (cognitive 34) src/services/anthropicGeminiBridgeService.js:1623 — anthropicGeminiBridgeService.convertGeminiPayloadToAnthropicContent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 9, ternaries 4 (8 pts), loops 1 (nesting depth added 10). Of this number, 23 points are the body's own statements and 11 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 · geminiHandlers.buildGeminiApiUrl (cognitive 34) · ×1
  • geminiHandlers.buildGeminiApiUrl (cognitive 34) REDACTED:88 — geminiHandlers.buildGeminiApiUrl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 4 (11 pts), boolean chains 4 (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 · OpenAIResponsesRelayService._handleStreamResponse · ×1
  • OpenAIResponsesRelayService._handleStreamResponse::parseSSEForUsage (cognitive 34) REDACTED:499 — OpenAIResponsesRelayService._handleStreamResponse::parseSSEForUsage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (28 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (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 · claudeConsoleAccounts.router.put("/claude-console-accounts/ · ×1
  • claudeConsoleAccounts.router.put("/claude-console-accounts/:accountId") (cognitive 34) REDACTED:211 — claudeConsoleAccounts.router.put("/claude-console-accounts/:accountId") has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 8, loops 1 (3 pts), error handling 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 · azureOpenaiRoutes.router.post("/chat/completions") (cognitive 34) · ×1
  • azureOpenaiRoutes.router.post("/chat/completions") (cognitive 34) REDACTED:161 — azureOpenaiRoutes.router.post("/chat/completions") has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). Of this number, 31 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. This shape REPEATS in the file: one other method here (azureOpenaiRoutes.router.post("/responses")) 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 · azureOpenaiRoutes.router.post("/responses") (cognitive 34) · ×1
  • azureOpenaiRoutes.router.post("/responses") (cognitive 34) REDACTED:292 — azureOpenaiRoutes.router.post("/responses") has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). Of this number, 31 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. This shape REPEATS in the file: one other method here (azureOpenaiRoutes.router.post("/chat/completions")) 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 · _normalizeExtInfo (cognitive 34) · ×1
  • _normalizeExtInfo (cognitive 34) src/services/account/claudeAccountService.js:3456 — _normalizeExtInfo has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiToOpenAIConverter.convertResponse (cognitive 33) · ×1
  • GeminiToOpenAIConverter.convertResponse (cognitive 33) src/services/geminiToOpenAI.js:97 — GeminiToOpenAIConverter.convertResponse has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 5 of the 33 points are its own statements and the rest belongs 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 · GrokScheduler.selectAccount (cognitive 33) · ×1
  • GrokScheduler.selectAccount (cognitive 33) src/services/scheduler/grokScheduler.js:69 — GrokScheduler.selectAccount has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 10). Of this number, 29 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 · request · ×1
  • request::attemptRequest (cognitive 33) src/services/antigravityClient.js:366 — request::attemptRequest has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (11 pts), boolean chains 5, error handling 2 (4 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 · (anonymous) (cognitive 33) · ×1
  • (anonymous) (cognitive 33) REDACTED:24 — (anonymous) has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 14, ternaries 4 (8 pts), if/else 5 (7 pts), loops 3, error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 17 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 · updateSessionWindowStatus (cognitive 33) · ×1
  • updateSessionWindowStatus (cognitive 33) src/services/account/claudeAccountService.js:3049 — updateSessionWindowStatus has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, error handling 2 (5 pts), ternaries 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sendGeminiRequest (cognitive 33) · ×1
  • sendGeminiRequest (cognitive 33) src/services/relay/geminiRelayService.js:229 — sendGeminiRequest has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 9, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiAccountService.getAllAccounts (cognitive 32) · ×1
  • geminiAccountService.getAllAccounts (cognitive 32) REDACTED:774 — geminiAccountService.getAllAccounts has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 2 (5 pts), boolean chains 4, error handling 1 (4 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · unified.routeToBackend (cognitive 32) · ×1
  • unified.routeToBackend (cognitive 32) REDACTED:115 — unified.routeToBackend has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 8 (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 · dashboard.router.get("/dashboard") (cognitive 32) · ×1
  • dashboard.router.get("/dashboard") (cognitive 32) REDACTED:23 — dashboard.router.get("/dashboard") has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 21, ternaries 4 (7 pts), loops 3 (4 pts), error handling 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. This shape REPEATS in the file: one other method here (dashboard.router.get("/dashboard")::countAccountStats) 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 · (anonymous) (cognitive 32) · ×1
  • (anonymous) (cognitive 32) REDACTED:139 — (anonymous) has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (7 pts), ternaries 3 (6 pts), loops 3, error handling 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 12 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 · selectAvailableAccount (cognitive 32) · ×1
  • selectAvailableAccount (cognitive 32) src/services/account/claudeAccountService.js:969 — selectAvailableAccount has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, error handling 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 13). Of this number, 18 points are the body's own statements and 14 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · anthropicGeminiBridgeService.summarizeAntigravityRequestForDebug (cognitive 31) · ×1
  • anthropicGeminiBridgeService.summarizeAntigravityRequestForDebug (cognitive 31) src/services/anthropicGeminiBridgeService.js:407 — anthropicGeminiBridgeService.summarizeAntigravityRequestForDebug has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (22 pts), ternaries 3 (4 pts), loops 2 (3 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 · apiStats.router.post("/api-key/test-openai") (cognitive 31) · ×1
  • apiStats.router.post("/api-key/test-openai") (cognitive 31) REDACTED:1165 — apiStats.router.post("/api-key/test-openai") has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, error handling 4 (6 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1258, 1238). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · _getAccountBalanceForAccount (cognitive 31) · ×1
  • _getAccountBalanceForAccount (cognitive 31) src/services/account/accountBalanceService.js:283 — _getAccountBalanceForAccount has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 12, other 2, ternaries 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 · requestDetailHelper.extractPreviewReasoningInfo (cognitive 30) · ×1
  • requestDetailHelper.extractPreviewReasoningInfo (cognitive 30) REDACTED:289 — requestDetailHelper.extractPreviewReasoningInfo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 2 (7 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · anthropicGeminiBridgeService.canEnableAntigravityThinking (cognitive 30) · ×1
  • anthropicGeminiBridgeService.canEnableAntigravityThinking (cognitive 30) src/services/anthropicGeminiBridgeService.js:1221 — anthropicGeminiBridgeService.canEnableAntigravityThinking has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 10, loops 3 (4 pts) (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exchangeCodeForTokens (cognitive 30) · ×1
  • exchangeCodeForTokens (cognitive 30) src/utils/oauthHelper.js:156 — exchangeCodeForTokens has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, ternaries 2, error handling 1, other 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 · exchangeSetupTokenCode (cognitive 30) · ×1
  • exchangeSetupTokenCode (cognitive 30) src/utils/oauthHelper.js:375 — exchangeSetupTokenCode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, ternaries 2, error handling 1, other 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 · (anonymous) (cognitive 30) · ×1
  • (anonymous) (cognitive 30) REDACTED:351 — (anonymous) has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 11, error handling 3 (4 pts), ternaries 1 (nesting depth added 4). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · createAccount (cognitive 30) · ×1
  • createAccount (cognitive 30) src/services/account/grokAccountService.js:71 — createAccount has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 17, if/else 4 (6 pts), ternaries 6, other 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · geminiAccountService.fetchAvailableModelsAntigravity (cognitive 29) · ×1
  • geminiAccountService.fetchAvailableModelsAntigravity (cognitive 29) REDACTED:97 — geminiAccountService.fetchAvailableModelsAntigravity has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 11). Of this number, 24 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 · errorSanitizer.mapToErrorCode (cognitive 29) · ×1
  • errorSanitizer.mapToErrorCode (cognitive 29) src/utils/errorSanitizer.js:75 — errorSanitizer.mapToErrorCode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ClaudeCodeValidator.hasClaudeCodeSystemPrompt (cognitive 29) · ×1
  • ClaudeCodeValidator.hasClaudeCodeSystemPrompt (cognitive 29) src/validators/clients/claudeCodeValidator.js:51 — ClaudeCodeValidator.hasClaudeCodeSystemPrompt has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 7 (10 pts), boolean chains 6, 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 · CodexToOpenAIConverter.convertResponse (cognitive 29) · ×1
  • CodexToOpenAIConverter.convertResponse (cognitive 29) src/services/codexToOpenAI.js:84 — CodexToOpenAIConverter.convertResponse has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (13 pts), ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · apiKeys.router.get("/accounts/binding-counts") (cognitive 29) · ×1
  • apiKeys.router.get("/accounts/binding-counts") (cognitive 29) REDACTED:860 — apiKeys.router.get("/accounts/binding-counts") has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grokAccounts.router.post("/grok-accounts/ · ×1
  • grokAccounts.router.post("/grok-accounts/:accountId/test") (cognitive 29) REDACTED:412 — grokAccounts.router.post("/grok-accounts/:accountId/test") has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (6 pts), boolean chains 3, error handling 1, ternaries 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 · updateApiKey (cognitive 29) · ×1
  • updateApiKey (cognitive 29) src/services/apiKeyService.js:1328 — updateApiKey has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, ternaries 2 (8 pts), error handling 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 · (anonymous) (cognitive 29) · ×1
  • (anonymous) (cognitive 29) REDACTED:860 — (anonymous) has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · selectAvailableAccount (cognitive 29) · ×1
  • selectAvailableAccount (cognitive 29) REDACTED:829 — selectAvailableAccount has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 9). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiAccountService.selectAvailableAccount (cognitive 28) · ×1
  • geminiAccountService.selectAvailableAccount (cognitive 28) REDACTED:849 — geminiAccountService.selectAvailableAccount has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 9). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RedisClient.getAccountUsageStats (cognitive 28) · ×1
  • RedisClient.getAccountUsageStats (cognitive 28) REDACTED:2338 — RedisClient.getAccountUsageStats has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 10, ternaries 1 (nesting depth added 6). Of this number, 20 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 · RedisClient.getTodayStats (cognitive 28) · ×1
  • RedisClient.getTodayStats (cognitive 28) REDACTED:2931 — RedisClient.getTodayStats has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 9, 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 · ClaudeRelayService.testAccountConnectionSync (cognitive 28) · ×1
  • ClaudeRelayService.testAccountConnectionSync (cognitive 28) REDACTED:3517 — ClaudeRelayService.testAccountConnectionSync has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 11). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 3537). 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 · anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic (cognitive 28) · ×1
  • anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic (cognitive 28) src/services/anthropicGeminiBridgeService.js:1300 — anthropicGeminiBridgeService.buildGeminiRequestFromAnthropic has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 7, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · anthropicGeminiBridgeService.handleAnthropicMessagesToGemini · ×1
  • anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs (cognitive 28) src/services/anthropicGeminiBridgeService.js:2486 — anthropicGeminiBridgeService.handleAnthropicMessagesToGemini::resolveFunctionCallArgs has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (18 pts), boolean chains 5, if/else 4, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claudeAccounts.router.get("/claude-accounts") (cognitive 28) · ×1
  • claudeAccounts.router.get("/claude-accounts") (cognitive 28) REDACTED:393 — claudeAccounts.router.get("/claude-accounts") has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 2 (5 pts), error handling 3 (4 pts) (nesting depth added 10). Of this number, 16 points are the body's own statements and 12 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 · claudeConsoleAccounts.router.post("/claude-console-accounts") (cognitive 28) · ×1
  • claudeConsoleAccounts.router.post("/claude-console-accounts") (cognitive 28) REDACTED:118 — claudeConsoleAccounts.router.post("/claude-console-accounts") has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 17, if/else 7 (8 pts), ternaries 2, 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.
D2 · Cognitive Complexity · droidAccounts.router.get("/droid-accounts") (cognitive 28) · ×1
  • droidAccounts.router.get("/droid-accounts") (cognitive 28) REDACTED:144 — droidAccounts.router.get("/droid-accounts") has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 31, if/else 4 (8 pts), loops 7 (8 pts), ternaries 4 (8 pts), error handling 1 (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (droidAccounts.router.get("/droid-accounts")::parseUsage) 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 · apiStats.router.post("/api-key/test-gemini") (cognitive 28) · ×1
  • apiStats.router.post("/api-key/test-gemini") (cognitive 28) REDACTED:1013 — apiStats.router.post("/api-key/test-gemini") has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 4 (6 pts), boolean chains 5, loops 1 (nesting depth added 8). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1105, 1085). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · authenticateUserCredentials (cognitive 28) · ×1
  • authenticateUserCredentials (cognitive 28) REDACTED:514 — authenticateUserCredentials has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 7, error handling 2, ternaries 1 (2 pts) (nesting depth added 3). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · _isAccountAvailable (cognitive 28) · ×1
  • _isAccountAvailable (cognitive 28) src/services/scheduler/unifiedOpenAIScheduler.js:522 — _isAccountAvailable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, error handling 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 · ClaudeAccountService.fetchAndUpdateAccountProfile (cognitive 27) · ×1
  • ClaudeAccountService.fetchAndUpdateAccountProfile (cognitive 27) src/services/account/claudeAccountService.js:2329 — ClaudeAccountService.fetchAndUpdateAccountProfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 6, ternaries 2 (5 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 · geminiHandlers.handleCountTokens (cognitive 27) · ×1
  • geminiHandlers.handleCountTokens (cognitive 27) REDACTED:1439 — geminiHandlers.handleCountTokens has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (8 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · GeminiToOpenAIConverter.convertStreamChunk (cognitive 27) · ×1
  • GeminiToOpenAIConverter.convertStreamChunk (cognitive 27) src/services/geminiToOpenAI.js:25 — GeminiToOpenAIConverter.convertStreamChunk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (6 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ccrAccounts.router.put("/ · ×1
  • ccrAccounts.router.put("/:accountId") (cognitive 27) REDACTED:182 — ccrAccounts.router.put("/:accountId") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, loops 1 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openaiResponsesAccounts.router.post("/openai-responses-accounts/ · ×1
  • openaiResponsesAccounts.router.post("/openai-responses-accounts/:accountId/test") (cognitive 27) REDACTED:459 — openaiResponsesAccounts.router.post("/openai-responses-accounts/:accountId/test") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (6 pts), boolean chains 4, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · droidAccounts.router.post("/droid-accounts/exchange-code") (cognitive 27) · ×1
  • droidAccounts.router.post("/droid-accounts/exchange-code") (cognitive 27) REDACTED:68 — droidAccounts.router.post("/droid-accounts/exchange-code") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (8 pts), boolean chains 6, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · droidAccounts.router.put("/droid-accounts/ · ×1
  • droidAccounts.router.put("/droid-accounts/:id") (cognitive 27) REDACTED:351 — droidAccounts.router.put("/droid-accounts/:id") has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, error handling 3 (4 pts), ternaries 1 (nesting depth added 4). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · usageStats.getUsageDataByIndex (cognitive 27) · ×1
  • usageStats.getUsageDataByIndex (cognitive 27) src/routes/admin/usageStats.js:23 — usageStats.getUsageDataByIndex has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 9 (nesting depth added 5). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 63, 26, 43, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · BalanceScriptService.execute (cognitive 27) · ×1
  • BalanceScriptService.execute (cognitive 27) src/services/balanceScriptService.js:62 — BalanceScriptService.execute has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 8, error handling 3, ternaries 2 (3 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 · index.router.beforeEach() (cognitive 27) · ×1
  • index.router.beforeEach() (cognitive 27) web/admin-spa/src/router/index.js:188 — index.router.beforeEach() has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _sumModelCostsByKeysPattern (cognitive 27) · ×1
  • _sumModelCostsByKeysPattern (cognitive 27) src/services/account/accountBalanceService.js:575 — _sumModelCostsByKeysPattern has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (10 pts), loops 3 (4 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 · modelHelper.isOpus45OrNewer (cognitive 26) · ×1
  • modelHelper.isOpus45OrNewer (cognitive 26) src/utils/modelHelper.js:98 — modelHelper.isOpus45OrNewer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiAccountService.refreshAccountToken (cognitive 26) · ×1
  • geminiAccountService.refreshAccountToken (cognitive 26) REDACTED:996 — geminiAccountService.refreshAccountToken has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (8 pts), error handling 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 · BedrockAccountService.testAccountConnection (cognitive 26) · ×1
  • BedrockAccountService.testAccountConnection (cognitive 26) REDACTED:528 — BedrockAccountService.testAccountConnection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, error handling 2 (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 · PricingService.getModelPricing (cognitive 26) · ×1
  • PricingService.getModelPricing (cognitive 26) src/services/pricingService.js:355 — PricingService.getModelPricing has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RequestDetailService._findRequestTimestampInRange (cognitive 26) · ×1
  • RequestDetailService._findRequestTimestampInRange (cognitive 26) src/services/requestDetailService.js:998 — RequestDetailService._findRequestTimestampInRange has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 2 (4 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 · claudeAccounts.router.put("/claude-accounts/ · ×1
  • claudeAccounts.router.put("/claude-accounts/:accountId") (cognitive 26) REDACTED:717 — claudeAccounts.router.put("/claude-accounts/:accountId") has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, 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 · geminiApiAccounts.router.put("/gemini-api-accounts/ · ×1
  • geminiApiAccounts.router.put("/gemini-api-accounts/:id") (cognitive 26) REDACTED:219 — geminiApiAccounts.router.put("/gemini-api-accounts/:id") has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, 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 · DroidRelayService._parseAnthropicUsageFromSSE (cognitive 26) · ×1
  • DroidRelayService._parseAnthropicUsageFromSSE (cognitive 26) src/services/relay/droidRelayService.js:706 — DroidRelayService._parseAnthropicUsageFromSSE has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 9, error handling 2 (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 · azureOpenaiRoutes.router.post("/embeddings") (cognitive 26) · ×1
  • azureOpenaiRoutes.router.post("/embeddings") (cognitive 26) REDACTED:423 — azureOpenaiRoutes.router.post("/embeddings") has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9, ternaries 2 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateAccount (cognitive 26) · ×1
  • updateAccount (cognitive 26) REDACTED:573 — updateAccount has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 3 (6 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _handleBedrockError (cognitive 26) · ×1
  • _handleBedrockError (cognitive 26) src/services/relay/bedrockRelayService.js:762 — _handleBedrockError has cognitive complexity 26 (threshold 15). Drivers by points: error handling 4 (12 pts), if/else 9 (10 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProxyHelper.createProxyAgent (cognitive 25) · ×1
  • ProxyHelper.createProxyAgent (cognitive 25) src/utils/proxyHelper.js:21 — ProxyHelper.createProxyAgent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7, ternaries 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ClaudeConsoleAccountService.getAllAccounts (cognitive 25) · ×1
  • ClaudeConsoleAccountService.getAllAccounts (cognitive 25) src/services/account/claudeConsoleAccountService.js:169 — ClaudeConsoleAccountService.getAllAccounts has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, ternaries 2 (6 pts), if/else 2 (5 pts), error handling 1, loops 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · antigravityClient.normalizeAntigravityThinking (cognitive 25) · ×1
  • antigravityClient.normalizeAntigravityThinking (cognitive 25) src/services/antigravityClient.js:123 — antigravityClient.normalizeAntigravityThinking has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, boolean chains 10, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RedisClient.migrateAlltimeModelStats (cognitive 25) · ×1
  • RedisClient.migrateAlltimeModelStats (cognitive 25) REDACTED:379 — RedisClient.migrateAlltimeModelStats has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 6, loops 3 (4 pts), error handling 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 · OpenAIToClaudeConverter._convertStreamEvent (cognitive 25) · ×1
  • OpenAIToClaudeConverter._convertStreamEvent (cognitive 25) src/services/openaiToClaude.js:410 — OpenAIToClaudeConverter._convertStreamEvent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 9 (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 · geminiAccounts.router.put("/ · ×1
  • geminiAccounts.router.put("/:accountId") (cognitive 25) REDACTED:301 — geminiAccounts.router.put("/:accountId") has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 1 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openaiResponsesAccounts.router.put("/openai-responses-accounts/ · ×1
  • openaiResponsesAccounts.router.put("/openai-responses-accounts/:id") (cognitive 25) REDACTED:192 — openaiResponsesAccounts.router.put("/openai-responses-accounts/:id") has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (3 pts), boolean chains 2, error handling 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 · DroidRelayService._handleUpstreamClientError (cognitive 25) · ×1
  • DroidRelayService._handleUpstreamClientError (cognitive 25) src/services/relay/droidRelayService.js:1361 — DroidRelayService._handleUpstreamClientError has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (6 pts), boolean chains 4, 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 · authenticateUserOrAdmin (cognitive 25) · ×1
  • authenticateUserOrAdmin (cognitive 25) REDACTED:1560 — authenticateUserOrAdmin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, error handling 3 (5 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getTagsWithCount (cognitive 25) · ×1
  • getTagsWithCount (cognitive 25) src/services/apiKeyService.js:729 — getTagsWithCount has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 3 (6 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · recordUsage (cognitive 25) · ×1
  • recordUsage (cognitive 25) src/services/apiKeyService.js:1669 — recordUsage has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 9 (10 pts), error handling 3 (4 pts), other 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cleanupClaudeAccounts (cognitive 25) · ×1
  • cleanupClaudeAccounts (cognitive 25) src/services/rateLimitCleanupService.js:211 — cleanupClaudeAccounts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 7, error handling 3 (5 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cleanupClaudeConsoleAccounts (cognitive 25) · ×1
  • cleanupClaudeConsoleAccounts (cognitive 25) src/services/rateLimitCleanupService.js:306 — cleanupClaudeConsoleAccounts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 7, error handling 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azureOpenaiAccountService.selectAvailableAccount (cognitive 24) · ×1
  • azureOpenaiAccountService.selectAvailableAccount (cognitive 24) src/services/account/azureOpenaiAccountService.js:386 — azureOpenaiAccountService.selectAvailableAccount has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, loops 1 (nesting depth added 9). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RedisClient._parseApiKeyData (cognitive 24) · ×1
  • RedisClient._parseApiKeyData (cognitive 24) REDACTED:768 — RedisClient._parseApiKeyData has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (6 pts), loops 4, 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 · auth.requestLogger (cognitive 24) · ×1
  • auth.requestLogger (cognitive 24) REDACTED:1765 — auth.requestLogger has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10, ternaries 5 (8 pts), boolean chains 6 (nesting depth added 3). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 1795). 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 · IncrementalSSEParser.feed (cognitive 24) · ×1
  • IncrementalSSEParser.feed (cognitive 24) src/utils/sseParser.js:64 — IncrementalSSEParser.feed has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · accountGroups.router.get("/ · ×1
  • accountGroups.router.get("/:groupId/members") (cognitive 24) REDACTED:90 — accountGroups.router.get("/:groupId/members") has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oauthHelper.authorizeWithCookie (cognitive 24) · ×1
  • oauthHelper.authorizeWithCookie (cognitive 24) src/utils/oauthHelper.js:707 — oauthHelper.authorizeWithCookie has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 1, error handling 1, 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 · grokAccounts.router.put("/grok-accounts/ · ×1
  • grokAccounts.router.put("/grok-accounts/:id") (cognitive 24) REDACTED:273 — grokAccounts.router.put("/grok-accounts/:id") has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (3 pts), boolean chains 2, error handling 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 · RuntimeAddonBus._ensureInitialized (cognitive 24) · ×1
  • RuntimeAddonBus._ensureInitialized (cognitive 24) src/utils/runtimeAddon.js:56 — RuntimeAddonBus._ensureInitialized has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LdapService.createClient (cognitive 24) · ×1
  • LdapService.createClient (cognitive 24) REDACTED:133 — LdapService.createClient has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1, error handling 1 (nesting depth added 11). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _extractTagsFromKeyIds (cognitive 24) · ×1
  • _extractTagsFromKeyIds (cognitive 24) REDACTED:640 — _extractTagsFromKeyIds has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), boolean chains 4, error handling 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 · handleAnthropicCountTokensToGemini (cognitive 24) · ×1
  • handleAnthropicCountTokensToGemini (cognitive 24) src/services/anthropicGeminiBridgeService.js:3008 — handleAnthropicCountTokensToGemini has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), error handling 3 (4 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.
D2 · Cognitive Complexity · queryWithIndex (cognitive 24) · ×1
  • queryWithIndex (cognitive 24) src/services/apiKeyIndexService.js:432 — queryWithIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 3 (5 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 6). Of this number, 21 points are the body's own statements and 3 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · getApiKeysSortedByCostCustom (cognitive 24) · ×1
  • getApiKeysSortedByCostCustom (cognitive 24) REDACTED:517 — getApiKeysSortedByCostCustom has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 3 (6 pts), loops 2 (nesting depth added 5). Of this number, 19 points are the body's own statements and 5 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateAccount (cognitive 24) · ×1
  • updateAccount (cognitive 24) src/services/account/grokAccountService.js:289 — updateAccount has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 4, 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 · logger.safeStringify · ×1
  • logger.safeStringify::replacer (cognitive 23) REDACTED:13 — logger.safeStringify::replacer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (4 pts), loops 1 (3 pts), error handling 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. This shape REPEATS in the file: one other method here (logger.safeStringify) 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 · azureOpenaiAccountService.getAllAccounts (cognitive 23) · ×1
  • azureOpenaiAccountService.getAllAccounts (cognitive 23) src/services/account/azureOpenaiAccountService.js:298 — azureOpenaiAccountService.getAllAccounts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (8 pts), boolean chains 5, 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 · BedrockAccountService.updateAccount (cognitive 23) · ×1
  • BedrockAccountService.updateAccount (cognitive 23) REDACTED:280 — BedrockAccountService.updateAccount has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 1, 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 · grokHelper.isBlockedHost (cognitive 23) · ×1
  • grokHelper.isBlockedHost (cognitive 23) src/utils/grokHelper.js:211 — grokHelper.isBlockedHost has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 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 · ClaudeRelayService._transformToolNamesInRequestBody (cognitive 23) · ×1
  • ClaudeRelayService._transformToolNamesInRequestBody (cognitive 23) REDACTED:309 — ClaudeRelayService._transformToolNamesInRequestBody has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, ternaries 2 (nesting depth added 5). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (transformName, a function literal at line 336, a function literal at line 353, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · ClaudeRelayService._patchOrphanedToolUse (cognitive 23) · ×1
  • ClaudeRelayService._patchOrphanedToolUse (cognitive 23) REDACTED:1115 — ClaudeRelayService._patchOrphanedToolUse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, loops 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeRelayService._createTestStreamTransformer (cognitive 23) · ×1
  • ClaudeRelayService._createTestStreamTransformer (cognitive 23) REDACTED:3380 — ClaudeRelayService._createTestStreamTransformer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 9). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 3383). 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 · ClaudeConsoleRelayService._createTestStreamTransformer (cognitive 23) · ×1
  • ClaudeConsoleRelayService._createTestStreamTransformer (cognitive 23) REDACTED:1399 — ClaudeConsoleRelayService._createTestStreamTransformer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 9). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 1402). 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 · oauthHelper.getOrganizationInfo (cognitive 23) · ×1
  • oauthHelper.getOrganizationInfo (cognitive 23) src/utils/oauthHelper.js:614 — oauthHelper.getOrganizationInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claudeAccounts.router.post("/claude-accounts") (cognitive 23) · ×1
  • claudeAccounts.router.post("/claude-accounts") (cognitive 23) REDACTED:606 — claudeAccounts.router.post("/claude-accounts") has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (9 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.
D2 · Cognitive Complexity · startCleanupTasks (cognitive 23) · ×1
  • startCleanupTasks (cognitive 23) REDACTED:674 — startCleanupTasks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 4 (6 pts), boolean chains 4, loops 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 714, 676, 801, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · needsInitialization (cognitive 23) · ×1
  • needsInitialization (cognitive 23) src/services/costInitService.js:286 — needsInitialization has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (6 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getApiKeysSortedByCostPrecomputed (cognitive 23) · ×1
  • getApiKeysSortedByCostPrecomputed (cognitive 23) REDACTED:409 — getApiKeysSortedByCostPrecomputed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 2 (5 pts), loops 2 (nesting depth added 5). Of this number, 19 points are the body's own statements and 4 belong to 10 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 23) · ×1
  • (anonymous) (cognitive 23) REDACTED:606 — (anonymous) has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (9 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.
D2 · Cognitive Complexity · updateAccount (cognitive 23) · ×1
  • updateAccount (cognitive 23) src/services/account/ccrAccountService.js:242 — updateAccount has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (20 pts), 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 · testAccountConnectionSync · ×1
  • testAccountConnectionSync::write (cognitive 23) REDACTED:3537 — testAccountConnectionSync::write has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 6, error handling 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 · ClaudeAccountService.getAllAccounts (cognitive 22) · ×1
  • ClaudeAccountService.getAllAccounts (cognitive 22) src/services/account/claudeAccountService.js:546 — ClaudeAccountService.getAllAccounts has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, ternaries 6, error handling 1. Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 552). 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 · CostCalculator.buildLegacyCostResult (cognitive 22) · ×1
  • CostCalculator.buildLegacyCostResult (cognitive 22) src/utils/costCalculator.js:199 — CostCalculator.buildLegacyCostResult has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 17, if/else 3 (4 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · BillingEventPublisher.publishBillingEvent (cognitive 22) · ×1
  • BillingEventPublisher.publishBillingEvent (cognitive 22) src/services/billingEventPublisher.js:24 — BillingEventPublisher.publishBillingEvent has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 20, error handling 1, if/else 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 · index.renewApiKeys (cognitive 22) · ×1
  • index.renewApiKeys (cognitive 22) REDACTED:462 — index.renewApiKeys has cognitive complexity 22 (threshold 15). Drivers by points: error handling 3 (8 pts), if/else 5 (7 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 10). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedClaudeScheduler._getAvailableCcrAccounts (cognitive 22) · ×1
  • UnifiedClaudeScheduler._getAvailableCcrAccounts (cognitive 22) src/services/scheduler/unifiedClaudeScheduler.js:1791 — UnifiedClaudeScheduler._getAvailableCcrAccounts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiHandlers.handleStandardStreamGenerateContent · ×1
  • geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock (cognitive 22) REDACTED:2801 — geminiHandlers.handleStandardStreamGenerateContent::handleEventBlock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 (geminiHandlers.handleStandardStreamGenerateContent) 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 · UnifiedOpenAIScheduler._ensureAccountReadyForScheduling (cognitive 22) · ×1
  • UnifiedOpenAIScheduler._ensureAccountReadyForScheduling (cognitive 22) src/services/scheduler/unifiedOpenAIScheduler.js:55 — UnifiedOpenAIScheduler._ensureAccountReadyForScheduling has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiApiAccounts.router.get("/gemini-api-accounts") · ×1
  • geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage (cognitive 22) REDACTED:79 — geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. To reduce it, name the conditions: bind each compound test to a 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 (geminiApiAccounts.router.get("/gemini-api-accounts")) 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 · geminiApiAccounts.router.get("/gemini-api-accounts") (cognitive 22) · ×1
  • geminiApiAccounts.router.get("/gemini-api-accounts") (cognitive 22) REDACTED:13 — geminiApiAccounts.router.get("/gemini-api-accounts") has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 31, ternaries 5 (9 pts), if/else 5 (7 pts), loops 3, error handling 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. This shape REPEATS in the file: one other method here (geminiApiAccounts.router.get("/gemini-api-accounts")::parseUsage) 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 · openaiResponsesAccounts.router.get("/openai-responses-accounts") · ×1
  • openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage (cognitive 22) REDACTED:90 — openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. To reduce it, name the conditions: bind each compound test to a 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 (openaiResponsesAccounts.router.get("/openai-responses-accounts")) 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 · openaiResponsesAccounts.router.get("/openai-responses-accounts") (cognitive 22) · ×1
  • openaiResponsesAccounts.router.get("/openai-responses-accounts") (cognitive 22) REDACTED:24 — openaiResponsesAccounts.router.get("/openai-responses-accounts") has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 29, ternaries 4 (8 pts), if/else 5 (7 pts), loops 3, error handling 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. This shape REPEATS in the file: one other method here (openaiResponsesAccounts.router.get("/openai-responses-accounts")::parseUsage) 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 · droidAccounts.router.get("/droid-accounts") · ×1
  • droidAccounts.router.get("/droid-accounts")::parseUsage (cognitive 22) REDACTED:200 — droidAccounts.router.get("/droid-accounts")::parseUsage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. To reduce it, name the conditions: bind each compound test to a 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 (droidAccounts.router.get("/droid-accounts")) 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 · grokAccounts.router.get("/grok-accounts") · ×1
  • grokAccounts.router.get("/grok-accounts")::parseUsage (cognitive 22) REDACTED:188 — grokAccounts.router.get("/grok-accounts")::parseUsage has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 22. To reduce it, name the conditions: bind each compound test to a 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 (grokAccounts.router.get("/grok-accounts")) 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 · system.router.get("/check-updates") (cognitive 22) · ×1
  • system.router.get("/check-updates") (cognitive 22) REDACTED:93 — system.router.get("/check-updates") has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, ternaries 2 (4 pts), error handling 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 · browserFallback.browserFallbackMiddleware (cognitive 22) · ×1
  • browserFallback.browserFallbackMiddleware (cognitive 22) src/middleware/browserFallback.js:7 — browserFallback.browserFallbackMiddleware has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9, ternaries 1 (2 pts) (nesting depth added 4). Of this number, 17 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 · _captureRequestDetail (cognitive 22) · ×1
  • _captureRequestDetail (cognitive 22) src/services/apiKeyService.js:2145 — _captureRequestDetail has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 19, other 2, if/else 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 · headerValue (cognitive 22) · ×1
  • headerValue (cognitive 22) src/utils/grokQuota.js:55 — headerValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (5 pts), boolean chains 4, ternaries 2 (4 pts), other 1 (nesting depth added 7). 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 · updateAccount (cognitive 22) · ×1
  • updateAccount (cognitive 22) src/services/account/azureOpenaiAccountService.js:205 — updateAccount has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 3 (6 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · setAccountRateLimited (cognitive 22) · ×1
  • setAccountRateLimited (cognitive 22) REDACTED:942 — setAccountRateLimited has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, error handling 2 (5 pts), ternaries 4 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · upstreamErrorHelper.parseRetryAfter (cognitive 21) · ×1
  • upstreamErrorHelper.parseRetryAfter (cognitive 21) src/utils/upstreamErrorHelper.js:176 — upstreamErrorHelper.parseRetryAfter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeAccountService.updateSessionWindow (cognitive 21) · ×1
  • ClaudeAccountService.updateSessionWindow (cognitive 21) src/services/account/claudeAccountService.js:1874 — ClaudeAccountService.updateSessionWindow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeAccountService.updateClaudeUsageSnapshot (cognitive 21) · ×1
  • ClaudeAccountService.updateClaudeUsageSnapshot (cognitive 21) src/services/account/claudeAccountService.js:2259 — ClaudeAccountService.updateClaudeUsageSnapshot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CcrAccountService.getAllAccounts (cognitive 21) · ×1
  • CcrAccountService.getAllAccounts (cognitive 21) src/services/account/ccrAccountService.js:134 — CcrAccountService.getAllAccounts has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, ternaries 2 (6 pts), if/else 1 (2 pts), error handling 1, 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 · BedrockAccountService.getAccount (cognitive 21) · ×1
  • BedrockAccountService.getAccount (cognitive 21) REDACTED:109 — BedrockAccountService.getAccount has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, error handling 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 · RedisClient._sumModelCostsForAccountDays (cognitive 21) · ×1
  • RedisClient._sumModelCostsForAccountDays (cognitive 21) REDACTED:2184 — RedisClient._sumModelCostsForAccountDays has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (6 pts), loops 1 (nesting depth added 2). 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, name the conditions: bind each compound test to a 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 · ClaudeRelayService._makeClaudeRequest (cognitive 21) · ×1
  • ClaudeRelayService._makeClaudeRequest (cognitive 21) REDACTED:1727 — ClaudeRelayService._makeClaudeRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 5, error handling 3 (5 pts) (nesting depth added 2). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 1788, 1761, 1839). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · CcrRelayService._parseSSELineForUsage (cognitive 21) · ×1
  • CcrRelayService._parseSSELineForUsage (cognitive 21) src/services/relay/ccrRelayService.js:887 — CcrRelayService._parseSSELineForUsage has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, if/else 4 (7 pts), 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.
D2 · Cognitive Complexity · geminiRelayService.countTokens (cognitive 21) · ×1
  • geminiRelayService.countTokens (cognitive 21) src/services/relay/geminiRelayService.js:443 — geminiRelayService.countTokens has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, 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 · geminiHandlers.normalizeAxiosStreamError (cognitive 21) · ×1
  • geminiHandlers.normalizeAxiosStreamError (cognitive 21) REDACTED:322 — geminiHandlers.normalizeAxiosStreamError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 2 (5 pts), boolean chains 4 (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 · GrokRelayService._handleStreamResponse · ×1
  • GrokRelayService._handleStreamResponse::parseSSEForUsage (cognitive 21) REDACTED:275 — GrokRelayService._handleStreamResponse::parseSSEForUsage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · apiKeys.router.patch("/api-keys/ · ×1
  • apiKeys.router.patch("/api-keys/:keyId/expiration") (cognitive 21) REDACTED:2460 — apiKeys.router.patch("/api-keys/:keyId/expiration") has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, 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 · claudeConsoleAccounts.router.get("/claude-console-accounts") (cognitive 21) · ×1
  • claudeConsoleAccounts.router.get("/claude-console-accounts") (cognitive 21) REDACTED:20 — claudeConsoleAccounts.router.get("/claude-console-accounts") has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 7). Of this number, 16 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 · ccrAccounts.router.get("/") (cognitive 21) · ×1
  • ccrAccounts.router.get("/") (cognitive 21) REDACTED:17 — ccrAccounts.router.get("/") has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (3 pts) (nesting depth added 7). Of this number, 16 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 · Application.setupGracefulShutdown (cognitive 21) · ×1
  • Application.setupGracefulShutdown (cognitive 21) REDACTED:834 — Application.setupGracefulShutdown has cognitive complexity 21 (threshold 15). Drivers by points: error handling 8 (16 pts), if/else 4 (5 pts) (nesting depth added 9). None of this is in the body itself: all 21 points belong to 2 function items inside it that branch (a function literal at line 839, shutdown). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work 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 · renameTag (cognitive 21) · ×1
  • renameTag (cognitive 21) src/services/apiKeyService.js:808 — renameTag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (7 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _buildListQueryData (cognitive 21) · ×1
  • _buildListQueryData (cognitive 21) src/services/requestDetailService.js:1230 — _buildListQueryData has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), other 2, boolean chains 1, ternaries 1 (nesting depth added 9). Of this number, 15 points are the body's own statements and 6 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 · getAllTempUnavailable (cognitive 21) · ×1
  • getAllTempUnavailable (cognitive 21) src/utils/upstreamErrorHelper.js:429 — getAllTempUnavailable has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (5 pts), error handling 3 (4 pts), boolean chains 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 · ProxyHelper._getIPFamilyPreference (cognitive 20) · ×1
  • ProxyHelper._getIPFamilyPreference (cognitive 20) src/utils/proxyHelper.js:136 — ProxyHelper._getIPFamilyPreference has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · antigravityClient.request (cognitive 20) · ×1
  • antigravityClient.request (cognitive 20) src/services/antigravityClient.js:259 — antigravityClient.request has cognitive complexity 20 (threshold 15). Drivers by points: if/else 23 (51 pts), error handling 6 (17 pts), boolean chains 16, ternaries 5 (12 pts), loops 3 (5 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BedrockRelayService._getBedrockClient (cognitive 20) · ×1
  • BedrockRelayService._getBedrockClient (cognitive 20) src/services/relay/bedrockRelayService.js:31 — BedrockRelayService._getBedrockClient has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 4). Of this number, 15 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 · DroidAccountService._refreshTokensWithWorkOS (cognitive 20) · ×1
  • DroidAccountService._refreshTokensWithWorkOS (cognitive 20) REDACTED:337 — DroidAccountService._refreshTokensWithWorkOS has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (7 pts), ternaries 2 (3 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · RedisClient.getAccountDailyCostFallback (cognitive 20) · ×1
  • RedisClient.getAccountDailyCostFallback (cognitive 20) REDACTED:2114 — RedisClient.getAccountDailyCostFallback has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (8 pts), loops 2 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · redis.redisClient.batchGetApiKeyStats (cognitive 20) · ×1
  • redis.redisClient.batchGetApiKeyStats (cognitive 20) REDACTED:4988 — redis.redisClient.batchGetApiKeyStats has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, loops 2, ternaries 1 (2 pts), if/else 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 · redis.redisClient.migrateGlobalStats (cognitive 20) · ×1
  • redis.redisClient.migrateGlobalStats (cognitive 20) REDACTED:5302 — redis.redisClient.migrateGlobalStats has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (5 pts), loops 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 5325). 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 · ClaudeRelayService._extractErrorMessage (cognitive 20) · ×1
  • ClaudeRelayService._extractErrorMessage (cognitive 20) REDACTED:100 — ClaudeRelayService._extractErrorMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexCliValidator.validate (cognitive 20) · ×1
  • CodexCliValidator.validate (cognitive 20) src/validators/clients/codexCliValidator.js:35 — CodexCliValidator.validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8, 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 · bedrockAccounts.router.get("/") (cognitive 20) · ×1
  • bedrockAccounts.router.get("/") (cognitive 20) REDACTED:20 — bedrockAccounts.router.get("/") has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grokAccounts.router.get("/grok-accounts") (cognitive 20) · ×1
  • grokAccounts.router.get("/grok-accounts") (cognitive 20) REDACTED:139 — grokAccounts.router.get("/grok-accounts") has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 30, if/else 5 (7 pts), ternaries 3 (6 pts), loops 3, error handling 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. This shape REPEATS in the file: one other method here (grokAccounts.router.get("/grok-accounts")::parseUsage) 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 · dashboard.router.get("/dashboard") · ×1
  • dashboard.router.get("/dashboard")::countAccountStats (cognitive 20) REDACTED:84 — dashboard.router.get("/dashboard")::countAccountStats has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (6 pts), if/else 4 (5 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (dashboard.router.get("/dashboard")) 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 · GeminiBalanceProvider.queryBalance (cognitive 20) · ×1
  • GeminiBalanceProvider.queryBalance (cognitive 20) src/services/balanceProviders/geminiBalanceProvider.js:191 — GeminiBalanceProvider.queryBalance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, 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 · handleGeminiUpstreamError (cognitive 20) · ×1
  • handleGeminiUpstreamError (cognitive 20) REDACTED:27 — handleGeminiUpstreamError has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, error handling 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 · buildModelMappingFromSupportedModels (cognitive 20) · ×1
  • buildModelMappingFromSupportedModels (cognitive 20) REDACTED:52 — buildModelMappingFromSupportedModels has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserService.getUserStats (cognitive 19) · ×1
  • UserService.getUserStats (cognitive 19) REDACTED:461 — UserService.getUserStats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, error handling 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 · UserService.transferMatchingApiKeys (cognitive 19) · ×1
  • UserService.transferMatchingApiKeys (cognitive 19) REDACTED:529 — UserService.transferMatchingApiKeys has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (4 pts), error handling 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.router.get("/v1/models") (cognitive 19) · ×1
  • api.router.get("/v1/models") (cognitive 19) REDACTED:1477 — api.router.get("/v1/models") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiHandlers.handleOnboardUser (cognitive 19) · ×1
  • geminiHandlers.handleOnboardUser (cognitive 19) REDACTED:1225 — geminiHandlers.handleOnboardUser has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (6 pts), if/else 5, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · unified.buildContentParts (cognitive 19) · ×1
  • unified.buildContentParts (cognitive 19) REDACTED:802 — unified.buildContentParts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · claudeAccounts.router.post("/claude-accounts/exchange-setup-token-code") (cognitive 19) · ×1
  • claudeAccounts.router.post("/claude-accounts/exchange-setup-token-code") (cognitive 19) REDACTED:209 — claudeAccounts.router.post("/claude-accounts/exchange-setup-token-code") has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4, boolean chains 3, 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 · ccrAccounts.router.post("/") (cognitive 19) · ×1
  • ccrAccounts.router.post("/") (cognitive 19) REDACTED:112 — ccrAccounts.router.post("/") has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 5, 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 · geminiAccounts.router.get("/") (cognitive 19) · ×1
  • geminiAccounts.router.get("/") (cognitive 19) REDACTED:155 — geminiAccounts.router.get("/") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). 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 · openaiAccounts.router.get("/") (cognitive 19) · ×1
  • openaiAccounts.router.get("/") (cognitive 19) REDACTED:230 — openaiAccounts.router.get("/") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (3 pts), error handling 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azureOpenaiAccounts.router.get("/azure-openai-accounts") (cognitive 19) · ×1
  • azureOpenaiAccounts.router.get("/azure-openai-accounts") (cognitive 19) REDACTED:15 — azureOpenaiAccounts.router.get("/azure-openai-accounts") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). 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 · azureOpenaiAccounts.router.post("/azure-openai-accounts") (cognitive 19) · ×1
  • azureOpenaiAccounts.router.post("/azure-openai-accounts") (cognitive 19) REDACTED:106 — azureOpenaiAccounts.router.post("/azure-openai-accounts") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, 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 · BalanceScriptService.mapExtractorResult (cognitive 19) · ×1
  • BalanceScriptService.mapExtractorResult (cognitive 19) src/services/balanceScriptService.js:177 — BalanceScriptService.mapExtractorResult has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LdapService.validateConfiguration (cognitive 19) · ×1
  • LdapService.validateConfiguration (cognitive 19) REDACTED:18 — LdapService.validateConfiguration has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _resolveAccountInfo (cognitive 19) · ×1
  • _resolveAccountInfo (cognitive 19) src/services/requestDetailService.js:928 — _resolveAccountInfo has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiKeyIndexService.rebuildHashMap (cognitive 18) · ×1
  • ApiKeyIndexService.rebuildHashMap (cognitive 18) src/services/apiKeyIndexService.js:73 — ApiKeyIndexService.rebuildHashMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), boolean chains 1, 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 · antigravityUpstreamDump.dumpAntigravityUpstreamRequest (cognitive 18) · ×1
  • antigravityUpstreamDump.dumpAntigravityUpstreamRequest (cognitive 18) src/utils/antigravityUpstreamDump.js:67 — antigravityUpstreamDump.dumpAntigravityUpstreamRequest has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 2 (3 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · requestIdentityService.resolveAccountId (cognitive 18) · ×1
  • requestIdentityService.resolveAccountId (cognitive 18) src/services/requestIdentityService.js:205 — requestIdentityService.resolveAccountId has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 3 (5 pts), loops 1, ternaries 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · OpenAIToClaudeConverter.convertStreamChunk (cognitive 18) · ×1
  • OpenAIToClaudeConverter.convertStreamChunk (cognitive 18) src/services/openaiToClaude.js:122 — OpenAIToClaudeConverter.convertStreamChunk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (3 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 · geminiHandlers.handleLoadCodeAssist (cognitive 18) · ×1
  • geminiHandlers.handleLoadCodeAssist (cognitive 18) REDACTED:1123 — geminiHandlers.handleLoadCodeAssist has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (6 pts), if/else 4, 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.
D2 · Cognitive Complexity · claudeAccounts.router.post("/claude-accounts/exchange-code") (cognitive 18) · ×1
  • claudeAccounts.router.post("/claude-accounts/exchange-code") (cognitive 18) REDACTED:92 — claudeAccounts.router.post("/claude-accounts/exchange-code") has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 3, if/else 3, 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 · openaiAccounts.router.post("/exchange-code") (cognitive 18) · ×1
  • openaiAccounts.router.post("/exchange-code") (cognitive 18) REDACTED:110 — openaiAccounts.router.post("/exchange-code") has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4, 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 · workosOAuthHelper.pollDeviceAuthorization (cognitive 18) · ×1
  • workosOAuthHelper.pollDeviceAuthorization (cognitive 18) src/utils/workosOAuthHelper.js:104 — workosOAuthHelper.pollDeviceAuthorization has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, 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 · DroidRelayService._detectStreamCompletion (cognitive 18) · ×1
  • DroidRelayService._detectStreamCompletion (cognitive 18) src/services/relay/droidRelayService.js:842 — DroidRelayService._detectStreamCompletion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiBalanceProvider.normalizeQuotaCategory (cognitive 18) · ×1
  • geminiBalanceProvider.normalizeQuotaCategory (cognitive 18) src/services/balanceProviders/geminiBalanceProvider.js:27 — geminiBalanceProvider.normalizeQuotaCategory has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 8. To reduce it, name the conditions: bind each compound test to a 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 · RateLimitCleanupService.proactiveRefreshClaudeTokens (cognitive 18) · ×1
  • RateLimitCleanupService.proactiveRefreshClaudeTokens (cognitive 18) src/services/rateLimitCleanupService.js:430 — RateLimitCleanupService.proactiveRefreshClaudeTokens has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 18) · ×1
  • (anonymous) (cognitive 18) REDACTED:110 — (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4, 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 · createAccount (cognitive 18) · ×1
  • createAccount (cognitive 18) src/services/account/azureOpenaiAccountService.js:113 — createAccount has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, ternaries 4 (5 pts), if/else 2 (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 · markAccountTempError (cognitive 18) · ×1
  • markAccountTempError (cognitive 18) src/services/account/claudeAccountService.js:2932 — markAccountTempError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 4 (5 pts), boolean chains 3 (nesting depth added 4). Of this number, 9 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 · _normalizeUsageSnapshot (cognitive 18) · ×1
  • _normalizeUsageSnapshot (cognitive 18) src/services/relay/droidRelayService.js:896 — _normalizeUsageSnapshot has cognitive complexity 18 (threshold 15). Drivers by points: other 7, boolean chains 6, if/else 5. Of this number, 14 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.
D2 · Cognitive Complexity · ClaudeAccountService.buildClaudeUsageSnapshot (cognitive 17) · ×1
  • ClaudeAccountService.buildClaudeUsageSnapshot (cognitive 17) src/services/account/claudeAccountService.js:2177 — ClaudeAccountService.buildClaudeUsageSnapshot has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (4 pts), ternaries 4, error handling 1 (2 pts) (nesting depth added 2). Of this number, 13 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · grokHelper.describeTokenError (cognitive 17) · ×1
  • grokHelper.describeTokenError (cognitive 17) src/utils/grokHelper.js:710 — grokHelper.describeTokenError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RedisClient.getAccountDailyCost (cognitive 17) · ×1
  • RedisClient.getAccountDailyCost (cognitive 17) REDACTED:1959 — RedisClient.getAccountDailyCost has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (6 pts), loops 2 (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 · UserService.getAllUsers (cognitive 17) · ×1
  • UserService.getAllUsers (cognitive 17) REDACTED:193 — UserService.getAllUsers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 4, error handling 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 · ClaudeCodeValidator.validate (cognitive 17) · ×1
  • ClaudeCodeValidator.validate (cognitive 17) src/validators/clients/claudeCodeValidator.js:128 — ClaudeCodeValidator.validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 1 (2 pts), 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 · auth.errorHandler (cognitive 17) · ×1
  • auth.errorHandler (cognitive 17) REDACTED:1925 — auth.errorHandler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, ternaries 3, match/switch 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 · UnifiedGeminiScheduler._isAccountAvailable (cognitive 17) · ×1
  • UnifiedGeminiScheduler._isAccountAvailable (cognitive 17) src/services/scheduler/unifiedGeminiScheduler.js:478 — UnifiedGeminiScheduler._isAccountAvailable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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 · apiKeys.router.post("/api-keys/batch-stats") (cognitive 17) · ×1
  • apiKeys.router.post("/api-keys/batch-stats") (cognitive 17) REDACTED:959 — apiKeys.router.post("/api-keys/batch-stats") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claudeAccounts.router.get("/claude-accounts/usage") (cognitive 17) · ×1
  • claudeAccounts.router.get("/claude-accounts/usage") (cognitive 17) REDACTED:536 — claudeAccounts.router.get("/claude-accounts/usage") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2 (3 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 2 function literals inside it that branch (lines 543, 592). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · QuotaCardService.createCard (cognitive 17) · ×1
  • QuotaCardService.createCard (cognitive 17) src/services/quotaCardService.js:88 — QuotaCardService.createCard has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, if/else 3, 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 · web.router.post("/auth/change-password") (cognitive 17) · ×1
  • web.router.post("/auth/change-password") (cognitive 17) REDACTED:137 — web.router.post("/auth/change-password") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, error handling 2, 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 · userRoutes.router.post("/login") (cognitive 17) · ×1
  • userRoutes.router.post("/login") (cognitive 17) REDACTED:52 — userRoutes.router.post("/login") has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 6, boolean chains 5 (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.
D2 · Cognitive Complexity · dashboard.useDashboardStore.setTrendGranularity (cognitive 17) · ×1
  • dashboard.useDashboardStore.setTrendGranularity (cognitive 17) web/admin-spa/src/stores/dashboard.js:614 — dashboard.useDashboardStore.setTrendGranularity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · handleModels (cognitive 17) · ×1
  • handleModels (cognitive 17) REDACTED:825 — handleModels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 3 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · authenticateAdmin (cognitive 17) · ×1
  • authenticateAdmin (cognitive 17) REDACTED:1360 — authenticateAdmin has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 5, error handling 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 · handleChatCompletion · ×1
  • handleChatCompletion::usageCallback (cognitive 17) REDACTED:280 — handleChatCompletion::usageCallback has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (5 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ApiKeyIndexService.addToIndex (cognitive 16) · ×1
  • ApiKeyIndexService.addToIndex (cognitive 16) src/services/apiKeyIndexService.js:255 — ApiKeyIndexService.addToIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 3, 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 · WebhookConfigService.validateConfig (cognitive 16) · ×1
  • WebhookConfigService.validateConfig (cognitive 16) src/services/webhookConfigService.js:69 — WebhookConfigService.validateConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, 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 · ClaudeAccountService.isAccountRateLimited (cognitive 16) · ×1
  • ClaudeAccountService.isAccountRateLimited (cognitive 16) src/services/account/claudeAccountService.js:1775 — ClaudeAccountService.isAccountRateLimited has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, 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 · BedrockRelayService._convertToBedrockFormat (cognitive 16) · ×1
  • BedrockRelayService._convertToBedrockFormat (cognitive 16) src/services/relay/bedrockRelayService.js:657 — BedrockRelayService._convertToBedrockFormat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · grokQuota.formatWindow (cognitive 16) · ×1
  • grokQuota.formatWindow (cognitive 16) src/utils/grokQuota.js:351 — grokQuota.formatWindow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 7, if/else 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 · GrokAccountService.refreshAccountToken (cognitive 16) · ×1
  • GrokAccountService.refreshAccountToken (cognitive 16) src/services/account/grokAccountService.js:373 — GrokAccountService.refreshAccountToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CostCalculator.buildDetailedPricingResult (cognitive 16) · ×1
  • CostCalculator.buildDetailedPricingResult (cognitive 16) src/utils/costCalculator.js:144 — CostCalculator.buildDetailedPricingResult has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 16. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · RedisClient.batchGetAccountRollingUsage (cognitive 16) · ×1
  • RedisClient.batchGetAccountRollingUsage (cognitive 16) REDACTED:2250 — RedisClient.batchGetAccountRollingUsage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), loops 2 (nesting depth added 1). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · RequestDetailService._loadRequestPointersInRange (cognitive 16) · ×1
  • RequestDetailService._loadRequestPointersInRange (cognitive 16) src/services/requestDetailService.js:785 — RequestDetailService._loadRequestPointersInRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (5 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.
D2 · Cognitive Complexity · anthropicGeminiBridgeService.buildToolUseIdToNameMap (cognitive 16) · ×1
  • anthropicGeminiBridgeService.buildToolUseIdToNameMap (cognitive 16) src/services/anthropicGeminiBridgeService.js:181 — anthropicGeminiBridgeService.buildToolUseIdToNameMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · anthropicGeminiBridgeService.sanitizeToolResultBlocksForAntigravity (cognitive 16) · ×1
  • anthropicGeminiBridgeService.sanitizeToolResultBlocksForAntigravity (cognitive 16) src/services/anthropicGeminiBridgeService.js:466 — anthropicGeminiBridgeService.sanitizeToolResultBlocksForAntigravity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.isOldSession (cognitive 16) · ×1
  • api.isOldSession (cognitive 16) REDACTED:84 — api.isOldSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5 (nesting depth added 3). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAIToClaudeConverter._convertClaudeMessage (cognitive 16) · ×1
  • OpenAIToClaudeConverter._convertClaudeMessage (cognitive 16) src/services/openaiToClaude.js:345 — OpenAIToClaudeConverter._convertClaudeMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiHandlers.handleRetrieveUserQuota (cognitive 16) · ×1
  • geminiHandlers.handleRetrieveUserQuota (cognitive 16) REDACTED:1340 — geminiHandlers.handleRetrieveUserQuota has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), boolean chains 5, if/else 4, 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.
D2 · Cognitive Complexity · apiKeys.router.post("/api-keys/batch-last-usage") (cognitive 16) · ×1
  • apiKeys.router.post("/api-keys/batch-last-usage") (cognitive 16) REDACTED:1383 — apiKeys.router.post("/api-keys/batch-last-usage") has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, 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 1411). 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 · droidAccounts.router.get("/droid-accounts/ · ×1
  • droidAccounts.router.get("/droid-accounts/:id") (cognitive 16) REDACTED:479 — droidAccounts.router.get("/droid-accounts/:id") has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), error handling 4 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 517, 552). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · DroidRelayService._normalizeRequestBody (cognitive 16) · ×1
  • DroidRelayService._normalizeRequestBody (cognitive 16) src/services/relay/droidRelayService.js:57 — DroidRelayService._normalizeRequestBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · incrementTokenUsage (cognitive 16) · ×1
  • incrementTokenUsage (cognitive 16) REDACTED:1068 — incrementTokenUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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 · getEnabledTestAccounts (cognitive 16) · ×1
  • getEnabledTestAccounts (cognitive 16) REDACTED:4853 — getEnabledTestAccounts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), boolean chains 4, loops 3 (4 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 · validateAndNormalizeRules (cognitive 16) · ×1
  • validateAndNormalizeRules (cognitive 16) src/services/requestBodyRuleService.js:74 — validateAndNormalizeRules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _normalizeRecord (cognitive 16) · ×1
  • _normalizeRecord (cognitive 16) src/services/requestDetailService.js:697 — _normalizeRecord has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, if/else 1, other 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 · extractAnthropicReasoningInfo (cognitive 16) · ×1
  • extractAnthropicReasoningInfo (cognitive 16) REDACTED:147 — extractAnthropicReasoningInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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 · 321 plain JS — the untyped files are REDACTED, REDACTED, config/models.js, config/pricingSource.js, REDACTED, scripts/check-redis-keys.js (+315 more).
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (46 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (46 clone groups) REDACTED:154 — 46 duplicated blocks under src/ have copies in at least two of the sibling directories handlers, middleware, models, routes, services, utils (+1 more sibling(s) not listed) — 39 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 46 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 46 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 46 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 (29 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (29 clone groups) web/admin-spa/src/components/apistats/StatsOverview.vue:478 — 29 duplicated blocks under web/admin-spa/src/ have copies in at least two of the sibling directories components, stores, utils, views — 23 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 29 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 29 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 29 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 (14 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (14 clone groups) REDACTED:35 — 14 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, scripts, src, web — 8 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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 (12 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (12 clone groups) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue:216 — 12 duplicated blocks under web/admin-spa/src/components/ have copies in at least two of the sibling directories accounts, admin, apikeys, apistats, user — 9 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 12 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 4 sibling directories (6 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (6 clone groups) src/services/account/claudeAccountService.js:2899 — 6 duplicated blocks under src/services/ have copies in at least two of the sibling directories account, balanceProviders, relay, scheduler — 2 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 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 · Duplicated block with local edits (457 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (457 matched lines × 2 locations) src/services/relay/ccrRelayService.js:59 — src/services/relay/ccrRelayService.js:59 · REDACTED:69 — the two spans are one implementation copied and then locally edited — 2434 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 (295 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (295 matched lines × 2 locations) REDACTED:10 — REDACTED:10 · REDACTED:19 — the two spans are one implementation copied and then locally edited — 2065 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 (283 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (283 matched lines × 2 locations) REDACTED:17 — REDACTED:17 · REDACTED:20 — the two spans are one implementation copied and then locally edited — 1955 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 (207 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (207 matched lines × 2 locations) REDACTED:566 — REDACTED:566 · REDACTED:530 — the two spans are one implementation copied and then locally edited — 1200 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 (202 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (202 matched lines × 2 locations) REDACTED:211 — REDACTED:211 · REDACTED:107 — the two spans are one implementation copied and then locally edited — 1474 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 (192 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (192 matched lines × 2 locations) src/services/account/azureOpenaiAccountService.js:117 — src/services/account/azureOpenaiAccountService.js:117 · REDACTED:457 — the two spans are one implementation copied and then locally edited — 1146 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 (180 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (180 matched lines × 2 locations) REDACTED:341 — REDACTED:341 · REDACTED:291 — the two spans are one implementation copied and then locally edited — 1132 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 (179 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (179 matched lines × 2 locations) src/services/account/geminiApiAccountService.js:365 — src/services/account/geminiApiAccountService.js:365 · src/services/account/openaiResponsesAccountService.js:326 — the two spans are one implementation copied and then locally edited — 1056 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 (167 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (167 matched lines × 2 locations) src/services/scheduler/unifiedClaudeScheduler.js:1318 — src/services/scheduler/unifiedClaudeScheduler.js:1318 · src/services/scheduler/unifiedOpenAIScheduler.js:636 — the two spans are one implementation copied and then locally edited — 778 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 (159 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (159 matched lines × 2 locations) src/services/account/ccrAccountService.js:567 — src/services/account/ccrAccountService.js:567 · src/services/account/claudeConsoleAccountService.js:1244 — the two spans are one implementation copied and then locally edited — 840 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 (145 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (145 matched lines × 2 locations) REDACTED:21 — REDACTED:21 · REDACTED:47 — the two spans are one implementation copied and then locally edited — 864 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (144 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (144 matched lines × 2 locations) REDACTED:106 — REDACTED:106 · REDACTED:576 — the two spans are one implementation copied and then locally edited — 805 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (133 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (133 matched lines × 2 locations) src/services/account/geminiApiAccountService.js:54 — src/services/account/geminiApiAccountService.js:54 · src/services/account/openaiResponsesAccountService.js:68 — 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 (130 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (130 matched lines × 2 locations) web/admin-spa/src/views/AccountUsageRecordsView.vue:309 — web/admin-spa/src/views/AccountUsageRecordsView.vue:309 · web/admin-spa/src/views/ApiKeyUsageRecordsView.vue:302 — the two spans are one implementation copied and then locally edited — 859 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 (121 lines × 2 locations) · ×1
  • Duplicated block (121 lines × 2 locations) src/utils/oauthHelper.js:167 — src/utils/oauthHelper.js:167 · src/utils/oauthHelper.js:387 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (120 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (120 matched lines × 2 locations) src/services/account/claudeConsoleAccountService.js:543 — src/services/account/claudeConsoleAccountService.js:543 · src/services/account/claudeConsoleAccountService.js:845 — the two spans are one implementation copied and then locally edited — 574 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (99 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (99 matched lines × 2 locations) REDACTED:289 — REDACTED:289 · REDACTED:1001 — the two spans are one implementation copied and then locally edited — 428 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (91 lines × 2 locations) · ×1
  • Duplicated block (91 lines × 2 locations) REDACTED:2213 — REDACTED:2213 · REDACTED:2508 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (87 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (87 matched lines × 2 locations) src/services/scheduler/droidScheduler.js:41 — src/services/scheduler/droidScheduler.js:41 · src/services/scheduler/grokScheduler.js:21 — the two spans are one implementation copied and then locally edited — 472 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) REDACTED:1549 — REDACTED:1549 · REDACTED:1792 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (77 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (77 matched lines × 2 locations) src/services/account/claudeAccountService.js:1235 — src/services/account/claudeAccountService.js:1235 · src/services/account/claudeConsoleAccountService.js:1104 — the two spans are one implementation copied and then locally edited — 431 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (76 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (76 matched lines × 2 locations) web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:195 — web/admin-spa/src/components/apikeys/BatchApiKeyModal.vue:195 · web/admin-spa/src/components/apikeys/NewApiKeyModal.vue:149 — the two spans are one implementation copied and then locally edited — 321 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 (65 lines × 2 locations) · ×1
  • Duplicated block (65 lines × 2 locations) scripts/data-transfer-enhanced.js:832 — scripts/data-transfer-enhanced.js:832 · scripts/data-transfer.js:446 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (64 lines × 2 locations) · ×1
  • Duplicated block (64 lines × 2 locations) web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1011 — web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1011 · web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1059 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block with local edits (63 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (63 matched lines × 2 locations) REDACTED:1555 — REDACTED:1555 · REDACTED:59 — the two spans are one implementation copied and then locally edited — 339 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 (58 lines × 2 locations) · ×1
  • Duplicated block (58 lines × 2 locations) REDACTED:789 — REDACTED:789 · REDACTED:1502 — 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 (55 lines × 2 locations) · ×1
  • Duplicated block (55 lines × 2 locations) REDACTED:104 — REDACTED:104 · REDACTED:226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R11 · Import Boundaries · Boundary violation [package · ×1
  • Boundary violation [package:third-party-deep-import] web/admin-spa/src/main.js:4 — web/admin-spa/src/main.js:4 imports element-plus/dist/locale/zh-cn.mjs, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
R2 · Cyclomatic Complexity · Complex function createAccount (cyclomatic 172, cognitive 230) · ×1
  • Complex function createAccount (cyclomatic 172, cognitive 230) web/admin-spa/src/components/accounts/AccountForm.vue:5492 — createAccount has cyclomatic complexity 172 and cognitive complexity 230; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleMessagesRequest (cyclomatic 157, cognitive 282) · ×1
  • Complex function handleMessagesRequest (cyclomatic 157, cognitive 282) REDACTED:137 — handleMessagesRequest has cyclomatic complexity 157 and cognitive complexity 282; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 updateAccount (cyclomatic 155, cognitive 207) · ×1
  • Complex function updateAccount (cyclomatic 155, cognitive 207) web/admin-spa/src/components/accounts/AccountForm.vue:5940 — updateAccount has cyclomatic complexity 155 and cognitive complexity 207; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 createAccount (cyclomatic 130, cognitive 158) · ×1
  • Complex function createAccount (cyclomatic 130, cognitive 158) REDACTED:458 — createAccount has cyclomatic complexity 130 and cognitive complexity 158; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 updateAccount (cyclomatic 122, cognitive 170) · ×1
  • Complex function updateAccount (cyclomatic 122, cognitive 170) REDACTED:836 — updateAccount has cyclomatic complexity 122 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 handleResponses (cyclomatic 119, cognitive 167) · ×1
  • Complex function handleResponses (cyclomatic 119, cognitive 167) REDACTED:293 — handleResponses has cyclomatic complexity 119 and cognitive complexity 167; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 119, cognitive 148) · ×1
  • Complex function (anonymous) (cyclomatic 119, cognitive 148) REDACTED:101 — (anonymous) has cyclomatic complexity 119 and cognitive complexity 148; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleOAuthSuccess (cyclomatic 115, cognitive 143) · ×1
  • Complex function handleOAuthSuccess (cyclomatic 115, cognitive 143) web/admin-spa/src/components/accounts/AccountForm.vue:5236 — handleOAuthSuccess has cyclomatic complexity 115 and cognitive complexity 143; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 relayRequest (cyclomatic 111, cognitive 210) · ×1
  • Complex function relayRequest (cyclomatic 111, cognitive 210) REDACTED:480 — relayRequest has cyclomatic complexity 111 and cognitive complexity 210; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 authenticateApiKey (cyclomatic 109, cognitive 183) · ×1
  • Complex function authenticateApiKey (cyclomatic 109, cognitive 183) REDACTED:440 — authenticateApiKey has cyclomatic complexity 109 and cognitive complexity 183; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 106, cognitive 139) · ×1
  • Complex function (anonymous) (cyclomatic 106, cognitive 139) REDACTED:2108 — (anonymous) has cyclomatic complexity 106 and cognitive complexity 139; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 _getAllAvailableAccounts (cyclomatic 102, cognitive 194) · ×1
  • Complex function _getAllAvailableAccounts (cyclomatic 102, cognitive 194) src/services/scheduler/unifiedClaudeScheduler.js:515 — _getAllAvailableAccounts has cyclomatic complexity 102 and cognitive complexity 194; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 101, cognitive 211) · ×1
  • Complex function (anonymous) (cyclomatic 101, cognitive 211) src/routes/admin/usageStats.js:1247 — (anonymous) has cyclomatic complexity 101 and cognitive complexity 211; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 importData (cyclomatic 96, cognitive 253) · ×1
  • Complex function importData (cyclomatic 96, cognitive 253) scripts/data-transfer-enhanced.js:835 — importData has cyclomatic complexity 96 and cognitive complexity 253; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 96, cognitive 194) · ×1
  • Complex function (anonymous) (cyclomatic 96, cognitive 194) src/routes/admin/usageStats.js:1825 — (anonymous) has cyclomatic complexity 96 and cognitive complexity 194; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 relayRequest (cyclomatic 94, cognitive 149) · ×1
  • Complex function relayRequest (cyclomatic 94, cognitive 149) REDACTED:23 — relayRequest has cyclomatic complexity 94 and cognitive complexity 149; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleRequest (cyclomatic 91, cognitive 186) · ×1
  • Complex function handleRequest (cyclomatic 91, cognitive 186) REDACTED:68 — handleRequest has cyclomatic complexity 91 and cognitive complexity 186; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 recordUsageWithDetails (cyclomatic 85, cognitive 87) · ×1
  • Complex function recordUsageWithDetails (cyclomatic 85, cognitive 87) src/services/apiKeyService.js:1862 — recordUsageWithDetails has cyclomatic complexity 85 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 (anonymous) (cyclomatic 83, cognitive 98) · ×1
  • Complex function (anonymous) (cyclomatic 83, cognitive 98) src/routes/admin/usageStats.js:2708 — (anonymous) has cyclomatic complexity 83 and cognitive complexity 98; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleAnthropicMessagesToGemini (cyclomatic 81, cognitive 112) · ×1
  • Complex function handleAnthropicMessagesToGemini (cyclomatic 81, cognitive 112) src/services/anthropicGeminiBridgeService.js:1859 — handleAnthropicMessagesToGemini has cyclomatic complexity 81 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 (anonymous) (cyclomatic 81, cognitive 104) · ×1
  • Complex function (anonymous) (cyclomatic 81, cognitive 104) src/routes/admin/usageStats.js:3066 — (anonymous) has cyclomatic complexity 81 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 81, cognitive 80) · ×1
  • Complex function (anonymous) (cyclomatic 81, cognitive 80) REDACTED:1472 — (anonymous) has cyclomatic complexity 81 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 exportData (cyclomatic 80, cognitive 196) · ×1
  • Complex function exportData (cyclomatic 80, cognitive 196) scripts/data-transfer-enhanced.js:478 — exportData has cyclomatic complexity 80 and cognitive complexity 196; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 79, cognitive 145) · ×1
  • Complex function (anonymous) (cyclomatic 79, cognitive 145) src/routes/admin/usageStats.js:539 — (anonymous) has cyclomatic complexity 79 and cognitive complexity 145; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 getAllApiKeysFast (cyclomatic 77, cognitive 72) · ×1
  • Complex function getAllApiKeysFast (cyclomatic 77, cognitive 72) src/services/apiKeyService.js:1052 — getAllApiKeysFast has cyclomatic complexity 77 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 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 relayRequest (cyclomatic 76, cognitive 115) · ×1
  • Complex function relayRequest (cyclomatic 76, cognitive 115) src/services/relay/ccrRelayService.js:16 — relayRequest has cyclomatic complexity 76 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 (anonymous) (cyclomatic 76, cognitive 106) · ×1
  • Complex function (anonymous) (cyclomatic 76, cognitive 106) src/routes/admin/usageStats.js:933 — (anonymous) has cyclomatic complexity 76 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildGeminiRequestFromOpenAI (cyclomatic 74, cognitive 128) · ×1
  • Complex function buildGeminiRequestFromOpenAI (cyclomatic 74, cognitive 128) REDACTED:557 — buildGeminiRequestFromOpenAI has cyclomatic complexity 74 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 cleanJsonSchemaForGemini (cyclomatic 74, cognitive 104) · ×1
  • Complex function cleanJsonSchemaForGemini (cyclomatic 74, cognitive 104) src/utils/geminiSchemaCleaner.js:87 — cleanJsonSchemaForGemini has cyclomatic complexity 74 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 72, cognitive 72) · ×1
  • Complex function (anonymous) (cyclomatic 72, cognitive 72) REDACTED:38 — (anonymous) has cyclomatic complexity 72 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 _getAllAvailableAccounts (cyclomatic 69, cognitive 137) · ×1
  • Complex function _getAllAvailableAccounts (cyclomatic 69, cognitive 137) src/services/scheduler/unifiedGeminiScheduler.js:224 — _getAllAvailableAccounts has cyclomatic complexity 69 and cognitive complexity 137; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 calculateKeyStats (cyclomatic 68, cognitive 78) · ×1
  • Complex function calculateKeyStats (cyclomatic 68, cognitive 78) REDACTED:1073 — calculateKeyStats has cyclomatic complexity 68 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 convertAnthropicMessagesToGeminiContents (cyclomatic 63, cognitive 198) · ×1
  • Complex function convertAnthropicMessagesToGeminiContents (cyclomatic 63, cognitive 198) src/services/anthropicGeminiBridgeService.js:1026 — convertAnthropicMessagesToGeminiContents has cyclomatic complexity 63 and cognitive complexity 198; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleImages (cyclomatic 63, cognitive 78) · ×1
  • Complex function handleImages (cyclomatic 63, cognitive 78) REDACTED:971 — handleImages has cyclomatic complexity 63 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 60, cognitive 93) · ×1
  • Complex function (anonymous) (cyclomatic 60, cognitive 93) src/routes/admin/usageStats.js:2286 — (anonymous) has cyclomatic complexity 60 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 calculateCost (cyclomatic 59, cognitive 64) · ×1
  • Complex function calculateCost (cyclomatic 59, cognitive 64) src/services/pricingService.js:513 — calculateCost has cyclomatic complexity 59 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 58, cognitive 75) · ×1
  • Complex function (anonymous) (cyclomatic 58, cognitive 75) REDACTED:93 — (anonymous) has cyclomatic complexity 58 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 58, cognitive 57) · ×1
  • Complex function (anonymous) (cyclomatic 58, cognitive 57) web/admin-spa/src/views/ApiKeysView.vue:4530 — (anonymous) has cyclomatic complexity 58 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 58, cognitive 50) · ×1
  • Complex function (anonymous) (cyclomatic 58, cognitive 50) web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1655 — (anonymous) has cyclomatic complexity 58 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 56, cognitive 119) · ×1
  • Complex function (anonymous) (cyclomatic 56, cognitive 119) src/services/anthropicGeminiBridgeService.js:2715 — (anonymous) has cyclomatic complexity 56 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.
R3 · Large Files · web/admin-spa/src/components/accounts/AccountForm.vue · ×1
  • web/admin-spa/src/components/accounts/AccountForm.vue: 6637 lines of code web/admin-spa/src/components/accounts/AccountForm.vue:1 — web/admin-spa/src/components/accounts/AccountForm.vue has 6637 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 · web/admin-spa/src/views/AccountsView.vue · ×1
  • web/admin-spa/src/views/AccountsView.vue: 5419 lines of code web/admin-spa/src/views/AccountsView.vue:1 — web/admin-spa/src/views/AccountsView.vue has 5419 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: 4835 lines of code REDACTED:1 — REDACTED has 4835 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 · web/admin-spa/src/views/ApiKeysView.vue · ×1
  • web/admin-spa/src/views/ApiKeysView.vue: 4687 lines of code web/admin-spa/src/views/ApiKeysView.vue:1 — web/admin-spa/src/views/ApiKeysView.vue has 4687 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: 3288 lines of code REDACTED:1 — REDACTED has 3288 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/services/account/claudeAccountService.js · ×1
  • src/services/account/claudeAccountService.js: 3131 lines of code src/services/account/claudeAccountService.js:1 — src/services/account/claudeAccountService.js has 3131 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 · web/admin-spa/src/views/SettingsView.vue · ×1
  • web/admin-spa/src/views/SettingsView.vue: 3078 lines of code web/admin-spa/src/views/SettingsView.vue:1 — web/admin-spa/src/views/SettingsView.vue has 3078 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/routes/admin/usageStats.js · ×1
  • src/routes/admin/usageStats.js: 3013 lines of code src/routes/admin/usageStats.js:1 — src/routes/admin/usageStats.js has 3013 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/services/anthropicGeminiBridgeService.js · ×1
  • src/services/anthropicGeminiBridgeService.js: 2812 lines of code src/services/anthropicGeminiBridgeService.js:1 — src/services/anthropicGeminiBridgeService.js has 2812 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: 2721 lines of code REDACTED:1 — REDACTED has 2721 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/services/apiKeyService.js · ×1
  • src/services/apiKeyService.js: 2572 lines of code src/services/apiKeyService.js:1 — src/services/apiKeyService.js has 2572 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: 2495 lines of code REDACTED:1 — REDACTED has 2495 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: 1863 lines of code REDACTED:1 — REDACTED has 1863 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: 1755 lines of code REDACTED:1 — REDACTED has 1755 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/services/scheduler/unifiedClaudeScheduler.js · ×1
  • src/services/scheduler/unifiedClaudeScheduler.js: 1751 lines of code src/services/scheduler/unifiedClaudeScheduler.js:1 — src/services/scheduler/unifiedClaudeScheduler.js has 1751 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 · web/admin-spa/src/views/DashboardView.vue · ×1
  • web/admin-spa/src/views/DashboardView.vue: 1713 lines of code web/admin-spa/src/views/DashboardView.vue:1 — web/admin-spa/src/views/DashboardView.vue has 1713 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 · web/admin-spa/src/components/apikeys/EditApiKeyModal.vue · ×1
  • web/admin-spa/src/components/apikeys/EditApiKeyModal.vue: 1699 lines of code web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1 — web/admin-spa/src/components/apikeys/EditApiKeyModal.vue has 1699 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: 1656 lines of code REDACTED:1 — REDACTED has 1656 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 · web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue · ×1
  • web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue: 1568 lines of code web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue:1 — web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue has 1568 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: 1470 lines of code REDACTED:1 — REDACTED has 1470 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/services/requestDetailService.js · ×1
  • src/services/requestDetailService.js: 1430 lines of code src/services/requestDetailService.js:1 — src/services/requestDetailService.js has 1430 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/services/account/claudeConsoleAccountService.js · ×1
  • src/services/account/claudeConsoleAccountService.js: 1403 lines of code src/services/account/claudeConsoleAccountService.js:1 — src/services/account/claudeConsoleAccountService.js has 1403 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: 1387 lines of code REDACTED:1 — REDACTED has 1387 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/services/relay/droidRelayService.js · ×1
  • src/services/relay/droidRelayService.js: 1354 lines of code src/services/relay/droidRelayService.js:1 — src/services/relay/droidRelayService.js has 1354 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: 1343 lines of code REDACTED:1 — REDACTED has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1271 lines of code REDACTED:1 — REDACTED has 1271 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 · web/admin-spa/src/components/accounts/OAuthFlow.vue · ×1
  • web/admin-spa/src/components/accounts/OAuthFlow.vue: 1221 lines of code web/admin-spa/src/components/accounts/OAuthFlow.vue:1 — web/admin-spa/src/components/accounts/OAuthFlow.vue has 1221 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 · web/admin-spa/src/views/RequestDetailsView.vue · ×1
  • web/admin-spa/src/views/RequestDetailsView.vue: 1174 lines of code web/admin-spa/src/views/RequestDetailsView.vue:1 — web/admin-spa/src/views/RequestDetailsView.vue has 1174 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 · web/admin-spa/src/views/ApiStatsView.vue · ×1
  • web/admin-spa/src/views/ApiStatsView.vue: 1131 lines of code web/admin-spa/src/views/ApiStatsView.vue:1 — web/admin-spa/src/views/ApiStatsView.vue has 1131 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: 1092 lines of code REDACTED:1 — REDACTED has 1092 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: 1045 lines of code REDACTED:1 — REDACTED has 1045 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 · web/admin-spa/src/views/QuotaCardsView.vue · ×1
  • web/admin-spa/src/views/QuotaCardsView.vue: 1006 lines of code web/admin-spa/src/views/QuotaCardsView.vue:1 — web/admin-spa/src/views/QuotaCardsView.vue has 1006 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/services/scheduler/unifiedOpenAIScheduler.js · ×1
  • src/services/scheduler/unifiedOpenAIScheduler.js: 903 lines of code src/services/scheduler/unifiedOpenAIScheduler.js:1 — src/services/scheduler/unifiedOpenAIScheduler.js has 903 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 · web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue · ×1
  • web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue: 901 lines of code web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue:1 — web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue has 901 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/services/relay/ccrRelayService.js · ×1
  • src/services/relay/ccrRelayService.js: 875 lines of code src/services/relay/ccrRelayService.js:1 — src/services/relay/ccrRelayService.js has 875 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: 873 lines of code REDACTED:1 — REDACTED has 873 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: 830 lines of code REDACTED:1 — REDACTED has 830 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: 829 lines of code REDACTED:1 — REDACTED has 829 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/utils/grokHelper.js · ×1
  • src/utils/grokHelper.js: 825 lines of code src/utils/grokHelper.js:1 — src/utils/grokHelper.js has 825 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: 818 lines of code REDACTED:1 — REDACTED has 818 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R5 · Dependency Freshness · Dependency Freshness · ×1
  • Dependency Freshness — 33 outdated package(s); JS/npm CVEs scored in D30
R6 · Tooling · No typecheck script · ×1
  • No typecheck script — test ✓ · lint ✓ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
R7 · Dead Code · Dead file (~7079 LoC) · ×1
  • Dead file (~7079 LoC) web/admin-spa/src/components/accounts/AccountForm.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~5758 LoC) · ×1
  • Dead file (~5758 LoC) web/admin-spa/src/views/AccountsView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~4917 LoC) · ×1
  • Dead file (~4917 LoC) web/admin-spa/src/views/ApiKeysView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~3208 LoC) · ×1
  • Dead file (~3208 LoC) web/admin-spa/src/views/SettingsView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~1816 LoC) · ×1
  • Dead file (~1816 LoC) web/admin-spa/src/components/apikeys/EditApiKeyModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~1812 LoC) · ×1
  • Dead file (~1812 LoC) web/admin-spa/src/views/DashboardView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~1668 LoC) · ×1
  • Dead file (~1668 LoC) web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~1290 LoC) · ×1
  • Dead file (~1290 LoC) web/admin-spa/src/components/accounts/OAuthFlow.vue — no import path from any entry point (25 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — 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 (~1070 LoC) · ×1
  • Dead file (~1070 LoC) web/admin-spa/src/views/QuotaCardsView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~1053 LoC) · ×1
  • Dead file (~1053 LoC) web/admin-spa/src/views/RequestDetailsView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~972 LoC) · ×1
  • Dead file (~972 LoC) web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~880 LoC) · ×1
  • Dead file (~880 LoC) web/admin-spa/src/components/accounts/ApiKeyManagementModal.vue — no import path from any entry point (25 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — 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 (~832 LoC) · ×1
  • Dead file (~832 LoC) web/admin-spa/src/views/ApiStatsView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~748 LoC) · ×1
  • Dead file (~748 LoC) web/admin-spa/src/components/accounts/AccountUsageDetailModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~691 LoC) · ×1
  • Dead file (~691 LoC) web/admin-spa/src/components/common/AccountSelector.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~651 LoC) · ×1
  • Dead file (~651 LoC) web/admin-spa/src/views/UserManagementView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~625 LoC) · ×1
  • Dead file (~625 LoC) web/admin-spa/src/stores/apistats.js — no import path from any entry point (25 application, 25 tooling, 33 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 (~604 LoC) · ×1
  • Dead file (~604 LoC) web/admin-spa/src/components/common/UnifiedTestModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~567 LoC) · ×1
  • Dead file (~567 LoC) web/admin-spa/src/views/AccountUsageRecordsView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~549 LoC) · ×1
  • Dead file (~549 LoC) scripts/test-group-scheduling.js — no import path from any entry point (25 application, 25 tooling, 33 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 (~541 LoC) · ×1
  • Dead file (~541 LoC) web/admin-spa/src/views/ApiKeyUsageRecordsView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~538 LoC) · ×1
  • Dead file (~538 LoC) web/admin-spa/src/components/apistats/StatsOverview.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~523 LoC) · ×1
  • Dead file (~523 LoC) web/admin-spa/src/components/layout/AppHeader.vue — no import path from any entry point (25 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/layout/MainLayout.vue) — 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 (~515 LoC) · ×1
  • Dead file (~515 LoC) web/admin-spa/src/components/accounts/GroupManagementModal.vue — no import path from any entry point (25 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — 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 (~494 LoC) · ×1
  • Dead file (~494 LoC) web/admin-spa/src/components/tutorial/ClaudeCodeTutorial.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~477 LoC) · ×1
  • Dead file (~477 LoC) web/admin-spa/src/components/apikeys/ExpiryEditModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~473 LoC) · ×1
  • Dead file (~473 LoC) web/admin-spa/src/components/admin/RequestDetailModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~438 LoC) · ×1
  • Dead file (~438 LoC) web/admin-spa/src/components/apikeys/UsageDetailModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~418 LoC) · ×1
  • Dead file (~418 LoC) web/admin-spa/src/components/accounts/CcrAccountForm.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~416 LoC) · ×1
  • Dead file (~416 LoC) web/admin-spa/src/components/apistats/LimitConfig.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~414 LoC) · ×1
  • Dead file (~414 LoC) web/admin-spa/src/components/accounts/ProxyConfig.vue — no import path from any entry point (25 application, 25 tooling, 33 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/admin-spa/src/components/accounts/AccountForm.vue) — 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 (~411 LoC) · ×1
  • Dead file (~411 LoC) web/admin-spa/src/views/UserDashboardView.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~401 LoC) · ×1
  • Dead file (~401 LoC) web/admin-spa/src/components/admin/UserUsageStatsModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~399 LoC) · ×1
  • Dead file (~399 LoC) web/admin-spa/src/stores/theme.js — no import path from any entry point (25 application, 25 tooling, 33 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 (~397 LoC) · ×1
  • Dead file (~397 LoC) web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~391 LoC) · ×1
  • Dead file (~391 LoC) web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~383 LoC) · ×1
  • Dead file (~383 LoC) web/admin-spa/src/components/user/UserUsageStats.vue — no import path from any entry point (25 application, 25 tooling, 33 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 (~370 LoC) · ×1
  • Dead file (~370 LoC) web/admin-spa/src/utils/http_apis.js — no import path from any entry point (25 application, 25 tooling, 33 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 (~366 LoC) · ×1
  • Dead file (~366 LoC) web/admin-spa/src/stores/accounts.js — no import path from any entry point (25 application, 25 tooling, 33 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 · Unused dependency 'morgan' · ×1
  • Unused dependency 'morgan' — 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 'unplugin-element-plus' · ×1
  • Unused dependency 'unplugin-element-plus' — Declared in web/admin-spa/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 'xlsx' · ×1
  • Unused dependency 'xlsx' — Declared in web/admin-spa/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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) src/services/openaiToClaude.js:152 — `catch (e)` 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 — 273 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×51
  • 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 web/admin-spa/src/views/ApiKeyUsageRecordsView.vue: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 web/admin-spa/src/components/admin/UserUsageStatsModal.vue: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 web/admin-spa/src/components/user/UserUsageStats.vue: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 web/admin-spa/src/components/accounts/AccountScheduledTestModal.vue: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 web/admin-spa/src/components/accounts/AccountExpiryEditModal.vue: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/services/accountTestSchedulerService.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 web/admin-spa/src/components/settings/ModelPricingSection.vue: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 web/admin-spa/src/components/user/UserApiKeysManager.vue: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 web/admin-spa/src/components/accounts/BalanceDisplay.vue: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/services/userMessageQueueService.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/services/geminiToOpenAI.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/utils/commonHelper.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 web/admin-spa/src/views/BalanceScriptsView.vue: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 web/admin-spa/src/components/tutorial/NodeInstallTutorial.vue: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 web/admin-spa/src/components/admin/ChangeRoleModal.vue: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 web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue: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 web/admin-spa/src/components/apistats/ServiceCostCards.vue: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 web/admin-spa/src/components/user/CreateApiKeyModal.vue: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 web/admin-spa/src/components/user/ViewApiKeyModal.vue: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 web/admin-spa/src/components/accounts/AccountErrorHistoryModal.vue: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 web/admin-spa/src/components/tutorial/GeminiCliTutorial.vue: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 web/admin-spa/src/components/apikeys/RecordDetailModal.vue: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.
  • + 26 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate REDACTED:1116 — `!Array.isArray(messages) || messages.length === 0` appears character-identically in 2 files — REDACTED, src/services/userMessageQueueService.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/services/account/accountBalanceService.js:651 — `!Number.isFinite(dailyQuota) || dailyQuota <= 0` appears character-identically in 2 files — src/services/account/accountBalanceService.js, src/services/balanceProviders/baseBalanceProvider.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/services/scheduler/droidScheduler.js:63 — `!account || !isAccountHealthy(account) || !this._isAccountSchedulable(account)` appears character-identically in 2 files — src/services/scheduler/droidScheduler.js, src/services/scheduler/grokScheduler.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/services/account/geminiApiAccountService.js:423 — `!account || account.rateLimitStatus !== 'limited'` appears character-identically in 3 files — src/services/account/geminiApiAccountService.js, src/services/account/grokAccountService.js, src/services/account/openaiResponsesAccountService.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:408 — `!accountData || Object.keys(accountData).length === 0` appears character-identically in 8 files — REDACTED, src/services/account/azureOpenaiAccountService.js, src/services/account/ccrAccountService.js, src/services/account/claudeAccountService.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/services/requestBodyRuleService.js:165 — `!body || typeof body !== 'object' || Array.isArray(body)` appears character-identically in 2 files — src/services/requestBodyRuleService.js, src/utils/grokHelper.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 scripts/data-transfer-enhanced.js:1279 — `!command || command === '--help' || command === 'help'` appears character-identically in 2 files — scripts/data-transfer-enhanced.js, scripts/data-transfer.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 scripts/data-transfer-enhanced.js:857 — `!importDataObj.metadata || !importDataObj.data` appears character-identically in 2 files — scripts/data-transfer-enhanced.js, scripts/data-transfer.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/services/account/grokAccountService.js:227 — `!includeInactive && accountData.isActive !== 'true'` appears character-identically in 2 files — src/services/account/grokAccountService.js, src/services/account/openaiResponsesAccountService.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:2467 — `!keyData || Object.keys(keyData).length === 0` appears character-identically in 6 files — REDACTED, REDACTED, REDACTED, src/services/apiKeyService.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:426 — `!messages || !Array.isArray(messages) || messages.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 src/services/account/ccrAccountService.js:599 — `!modelMapping || Object.keys(modelMapping).length === 0` appears character-identically in 3 files — src/services/account/ccrAccountService.js, src/services/account/claudeConsoleAccountService.js, src/utils/commonHelper.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:344 — `!password || typeof password !== 'string'` appears character-identically in 2 files — REDACTED, src/utils/inputValidator.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/services/relay/bedrockRelayService.js:122 — `!queueResult.acquired && !queueResult.skipped` appears character-identically in 4 files — src/services/relay/bedrockRelayService.js, src/services/relay/ccrRelayService.js, 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/services/relay/droidRelayService.js:58 — `!requestBody || typeof requestBody !== 'object'` appears character-identically in 2 files — src/services/relay/droidRelayService.js, src/utils/sessionHelper.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/services/account/ccrAccountService.js:573 — `!supportedModels || (Array.isArray(supportedModels) && supportedModels.length === 0)` appears character-identically in 2 files — src/services/account/ccrAccountService.js, src/services/account/claudeConsoleAccountService.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/services/account/claudeAccountService.js:2260 — `!usageData || typeof usageData !== 'object'` appears character-identically in 2 files — src/services/account/claudeAccountService.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 REDACTED:2090 — `!usageReported && totalUsage.totalTokenCount > 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:1312 — `'realCostMicro' in data || 'ratedCostMicro' in data` appears character-identically in 3 files — REDACTED, src/routes/admin/usageStats.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 REDACTED:1163 — `(await client.get(requestCountKey)) || '0'` appears character-identically in 3 files — REDACTED, REDACTED, src/services/apiKeyService.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:1164 — `(await client.get(tokenCountKey)) || '0'` appears character-identically in 3 files — REDACTED, REDACTED, src/services/apiKeyService.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:494 — `abortController && !abortController.signal.aborted` appears character-identically in 8 files — REDACTED, REDACTED, REDACTED, src/services/relay/bedrockRelayService.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/services/balanceProviders/geminiBalanceProvider.js:194 — `account && Object.prototype.hasOwnProperty.call(account, 'dailyQuota')` appears character-identically in 2 files — src/services/balanceProviders/geminiBalanceProvider.js, src/services/balanceProviders/genericBalanceProvider.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:266 — `account && account.accountType === 'group'` appears character-identically in 4 files — REDACTED, REDACTED, 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:904 — `account && account.isActive === 'true' && !isRateLimited(account) && !isSubscriptionExpired(account)` 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.
  • + 15 more in this group — see findings.md.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×40
  • Diagnostic log message is built whether or not it is wanted REDACTED:313 — `debug` at line 313 is called with an argument built by `Object.keys(entries[0])` (line 316), 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.
  • Diagnostic log message is built whether or not it is wanted REDACTED:560 — `debug` at line 560 is called with an argument built by `Object.keys(ldapEntry || { })` (line 563), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:107 — `debug` at line 107 is called with an argument built by `JSON.stringify(processedBody)` (line 116), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:119 — `debug` at line 119 is called with an argument built by `Object.keys(requestHeaders)` (line 122), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:127 — `debug` at line 127 is called with an argument built by `Object.keys(processedBody)` (line 130), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:142 — `debug` at line 142 is called with an argument built by `Object.keys(response.headers || { })` (line 146), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/azureOpenaiRelayService.js:621 — `debug` at line 621 is called with an argument built by `Object.keys(responseData || { })` (line 622), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:98 — `debug` at line 98 is called with an argument built by `JSON.stringify(account.supportedModels)` (line 98), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:161 — `debug` at line 161 is called with an argument built by `JSON.stringify(options)` (line 161), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:162 — `debug` at line 162 is called with an argument built by `JSON.stringify(clientHeaders)` (line 162), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:166 — `debug` at line 166 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 166), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:208 — `debug` at line 208 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 209), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:221 — `debug` at line 221 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 223), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:253 — `debug` at line 253 is called with an argument built by `JSON.stringify(response.headers)` (line 253), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:255 — `debug` at line 255 is called with an argument built by `JSON.stringify(response.data)` (line 256), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:258 — `debug` at line 258 is called with an argument built by `JSON.stringify(response.data)` (line 259), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:584 — `debug` at line 584 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 584), 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.
  • Diagnostic log message is built whether or not it is wanted src/services/relay/ccrRelayService.js:817 — `debug` at line 817 is called with an argument built by `JSON.stringify(collectedUsage)` (line 817), 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.
  • Diagnostic log message is built whether or not it is wanted REDACTED:139 — `debug` at line 139 is called with an argument built by `JSON.stringify(account.supportedModels)` (line 139), 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.
  • Diagnostic log message is built whether or not it is wanted REDACTED:204 — `debug` at line 204 is called with an argument built by `JSON.stringify(options)` (line 204), 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.
  • Diagnostic log message is built whether or not it is wanted REDACTED:205 — `debug` at line 205 is called with an argument built by `JSON.stringify(clientHeaders)` (line 205), 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.
  • Diagnostic log message is built whether or not it is wanted REDACTED:209 — `debug` at line 209 is called with an argument built by `JSON.stringify(filteredHeaders)` (line 209), 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.
  • Diagnostic log message is built whether or not it is wanted REDACTED:251 — `debug` at line 251 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 252), 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.
  • Diagnostic log message is built whether or not it is wanted REDACTED:264 — `debug` at line 264 is called with an argument built by `JSON.stringify(requestConfig.headers, null, 2)` (line 266), 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.
  • Diagnostic log message is built whether or not it is wanted REDACTED:296 — `debug` at line 296 is called with an argument built by `JSON.stringify(response.headers)` (line 296), 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.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging REDACTED:62 — `info` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:125 — `info` at line 125 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:256 — `info` at line 256 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:274 — `info` at line 274 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:507 — `info` at line 507 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:610 — `info` at line 610 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:613 — `info` at line 613 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:616 — `info` at line 616 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:617 — `info` at line 617 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:618 — `info` at line 618 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:624 — `info` at line 624 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:657 — `info` at line 657 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:664 — `info` at line 664 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:699 — `info` at line 699 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:708 — `info` at line 708 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:781 — `error` at line 781 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:786 — `info` at line 786 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:789 — `warn` at line 789 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:836 — `info` at line 836 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:901 — `info` at line 901 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging src/validators/clientValidator.js:38 — `warn` at line 38 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging src/validators/clientValidator.js:62 — `warn` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging src/validators/clientValidator.js:69 — `error` at line 69 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging src/validators/clientValidator.js:97 — `warn` at line 97 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging src/validators/clientValidator.js:103 — `debug` at line 103 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Pending state with no failure state · ×26
  • Pending state with no failure state web/admin-spa/src/views/AccountUsageRecordsView.vue:125 — The view draws `加载中...` 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 web/admin-spa/src/views/ApiKeyUsageRecordsView.vue:124 — The view draws `加载中...` 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 web/admin-spa/src/views/QuotaCardsView.vue:158 — The view draws `加载中...` 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 web/admin-spa/src/views/QuotaCardsView.vue:513 — The view draws `创建额度卡 卡片类型 额度卡 时间卡 组合卡 额度数量 (美元) 时间数量 小时 天 月 批量生成数量 备注(可选) 取消 {{ creating ? '创建中...' : '创建' }}` under `showCreateModal`, but `showCreateModal` 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 web/admin-spa/src/views/QuotaCardsView.vue:628 — The view draws `<i v-if="creating" class="fas fa-spinner fa-spin mr-2" />` under `creating`, but `creating` 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 web/admin-spa/src/views/RequestDetailsView.vue:40 — The view draws `请求明细采集尚未开启 到系统设置开启“请求明细采集”后,后台会开始记录新的请求摘要。历史请求不会回填。 前往系统设置 清理所有已保存的历史请求体预览数据;仅影响历史预览,不影响当前请求体预览开关设置 清理历史预览` under `!captureEnabled && !loading && records.length === 0 && !hasActiveFilters`, 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 web/admin-spa/src/views/RequestDetailsView.vue:91 — The view draws `请求明细采集已关闭,当前展示的是仍在保留期内的历史记录;不会继续写入新的请求明细。 总请求 {{ formatNumber(summary.totalRequests) }} 输入 / 输出 {{ formatNumber(summary.inputTokens) }} 输出 {{ formatNumber(summary.outputTokens) }} 缓存命中率 {{ formatPercent(summary.cacheHitRate) }} 读 / (输入 + 读 + 建):{{ formatNumber(summary.cacheHitNumerator) }} / {{ formatNumber(summary.cacheHitDenominator) }} 总费用 {{ formatCost(summary.totalCost) }} 平均耗时 {{ formatDuration(summary.avgDurationMs) }} 刷新 重置筛选 导出 CSV 清理所有已保存的历史请求体预览数据;仅影响历史预览,不影响当前请求体预览开关设置 清理历史预览` under `!captureEnabled && !loading && records.length === 0 && !hasActiveFilters`, 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 web/admin-spa/src/views/RequestDetailsView.vue:343 — The view draws `加载中...` 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 web/admin-spa/src/views/UserManagementView.vue:236 — The view draws `Loading users...` 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 web/admin-spa/src/components/user/UserApiKeysManager.vue:54 — The view draws `Loading API keys...` 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 web/admin-spa/src/components/user/UserUsageStats.vue:23 — The view draws `Loading usage statistics...` 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 web/admin-spa/src/components/settings/ModelPricingSection.vue:67 — The view draws `加载价格数据中...` 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 web/admin-spa/src/components/layout/AppHeader.vue:66 — The view draws `当前版本 v{{ versionInfo.current || '...' }} 有新版本 v{{ versionInfo.latest }} 查看更新 检查更新中... 当前已是最新版本 检查更新 修改账户信息 退出登录` under `userMenuOpen`, but `userMenuOpen` 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 web/admin-spa/src/components/layout/AppHeader.vue:267 — The view draws `<div v-if="changePasswordLoading" class="loading-spinner mr-2" />` under `changePasswordLoading`, but `changePasswordLoading` 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 web/admin-spa/src/components/apikeys/BatchEditApiKeyModal.vue:492 — The view draws `<div v-if="loading" class="loading-spinner mr-2" />` 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 web/admin-spa/src/components/apikeys/EditApiKeyModal.vue:1022 — The view draws `<div v-if="loading" class="loading-spinner mr-2" />` 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 web/admin-spa/src/components/apikeys/ExpiryEditModal.vue:206 — The view draws `<div v-if="saving" class="loading-spinner mr-2" />` under `saving`, but `saving` 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 web/admin-spa/src/components/apikeys/RenewApiKeyModal.vue:88 — The view draws `<div v-if="loading" class="loading-spinner mr-2" />` 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 web/admin-spa/src/components/apikeys/TagManagementModal.vue:42 — The view draws `<i v-if="creating" class="fas fa-spinner fa-spin mr-1" />` under `creating`, but `creating` 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 web/admin-spa/src/components/apikeys/TagManagementModal.vue:48 — The view draws `加载中...` 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 web/admin-spa/src/components/apikeys/TagManagementModal.vue:123 — The view draws `重命名标签 新名称 取消 确定` under `showRenameModal`, but `showRenameModal` 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 web/admin-spa/src/components/apikeys/TagManagementModal.vue:154 — The view draws `<i v-if="processing" class="fas fa-spinner fa-spin mr-1" />` under `processing`, but `processing` 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 web/admin-spa/src/components/admin/UserUsageStatsModal.vue:42 — The view draws `Loading usage statistics...` 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 web/admin-spa/src/components/accounts/GroupManagementModal.vue:62 — The view draws `加载中...` 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 web/admin-spa/src/components/accounts/GroupManagementModal.vue:209 — The view draws `<div v-if="updating" class="loading-spinner mr-2" />` under `updating`, but `updating` 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.
  • + 1 more in this group — see findings.md.
D12 · Dependency Hygiene · Deprecated · ×21
  • Deprecated: @humanwhocodes/config-array REDACTED:1518 — @humanwhocodes/config-array 0.13.0 is resolved in REDACTED and is marked deprecated by its publisher: "Use @eslint/config-array instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @humanwhocodes/object-schema REDACTED:1573 — @humanwhocodes/object-schema 2.0.3 is resolved in REDACTED and is marked deprecated by its publisher: "Use @eslint/object-schema instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/asn1 REDACTED:2079 — @ldapjs/asn1 2.0.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/attribute REDACTED:2086 — @ldapjs/attribute 1.0.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/change REDACTED:2098 — @ldapjs/change 1.0.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/controls REDACTED:2109 — @ldapjs/controls 2.1.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/asn1 REDACTED:2120 — @ldapjs/asn1 1.2.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/dn REDACTED:2127 — @ldapjs/dn 1.1.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/filter REDACTED:2138 — @ldapjs/filter 2.1.1 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/messages REDACTED:2150 — @ldapjs/messages 1.3.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @ldapjs/protocol REDACTED:2167 — @ldapjs/protocol 1.2.1 is resolved in REDACTED and is marked deprecated by its publisher: "This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: glob REDACTED:5236 — glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: inflight REDACTED:5575 — inflight 1.0.6 is resolved in REDACTED and is marked deprecated by its publisher: "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: node-domexception REDACTED:7041 — node-domexception 1.0.0 is resolved in REDACTED and is marked deprecated by its publisher: "Use your platform's native DOMException instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: rimraf REDACTED:8020 — rimraf 3.0.2 is resolved in REDACTED and is marked deprecated by its publisher: "Rimraf versions prior to v4 are no longer supported". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: superagent REDACTED:8597 — superagent 8.1.2 is resolved in REDACTED and is marked deprecated by its publisher: "Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @humanwhocodes/config-array REDACTED:622 — @humanwhocodes/config-array 0.13.0 is resolved in REDACTED and is marked deprecated by its publisher: "Use @eslint/config-array instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: @humanwhocodes/object-schema REDACTED:652 — @humanwhocodes/object-schema 2.0.3 is resolved in REDACTED and is marked deprecated by its publisher: "Use @eslint/object-schema instead". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: glob REDACTED:2651 — glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: inflight REDACTED:2807 — inflight 1.0.6 is resolved in REDACTED and is marked deprecated by its publisher: "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: rimraf REDACTED:4008 — rimraf 3.0.2 is resolved in REDACTED and is marked deprecated by its publisher: "Rimraf versions prior to v4 are no longer supported". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
P2 · Observability · Console output used as the logging channel · ×10
  • Console output used as the logging channel src/utils/costCalculator.js:368 — `src/utils/costCalculator.js` reports through `console.*` at line 368 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/utils/costCalculator.js:376 — `src/utils/costCalculator.js` reports through `console.*` at line 376 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/utils/lruCache.js:89 — `src/utils/lruCache.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/utils/lruCache.js:102 — `src/utils/lruCache.js` reports through `console.*` at line 102 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/utils/lruCache.js:128 — `src/utils/lruCache.js` reports through `console.*` at line 128 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/utils/runtimeAddon.js:114 — `src/utils/runtimeAddon.js` reports through `console.*` at line 114 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel src/utils/runtimeAddon.js:116 — `src/utils/runtimeAddon.js` reports through `console.*` at line 116 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 REDACTED:3014 — `REDACTED` reports through `console.*` at line 3014 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 REDACTED:3081 — `REDACTED` reports through `console.*` at line 3081 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 REDACTED:3171 — `REDACTED` reports through `console.*` at line 3171 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×7
  • Hand-rolled JSON/XML parsing via regex REDACTED:299 — 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:304 — 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:310 — 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:319 — 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:320 — 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:342 — 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:343 — 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.
D12 · Dependency Hygiene · Outdated (npm) · ×6
  • Outdated (npm): commander package.json:57 — commander is pinned at 11.1.0; registry.npmjs.org publishes 15.1.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): inquirer package.json:65 — inquirer is pinned at 8.2.7; registry.npmjs.org publishes 14.3.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): nodemailer package.json:70 — nodemailer is pinned at 7.0.11; registry.npmjs.org publishes 10.5.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): ora package.json:71 — ora is pinned at 5.4.1; registry.npmjs.org publishes 10.0.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): rate-limiter-flexible package.json:72 — rate-limiter-flexible is pinned at 5.0.5; registry.npmjs.org publishes 11.4.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): uuid package.json:76 — uuid is pinned at 9.0.1; registry.npmjs.org publishes 14.0.3 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
D30 · Dependency Vulnerabilities · Low CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default in catch · ×5
  • Silent fallback default in catch src/services/apiKeyIndexService.js:602 — `_getAvailableTags` 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/services/account/claudeConsoleAccountService.js:1216 — `_maskApiUrl` 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/utils/safeRotatingAppend.js:42 — `getFileSize` 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 src/services/apiKeyService.js:158 — `parseOpenAIResponsesPayloadRules` 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/services/anthropicGeminiBridgeService.js:226 — `normalizeToolUseInput` 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.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 4 significant file(s) lose their only recent owner: src/services/requestDetailService.js, web/admin-spa/src/views/RequestDetailsView.vue, web/admin-spa/src/components/admin/RequestDetailModal.vue, REDACTED. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: REDACTED, src/utils/rateLimitHeaderHelper.js, src/utils/accountRollingUsage.js. Pair on, review, or document these before any departure.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies REDACTED:197 — 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) — 8 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 (17 single-owned of 234 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; 234 of the 267 production source files in this repository met that bar). They are anonymized user #3 (3 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)) (+2 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: web/admin-spa/src/components/accounts/AccountBalanceScriptModal.vue, web/admin-spa/src/components/apikeys/RecordDetailModal.vue, REDACTED, src/services/relay/bedrockRelayService.js, src/services/quotaCardService.js, REDACTED, src/services/requestIdentityService.js, REDACTED (+2 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found package.json:7 — 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 7).
D21 · Naming Consistency · `effectiveClientID` spells `ID` where 541 names in the project spell it `Id` · ×1
  • `effectiveClientID` spells `ID` where 541 names in the project spell it `Id` src/utils/grokHelper.js:631 — 541 of 543 names in project claude-relay-service spell the token `Id` (541 of 543; unit: names in project claude-relay-service containing `Id`). Peers: data-transfer-enhanced.exportUsageStats(keyId) (scripts/data-transfer-enhanced.js:148); data-transfer-enhanced.importUsageStats(keyId) (scripts/data-transfer-enhanced.js:299); generate-test-data.generateDataForDate(apiKeyId) (REDACTED:30); geminiHandlers.handleGeminiUpstreamError(accountId) (REDACTED:27); auth.shouldRejectDueToOverload(apiKeyId) (REDACTED:29). Rename to `effectiveClientId`. [rule N6]
D21 · Naming Consistency · `clientID` spells `ID` where 541 names in the project spell it `Id` · ×1
  • `clientID` spells `ID` where 541 names in the project spell it `Id` src/utils/grokHelper.js:784 — 541 of 543 names in project claude-relay-service spell the token `Id` (541 of 543; unit: names in project claude-relay-service containing `Id`). Peers: data-transfer-enhanced.exportUsageStats(keyId) (scripts/data-transfer-enhanced.js:148); data-transfer-enhanced.importUsageStats(keyId) (scripts/data-transfer-enhanced.js:299); generate-test-data.generateDataForDate(apiKeyId) (REDACTED:30); geminiHandlers.handleGeminiUpstreamError(accountId) (REDACTED:27); auth.shouldRejectDueToOverload(apiKeyId) (REDACTED:29). Rename to `clientId`. [rule N6]
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (96848 LoC, 204 module-visible types across 17 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
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 51 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: REDACTED, REDACTED, src/services/accountTestSchedulerService.js, src/services/userMessageQueueService.js, src/services/geminiToOpenAI.js, src/utils/commonHelper.js, web/admin-spa/src/views/ApiKeyUsageRecordsView.vue, REDACTED (and 43 more) (66 orphaned of 234 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; 234 of the 267 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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D37 · Vulnerability-disclosure Policy · REDACTED · ×1
  • REDACTED
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.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift README_EN.md:85 — README_EN.md links to `docs/preview.md`, but `docs/preview.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.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:4 — 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:51 — `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`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
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 8/50 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.
Minor — 27 finding(s)
D12 · Dependency Hygiene · Outdated (npm) · ×26
  • Outdated (npm): @aws-sdk/client-bedrock-runtime — @aws-sdk/client-bedrock-runtime is pinned at 3.943.0; registry.npmjs.org publishes 3.1169.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): @aws-sdk/credential-providers — @aws-sdk/credential-providers is pinned at 3.943.0; registry.npmjs.org publishes 3.1169.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): @fortawesome/fontawesome-free — @fortawesome/fontawesome-free is pinned at 6.7.2; registry.npmjs.org publishes 7.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): axios — axios is pinned at 1.13.2; registry.npmjs.org publishes 1.21.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): bcryptjs — bcryptjs is pinned at 2.4.3; registry.npmjs.org publishes 3.0.3 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): chalk — chalk is pinned at 4.1.2; registry.npmjs.org publishes 6.0.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): chart.js — chart.js is pinned at 4.5.0; registry.npmjs.org publishes 4.6.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): compression — compression is pinned at 1.8.1; registry.npmjs.org publishes 1.8.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): cors — cors is pinned at 2.8.5; registry.npmjs.org publishes 2.8.6 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): dayjs — dayjs is pinned at 1.11.13; registry.npmjs.org publishes 1.11.23 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): dotenv — dotenv is pinned at 16.6.1; registry.npmjs.org publishes 18.0.10 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): element-plus — element-plus is pinned at 2.10.4; registry.npmjs.org publishes 2.14.8 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): express — express is pinned at 4.22.1; registry.npmjs.org publishes 5.3.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): google-auth-library — google-auth-library is pinned at 10.5.0; registry.npmjs.org publishes 11.3.4 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): helmet — helmet is pinned at 7.2.0; registry.npmjs.org publishes 8.3.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): https-proxy-agent — https-proxy-agent is pinned at 7.0.6; registry.npmjs.org publishes 9.1.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): ioredis — ioredis is pinned at 5.8.2; registry.npmjs.org publishes 6.0.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): morgan — morgan is pinned at 1.10.1; registry.npmjs.org publishes 1.12.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): node-cron — node-cron is pinned at 4.2.1; registry.npmjs.org publishes 4.6.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): pinia — pinia is pinned at 2.3.1; registry.npmjs.org publishes 4.1.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): socks-proxy-agent — socks-proxy-agent is pinned at 8.0.5; registry.npmjs.org publishes 10.1.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): table — table is pinned at 6.9.0; registry.npmjs.org publishes 6.10.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): vue — vue is pinned at 3.5.18; registry.npmjs.org publishes 3.5.45 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): vue-router — vue-router is pinned at 4.5.1; registry.npmjs.org publishes 5.5.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): winston — winston is pinned at 3.18.3; registry.npmjs.org publishes 3.19.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • + 1 more in this group — see findings.md.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names src/utils/modelHelper.js:95 — 1 of 5 documented parameters and 0 of 7 summaries in `claude-relay-service` only repeat the member or parameter name (e.g. "Model name" for `modelName`). Delete the restating tags, or add what the name does not say.

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-a0e7c800f9074b0aaa809272ef7cf207/history.json --exit-code 0 --source .5artifacts/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-a0e7c800f9074b0aaa809272ef7cf207/tree.json --exit-code 0 --source .2artifacts/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 .367artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .88artifacts/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 --config /opt/semgrep-rules/gdpr.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 .2artifacts/raw/semgrep-gdpr.json
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 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 01a1dd9e-daf0-7909-b89f-5eafcfcb27e0 · 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