Public report of Javis603/token-monitor, published 17 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, 17 November 2026, 08:06 UTC · Survey ID cd_64caddce8a3d49958986e46b1d4e24cd

Javis603/token-monitor

Measured 17 November 2026, 08:05 UTC, at code version 2e88ee0

First survey, so nothing to compare with yet
CAI score 42.2out of 100 Weak
CriticalWeakAdequateStrongExemplary

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: 186,853 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 2.7 person-years · Weakest lens: Accessibility, 34.4

Findings by how serious they are

57 critical 2363 serious 147 minor

11 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
17 November 2026, 08:05 UTC

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

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

65of 65 dimensions measured by tools.
2545of 2567 findings point to an exact file and line, so you can open each one in the code. The other 22 concern the repository as a whole, such as missing documentation.
65dimensions across 7 lenses, read from 186,853 lines of product code in 2 projects.
Chapters

Executive summary

Javis603/token-monitor falls short of our standard for a preview release, in part because it has controls that only work with a mouse. It scores 42.2 out of 100 and is rated Weak, and 28 of its 57 critical findings are security problems.

Accessibility, at 34.4, is the weakest lens and counts most in the score. The best first step for the work it takes is replacing the three exposed passwords or keys and switching the old ones off, worth about 2.3 points. Fixing focus, motion and contrast would lift Accessibility itself, worth about 4.3 points. Raising Accessibility to 65 would lift the score to about 48.6.

Nineteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Five controls can't be used without a mouse, and seven form fields can't be read by a screen reader. Pinning each tool to an exact version, making the controls work with a keyboard and labelling the form fields would close these risks. Fixing the weaknesses the scanner points to would fix the two security weaknesses in the code, and the three passwords or keys in the code and the two passwords or keys in the code's history need replacing, with the old ones switched off. The five sets of files in separate parts that keep changing together need that dependency made explicit.

The product code is 186,853 lines, about €390,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.
Accessibility 34.4 · counts for 46%Code Health 37.6 · counts for 25%Production Readiness 51.1 · counts for 14%Performance 60.0 · counts for 8%Maturity 67.9 · counts for 4%Security and Compliance 68.9 · counts for 2%Architecture 76.0 · counts for 1%

If Accessibility rose from 34.4 to 65, the lowest score rated Strong, the score would rise from 42.2 to about 48.6.

Code composition: what the lines of code are
Business logic 0%Supporting code 0%Tests 100%
Rebuild cost: about €390,000 · Estimate
Cost to rebuild€130,000 to €660,000, for 2,173 to 6,895 hours of work, about 2.7 person-years for 1 to 6 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 42. 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: 186,853 lines of product code
Comment linesThe estimate prices 186,526 lines. Comment lines count towards the size of 186,853 lines but aren't priced as work.
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.

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 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3).
Raises the score by about 2.3 points · Low effort · REDACTED Scanning
2
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.
Raises the score by about 4.3 points · Medium effort · Visual & motion safety
3
Resolve the 1 finding(s) in Type Safety.
Raises the score by about 3.6 points · Medium effort · Type Safety

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €390,000 to build again, about 2.7 person-years of work. Its weakest lens is Accessibility, at 34.4 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 3 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 2.3 points for low effort, because it clears the 3 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 371,809 lines over the last 90 days, which is about 1,507,892 lines a year. At that pace, the extra work comes to an estimated 225.2 to 1351 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.

At a glance — Code Health · 37.6 · Weak · gated by D1, D2, R1, X5 ·

At a glance — Architecture · 76.0 · Adequate · gated by R9 ·

At a glance — Maturity · 67.9 · Adequate · gated by M2 ·

At a glance — Readiness · 51.1 · Adequate · gated by D13, P2 ·

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

At a glance — Accessibility · 34.4 · Weak · gated by AC1, AC4, AC6 ·

At a glance — Performance · 60.0 · 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 — Injection68High / Critical
A03:2025 — Software Supply Chain Failures8Medium
A07:2025 — Authentication Failures6High / Critical

Roadmap

Top priorities: 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; Resolve the 1 finding(s) in Type Safety; Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.

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

Do thisHelpsEffortDimension
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3).+2.3 ptsLowREDACTED Scanning
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.+4.3 ptsMediumVisual & motion safety
Resolve the 1 finding(s) in Type Safety.+3.6 ptsMediumType Safety
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.9 ptsMediumKeyboard semantics
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.+2.7 ptsMediumText alternatives
Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.+2.6 ptsMediumNullable reference types
Adopt pino (or winston) and log at meaningful points in the services you run.+1.6 ptsMediumObservability
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+1.6 ptsMediumPage structure

File quality

Per-file score 0–10 — a quality signature. Of 318 files carrying findings, judged against the Preview bar: 1% slop · 7% mixed · 92% near-clean.

FileScoreBandWorst signal
REDACTED0.1SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED2.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): High: REDACTED
src/electron/main.js5.0MixedChange Coupling: Boundary-crossing change coupling: main.js ↔ index.js
src/electron/renderer/limits/providerPresentation.js5.0MixedChange Coupling: Boundary-crossing change coupling: providerPresentation.js ↔ credentialStore.js
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.4MixedDependency Vulnerabilities: Medium CVE: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
src/shared/credentialStore.js5.7MixedCyclomatic Complexity: credentialStore.readRegularFileNoFollow (cyclomatic 27)

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

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

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

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

Could not be resolved — 11

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 65 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 1.0, 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 — 65 dimensions across the health lenses
D1D2D3D4D5D6D8D10D11D12D13D14D15D16D17D19D20D21D24D27D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX4AX6GD1M1M2M3M4P1P10P2P3P4P6PF3R1R10R11R2R3R4R5R6R7R8R9X24X5

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, 2545 of 2567 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 01a1e889-c841-7405-9058-e8481c55467b.

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. At least one `dotnet test` target was stopped at its time budget, so the gathered reports cover only part of the suite. The overall 43.6% is a FLOOR (everything the completed runs covered really is covered), but a per-file figure from a partial gather cannot tell an untested file from one whose test project never ran — so per-file and CRAP rows are withheld rather than published as measurements. You can widen what we reach: optional: commit the Cobertura/OpenCover/lcov report your CI already produces, and per-file rows can be read without a re-run.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 9,404 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 2 test source file(s) (.swift) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `native/macos/TokenMonitorWidget/WidgetDashboardViews.swift`, `native/macos/TokenMonitorWidget/WidgetViewModel.swift`, `REDACTED`, `src/shared/providers/ollama/limits.js` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • 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. 17 further occurrence(s) are not listed individually; the score already reflects all 57.
  • AXB2 Runtime readiness — 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. The dev server exited, and its output does not match a cause we recognise. (rule: unrecognised-exit). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "> token-monitor@0.93.1 dev / > npm run ensure:tokscale && electron . / > token-monitor@0.93.1 ensure:tokscale / > node scripts/ensure-vendored-tokscale.js / Ensuring vendored tokscale (token-monitor-648cc594, source 648cc594b86f) for linux-x64... / ensure-vendored-tokscale failed: fetch failed" No runtime evidence was gathered.
  • 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 DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "> token-monitor@0.93.1 dev / > npm run ensure:tokscale && electron . / > token-monitor@0.93.1 ensure:tokscale / > node scripts/ensure-vendored-tokscale.js / Ensuring vendored tokscale (token-monitor-648cc594, source 648cc594b86f) for linux-x64... / ensure-vendored-tokscale failed: fetch failed" No runtime evidence was gathered.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and none applies: this repository publishes a library and deploys nothing (no container, IaC or deployment manifest), so it holds no runtime state of its own. Any data-access dependency it declares is the store it is a CLIENT for, not one it operates. The DR control belongs to whoever runs that data.
  • PF3 Async & latency hygiene — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
  • 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. 468 further occurrence(s) are not listed individually; the score already reflects all 508.
  • 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. 1120 further occurrence(s) are not listed individually; the score already reflects all 1160.
  • 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. 37 further occurrence(s) are not listed individually; the score already reflects all 77.
  • 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. 73 further occurrence(s) are not listed individually; the score already reflects all 113.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 23 further occurrence(s) are not listed individually; the score already reflects all 63.

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.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • 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.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (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".
  • 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

1200 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was windowsView.createLimitWindowsView.renderProviderWindows at 292. A further 9 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 main.getSyncContentRuntime at 28 — they are counted neither in the figure above nor in this dimension's score.

selectControl.enhance::handleKey (cyclomatic 30) · ×3src/electron/renderer/selectControl.js:459
sessionMetadata.resolveSessionMetadata (cyclomatic 40) · ×2src/shared/providers/cursor/sessionMetadata.js:195
sessionMetadata.resolveSessionMetadata (cyclomatic 21) · ×2src/shared/providers/claude/sessionMetadata.js:643
windowsView.createLimitWindowsView.renderProviderWindows (cyclomatic 292)src/electron/renderer/limits/windowsView.js:1030
createLimitWindowsView.renderProviderWindows (cyclomatic 292)src/electron/renderer/limits/windowsView.js:1030

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

What to do

  1. Bring the 52 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with windowsView.createLimitWindowsView.renderProviderWindows (cyclomatic 292), createLimitWindowsView.renderProviderWindows (cyclomatic 292), (anonymous)::applySettingsPatch (cyclomatic 255). — 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 52 together lifts Cyclomatic Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

Detailed fixes: 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

1313 method(s) exceeded the cognitive complexity threshold of 15; the worst was windowsView.createLimitWindowsView.renderProviderWindows at 498.

enhance::handleKey (cognitive 35) · ×2src/electron/renderer/selectControl.js:459
windowsView.createLimitWindowsView.renderProviderWindows (cognitive 498)src/electron/renderer/limits/windowsView.js:1030
createLimitWindowsView.renderProviderWindows (cognitive 498)src/electron/renderer/limits/windowsView.js:1030
setupCursorAccountUI (cognitive 282)REDACTED:19600
(anonymous)::applySettingsPatch (cognitive 264)src/electron/main.js:8498

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

What to do

  1. Bring the 92 bodies over 60 down to 60 or less in Cognitive Complexity — start with windowsView.createLimitWindowsView.renderProviderWindows (cognitive 498), createLimitWindowsView.renderProviderWindows (cognitive 498), setupCursorAccountUI (cognitive 282). — 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 92 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes7.1 / 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.1 / 10 · rule-coverage 100% · ceiling Prevented

164 over-large unit(s) detected — types, modules or files that carry too much.

FunctionTooLong: windowsView.createLimitWindowsView · ×123src/electron/renderer/limits/windowsView.js:50
FileTooLong: REDACTED · ×40REDACTED
MethodTooLong: HubDO.fetchworker/src/index.js:462

What to do

  1. Resolve the 123 FunctionTooLong finding(s) in God Classes — start with REDACTED (16), main.js (7), collector.js (6). — One of this dimension's main actionable groups (123 warning-level).
  2. Resolve the 40 FileTooLong finding(s) in God Classes — start with REDACTED (8), main.js (2), controller.js (2). — One of this dimension's main actionable groups (40 warning-level).
  3. Resolve the 1 MethodTooLong finding(s) in God Classes — start with index.js. — One of this dimension's main actionable groups (1 warning-level).

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

D4 · Code Duplication9.9 / 10Stronggated by 8 serious findings✓ 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 9.9 / 10 · rule-coverage 100% · ceiling Verified

1 duplicated block group(s) detected. 0.1 % of the production lines (264 of 186,853) are in a reported copy. A further 7 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .js (94% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Edited copy of a member (28 corresponding lines) · ×2native/macos/TokenMonitorWidget/WidgetActivityViews.swift:93
Edited copy of a member (10 corresponding lines)native/macos/TokenMonitorWidget/WidgetConfigurationIntent.swift:396
Edited copy of a member (26 corresponding lines)native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:499
Edited copy of a member (6 corresponding lines)native/macos/TokenMonitorWidget/WidgetSnapshot.swift:555
Edited copies of one member (5 members, 10+ corresponding lines)native/macos/TokenMonitorWidget/TokenMonitorWidget.swift:16

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

What to do

  1. Resolve the 2 Edited copy of a member (28 corresponding lines) finding(s) in Code Duplication — start with WidgetActivityViews.swift, WidgetDashboardViews.swift. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 Edited copy of a member (10 corresponding lines) finding(s) in Code Duplication — start with WidgetConfigurationIntent.swift. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Edited copy of a member (26 corresponding lines) finding(s) in Code Duplication — start with WidgetDashboardViews.swift. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.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; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)8.5 / 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.5 / 10 · rule-coverage 100% · ceiling Verified

1 of 8 classes have LCOM4 above 3.

Low cohesion: Element (LCOM4 5)tests/helpers/notchPanel.js:7

What to do

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

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

D8 · Code Coverage8.1 / 10Strong✓ 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 8.1 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 43.6%. Measured from the JavaScript/TypeScript suite (node:test via `npm ci --ignore-scripts` in the repository root: killed; node:test via `npm ci --ignore-scripts` in site/, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it.

Detailed fixes: d8_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 10 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

13 skipped (13 with a documented reason), 1 zero-assertion, 9 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 9404 tests. Measured on the JavaScript/TypeScript suite only — at least 2 test source file(s) (.swift) went unread, so its test quality is unmeasured and is not in these counts.

Fixed-sleep synchronisation: Antigravity workspace provenance persists across restart without moving usage anchors · ×9tests/shared/antigravitySessionMetadata.test.js:738
No assertions: the shared native watcher delivers activity-only registry and T3 WAL writestests/shared/watcherNativeEvents.test.js:30
Skipped (documented): Desktop links follow discovery, explicit scan-root and file boundaries · ×13tests/shared/claudeDesktopWatch.test.js:53

What to do

  1. Resolve the 9 Fixed-sleep synchronisation finding(s) in Test Quality — start with edgeDockController.test.js (4), antigravitySessionMetadata.test.js (2), collectorSqliteSidecars.test.js. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 1 No assertions finding(s) in Test Quality — start with watcherNativeEvents.test.js. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.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 (node:test via `npm ci --ignore-scripts` in the repository root; node:test via `npm ci --ignore-scripts` in site/ (18 tests)): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene9.7 / 10Exemplary✓ 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 9.7 / 10 · rule-coverage 100% · ceiling Verified

6 outdated direct production npm dependency(ies) of 13 graded, 0 pinning defect(s), across 3 package.json (3 of them the product) and 3 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 0 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: boolean · ×5REDACTED:2206
Outdated (npm): chokidar · ×6

✓ On the Gold path — maintain.

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

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

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

3 secret(s) detected.

REDACTED

What to do

  1. Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3). — One of this dimension's main actionable groups (3 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 73 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 73 package(s) this repository's committed lockfile installs for a consumer — its 13 production, optional and peer dependency(ies), across 3 product package.json manifest(s), and everything those install in turn. Its 14 `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. Third-party code that ships WITHOUT a manifest entry was read too: 0 component(s) whose licence travels in the tree (vendored or copied-in directories, licence comments preserved in committed bundles, compiled wasm modules) and 0 bundled package(s) named only by a bundle's module path, graded on the registry; 0 use a banned licence. 5 vendored, copied-in or compiled component(s) state no licence this pass can read — missing data, not 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 Hotspots6.1 / 10Adequate✓ 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 6.1 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/electron/main.js (181×537=97197); REDACTED (217×170=36890); src/shared/collector.js (89×146=12994) Repeated repair below the complexity floor: src/shared/watcherHost.js (4 of 5 changes were fixes); src/shared/watcherWorker.js (4 of 5 changes were fixes); src/electron/renderer/pluginViews.js (3 of 5 changes were fixes)

Hotspot: src/electron/main.js · ×109src/electron/main.js:8255
Repeated repair: src/shared/watcherHost.js · ×4src/shared/watcherHost.js:240

What to do

  1. Resolve the 109 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (11), sessionMetadata.js (4), main.js (2). — One of this dimension's main actionable groups (109 warning-level).
  2. Resolve the 4 Repeated repair finding(s) in Churn × Complexity Hotspots — start with watcherHost.js, watcherWorker.js, pluginViews.js. — One of this dimension's main actionable groups (4 warning-level).

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

D16 · Bus Factor8.4 / 10Strong✓ Tool-verified

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

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

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

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

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

What to do

  1. Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

0 deducted task-comment markers across 3505 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.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. 98 document(s) read across 3 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs foundpackage.json:8

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 Consistency2.6 / 10Weak✓ 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 2.6 / 10 · rule-coverage 100% · ceiling Verified

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

`validatePersonalCLIUsage` spells `CLI` where 25 names in the project spell it `Cli`src/shared/providers/alibaba/cli.js:89
`fetchBailianCLI` spells `CLI` where 25 names in the project spell it `Cli`src/shared/providers/alibaba/cli.js:101

What to do

  1. Resolve the 1 `validatePersonalCLIUsage` spells `CLI` where 25 names in the project… finding(s) in Naming Consistency — start with cli.js. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `fetchBailianCLI` spells `CLI` where 25 names in the project spell it… finding(s) in Naming Consistency — start with cli.js. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value10.0 9.9 / 10Exemplary✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 99% · ceiling Documented

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

redundant comment · ×2tests/electron/limitProviderWiring.test.js:245

✓ On the Gold path — maintain.

Detailed fixes: d24_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

0 % 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)8.0 / 10Adequategated by 2 critical findings✓ 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 8.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

D29 · Static Analysis (SAST)0.9 / 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.9 / 10 · rule-coverage 100% · ceiling Documented

91 finding(s): 0 critical, 23 high, 21 medium, 47 low. 19 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 14 file(s) — `scripts/test-plugin-trusted-app.cjs`, `src/electron/edgeDock/controller.js`, `src/electron/main.js`, `src/electron/plugins/runtime.js`, `REDACTED`, … (+9 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 19 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 (19 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities9.4 / 10Stronggated by 3 serious findings✓ 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 9.4 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED

What to do

  1. Resolve the 3 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).

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

D31 · IaC & Container Security10.0 / 10Exemplary○ Nothing flagged

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

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

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

trivy and checkov found no infrastructure-as-code or container misconfigurations.

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

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

Orphaned file · ×2src/electron/syncUploadScheduler.js:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

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

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: preload.js↔REDACTED 95%; discordRpc.js↔REDACTED 84%; i18n.js↔credentialStore.js 80%

Boundary-crossing change coupling: i18n.js ↔ credentialStore.js · ×5src/electron/renderer/i18n.js:1
Change coupling: REDACTED ↔ presentation.js · ×3REDACTED:1
Change-coupling hub: REDACTED → discordRpc.js, floatingBubble.js, preload.jsREDACTED

What to do

  1. Resolve the 5 Boundary-crossing change coupling finding(s) in Change Coupling — start with i18n.js, REDACTED, main.js. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 3 Change coupling finding(s) in Change Coupling — start with REDACTED, credentialStore.js, discordRpc.js. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

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

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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. — 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 Policy10.0 / 10Exemplary✓ Tool-verified

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

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

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.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 10 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 alternatives3.1 / 10Weak✓ 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. (×7) — site/scripts/darkVeil.jsx:162, REDACTED:15945, REDACTED:15969, …
  • An svg presented as an image needs a name — add a <title> child or an aria-label/aria-labelledby. — src/electron/renderer/limits/history.html:0

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 & labels6.5 / 10Strong✓ Tool-verified

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

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

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

  • This <label> has no 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. (×2) — REDACTED:13043, REDACTED:13134
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×7) — REDACTED:18293, src/electron/renderer/edgeDock/composer.js:224, src/electron/renderer/edgeDock/composer.js:239, …

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 structure5.9 / 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.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — src/electron/renderer/dashboard.html:2
  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — src/electron/renderer/plugins/page.html:2

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.9 / 10Weak✓ 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".

  • The repo's own CSS styles .detail-ex-head with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — REDACTED:5888
  • The repo's own CSS styles .trends-open-hint with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — REDACTED:6123
  • A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabindex="0". — REDACTED:18267
  • The repo's own CSS styles .edge-dock-root with `cursor: pointer`, so this <main> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — src/electron/renderer/edgeDock/index.html:12
  • The repo's own CSS styles .live-dot with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — src/electron/renderer/index.html:16

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness7.8 / 10Strong✓ Tool-verified

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.

  • A plain <span> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <span> a role that supports aria-expanded. — REDACTED:18267
  • aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden. — src/electron/renderer/notch/panel.js:88

What to do

  • Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
AC6 · Visual & motion safety1.0 / 10Critical✓ 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.

  • `button:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/styles.css:99
  • `.shell:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/styles.css:104
  • `.floating-bubble-tab` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/styles.css:232
  • `.settings-panel select` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/styles.css:3170
  • `.session-search-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/styles.css:4365
  • `.limit-account-active-zone` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/styles.css:5377
  • `.opencode-profile-item .profile-name-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/styles.css:8064
  • `.plugin-main-page:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/styles.css:9125
  • `.edge-dock-composer-item.is-selected` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/edgeDock/composer.css:92
  • `.edge-dock-composer-add.is-open` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/electron/renderer/edgeDock/composer.css:156
  • `#edge-dock .ed-scene button:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — site/styles/edgedock.css:67
  • `.window-actions` moves (`transition: opacity 160ms ease 140ms, transform 160ms ease 140ms`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:479
  • `.utility-actions .settings-icon-button` moves (`transition: clip-path 0s var(--footer-secondary-reveal-delay, 0ms), opacity 160ms ease var(--footer-secondary-reveal-delay, 0ms), transform 180ms cubic-bezier(0.22, 1, 0.36, 1) var(--footer-secondary-reveal-delay, 0ms), border-color 160ms ease, background 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:500
  • `.utility-actions .refresh-button` moves (`transition: clip-path 0s var(--footer-secondary-reveal-delay, 0ms), opacity 160ms ease var(--footer-secondary-reveal-delay, 0ms), transform 180ms cubic-bezier(0.22, 1, 0.36, 1) var(--footer-secondary-reveal-delay, 0ms), border-color 160ms cubic-bezier(0.25, 1, 0.5, 1), background 160ms cubic-bezier(0.25, 1, 0.5, 1), color 160ms cubic-bezier(0.25, 1, 0.5, 1), box-shadow 160ms cubic-bezier(0.25, 1, 0.5, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:510
  • `.title-controls .tabs` moves (`transition: opacity 160ms ease 140ms, transform 160ms ease 140ms`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:559
  • `.settings-panel` moves (`transition: max-height 140ms ease, opacity 120ms ease, padding 140ms ease, transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:607
  • `.settings-panel .checkbox-label > input[type="checkbox"]::before` moves (`transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:671
  • `.settings-section-disclosure` moves (`transition: transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:929
  • `.accordion-animated-container` moves (`transition: grid-template-rows 250ms cubic-bezier(0.4, 0, 0.2, 1), margin-top 250ms cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:963
  • `.cursor-disclosure-icon` moves (`transition: transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:1258
  • `.about-settings-diagnostics` moves (`transition: grid-template-rows 250ms cubic-bezier(0.4, 0, 0.2, 1), margin-top 250ms cubic-bezier(0.4, 0, 0.2, 1), padding-top 250ms cubic-bezier(0.4, 0, 0.2, 1), border-top-color 250ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:1571
  • `.shell.settings-open .settings-sync-group.expanded .sync-panel-connection[data-state="connecting"] .sync-panel-signal[data-visible="true"]:not([data-window-hidden="true"]) > .sync-panel-signal-pending` moves (`animation: sync-signal-spin 1.4s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:1901
  • `.sync-panel-link-arrow::before` moves (`transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:2034
  • `.refresh-button-icon` moves (`transition: transform 120ms cubic-bezier(0.25, 1, 0.5, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:3354
  • `.tab-indicator` moves (`transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:3429
  • `.home-module` moves (`transition: opacity 140ms ease, transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:3720
  • `.session-search-host` moves (`transition: height 200ms cubic-bezier(0.22, 1, 0.36, 1), margin-block 200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 140ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:4322
  • `.bar-fill` moves (`transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:4729
  • `.row-context-fill` moves (`transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:4839
  • `.limit-account-active-popover` moves (`transition: opacity 140ms ease, transform 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:5403
  • `.limit-account-switch-popover` moves (`transition: opacity 140ms ease, transform 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:5443
  • `.limit-meter-fill` moves (`transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), filter 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:5584
  • `.limit-detail-tooltip` moves (`transition: opacity 120ms ease, transform 120ms ease, display 120ms allow-discrete, overlay 120ms allow-discrete`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:5770
  • `.live-token-rate.is-fresh .live-token-rate-icon` moves (`animation: live-token-rate-flash 620ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:6434
  • `.view-switcher-disclosure::before` moves (`transition: transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:6514
  • `.view-switcher-menu` moves (`transition: opacity 190ms cubic-bezier(0.22, 1, 0.36, 1), transform 190ms cubic-bezier(0.22, 1, 0.36, 1), filter 190ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:6555
  • `.update-pill` moves (`transition: opacity 120ms ease, margin-right 180ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:6808
  • `.update-pill-action[data-status="installing"] .update-pill-icon` moves (`animation: sync-signal-spin 1.4s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:6859
  • `.app-update-popover` moves (`transition: opacity 140ms ease, transform 140ms cubic-bezier(0.22, 1, 0.36, 1), overlay 140ms allow-discrete, display 140ms allow-discrete`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:6958
  • `.opencode-add-summary .add-icon` moves (`transition: transform 0.25s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/electron/renderer/styles.css:8176

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 composition10.0 / 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.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in 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.

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 documentation2.0 / 10Weak✓ Tool-verified

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

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

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

What to do

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

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

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

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.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

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

  • No logging call was found in the 552 JavaScript/TypeScript, Swift production file(s) this check read across 4 module(s). Each was searched for its ecosystem's logging libraries (JavaScript/TypeScript: pino, winston, bunyan, log4js, loglevel, consola, the NestJS Logger; Swift: os.Logger/os_log/NSLog, swift-log, CocoaLumberjack, SwiftyBeaver, XCGLogger) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.

What to do

  • Adopt pino (or winston) and log at meaningful points in the services you run.
P3 · Security & performance tooling4.0 / 10Weak✓ 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.

  • `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:164

What to do

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

What to do

  • Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
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.

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.mkdirSync` in `proof` 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. — scripts/plugin-native-surfaces-proof.cjs:10
  • `fs.readFileSync` in `proof` 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. (×3) — scripts/plugin-native-surfaces-proof.cjs:16, scripts/plugin-native-surfaces-proof.cjs:23, scripts/plugin-native-surfaces-proof.cjs:66
  • `fs.writeFileSync` in `proof` 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. (×7) — scripts/plugin-native-surfaces-proof.cjs:101, scripts/plugin-native-surfaces-proof.cjs:108, scripts/plugin-native-surfaces-proof.cjs:112, …
  • `fs.writeFileSync` in `callback to then` 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:37, REDACTED:39
  • `fs.existsSync` in `transact` 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/electron/plugins/managed.js:190
  • `fs.rmSync` in `commit` 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. (×3) — src/electron/plugins/managed.js:224, src/electron/plugins/managed.js:268, src/electron/plugins/managed.js:271
  • `fs.mkdirSync` in `commit` 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/electron/plugins/managed.js:224
  • `fs.existsSync` in `commit` 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. (×4) — src/electron/plugins/managed.js:226, src/electron/plugins/managed.js:253, src/electron/plugins/managed.js:254, …
  • `fs.copyFileSync` in `commit` 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/electron/plugins/managed.js:227
  • `fs.renameSync` in `commit` 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. (×5) — src/electron/plugins/managed.js:236, src/electron/plugins/managed.js:238, src/electron/plugins/managed.js:253, …
  • `fs.lstatSync` in `commit` 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) — src/electron/plugins/managed.js:256, src/electron/plugins/managed.js:261
  • `fs.writeFileSync` in `commit` 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/electron/plugins/managed.js:270
  • `fs.readdirSync` in `reload` 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/electron/plugins/manager.js:137
  • `fs.mkdirSync` in `handle("plugins:openFolder")` 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/electron/plugins/runtime.js:742
  • `fs.mkdtempSync` in `forkOnlyClientsAccepted` 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/shared/collector.js:399
  • `fs.rmSync` in `forkOnlyClientsAccepted` 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/shared/collector.js:417
  • `fs.mkdirSync` in `prepareClaudeProbeDir` 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) — src/shared/providers/claude/probe.js:56, src/shared/providers/claude/probe.js:62
  • `fs.realpathSync` in `prepareClaudeProbeDir` 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/shared/providers/claude/probe.js:57
  • `fs.lstatSync` in `prepareClaudeProbeDir` 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) — src/shared/providers/claude/probe.js:59, src/shared/providers/claude/probe.js:64

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

  • 38 typed · 1223 plain JS — the untyped files are plugins/openai-api-credit/backend.cjs, plugins/openai-api-credit/balance.cjs, plugins/openai-api-credit/i18n.mjs, plugins/openai-api-credit/settings.mjs, plugins/quota-alerts/backend.cjs, plugins/quota-alerts/delivery.cjs (+1217 more).
R10 · Code Duplication7.6 / 10Strong✓ 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.

  • 88 duplicated blocks under src/shared/providers/ have copies in at least two of the sibling directories alibaba, antigravity, claude, cline, codebuddy, codex (+32 more sibling(s) not listed) — 66 of them are reported below, and 22 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 88 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 88 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 88 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/shared/providers/mimo/spendHistory.js:34
  • 49 duplicated blocks under src/ have copies in at least two of the sibling directories electron, shared — 41 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 49 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 49 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 49 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/electron/macWidget/historyStore.js:189
  • 12 duplicated blocks under src/electron/ have copies in at least two of the sibling directories edgeDock, limits, macWidget, notch, plugins, providers (+1 more sibling(s) not listed) — 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. — src/electron/edgeDock/preload.js:64
  • 7 duplicated blocks under src/shared/ have copies in at least two of the sibling directories limits, plugins, providers — 6 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 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 7 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:150
  • 5 duplicated blocks under src/electron/renderer/ have copies in at least two of the sibling directories edgeDock, limits, notch — 3 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — REDACTED:1078
  • REDACTED:1078 · src/electron/renderer/limits/resetAnimator.js:48 — the two spans are one implementation copied and then locally edited — 1030 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:1078
  • src/electron/renderer/homeModulePreferences.js:41 · src/electron/renderer/limits/providerOrder.js:8 — the two spans are one implementation copied and then locally edited — 601 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/electron/renderer/homeModulePreferences.js:41
  • src/electron/renderer/clientDisplayPreferences.js:3 · src/electron/renderer/viewDisplayPreferences.js:3 — the two spans are one implementation copied and then locally edited — 357 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/electron/renderer/clientDisplayPreferences.js:3
  • src/shared/providers/mimo/spendHistory.js:34 · src/shared/providers/zai/limits.js:577 — the two spans are one implementation copied and then locally edited — 423 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/shared/providers/mimo/spendHistory.js:34
  • src/shared/providers/antigravity/sessionMetadata.js:14 · src/shared/providers/cursor/sessionMetadata.js:11 — the two spans are one implementation copied and then locally edited — 259 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/shared/providers/antigravity/sessionMetadata.js:14
  • src/electron/main.js:1489 · src/electron/main.js:1667 — 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. — src/electron/main.js:1489
  • src/shared/providers/claude/limits.js:2160 · src/shared/providers/minimax/cliProcess.js:49 — 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. — src/shared/providers/claude/limits.js:2160
  • src/electron/main.js:9811 · src/electron/main.js:9965 — 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/electron/main.js:9811
  • src/shared/providers/claude/sessionMetadata.js:302 · src/shared/providers/codebuddy/sessionMetadata.js:73 — the two spans are one implementation copied and then locally edited — 261 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/shared/providers/claude/sessionMetadata.js:302
  • src/electron/edgeDock/preload.js:64 · src/electron/notch/preload.js:30 · src/electron/plugins/pagePreload.js:13 · src/electron/preload.js:343 — the 4 copies are spread across 4 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. — src/electron/edgeDock/preload.js:64
  • REDACTED:7019 · REDACTED:7059 — 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:7019
  • src/shared/providers/manus/desktop.js:81 · src/shared/providers/mimo/desktop.js:52 — 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. — src/shared/providers/manus/desktop.js:81
  • src/shared/providers/notion/limits.js:194 · src/shared/providers/opendesign/limits.js:72 — the two spans are one implementation copied and then locally edited — 233 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/shared/providers/notion/limits.js:194
  • src/electron/historySource.js:89 · src/electron/historySource.js:135 — the two spans are one implementation copied and then locally edited — 207 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/electron/historySource.js:89
  • src/electron/macWidget/historyStore.js:189 · src/shared/credentialStore.js:139 — the two spans are one implementation copied and then locally edited — 143 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/electron/macWidget/historyStore.js:189
  • REDACTED:10844 · REDACTED:10951 · REDACTED:11286 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — REDACTED:10844
  • REDACTED:10619 · REDACTED:10642 · REDACTED:10665 · REDACTED:10688 · +2 more site(s) not listed — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — REDACTED:10619
  • REDACTED:11037 · REDACTED:11065 — 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:11037
  • REDACTED:10968 · REDACTED:11303 — the two spans are one implementation copied and then locally edited — 191 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:10968
  • REDACTED:418 · worker/src/index.js:501 — the two spans are one implementation copied and then locally edited — 237 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:418
  • src/shared/providers/trae/limits.js:25 · src/shared/providers/workbuddy/limits.js:28 — 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. — src/shared/providers/trae/limits.js:25
  • src/shared/providers/zai/limits.js:289 · src/shared/providers/zaiteam/limits.js:50 — the two spans are one implementation copied and then locally edited — 167 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/shared/providers/zai/limits.js:289
  • src/electron/macWidget/bridge.js:132 · src/electron/macWidget/bridge.js:170 — 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/electron/macWidget/bridge.js:132
  • src/electron/main.js:9850 · src/electron/main.js:10004 — 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/electron/main.js:9850
  • REDACTED:13855 · src/electron/renderer/dashboard.js:662 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:13855
  • REDACTED:150 · REDACTED:295 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — REDACTED:150
  • src/electron/renderer/pluginCredentials.js:88 · src/electron/renderer/pluginCredentials.js:114 — the two spans are one implementation copied and then locally edited — 166 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/electron/renderer/pluginCredentials.js:88
  • REDACTED:11776 · REDACTED:11804 — 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:11776
  • REDACTED:15885 · REDACTED:16609 — 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:15885
  • src/shared/providers/antigravity/selfSync.js:168 · src/shared/providers/cursor/selfSync.js:34 — 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. — src/shared/providers/antigravity/selfSync.js:168
  • src/shared/usage.js:1103 · src/shared/usage.js:1134 — 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. — src/shared/usage.js:1103
  • scripts/ensure-vendored-tokscale.js:178 · scripts/verify-vendored-tokscale-release.js:210 — 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/ensure-vendored-tokscale.js:178
  • src/electron/macosSpaceBehavior.js:50 · src/electron/notch/macProgressiveBlur.js:91 — 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. — src/electron/macosSpaceBehavior.js:50
  • src/electron/main.js:4761 · src/electron/main.js:4843 · src/electron/main.js:4901 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/electron/main.js:4761
  • src/electron/renderer/edgeDock/composer.js:276 · src/electron/renderer/edgeDock/composer.js:331 — 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/electron/renderer/edgeDock/composer.js:276

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.

  • scripts/benchmark-sync-upload.js:6 imports tests/fixtures/syncUpload.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/benchmark-sync-upload.js:6
  • scripts/benchmark-upload-delta.js:9 imports tests/fixtures/syncUpload.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/benchmark-upload-delta.js:9
  • scripts/verify-vendored-tokscale.js:163 imports tests/fixtures/goose.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/verify-vendored-tokscale.js:163
  • scripts/verify-vendored-tokscale.js:746 imports tests/fixtures/goose.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/verify-vendored-tokscale.js:746

What to do

  • Fix the listed violations: move the shared test helper into a source directory production code may depend on (4 rows).
R2 · Cyclomatic Complexity6.0 / 10Adequate✓ 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.

  • renderProviderWindows has cyclomatic complexity 274 and cognitive complexity 476; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/electron/renderer/limits/windowsView.js:1030
  • applySettingsPatch has cyclomatic complexity 255 and cognitive complexity 264; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/electron/main.js:8498
  • normalizeManifest has cyclomatic complexity 133 and cognitive complexity 150; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/plugins/manifest.js:59
  • collectUsageOnce has cyclomatic complexity 122 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/shared/collector.js:947
  • performTick has cyclomatic complexity 118 and cognitive complexity 184; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/collector.js:3137
  • (anonymous) has cyclomatic complexity 115 and cognitive complexity 244; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/test-plugin-trusted-app.cjs:128
  • updateRow has cyclomatic complexity 104 and cognitive complexity 110; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:2787
  • normalizePeriod has cyclomatic complexity 97 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. — src/shared/usage.js:1031
  • recordActions has cyclomatic complexity 91 and cognitive complexity 155; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/electron/limits/historyDatabase.js:208
  • fetchOpenCodeLimits has cyclomatic complexity 78 and cognitive complexity 99; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/providers/opencode/limits.js:104
  • deltaValue has cyclomatic complexity 75 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/shared/usage.js:2292
  • projectResource has cyclomatic complexity 74 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. — src/shared/plugins/businessData.js:252
  • commitRows has cyclomatic complexity 72 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/shared/limits/runtime.js:644
  • limitProviderStatusLabel has cyclomatic complexity 72 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/electron/renderer/limits/providerPresentation.js:450
  • validateStaticSvg has cyclomatic complexity 70 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/plugins/staticSvg.js:14
  • mergeSession has cyclomatic complexity 70 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/usage.js:723
  • resolveSessionMetadata has cyclomatic complexity 69 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/providers/antigravity/sessionMetadata.js:145
  • normalizeSession has cyclomatic complexity 69 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/usage.js:901
  • normalizeProviderBalance has cyclomatic complexity 69 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/shared/limits/core.js:234
  • renderLimitProviderCheckboxesNow has cyclomatic complexity 68 and cognitive complexity 107; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:12404
  • syncSettingsForm has cyclomatic complexity 68 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:10080
  • fetchBailianCLI has cyclomatic complexity 67 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/providers/alibaba/cli.js:101
  • projectRowsForPeriod has cyclomatic complexity 66 and cognitive complexity 107; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/electron/renderer/projectRows.js:61
  • fetch has cyclomatic complexity 63 and cognitive complexity 90; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — worker/src/index.js:462
  • fetchClaudeAccountsLimits has cyclomatic complexity 63 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/providers/claude/limits.js:1363
  • applySessionMetadata has cyclomatic complexity 62 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/sessionMetadata.js:471
  • pluginDetail has cyclomatic complexity 62 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/electron/renderer/pluginSettings.js:1211
  • updateSessionUsageArchive has cyclomatic complexity 62 and cognitive complexity 91; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/usage/sessionUsageArchive.js:223
  • normalizeItem has cyclomatic complexity 61 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/trayLayout.js:382
  • normalizeClientName has cyclomatic complexity 61 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/usage.js:285
  • renderAppContent has cyclomatic complexity 59 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:7803
  • handleRequest has cyclomatic complexity 57 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:395
  • propagateTodayProjects has cyclomatic complexity 56 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/shared/collector.js:693
  • parseUsageSummary has cyclomatic complexity 56 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/providers/cursor/probe.js:158
  • renderExternalProviderStatus has cyclomatic complexity 55 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:17902
  • readT3SessionRelationResult has cyclomatic complexity 53 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/shared/t3SessionMetadata.js:217
  • queryInternal has cyclomatic complexity 53 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/electron/plugins/businessData.js:406
  • fetchMinimaxCodeLimits has cyclomatic complexity 52 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/shared/providers/minimax/limits.js:524
  • applyTokscaleSessionMetadata has cyclomatic complexity 52 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/shared/sessionMetadata.js:85
  • (anonymous) has cyclomatic complexity 51 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/electron/limits/historyDatabase.js:387
R3 · Large Files4.8 / 10Adequate✓ 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.

  • REDACTED has 19356 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/electron/main.js has 9916 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/electron/main.js:1
  • src/shared/collector.js has 4112 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/collector.js:1
  • src/electron/renderer/limits/windowsView.js has 3351 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/electron/renderer/limits/windowsView.js:1
  • src/shared/usage.js has 2296 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/usage.js:1
  • REDACTED has 2236 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/shared/providers/claude/limits.js has 2196 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/claude/limits.js:1
  • src/electron/edgeDock/controller.js has 1631 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/electron/edgeDock/controller.js:1
  • src/electron/renderer/pluginSettings.js has 1523 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/electron/renderer/pluginSettings.js:1
  • src/electron/renderer/notch/panel.js has 1460 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/electron/renderer/notch/panel.js:1
  • src/electron/renderer/trayComposer.js has 1374 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/electron/renderer/trayComposer.js:1
  • src/shared/providers/codex/limits.js has 1363 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/codex/limits.js:1
  • src/electron/icloudSync.js has 1234 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/electron/icloudSync.js:1
  • src/shared/trayLayout.js has 1137 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/trayLayout.js:1
  • src/shared/limits/runtime.js has 1115 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/limits/runtime.js:1
  • src/shared/diagnosticReport.js has 1096 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/diagnosticReport.js:1
  • src/shared/limits/core.js has 1077 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/limits/core.js:1
  • src/shared/providers/alibaba/limits.js has 950 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/alibaba/limits.js:1
  • src/electron/notch/controller.js has 948 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/electron/notch/controller.js:1
  • src/electron/renderer/edgeDock/presentation.js has 936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/electron/renderer/edgeDock/presentation.js:1
  • src/electron/renderer/sessionRows.js has 936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/electron/renderer/sessionRows.js:1
  • REDACTED has 935 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/electron/plugins/runtime.js has 912 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/electron/plugins/runtime.js:1
  • src/shared/providers/minimax/limits.js has 907 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/minimax/limits.js:1
  • src/shared/dailyHistoryArchive.js 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. — src/shared/dailyHistoryArchive.js:1
  • src/shared/providers/reasonix/sessionDetail.js has 854 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/reasonix/sessionDetail.js:1
  • src/shared/providers/grok/limits.js has 801 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/grok/limits.js:1
  • src/shared/providers/zai/limits.js has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/zai/limits.js:1
  • src/shared/providers/mimo/limits.js has 795 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/mimo/limits.js:1
  • src/shared/providers/claude/sessionMetadata.js has 769 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/claude/sessionMetadata.js:1
  • src/electron/renderer/dashboard.js has 765 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/electron/renderer/dashboard.js:1
  • src/electron/renderer/limits/providerPresentation.js has 721 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/electron/renderer/limits/providerPresentation.js:1
  • src/shared/sessionDetail.js has 716 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/sessionDetail.js:1
  • src/electron/renderer/notch/renderer.js has 703 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/electron/renderer/notch/renderer.js:1
  • src/shared/appUpdater.js has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/appUpdater.js:1
  • src/shared/macWidgetSnapshot.js has 678 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/macWidgetSnapshot.js:1
  • src/electron/renderer/fixedPeriodRanges.js has 677 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/electron/renderer/fixedPeriodRanges.js:1
  • src/shared/providers/volcengine/limits.js has 670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/providers/volcengine/limits.js:1
  • src/electron/tray.js has 669 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/electron/tray.js:1
  • worker/src/index.js has 666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — worker/src/index.js:1

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×5) — plugins/openai-api-credit/settings.mjs:1, src/electron/plugins/backendHost.cjs:1, src/electron/plugins/pagePreload.js:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness8.8 / 10Exemplary✓ 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.

R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

R8 · Dependency Hygiene6.0 / 10Adequate✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×2) — scripts/verify-vendored-tokscale-release.js:174, scripts/signpath-windows-artifacts.js:9

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports2.7 / 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.

  • src/shared/collector.js → src/shared/providers/cursor/selfSync.js → src/shared/providers/cursor/auth.js → src/shared/collector.js (one verified cycle inside a mutually-dependent group of 6 files) — src/shared/collector.js:53
  • src/shared/credentialStore.js → src/shared/limits/accounts.js → src/shared/providers/factory/limits.js → src/shared/credentialStore.js — src/shared/credentialStore.js:6
  • src/shared/limits/collector.js → src/shared/limits/runtime.js → src/shared/limits/collector.js — src/shared/limits/collector.js:251
  • src/shared/sessionDetailResolver.js → src/shared/sessionDetailWorker.js → src/shared/sessionDetailResolver.js — src/shared/sessionDetailResolver.js:74

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
X24 · Document value interpolated into markup unescaped5.2 / 10Adequate✓ Tool-verified

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

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

  • `v` 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. — REDACTED:6118
  • `rangeLabel` 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. — REDACTED:6123
  • `t('trends.open')` is text this program did not author, and it is written into a quoted attribute value 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. — REDACTED:6124
  • `first` 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. — REDACTED:6125
  • `t(`dashboard.range.${r}`)` is text this program did not author, and it is written into the text of an element through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/electron/renderer/dashboard.js:303
  • `colorFor(r.key)` is text this program did not author, and it is written into a quoted attribute value through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/electron/renderer/dashboard.js:347
  • `formatCompact(r.value)` is text this program did not author, and it is written into the text of an element through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/electron/renderer/dashboard.js:348
  • `colorFor(s.key)` is text this program did not author, and it is written into a quoted attribute value 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. — src/electron/renderer/dashboard.js:609
  • `shortDate(bar.label)` 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. — src/electron/renderer/dashboard.js:611
  • `head` 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. — src/electron/renderer/dashboard.js:620
  • `formatCompact(v)` 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. — src/electron/renderer/dashboard.js:621
  • `longDate(date)` 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. — src/electron/renderer/dashboard.js:630
  • `formatCompact(tokens)` 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. — src/electron/renderer/dashboard.js:631
  • `formatCost(cost,missing)` 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. — src/electron/renderer/dashboard.js:633
  • `t('usage.excludedFromCost',{tokens:Math.round(missing).toLocaleString('en-US')})` 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. — src/electron/renderer/dashboard.js:634
  • `result.html||''` 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. — src/electron/renderer/pluginSettings.js:634
  • `model.areaPath` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/electron/renderer/usageCharts.js:528
  • `model.linePath` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/electron/renderer/usageCharts.js:529
  • `model.width` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×3) — src/electron/renderer/usageCharts.js:530, src/electron/renderer/usageCharts.js:578, src/electron/renderer/usageCharts.js:599
  • `o.colorFor(s.key)` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — src/electron/renderer/usageCharts.js:566, src/electron/renderer/usageCharts.js:568
  • `cellAttrs(c)` is text this program did not author, and it is written into an unquoted attribute through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML text encoding does not help in an unquoted attribute — whitespace ends it; quote the attribute and encode the value. — src/electron/renderer/usageCharts.js:626
  • `turn` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/shared/sessionLive.js:262
  • `check` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/shared/sessionLive.js:263
  • `idle` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/shared/sessionLive.js:265
  • `waiting` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/shared/sessionLive.js:266

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.
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 0/2 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.

What to do

  • Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.

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 Health37.6Weak — gated by D1, D2, R1, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture76.0Adequate — gated by R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity67.9Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness51.1Adequate — gated by D13, P2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security68.9Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility34.4Weak — gated by AC1, AC4, AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60.0AdequateStrongest 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.

  • P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 60 check(s) not relevant to this codebase

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

  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • 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
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "> token-monitor@0.93.1 dev / > npm run ensure:tokscale && electron . / > token-monitor@0.93.1 ensure:tokscale / > node scripts/ensure-vendored-tokscale.js / Ensuring vendored tokscale (token-monitor-648cc594, source 648cc594b86f) for linux-x64... / ensure-vendored-tokscale failed: fetch failed" No runtime evidence was gathered. 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 the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 4 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • IC1 Incompleteness & stubs — IC1 reached only 0% of this repository's production lines — javascript (183,036 lines), swift (3,173 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • 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 37 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • 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.
  • S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — X12 reached only 0% of this repository's production lines — javascript (183,036 lines), swift (3,173 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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
  • X14 Bypassable address classification — 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
  • X16 Unfloored truncation loop — X16 reached only 0% of this repository's production lines — javascript (183,036 lines), swift (3,173 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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 — X18 reached only 0% of this repository's production lines — javascript (183,036 lines), swift (3,173 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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
  • X2 Cancellation propagation — no async method does work a token could cancel
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X23 Unguarded diagnostic materialisation — 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 — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — X27 reached only 0% of this repository's production lines — javascript (183,036 lines), swift (3,173 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — X29 reached only 0% of this repository's production lines — javascript (183,036 lines), swift (3,173 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X3 Exception handling — X3 reached only 0% of this repository's production lines — javascript (183,036 lines), swift (3,173 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 57 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×5
  • Boundary-crossing change coupling: i18n.js ↔ credentialStore.js src/electron/renderer/i18n.js:1 — `src/electron/renderer/i18n.js` (context electron) and `src/shared/credentialStore.js` (context shared) sit in DIFFERENT parts of the tree yet change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `1c13593e` feat(sync): save several Hubs and switch between them (#1496); `b0b3d8d3` feat(claude): support multiple managed Web accounts (#1220); `23868df9` feat(devin): add usage limits provider (#776) — run `git show` on any of them.
  • Boundary-crossing change coupling: REDACTED ↔ index.js REDACTED:1 — `REDACTED` (context hub) and `worker/src/index.js` (context worker) sit in DIFFERENT parts of the tree yet change together 73% of the time (16 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `7283067d` fix(hub): keep idle SSE updates incremental behind a slow snapshot (#…; `5463786e` perf(sync): avoid retransmitting unchanged device usage (#1374); `232dfa5b` perf(hub): send incremental stats and bound slow stream writes (#1250) — run `git show` on any of them.
  • Boundary-crossing change coupling: main.js ↔ index.js src/electron/main.js:1 — `src/electron/main.js` (context electron) and `worker/src/index.js` (context worker) sit in DIFFERENT parts of the tree yet change together 62% of the time (15 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `bdc265c6` fix(hub): recover stalled client sync automatically (#1486); `5463786e` perf(sync): avoid retransmitting unchanged device usage (#1374); `232dfa5b` perf(hub): send incremental stats and bound slow stream writes (#1250) — run `git show` on any of them.
  • Boundary-crossing change coupling: providerPresentation.js ↔ credentialStore.js src/electron/renderer/limits/providerPresentation.js:1 — `src/electron/renderer/limits/providerPresentation.js` (context electron) and `src/shared/credentialStore.js` (context shared) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `23868df9` feat(devin): add usage limits provider (#776) (at that commit the file was still `src/electron/renderer/limitProviderPresentation.js`); `67756fd0` refactor(providers): align provider ordering with README (#690) (at that commit the file was still `src/electron/renderer/limitProviderPresentation.js`); `44063bf7` feat(antigravity): add standalone multi-account OAuth limits (#564) (at that commit the file was still `src/electron/renderer/limitProviderPresentation.js`) — run `git show` on any of them.
  • Boundary-crossing change coupling: runtimeConfig.js ↔ credentialStore.js src/electron/runtimeConfig.js:1 — `src/electron/runtimeConfig.js` (context electron) and `src/shared/credentialStore.js` (context shared) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `23868df9` feat(devin): add usage limits provider (#776); `67756fd0` refactor(providers): align provider ordering with README (#690); `44063bf7` feat(antigravity): add standalone multi-account OAuth limits (#564) — run `git show` on any of them.
AC2 · Forms & labels · <input> without a programmatic label · ×4
  • <input> without a programmatic label REDACTED:18293 — 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 src/electron/renderer/edgeDock/composer.js:224 — 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 src/electron/renderer/edgeDock/composer.js:239 — 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 src/electron/renderer/edgeDock/composer.js:451 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×4
  • Clickable element isn't keyboard-operable REDACTED:5888 — The repo's own CSS styles .detail-ex-head with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable REDACTED:6123 — The repo's own CSS styles .trends-open-hint with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable src/electron/renderer/edgeDock/index.html:12 — The repo's own CSS styles .edge-dock-root with `cursor: pointer`, so this <main> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Clickable element isn't keyboard-operable src/electron/renderer/index.html:16 — The repo's own CSS styles .live-dot with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
AC2 · Forms & labels · <select> without a programmatic label · ×3
  • <select> without a programmatic label src/electron/renderer/edgeDock/composer.js:282 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label src/electron/renderer/edgeDock/composer.js:337 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label src/electron/renderer/limits/accountPanels.js:230 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
D13 · REDACTED Scanning · Leaked secret · ×3
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <label> that labels no control · ×2
  • <label> that labels no control REDACTED:13043 — 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 REDACTED:13134 — 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.
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (3 files) · ×2
  • Import cycle (3 files) src/shared/collector.js:53 — src/shared/collector.js → src/shared/providers/cursor/selfSync.js → src/shared/providers/cursor/auth.js → src/shared/collector.js (one verified cycle inside a mutually-dependent group of 6 files)
  • Import cycle (3 files) src/shared/credentialStore.js:6 — src/shared/credentialStore.js → src/shared/limits/accounts.js → src/shared/providers/factory/limits.js → src/shared/credentialStore.js
R9 · Circular Imports · Import cycle (2 files) · ×2
  • Import cycle (2 files) src/shared/limits/collector.js:251 — src/shared/limits/collector.js → src/shared/limits/runtime.js → src/shared/limits/collector.js
  • Import cycle (2 files) src/shared/sessionDetailResolver.js:74 — src/shared/sessionDetailResolver.js → src/shared/sessionDetailWorker.js → src/shared/sessionDetailResolver.js
AC1 · Text alternatives · <svg role="img"> without an accessible name · ×1
  • <svg role="img"> without an accessible name src/electron/renderer/limits/history.html — An svg presented as an image needs a name — add a <title> child or an aria-label/aria-labelledby.
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang src/electron/renderer/plugins/page.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC4 · Keyboard semantics · Click handler on a non-interactive <span> · ×1
  • Click handler on a non-interactive <span> REDACTED:18267 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabindex="0".
AC5 · ARIA correctness · aria-expanded on a <span> with no role to carry it · ×1
  • aria-expanded on a <span> with no role to carry it REDACTED:18267 — A plain <span> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <span> a role that supports aria-expanded.
AC5 · ARIA correctness · aria-hidden hides a focusable element · ×1
  • aria-hidden hides a focusable element src/electron/renderer/notch/panel.js:88 — aria-hidden="true" here hides the subtree from assistive tech, but a focusable descendant stays in the tab order — a keyboard user can land on a control screen readers can't see. Add inert, take the descendants out of the tab order (tabindex="-1"), or drop aria-hidden.
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
R8 · Dependency Hygiene · Unlisted import '@tokscale/cli' · ×1
  • Unlisted import '@tokscale/cli' scripts/verify-vendored-tokscale-release.js:174 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'app-builder-lib' · ×1
  • Unlisted import 'app-builder-lib' scripts/signpath-windows-artifacts.js:9 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Serious — 2363 finding(s)
D3 · God Classes · FunctionTooLong · ×123
  • FunctionTooLong: windowsView.createLimitWindowsView src/electron/renderer/limits/windowsView.js:50 — FunctionTooLong — createLimitWindowsView runs 2403 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2303 over it, 24.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.app.whenReady().then() src/electron/main.js:8255 — FunctionTooLong — app.whenReady().then() runs 1562 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1462 over it, 15.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: pluginSettings.createPluginSettingsPanel src/electron/renderer/pluginSettings.js:122 — FunctionTooLong — createPluginSettingsPanel runs 1184 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1084 over it, 11.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: controller.createEdgeDockController src/electron/edgeDock/controller.js:69 — FunctionTooLong — createEdgeDockController runs 1163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1063 over it, 11.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: panel.createNotchPanel src/electron/renderer/notch/panel.js:41 — FunctionTooLong — createNotchPanel runs 1162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1062 over it, 11.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: collector.startCollector src/shared/collector.js:2762 — FunctionTooLong — startCollector runs 1011 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 911 over it, 10.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: trayComposer.createTrayComposer src/electron/renderer/trayComposer.js:179 — FunctionTooLong — createTrayComposer runs 981 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 881 over it, 9.81× 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: runtime.createLimitsRuntime src/shared/limits/runtime.js:138 — FunctionTooLong — createLimitsRuntime runs 749 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 649 over it, 7.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: runtime.createPluginRuntime src/electron/plugins/runtime.js:49 — FunctionTooLong — createPluginRuntime runs 704 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 604 over it, 7.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: windowsView.createLimitWindowsView.renderProviderWindows src/electron/renderer/limits/windowsView.js:1030 — FunctionTooLong — createLimitWindowsView.renderProviderWindows runs 682 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 582 over it, 6.82× 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: controller.createNotchController src/electron/notch/controller.js:95 — FunctionTooLong — createNotchController runs 668 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 568 over it, 6.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: app.setupCursorAccountUI REDACTED:19600 — FunctionTooLong — setupCursorAccountUI runs 659 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 559 over it, 6.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: icloudSync.createIcloudSyncStore src/electron/icloudSync.js:532 — FunctionTooLong — createIcloudSyncStore runs 574 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 474 over it, 5.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: renderer.createNotchRenderer src/electron/renderer/notch/renderer.js:25 — FunctionTooLong — createNotchRenderer runs 561 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 461 over it, 5.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: businessData.createBusinessDataService src/electron/plugins/businessData.js:16 — FunctionTooLong — createBusinessDataService runs 474 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 374 over it, 4.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: selectControl.enhance src/electron/renderer/selectControl.js:55 — FunctionTooLong — enhance runs 456 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 356 over it, 4.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: composer.createEdgeDockComposer src/electron/renderer/edgeDock/composer.js:12 — FunctionTooLong — createEdgeDockComposer runs 436 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 336 over it, 4.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: syncContentRuntime.createSyncContentRuntime src/electron/syncContentRuntime.js:53 — FunctionTooLong — createSyncContentRuntime runs 429 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 329 over it, 4.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.
  • FunctionTooLong: historyDatabase.createHistoryDatabase src/electron/limits/historyDatabase.js:26 — FunctionTooLong — createHistoryDatabase runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: collector.collectUsageOnce src/shared/collector.js:947 — FunctionTooLong — collectUsageOnce runs 412 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 312 over it, 4.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: server.createHub REDACTED:53 — FunctionTooLong — createHub runs 405 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 305 over it, 4.05× 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: icloudSyncRuntime.createIcloudSyncRuntime src/electron/icloudSyncRuntime.js:41 — FunctionTooLong — createIcloudSyncRuntime runs 372 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 272 over it, 3.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.setupDashboard site/scripts/main.js:390 — FunctionTooLong — setupDashboard runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: islands.HeroDashboard site/scripts/islands.jsx:487 — FunctionTooLong — HeroDashboard runs 289 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: collector.startCollector.performTick src/shared/collector.js:3137 — FunctionTooLong — startCollector.performTick runs 285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 98 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×109
  • Hotspot: src/electron/main.js src/electron/main.js:8255 — src/electron/main.js changed 181 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 537 in main.app.whenReady().then() at line 8255. 49 of those changes were fix/bug commits, and the other 132 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/main.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:19600 — REDACTED changed 217 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 170 in app.setupCursorAccountUI at line 19600. 58 of those changes were fix/bug commits, and the other 159 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/collector.js src/shared/collector.js:3137 — src/shared/collector.js changed 89 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 146 in collector.startCollector.performTick at line 3137. 38 of those changes were fix/bug commits, and the other 51 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/collector.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/electron/renderer/limits/windowsView.js src/electron/renderer/limits/windowsView.js:1030 — src/electron/renderer/limits/windowsView.js changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 292 in windowsView.createLimitWindowsView.renderProviderWindows at line 1030. 10 of those changes were fix/bug commits, and the other 31 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/renderer/limits/windowsView.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/usage.js src/shared/usage.js:2292 — src/shared/usage.js changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in usage.deltaValue at line 2292. 8 of those changes were fix/bug commits, and the other 42 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/usage.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/electron/edgeDock/controller.js src/electron/edgeDock/controller.js:1353 — src/electron/edgeDock/controller.js changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in controller.createEdgeDockController.registerIpc at line 1353. 17 of those changes were fix/bug commits, and the other 20 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/edgeDock/controller.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/electron/renderer/limits/providerPresentation.js src/electron/renderer/limits/providerPresentation.js:450 — src/electron/renderer/limits/providerPresentation.js changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in providerPresentation.limitProviderStatusLabel at line 450. 3 of those changes were fix/bug commits, and the other 36 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/renderer/limits/providerPresentation.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:1157 — REDACTED changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in dock.animateRingResets at line 1157. 14 of those changes were fix/bug commits, and the other 44 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/electron/renderer/sessionRows.js src/electron/renderer/sessionRows.js:583 — src/electron/renderer/sessionRows.js changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in sessionRows.sessionRowsForPeriod at line 583. 7 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/renderer/sessionRows.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/limits/core.js src/shared/limits/core.js:993 — src/shared/limits/core.js changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in core.aggregateLimits at line 993. 4 of those changes were fix/bug commits, and the other 25 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/limits/core.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/electron/renderer/edgeDock/presentation.js src/electron/renderer/edgeDock/presentation.js:537 — src/electron/renderer/edgeDock/presentation.js changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in presentation.providerCell at line 537. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/renderer/edgeDock/presentation.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/sessionMetadata.js src/shared/sessionMetadata.js:471 — src/shared/sessionMetadata.js changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in sessionMetadata.applySessionMetadata at line 471. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/sessionMetadata.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: scripts/test-plugin-trusted-app.cjs scripts/test-plugin-trusted-app.cjs:128 — scripts/test-plugin-trusted-app.cjs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 128 in test-plugin-trusted-app.app.whenReady().then() at line 128. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- scripts/test-plugin-trusted-app.cjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/limits/runtime.js src/shared/limits/runtime.js:644 — src/shared/limits/runtime.js changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in runtime.createLimitsRuntime.commitRows at line 644. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/limits/runtime.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/history.js src/shared/history.js:159 — src/shared/history.js changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in history.parseGraphResult at line 159. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/history.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/electron/renderer/pluginSettings.js src/electron/renderer/pluginSettings.js:1211 — src/electron/renderer/pluginSettings.js changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in pluginSettings.createPluginSettingsPanel.pluginDetail at line 1211. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/renderer/pluginSettings.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/usage/sessionUsageArchive.js src/shared/usage/sessionUsageArchive.js:223 — src/shared/usage/sessionUsageArchive.js changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in sessionUsageArchive.updateSessionUsageArchive at line 223. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/usage/sessionUsageArchive.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/electron/runtimeConfig.js src/electron/runtimeConfig.js:131 — src/electron/runtimeConfig.js changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in runtimeConfig.limitsConfigFromSettings at line 131. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/runtimeConfig.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/providers/claude/limits.js src/shared/providers/claude/limits.js:1363 — src/shared/providers/claude/limits.js changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in limits.fetchClaudeAccountsLimits at line 1363. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/providers/claude/limits.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: worker/src/index.js worker/src/index.js:462 — worker/src/index.js changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in HubDO.fetch at line 462. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- worker/src/index.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/electron/notch/controller.js src/electron/notch/controller.js:95 — src/electron/notch/controller.js changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in controller.createNotchController at line 95. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/notch/controller.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/macWidgetSnapshot.js src/shared/macWidgetSnapshot.js:239 — src/shared/macWidgetSnapshot.js changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in macWidgetSnapshot.buildQuota at line 239. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/macWidgetSnapshot.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/shared/clientSources.js src/shared/clientSources.js:187 — src/shared/clientSources.js changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in clientSources.clientSourceRoots at line 187. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/clientSources.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/electron/plugins/runtime.js src/electron/plugins/runtime.js:606 — src/electron/plugins/runtime.js changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in runtime.createPluginRuntime.registerIpc at line 606. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/plugins/runtime.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/electron/renderer/usageCharts.js src/electron/renderer/usageCharts.js:602 — src/electron/renderer/usageCharts.js changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in usageCharts.heatmapSvg at line 602. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/renderer/usageCharts.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.
  • + 84 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×40
  • FileTooLong: REDACTED REDACTED — FileTooLong — 15654 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 15154 over it, 31.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: electron/main.js src/electron/main.js — FileTooLong — 7412 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 6912 over it, 14.82× 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: shared/collector.js src/shared/collector.js — FileTooLong — 2706 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 2206 over it, 5.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: limits/windowsView.js src/electron/renderer/limits/windowsView.js — FileTooLong — 2416 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 916 over it, 1.61× 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: claude/limits.js src/shared/providers/claude/limits.js — FileTooLong — 1692 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 1192 over it, 3.38× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: shared/usage.js src/shared/usage.js — FileTooLong — 1661 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 1161 over it, 3.32× 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 — 1568 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 1068 over it, 3.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: renderer/pluginSettings.js src/electron/renderer/pluginSettings.js — FileTooLong — 1278 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 778 over it, 2.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: edgeDock/controller.js src/electron/edgeDock/controller.js — FileTooLong — 1215 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: createEdgeDockController (69-1718). The bar is 500 significant lines; this is 715 over it, 2.43× 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: scripts/main.js site/scripts/main.js — FileTooLong — 1211 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 711 over it, 2.42× 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: notch/panel.js src/electron/renderer/notch/panel.js — FileTooLong — 1187 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 687 over it, 2.37× 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: renderer/trayComposer.js src/electron/renderer/trayComposer.js — FileTooLong — 1120 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 620 over it, 2.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: codex/limits.js src/shared/providers/codex/limits.js — FileTooLong — 1085 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 585 over it, 2.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: electron/icloudSync.js src/electron/icloudSync.js — FileTooLong — 993 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 493 over it, 1.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: shared/diagnosticReport.js src/shared/diagnosticReport.js — FileTooLong — 947 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 447 over it, 1.89× 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: shared/trayLayout.js src/shared/trayLayout.js — FileTooLong — 934 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 434 over it, 1.87× 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: limits/runtime.js src/shared/limits/runtime.js — FileTooLong — 855 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 88% of them inside a single declaration: createLimitsRuntime (138-1184). The bar is 500 significant lines; this is 355 over it, 1.71× 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: limits/core.js src/shared/limits/core.js — FileTooLong — 839 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 339 over it, 1.68× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: plugins/runtime.js src/electron/plugins/runtime.js — FileTooLong — 743 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: createPluginRuntime (49-928). The bar is 500 significant lines; this is 243 over it, 1.49× 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: minimax/limits.js src/shared/providers/minimax/limits.js — FileTooLong — 728 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 228 over it, 1.46× 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: notch/controller.js src/electron/notch/controller.js — FileTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 92% of them inside a single declaration: createNotchController (95-999). The bar is 500 significant lines; this is 224 over it, 1.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: renderer/sessionRows.js src/electron/renderer/sessionRows.js — FileTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 224 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 712 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 212 over it, 1.42× 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: reasonix/sessionDetail.js src/shared/providers/reasonix/sessionDetail.js — FileTooLong — 682 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 182 over it, 1.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: shared/dailyHistoryArchive.js src/shared/dailyHistoryArchive.js — FileTooLong — 668 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 168 over it, 1.34× 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.
  • + 15 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×40
  • Sync-over-async blocking scripts/plugin-native-surfaces-proof.cjs:10 — `fs.mkdirSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:16 — `fs.readFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:23 — `fs.readFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:66 — `fs.readFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:101 — `fs.writeFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:108 — `fs.writeFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:112 — `fs.writeFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:117 — `fs.writeFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:124 — `fs.writeFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:129 — `fs.writeFileSync` in `proof` 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 scripts/plugin-native-surfaces-proof.cjs:174 — `fs.writeFileSync` in `proof` 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:37 — `fs.writeFileSync` in `callback to then` 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.writeFileSync` in `callback to then` 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/electron/plugins/managed.js:190 — `fs.existsSync` in `transact` 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/electron/plugins/managed.js:224 — `fs.rmSync` in `commit` 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/electron/plugins/managed.js:224 — `fs.mkdirSync` in `commit` 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/electron/plugins/managed.js:226 — `fs.existsSync` in `commit` 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/electron/plugins/managed.js:227 — `fs.copyFileSync` in `commit` 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/electron/plugins/managed.js:236 — `fs.renameSync` in `commit` 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/electron/plugins/managed.js:238 — `fs.renameSync` in `commit` 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/electron/plugins/managed.js:253 — `fs.existsSync` in `commit` 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/electron/plugins/managed.js:253 — `fs.renameSync` in `commit` 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/electron/plugins/managed.js:254 — `fs.existsSync` in `commit` 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/electron/plugins/managed.js:254 — `fs.renameSync` in `commit` 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/electron/plugins/managed.js:255 — `fs.existsSync` in `commit` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • + 15 more in this group — see findings.md.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×29
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:479 — `.window-actions` moves (`transition: opacity 160ms ease 140ms, transform 160ms ease 140ms`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:500 — `.utility-actions .settings-icon-button` moves (`transition: clip-path 0s var(--footer-secondary-reveal-delay, 0ms), opacity 160ms ease var(--footer-secondary-reveal-delay, 0ms), transform 180ms cubic-bezier(0.22, 1, 0.36, 1) var(--footer-secondary-reveal-delay, 0ms), border-color 160ms ease, background 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:510 — `.utility-actions .refresh-button` moves (`transition: clip-path 0s var(--footer-secondary-reveal-delay, 0ms), opacity 160ms ease var(--footer-secondary-reveal-delay, 0ms), transform 180ms cubic-bezier(0.22, 1, 0.36, 1) var(--footer-secondary-reveal-delay, 0ms), border-color 160ms cubic-bezier(0.25, 1, 0.5, 1), background 160ms cubic-bezier(0.25, 1, 0.5, 1), color 160ms cubic-bezier(0.25, 1, 0.5, 1), box-shadow 160ms cubic-bezier(0.25, 1, 0.5, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:559 — `.title-controls .tabs` moves (`transition: opacity 160ms ease 140ms, transform 160ms ease 140ms`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:607 — `.settings-panel` moves (`transition: max-height 140ms ease, opacity 120ms ease, padding 140ms ease, transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:671 — `.settings-panel .checkbox-label > input[type="checkbox"]::before` moves (`transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background 180ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:929 — `.settings-section-disclosure` moves (`transition: transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:963 — `.accordion-animated-container` moves (`transition: grid-template-rows 250ms cubic-bezier(0.4, 0, 0.2, 1), margin-top 250ms cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:1258 — `.cursor-disclosure-icon` moves (`transition: transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:1571 — `.about-settings-diagnostics` moves (`transition: grid-template-rows 250ms cubic-bezier(0.4, 0, 0.2, 1), margin-top 250ms cubic-bezier(0.4, 0, 0.2, 1), padding-top 250ms cubic-bezier(0.4, 0, 0.2, 1), border-top-color 250ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:1901 — `.shell.settings-open .settings-sync-group.expanded .sync-panel-connection[data-state="connecting"] .sync-panel-signal[data-visible="true"]:not([data-window-hidden="true"]) > .sync-panel-signal-pending` moves (`animation: sync-signal-spin 1.4s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:2034 — `.sync-panel-link-arrow::before` moves (`transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:3354 — `.refresh-button-icon` moves (`transition: transform 120ms cubic-bezier(0.25, 1, 0.5, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:3429 — `.tab-indicator` moves (`transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:3720 — `.home-module` moves (`transition: opacity 140ms ease, transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:4322 — `.session-search-host` moves (`transition: height 200ms cubic-bezier(0.22, 1, 0.36, 1), margin-block 200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 140ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:4729 — `.bar-fill` moves (`transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:4839 — `.row-context-fill` moves (`transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:5403 — `.limit-account-active-popover` moves (`transition: opacity 140ms ease, transform 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:5443 — `.limit-account-switch-popover` moves (`transition: opacity 140ms ease, transform 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:5584 — `.limit-meter-fill` moves (`transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), filter 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:5770 — `.limit-detail-tooltip` moves (`transition: opacity 120ms ease, transform 120ms ease, display 120ms allow-discrete, overlay 120ms allow-discrete`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:6434 — `.live-token-rate.is-fresh .live-token-rate-icon` moves (`animation: live-token-rate-flash 620ms cubic-bezier(0.22, 1, 0.36, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:6514 — `.view-switcher-disclosure::before` moves (`transition: transform 140ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/electron/renderer/styles.css:6555 — `.view-switcher-menu` moves (`transition: opacity 190ms cubic-bezier(0.22, 1, 0.36, 1), transform 190ms cubic-bezier(0.22, 1, 0.36, 1), filter 190ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • + 4 more in this group — see findings.md.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×28
  • Untrusted text written into markup unescaped REDACTED:6118 — `v` 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 REDACTED:6123 — `rangeLabel` 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 REDACTED:6124 — `t('trends.open')` is text this program did not author, and it is written into a quoted attribute value 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 REDACTED:6125 — `first` 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 src/electron/renderer/dashboard.js:303 — `t(`dashboard.range.${r}`)` is text this program did not author, and it is written into the text of an element through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/dashboard.js:347 — `colorFor(r.key)` is text this program did not author, and it is written into a quoted attribute value through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/dashboard.js:348 — `formatCompact(r.value)` is text this program did not author, and it is written into the text of an element through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/dashboard.js:609 — `colorFor(s.key)` is text this program did not author, and it is written into a quoted attribute value 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 src/electron/renderer/dashboard.js:611 — `shortDate(bar.label)` 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 src/electron/renderer/dashboard.js:620 — `head` 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 src/electron/renderer/dashboard.js:621 — `formatCompact(v)` 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 src/electron/renderer/dashboard.js:630 — `longDate(date)` 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 src/electron/renderer/dashboard.js:631 — `formatCompact(tokens)` 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 src/electron/renderer/dashboard.js:633 — `formatCost(cost,missing)` 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 src/electron/renderer/dashboard.js:634 — `t('usage.excludedFromCost',{tokens:Math.round(missing).toLocaleString('en-US')})` 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 src/electron/renderer/pluginSettings.js:634 — `result.html||''` 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 src/electron/renderer/usageCharts.js:528 — `model.areaPath` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/usageCharts.js:529 — `model.linePath` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/usageCharts.js:530 — `model.width` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/usageCharts.js:566 — `o.colorFor(s.key)` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/usageCharts.js:568 — `o.colorFor(s.key)` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/usageCharts.js:578 — `model.width` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/usageCharts.js:599 — `model.width` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/electron/renderer/usageCharts.js:626 — `cellAttrs(c)` is text this program did not author, and it is written into an unquoted attribute through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML text encoding does not help in an unquoted attribute — whitespace ends it; quote the attribute and encode the value.
  • Untrusted text written into markup unescaped src/shared/sessionLive.js:262 — `turn` is text this program did not author, and it is written into a quoted attribute value through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • + 3 more in this group — see findings.md.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×11
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/styles.css:99 — `button:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/styles.css:104 — `.shell:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/styles.css:232 — `.floating-bubble-tab` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/styles.css:3170 — `.settings-panel select` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/styles.css:4365 — `.session-search-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/styles.css:5377 — `.limit-account-active-zone` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/styles.css:8064 — `.opencode-profile-item .profile-name-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/styles.css:9125 — `.plugin-main-page:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/edgeDock/composer.css:92 — `.edge-dock-composer-item.is-selected` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/electron/renderer/edgeDock/composer.css:156 — `.edge-dock-composer-add.is-open` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement site/styles/edgedock.css:67 — `#edge-dock .ed-scene button:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D10 · Test Quality · Fixed-sleep synchronisation · ×9
  • Fixed-sleep synchronisation: Antigravity workspace provenance persists across restart without moving usage anchors tests/shared/antigravitySessionMetadata.test.js:738 — This test starts work it did not wait for (`wait`, still running when the sleep starts) and then orders itself against it with `wait(1)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: Antigravity post-anchor sessions retain project labels and rollups through unavailable-store restart tests/shared/antigravitySessionMetadata.test.js:1092 — This test starts work it did not wait for (`wait`, still running when the sleep starts) and then orders itself against it with `wait(1)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: ${client} scan sidecars cannot feed another live scan, while DB and WAL changes still refresh tests/shared/collectorSqliteSidecars.test.js:32 — This test starts work it did not wait for (`runtime`, still running when the sleep starts) and then orders itself against it with `delay(60)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: ${entry.client} refreshes when only ${entry.sidecar} changes tests/shared/collectorTranscriptWatch.test.js:109 — This test starts work it did not wait for (`runtime`, still running when the sleep starts) and then orders itself against it with `delay(40)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: an overlapping Copilot exporter does not request an unrelated Kiro scan tests/shared/kiroWatch.test.js:115 — This test starts work it did not wait for (`runtime`, still running when the sleep starts) and then orders itself against it with `delay(40)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: the cursor poll speeds up in the approach zone so the handle takes the pointer sooner tests/electron/edgeDockController.test.js:1318 — This test starts work it did not wait for (`pollsOver`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 100))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: refresh reuses the peek and retains one Liquid Glass view across role changes tests/electron/edgeDockController.test.js:1539 — This test starts work it did not wait for (`handler`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 450))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: ${mode} refresh is opt-in and removing it rejects stale refresh requests tests/electron/edgeDockController.test.js:1713 — This test starts work it did not wait for (`handler`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 105))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: ${platform} refresh hover haptics ${enabled ? 'enabled' : 'disabled'} match readouts without click feedback tests/electron/edgeDockController.test.js:1749 — This test starts work it did not wait for (`handler`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 105))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
AC1 · Text alternatives · <canvas> without a text alternative · ×7
  • <canvas> without a text alternative site/scripts/darkVeil.jsx:162 — 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 REDACTED:15945 — 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 REDACTED:15969 — 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 REDACTED:15995 — 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 REDACTED:16061 — 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 REDACTED:16109 — 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 REDACTED:16123 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R4 · Test Coverage · No test reaches this file · ×5
  • No test reaches this file plugins/openai-api-credit/settings.mjs: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/electron/plugins/backendHost.cjs: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/electron/plugins/pagePreload.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/electron/limits/historyPreload.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/electron/limits/historyWorker.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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×4
  • Repeated repair: src/shared/watcherHost.js src/shared/watcherHost.js:240 — src/shared/watcherHost.js changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is watcherHost.createWatcherCoordinator.onMessage at line 240), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(collector): prune custom scan roots and bound the polling fallback (#875)”; “fix(watcher): host the watcher in a child process (#862)”; “fix(watcher): keep unconfirmed fallback on polling (#499)”; “fix(collector): bound memory during tracked-client changes (#495)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/watcherHost.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/shared/watcherWorker.js src/shared/watcherWorker.js:78 — src/shared/watcherWorker.js changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is watcherWorker.pump at line 78), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(collector): prune custom scan roots and bound the polling fallback (#875)”; “fix(watcher): host the watcher in a child process (#862)”; “fix(watcher): keep unconfirmed fallback on polling (#499)”; “fix(collector): bound memory during tracked-client changes (#495)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/watcherWorker.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/electron/renderer/pluginViews.js src/electron/renderer/pluginViews.js:152 — src/electron/renderer/pluginViews.js changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is pluginViews.createPluginViewHost.mount at line 152), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(plugins): preserve icon colors across live refreshes (#1476)”; “fix(plugins): preserve Home controls and order UI updates (#1270)”; “fix(plugins): preserve plugin UI and report delivery errors (#1242)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/electron/renderer/pluginViews.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/shared/providers/cursor/account.js src/shared/providers/cursor/account.js:19 — src/shared/providers/cursor/account.js changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is account.isCursorDetectedAccountCurrent at line 19), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cursor): hide stale desktop accounts in Settings (#1348)”; “fix(cursor): clarify manual setup after Grok redirects (#1303)”; “fix(cursor): restore the dashboard button (#1312)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 13:18:41 +08:00' --until='2026-11-17 13:18:41 +08:00' --full-history --no-merges -- src/shared/providers/cursor/account.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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×4
  • Duplicated block (18 lines × 2 locations) REDACTED:11776 — REDACTED:11776 · REDACTED:11804 — 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 (18 lines × 2 locations) REDACTED:15885 — REDACTED:15885 · REDACTED:16609 — 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 (18 lines × 2 locations) src/shared/providers/antigravity/selfSync.js:168 — src/shared/providers/antigravity/selfSync.js:168 · src/shared/providers/cursor/selfSync.js:34 — 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.
  • Duplicated block (18 lines × 2 locations) src/shared/usage.js:1103 — src/shared/usage.js:1103 · src/shared/usage.js:1134 — 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 · ×4
  • Boundary violation [package:test-suite-dependency] scripts/benchmark-sync-upload.js:6 — scripts/benchmark-sync-upload.js:6 imports tests/fixtures/syncUpload.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/benchmark-upload-delta.js:9 — scripts/benchmark-upload-delta.js:9 imports tests/fixtures/syncUpload.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/verify-vendored-tokscale.js:163 — scripts/verify-vendored-tokscale.js:163 imports tests/fixtures/goose.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/verify-vendored-tokscale.js:746 — scripts/verify-vendored-tokscale.js:746 imports tests/fixtures/goose.js, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
D1 · Cyclomatic Complexity · selectControl.enhance · ×3
  • selectControl.enhance::handleKey (cyclomatic 30) src/electron/renderer/selectControl.js:459 — selectControl.enhance::handleKey has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (selectControl.enhance, selectControl.enhance::sync, selectControl.enhance::anchorVisible) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • selectControl.enhance::sync (cyclomatic 21) src/electron/renderer/selectControl.js:230 — selectControl.enhance::sync has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 3 other methods here (selectControl.enhance, selectControl.enhance::anchorVisible, selectControl.enhance::handleKey) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • selectControl.enhance::anchorVisible (cyclomatic 16) src/electron/renderer/selectControl.js:343 — selectControl.enhance::anchorVisible 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: 3 other methods here (selectControl.enhance, selectControl.enhance::sync, selectControl.enhance::handleKey) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: REDACTED ↔ presentation.js REDACTED:1 — `REDACTED` and `src/electron/renderer/edgeDock/presentation.js` change together 64% of the time (14 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). Neither file is a module — they declare no import/export and are loaded together into one shared scope by a script tag or a bundle — so there is no dependency edge that COULD be declared between them, and this pass cannot tell a real relationship from a coincidence of release. Read the pair before acting: if one defines what the other uses through the shared global, that is the coupling, and making it explicit (a module boundary, or one named object they both go through) is what removes it; if they duplicate structure, extract the common part; if neither holds, the co-change is incidental and there is nothing to do. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `82e00510` feat(edge-dock): show daily cache hit rate and session details (#1307); `bbe8c62f` feat(edge-dock): add recent speed trends (#1441); `2e551134` feat(sessions): show latest model in multi-model sessions (#1423) — run `git show` on any of them.
  • Change coupling: credentialStore.js ↔ collector.js src/shared/credentialStore.js:1 — `src/shared/credentialStore.js` and `src/shared/limits/collector.js` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 `b0b3d8d3` feat(claude): support multiple managed Web accounts (#1220); `23868df9` feat(devin): add usage limits provider (#776); `67756fd0` refactor(providers): align provider ordering with README (#690) — run `git show` on any of them.
  • Change coupling: discordRpc.js ↔ themePresets.js src/electron/discordRpc.js:1 — `src/electron/discordRpc.js` and `src/electron/renderer/themePresets.js` change together 58% of the time (11 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `4a280443` feat(unsloth): add Unsloth Studio usage tracking (#606); `bda1e2f9` feat(lmstudio): add token usage tracking (#546); `b98fb089` feat(cherrystudio): add Cherry Studio usage tracking (#387) — run `git show` on any of them.
R10 · Code Duplication · Duplicated block with local edits (22 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (22 matched lines × 2 locations) REDACTED:10968 — REDACTED:10968 · REDACTED:11303 — the two spans are one implementation copied and then locally edited — 191 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 (22 matched lines × 2 locations) REDACTED:418 — REDACTED:418 · worker/src/index.js:501 — the two spans are one implementation copied and then locally edited — 237 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (22 matched lines × 2 locations) src/shared/providers/zai/limits.js:289 — src/shared/providers/zai/limits.js:289 · src/shared/providers/zaiteam/limits.js:50 — the two spans are one implementation copied and then locally edited — 167 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 (17 lines × 2 locations) · ×3
  • Duplicated block (17 lines × 2 locations) scripts/ensure-vendored-tokscale.js:178 — scripts/ensure-vendored-tokscale.js:178 · scripts/verify-vendored-tokscale-release.js:210 — 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.
  • Duplicated block (17 lines × 2 locations) src/electron/macosSpaceBehavior.js:50 — src/electron/macosSpaceBehavior.js:50 · src/electron/notch/macProgressiveBlur.js:91 — 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.
  • Duplicated block (17 lines × 2 locations) src/electron/renderer/edgeDock/composer.js:276 — src/electron/renderer/edgeDock/composer.js:276 · src/electron/renderer/edgeDock/composer.js:331 — 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.
D1 · Cyclomatic Complexity · sessionMetadata.resolveSessionMetadata (cyclomatic 40) · ×2
  • sessionMetadata.resolveSessionMetadata (cyclomatic 40) src/shared/providers/cursor/sessionMetadata.js:195 — sessionMetadata.resolveSessionMetadata has cyclomatic complexity 40 (threshold 15). Of this number, 36 points are the body's own statements and 4 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.
  • sessionMetadata.resolveSessionMetadata (cyclomatic 40) src/shared/providers/dsh/sessionMetadata.js:29 — sessionMetadata.resolveSessionMetadata 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 · sessionMetadata.resolveSessionMetadata (cyclomatic 21) · ×2
  • sessionMetadata.resolveSessionMetadata (cyclomatic 21) src/shared/providers/claude/sessionMetadata.js:643 — sessionMetadata.resolveSessionMetadata 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. This shape REPEATS in the file: one other method here (sessionMetadata.resolveSessionMetadata::applyFile) 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.
  • sessionMetadata.resolveSessionMetadata (cyclomatic 21) src/shared/providers/devin/sessionMetadata.js:94 — sessionMetadata.resolveSessionMetadata 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.
D2 · Cognitive Complexity · enhance · ×2
  • enhance::handleKey (cognitive 35) src/electron/renderer/selectControl.js:459 — enhance::handleKey has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 11, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • enhance::sync (cognitive 21) src/electron/renderer/selectControl.js:230 — enhance::sync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, ternaries 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×2
  • Edited copy of a member (28 corresponding lines) native/macos/TokenMonitorWidget/WidgetActivityViews.swift:93 — native/macos/TokenMonitorWidget/WidgetActivityViews.swift:93-120 | native/macos/TokenMonitorWidget/WidgetActivityViews.swift:135-165 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:357 — native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:357-384 | native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:397-424 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×2
  • Duplicated block (22 lines × 2 locations) REDACTED:11037 — REDACTED:11037 · REDACTED:11065 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2 locations) src/shared/providers/trae/limits.js:25 — src/shared/providers/trae/limits.js:25 · src/shared/providers/workbuddy/limits.js:28 — 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 (21 lines × 2 locations) · ×2
  • Duplicated block (21 lines × 2 locations) src/electron/macWidget/bridge.js:132 — src/electron/macWidget/bridge.js:132 · src/electron/macWidget/bridge.js:170 — 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 (21 lines × 2 locations) src/electron/main.js:9850 — src/electron/main.js:9850 · src/electron/main.js:10004 — 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 (20 lines × 2 locations) · ×2
  • Duplicated block (20 lines × 2 locations) REDACTED:13855 — REDACTED:13855 · src/electron/renderer/dashboard.js:662 — 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.
  • Duplicated block (20 lines × 2 locations) REDACTED:150 — REDACTED:150 · REDACTED:295 — 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.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark src/electron/renderer/dashboard.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D1 · Cyclomatic Complexity · windowsView.createLimitWindowsView.renderProviderWindows (cyclomatic 292) · ×1
  • windowsView.createLimitWindowsView.renderProviderWindows (cyclomatic 292) src/electron/renderer/limits/windowsView.js:1030 — windowsView.createLimitWindowsView.renderProviderWindows has cyclomatic complexity 292 (threshold 15). Of this number, 277 points are the body's own statements and 15 belong to 12 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 · createLimitWindowsView.renderProviderWindows (cyclomatic 292) · ×1
  • createLimitWindowsView.renderProviderWindows (cyclomatic 292) src/electron/renderer/limits/windowsView.js:1030 — createLimitWindowsView.renderProviderWindows has cyclomatic complexity 292 (threshold 15). Of this number, 274 points are the body's own statements and 18 belong to 35 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) · ×1
  • (anonymous)::applySettingsPatch (cyclomatic 255) src/electron/main.js:8498 — (anonymous)::applySettingsPatch has cyclomatic complexity 255 (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 · setupCursorAccountUI (cyclomatic 172) · ×1
  • setupCursorAccountUI (cyclomatic 172) REDACTED:19600 — setupCursorAccountUI has cyclomatic complexity 172 (threshold 15). Of this number, 16 points are the body's own statements and 156 belong to 78 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 · collector.startCollector.performTick (cyclomatic 146) · ×1
  • collector.startCollector.performTick (cyclomatic 146) src/shared/collector.js:3137 — collector.startCollector.performTick has cyclomatic complexity 146 (threshold 15). Of this number, 116 points are the body's own statements and 30 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 · collectUsageOnce (cyclomatic 144) · ×1
  • collectUsageOnce (cyclomatic 144) src/shared/collector.js:947 — collectUsageOnce has cyclomatic complexity 144 (threshold 15). Of this number, 122 points are the body's own statements and 22 belong to 25 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 · main.app.whenReady().then() · ×1
  • main.app.whenReady().then()::applySettingsPatch (cyclomatic 130) src/electron/main.js:8498 — main.app.whenReady().then()::applySettingsPatch has cyclomatic complexity 130 (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 (main.app.whenReady().then()) 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 · manifest.normalizeManifest (cyclomatic 129) · ×1
  • manifest.normalizeManifest (cyclomatic 129) src/shared/plugins/manifest.js:59 — manifest.normalizeManifest has cyclomatic complexity 129 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · collector.watchPolicyEntries (cyclomatic 118) · ×1
  • collector.watchPolicyEntries (cyclomatic 118) src/shared/collector.js:1895 — collector.watchPolicyEntries has cyclomatic complexity 118 (threshold 15). Of this number, 33 points are the body's own statements and 85 belong to 25 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 · startCollector.performTick (cyclomatic 118) · ×1
  • startCollector.performTick (cyclomatic 118) src/shared/collector.js:3137 — startCollector.performTick has cyclomatic complexity 118 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.updateRow (cyclomatic 107) · ×1
  • app.updateRow (cyclomatic 107) REDACTED:2787 — app.updateRow has cyclomatic complexity 107 (threshold 15). Of this number, 104 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · normalizePeriod (cyclomatic 97) · ×1
  • normalizePeriod (cyclomatic 97) src/shared/usage.js:1031 — normalizePeriod has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · projectRows.projectRowsForPeriod (cyclomatic 94) · ×1
  • projectRows.projectRowsForPeriod (cyclomatic 94) src/electron/renderer/projectRows.js:61 — projectRows.projectRowsForPeriod has cyclomatic complexity 94 (threshold 15). Of this number, 66 points are the body's own statements and 28 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.
D1 · Cyclomatic Complexity · main.setupDashboard (cyclomatic 91) · ×1
  • main.setupDashboard (cyclomatic 91) site/scripts/main.js:390 — main.setupDashboard has cyclomatic complexity 91 (threshold 15). Of this number, 17 points are the body's own statements and 74 belong to 25 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 · historyDatabase.createHistoryDatabase.recordActions (cyclomatic 91) · ×1
  • historyDatabase.createHistoryDatabase.recordActions (cyclomatic 91) src/electron/limits/historyDatabase.js:208 — historyDatabase.createHistoryDatabase.recordActions has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createHistoryDatabase.recordActions (cyclomatic 91) · ×1
  • createHistoryDatabase.recordActions (cyclomatic 91) src/electron/limits/historyDatabase.js:208 — createHistoryDatabase.recordActions has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · projectResource (cyclomatic 84) · ×1
  • projectResource (cyclomatic 84) src/shared/plugins/businessData.js:252 — projectResource has cyclomatic complexity 84 (threshold 15). Of this number, 74 points are the body's own statements and 10 belong to 23 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 · deltaValue (cyclomatic 83) · ×1
  • deltaValue (cyclomatic 83) src/shared/usage.js:2292 — deltaValue has cyclomatic complexity 83 (threshold 15). Of this number, 75 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.fetchOpenCodeLimits (cyclomatic 79) · ×1
  • limits.fetchOpenCodeLimits (cyclomatic 79) src/shared/providers/opencode/limits.js:104 — limits.fetchOpenCodeLimits 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 · runtime.createLimitsRuntime.commitRows (cyclomatic 79) · ×1
  • runtime.createLimitsRuntime.commitRows (cyclomatic 79) src/shared/limits/runtime.js:644 — runtime.createLimitsRuntime.commitRows has cyclomatic complexity 79 (threshold 15). Of this number, 74 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createLimitsRuntime.commitRows (cyclomatic 79) · ×1
  • createLimitsRuntime.commitRows (cyclomatic 79) src/shared/limits/runtime.js:644 — createLimitsRuntime.commitRows has cyclomatic complexity 79 (threshold 15). Of this number, 72 points are the body's own statements and 7 belong to 10 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 · fetchClaudeAccountsLimits (cyclomatic 78) · ×1
  • fetchClaudeAccountsLimits (cyclomatic 78) src/shared/providers/claude/limits.js:1363 — fetchClaudeAccountsLimits has cyclomatic complexity 78 (threshold 15). Of this number, 63 points are the body's own statements and 15 belong to 21 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createEdgeDockController.registerIpc (cyclomatic 78) · ×1
  • createEdgeDockController.registerIpc (cyclomatic 78) src/electron/edgeDock/controller.js:1353 — createEdgeDockController.registerIpc has cyclomatic complexity 78 (threshold 15). Most of this is not in the body itself: 2 of the 78 points are its own statements and the rest belongs to 20 function literals inside it that branch (lines 1369, 1405, 1456, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · controller.createEdgeDockController.registerIpc (cyclomatic 76) · ×1
  • controller.createEdgeDockController.registerIpc (cyclomatic 76) src/electron/edgeDock/controller.js:1353 — controller.createEdgeDockController.registerIpc has cyclomatic complexity 76 (threshold 15). Most of this is not in the body itself: 2 of the 76 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 1369, 1405, 1390, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · fetch (cyclomatic 74) · ×1
  • fetch (cyclomatic 74) worker/src/index.js:462 — fetch has cyclomatic complexity 74 (threshold 15). Of this number, 63 points are the body's own statements and 11 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 · limits.fetchZaiLimits (cyclomatic 73) · ×1
  • limits.fetchZaiLimits (cyclomatic 73) src/shared/providers/zai/limits.js:320 — limits.fetchZaiLimits has cyclomatic complexity 73 (threshold 15). Of this number, 25 points are the body's own statements and 48 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 · app.renderLimitProviderCheckboxesNow (cyclomatic 72) · ×1
  • app.renderLimitProviderCheckboxesNow (cyclomatic 72) REDACTED:12404 — app.renderLimitProviderCheckboxesNow has cyclomatic complexity 72 (threshold 15). Of this number, 68 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 · providerPresentation.limitProviderStatusLabel (cyclomatic 72) · ×1
  • providerPresentation.limitProviderStatusLabel (cyclomatic 72) src/electron/renderer/limits/providerPresentation.js:450 — providerPresentation.limitProviderStatusLabel has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · staticSvg.validateStaticSvg (cyclomatic 70) · ×1
  • staticSvg.validateStaticSvg (cyclomatic 70) src/shared/plugins/staticSvg.js:14 — staticSvg.validateStaticSvg has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionMetadata.resolveSessionMetadata (cyclomatic 70) · ×1
  • sessionMetadata.resolveSessionMetadata (cyclomatic 70) src/shared/providers/antigravity/sessionMetadata.js:145 — sessionMetadata.resolveSessionMetadata has cyclomatic complexity 70 (threshold 15). Of this number, 69 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 · runtime.createPluginRuntime.registerIpc (cyclomatic 70) · ×1
  • runtime.createPluginRuntime.registerIpc (cyclomatic 70) src/electron/plugins/runtime.js:606 — runtime.createPluginRuntime.registerIpc has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 2 of the 70 points are its own statements and the rest belongs to 25 function items inside it that branch (a function literal at line 614, a function literal at line 654, a function literal at line 716, …). 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 · mergeSession (cyclomatic 70) · ×1
  • mergeSession (cyclomatic 70) src/shared/usage.js:723 — mergeSession has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createPluginRuntime.registerIpc (cyclomatic 70) · ×1
  • createPluginRuntime.registerIpc (cyclomatic 70) src/electron/plugins/runtime.js:606 — createPluginRuntime.registerIpc has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 2 of the 70 points are its own statements and the rest belongs to 69 function items inside it that branch (a function literal at line 614, a function literal at line 654, a function literal at line 716, …). 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 · normalizeSession (cyclomatic 69) · ×1
  • normalizeSession (cyclomatic 69) src/shared/usage.js:901 — normalizeSession has cyclomatic complexity 69 (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 · normalizeProviderBalance (cyclomatic 69) · ×1
  • normalizeProviderBalance (cyclomatic 69) src/shared/limits/core.js:234 — normalizeProviderBalance has cyclomatic complexity 69 (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 · limits.fetchWorkbuddyAccount (cyclomatic 68) · ×1
  • limits.fetchWorkbuddyAccount (cyclomatic 68) src/shared/providers/workbuddy/limits.js:390 — limits.fetchWorkbuddyAccount has cyclomatic complexity 68 (threshold 15). Of this number, 43 points are the body's own statements and 25 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.fetchBailianCLI (cyclomatic 68) · ×1
  • cli.fetchBailianCLI (cyclomatic 68) src/shared/providers/alibaba/cli.js:101 — cli.fetchBailianCLI has cyclomatic complexity 68 (threshold 15). Of this number, 67 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · syncSettingsForm (cyclomatic 68) · ×1
  • syncSettingsForm (cyclomatic 68) REDACTED:10080 — syncSettingsForm has cyclomatic complexity 68 (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 · createHistoryDatabase.adopt (cyclomatic 68) · ×1
  • createHistoryDatabase.adopt (cyclomatic 68) src/electron/limits/historyDatabase.js:376 — createHistoryDatabase.adopt has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 6 of the 68 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 387, (anonymous)::sourceFor, a function literal at line 396, …). 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 · createPluginSettingsPanel.pluginDetail (cyclomatic 67) · ×1
  • createPluginSettingsPanel.pluginDetail (cyclomatic 67) src/electron/renderer/pluginSettings.js:1211 — createPluginSettingsPanel.pluginDetail has cyclomatic complexity 67 (threshold 15). Of this number, 62 points are the body's own statements and 5 belong to 24 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 · historyDatabase.createHistoryDatabase.adopt (cyclomatic 66) · ×1
  • historyDatabase.createHistoryDatabase.adopt (cyclomatic 66) src/electron/limits/historyDatabase.js:376 — historyDatabase.createHistoryDatabase.adopt has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 6 of the 66 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 387, 395, 396, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · main.setupSmartDownloads (cyclomatic 65) · ×1
  • main.setupSmartDownloads (cyclomatic 65) site/scripts/main.js:882 — main.setupSmartDownloads has cyclomatic complexity 65 (threshold 15). Of this number, 16 points are the body's own statements and 49 belong to 14 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · server.createHub.handleRequest (cyclomatic 65) · ×1
  • server.createHub.handleRequest (cyclomatic 65) REDACTED:395 — server.createHub.handleRequest has cyclomatic complexity 65 (threshold 15). Of this number, 58 points are the body's own statements and 7 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 · pluginSettings.createPluginSettingsPanel.pluginDetail (cyclomatic 65) · ×1
  • pluginSettings.createPluginSettingsPanel.pluginDetail (cyclomatic 65) src/electron/renderer/pluginSettings.js:1211 — pluginSettings.createPluginSettingsPanel.pluginDetail has cyclomatic complexity 65 (threshold 15). Of this number, 62 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 · createHub.handleRequest (cyclomatic 65) · ×1
  • createHub.handleRequest (cyclomatic 65) REDACTED:395 — createHub.handleRequest has cyclomatic complexity 65 (threshold 15). Of this number, 57 points are the body's own statements and 8 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 · trayLayout.normalizeItem (cyclomatic 64) · ×1
  • trayLayout.normalizeItem (cyclomatic 64) src/shared/trayLayout.js:382 — trayLayout.normalizeItem has cyclomatic complexity 64 (threshold 15). Of this number, 61 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 · t3SessionMetadata.readT3SessionRelationResult (cyclomatic 64) · ×1
  • t3SessionMetadata.readT3SessionRelationResult (cyclomatic 64) src/shared/t3SessionMetadata.js:217 — t3SessionMetadata.readT3SessionRelationResult has cyclomatic complexity 64 (threshold 15). Of this number, 53 points are the body's own statements and 11 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 · fetchMinimaxCodeLimits (cyclomatic 64) · ×1
  • fetchMinimaxCodeLimits (cyclomatic 64) src/shared/providers/minimax/limits.js:524 — fetchMinimaxCodeLimits has cyclomatic complexity 64 (threshold 15). Of this number, 52 points are the body's own statements and 12 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 · sessionMetadata.applySessionMetadata (cyclomatic 62) · ×1
  • sessionMetadata.applySessionMetadata (cyclomatic 62) src/shared/sessionMetadata.js:471 — sessionMetadata.applySessionMetadata has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionUsageArchive.updateSessionUsageArchive (cyclomatic 62) · ×1
  • sessionUsageArchive.updateSessionUsageArchive (cyclomatic 62) src/shared/usage/sessionUsageArchive.js:223 — sessionUsageArchive.updateSessionUsageArchive has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · usage.normalizeClientName (cyclomatic 61) · ×1
  • usage.normalizeClientName (cyclomatic 61) src/shared/usage.js:285 — usage.normalizeClientName has cyclomatic complexity 61 (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 · providerCell (cyclomatic 61) · ×1
  • providerCell (cyclomatic 61) src/electron/renderer/edgeDock/presentation.js:537 — providerCell has cyclomatic complexity 61 (threshold 15). Of this number, 45 points are the body's own statements and 16 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · renderExternalProviderStatus (cyclomatic 60) · ×1
  • renderExternalProviderStatus (cyclomatic 60) REDACTED:17902 — renderExternalProviderStatus has cyclomatic complexity 60 (threshold 15). Of this number, 55 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · app.renderAppContent (cyclomatic 59) · ×1
  • app.renderAppContent (cyclomatic 59) REDACTED:7803 — app.renderAppContent has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pluginSettings.createPluginSettingsPanel.render (cyclomatic 59) · ×1
  • pluginSettings.createPluginSettingsPanel.render (cyclomatic 59) src/electron/renderer/pluginSettings.js:1392 — pluginSettings.createPluginSettingsPanel.render has cyclomatic complexity 59 (threshold 15). Of this number, 40 points are the body's own statements and 19 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 · createPluginSettingsPanel.render (cyclomatic 59) · ×1
  • createPluginSettingsPanel.render (cyclomatic 59) src/electron/renderer/pluginSettings.js:1392 — createPluginSettingsPanel.render has cyclomatic complexity 59 (threshold 15). Of this number, 40 points are the body's own statements and 19 belong to 24 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 · sessionRowsForPeriod (cyclomatic 59) · ×1
  • sessionRowsForPeriod (cyclomatic 59) src/electron/renderer/sessionRows.js:583 — sessionRowsForPeriod has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 14 of the 59 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 596, 694, 688). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · settings.normalizeSettings (cyclomatic 57) · ×1
  • settings.normalizeSettings (cyclomatic 57) src/shared/plugins/settings.js:33 — settings.normalizeSettings has cyclomatic complexity 57 (threshold 15). Most of this is not in the body itself: 13 of the 57 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 39, 77, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · collector.propagateTodayProjects (cyclomatic 56) · ×1
  • collector.propagateTodayProjects (cyclomatic 56) src/shared/collector.js:693 — collector.propagateTodayProjects 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 · pluginSettings.createPluginSettingsPanel.authorSettingsSection (cyclomatic 56) · ×1
  • pluginSettings.createPluginSettingsPanel.authorSettingsSection (cyclomatic 56) src/electron/renderer/pluginSettings.js:1106 — pluginSettings.createPluginSettingsPanel.authorSettingsSection has cyclomatic complexity 56 (threshold 15). Of this number, 33 points are the body's own statements and 23 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 · parseUsageSummary (cyclomatic 56) · ×1
  • parseUsageSummary (cyclomatic 56) src/shared/providers/cursor/probe.js:158 — parseUsageSummary has cyclomatic complexity 56 (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 · collector.startCollector (cyclomatic 55) · ×1
  • collector.startCollector (cyclomatic 55) src/shared/collector.js:2762 — collector.startCollector has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · businessData.createBusinessDataService.queryInternal (cyclomatic 55) · ×1
  • businessData.createBusinessDataService.queryInternal (cyclomatic 55) src/electron/plugins/businessData.js:406 — businessData.createBusinessDataService.queryInternal has cyclomatic complexity 55 (threshold 15). Of this number, 53 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 · macLiquidGlass.createMacLiquidGlass (cyclomatic 55) · ×1
  • macLiquidGlass.createMacLiquidGlass (cyclomatic 55) src/electron/macLiquidGlass.js:122 — macLiquidGlass.createMacLiquidGlass has cyclomatic complexity 55 (threshold 15). Of this number, 33 points are the body's own statements and 22 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 · createNotchController (cyclomatic 55) · ×1
  • createNotchController (cyclomatic 55) src/electron/notch/controller.js:95 — createNotchController has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 2 of the 55 points are its own statements and the rest belongs to 17 function items inside it that branch (topNotch:size, a function literal at line 941, a function literal at line 947, …). 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 · createBusinessDataService.queryInternal (cyclomatic 55) · ×1
  • createBusinessDataService.queryInternal (cyclomatic 55) src/electron/plugins/businessData.js:406 — createBusinessDataService.queryInternal has cyclomatic complexity 55 (threshold 15). Of this number, 53 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · beginRoll (cyclomatic 54) · ×1
  • beginRoll (cyclomatic 54) src/electron/tokenNumberAnimation.js:198 — beginRoll has cyclomatic complexity 54 (threshold 15). Of this number, 19 points are the body's own statements and 35 belong to 26 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 · core.aggregateLimits (cyclomatic 53) · ×1
  • core.aggregateLimits (cyclomatic 53) src/shared/limits/core.js:993 — core.aggregateLimits has cyclomatic complexity 53 (threshold 15). Of this number, 43 points are the body's own statements and 10 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · startCollector.runTick (cyclomatic 53) · ×1
  • startCollector.runTick (cyclomatic 53) src/shared/collector.js:3545 — startCollector.runTick has cyclomatic complexity 53 (threshold 15). Of this number, 48 points are the body's own statements and 5 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 · collector.startCollector.runTick (cyclomatic 52) · ×1
  • collector.startCollector.runTick (cyclomatic 52) src/shared/collector.js:3545 — collector.startCollector.runTick has cyclomatic complexity 52 (threshold 15). Of this number, 47 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 · applyTokscaleSessionMetadata (cyclomatic 52) · ×1
  • applyTokscaleSessionMetadata (cyclomatic 52) src/shared/sessionMetadata.js:85 — applyTokscaleSessionMetadata has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.fetchMinimaxApiLimits (cyclomatic 51) · ×1
  • limits.fetchMinimaxApiLimits (cyclomatic 51) src/shared/providers/minimax/limits.js:701 — limits.fetchMinimaxApiLimits has cyclomatic complexity 51 (threshold 15). Of this number, 49 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 · sessionUsageArchive.normalizeSessionUsageArchive (cyclomatic 51) · ×1
  • sessionUsageArchive.normalizeSessionUsageArchive (cyclomatic 51) src/shared/usage/sessionUsageArchive.js:88 — sessionUsageArchive.normalizeSessionUsageArchive 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 · readSettings (cyclomatic 51) · ×1
  • readSettings (cyclomatic 51) src/electron/main.js:2738 — readSettings has cyclomatic complexity 51 (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 · sessionDetail.parseDshDetailRecords (cyclomatic 50) · ×1
  • sessionDetail.parseDshDetailRecords (cyclomatic 50) src/shared/providers/dsh/sessionDetail.js:109 — sessionDetail.parseDshDetailRecords has cyclomatic complexity 50 (threshold 15). Of this number, 48 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 · createEdgeDockController.placeSurface (cyclomatic 50) · ×1
  • createEdgeDockController.placeSurface (cyclomatic 50) src/electron/edgeDock/controller.js:821 — createEdgeDockController.placeSurface has cyclomatic complexity 50 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · islands.HeroDashboard (cyclomatic 49) · ×1
  • islands.HeroDashboard (cyclomatic 49) site/scripts/islands.jsx:487 — islands.HeroDashboard has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 9 of the 49 points are its own statements and the rest belongs to 13 function items inside it that branch (moveHeatFocus, updateHeatTooltip, a function literal at line 543, …). 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 · createDiagnosticSnapshotBuilder.build (cyclomatic 49) · ×1
  • createDiagnosticSnapshotBuilder.build (cyclomatic 49) src/electron/diagnosticSnapshot.js:261 — createDiagnosticSnapshotBuilder.build has cyclomatic complexity 49 (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 · managed.createManagedPlugins.transact · ×1
  • managed.createManagedPlugins.transact::commit (cyclomatic 48) src/electron/plugins/managed.js:201 — managed.createManagedPlugins.transact::commit 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 · limits.fetchCursorAccountLimits (cyclomatic 48) · ×1
  • limits.fetchCursorAccountLimits (cyclomatic 48) src/shared/providers/cursor/limits.js:141 — limits.fetchCursorAccountLimits has cyclomatic complexity 48 (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 · accountSlotService.createAccountSlotService.save (cyclomatic 48) · ×1
  • accountSlotService.createAccountSlotService.save (cyclomatic 48) src/electron/limits/accountSlotService.js:64 — accountSlotService.createAccountSlotService.save has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 78, 65, 122, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · app.renderToolPreferencesNow (cyclomatic 48) · ×1
  • app.renderToolPreferencesNow (cyclomatic 48) REDACTED:12192 — app.renderToolPreferencesNow has cyclomatic complexity 48 (threshold 15). Of this number, 44 points are the body's own statements and 4 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 · usage.aggregateDevices (cyclomatic 47) · ×1
  • usage.aggregateDevices (cyclomatic 47) src/shared/usage.js:1963 — usage.aggregateDevices has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · renderer.createNotchRenderer.notchSummary (cyclomatic 47) · ×1
  • renderer.createNotchRenderer.notchSummary (cyclomatic 47) src/electron/renderer/notch/renderer.js:250 — renderer.createNotchRenderer.notchSummary has cyclomatic complexity 47 (threshold 15). Of this number, 46 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mask.rasterizeMask (cyclomatic 47) · ×1
  • mask.rasterizeMask (cyclomatic 47) src/electron/edgeDock/mask.js:49 — mask.rasterizeMask has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.fetchWorkbuddyLimits (cyclomatic 47) · ×1
  • limits.fetchWorkbuddyLimits (cyclomatic 47) src/shared/providers/workbuddy/limits.js:554 — limits.fetchWorkbuddyLimits has cyclomatic complexity 47 (threshold 15). Of this number, 33 points are the body's own statements and 14 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 · accountSlotFetcher.createAccountSlotFetcher.fetchAccountSlots · ×1
  • accountSlotFetcher.createAccountSlotFetcher.fetchAccountSlots::collect (cyclomatic 47) src/shared/limits/accountSlotFetcher.js:177 — accountSlotFetcher.createAccountSlotFetcher.fetchAccountSlots::collect has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · diagnosticSnapshot.createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo (cyclomatic 47) · ×1
  • diagnosticSnapshot.createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo (cyclomatic 47) src/electron/diagnosticSnapshot.js:143 — diagnosticSnapshot.createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pageSettings.render (cyclomatic 47) · ×1
  • pageSettings.render (cyclomatic 47) src/electron/renderer/notch/pageSettings.js:63 — pageSettings.render has cyclomatic complexity 47 (threshold 15). Of this number, 19 points are the body's own statements and 28 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 · subscriptionAccountChoices (cyclomatic 47) · ×1
  • subscriptionAccountChoices (cyclomatic 47) REDACTED:3683 — subscriptionAccountChoices has cyclomatic complexity 47 (threshold 15). Of this number, 23 points are the body's own statements and 24 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 · createNotchRenderer.notchSummary (cyclomatic 47) · ×1
  • createNotchRenderer.notchSummary (cyclomatic 47) src/electron/renderer/notch/renderer.js:250 — createNotchRenderer.notchSummary has cyclomatic complexity 47 (threshold 15). Of this number, 46 points are the body's own statements and 1 belongs 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.
D1 · Cyclomatic Complexity · createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo (cyclomatic 47) · ×1
  • createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo (cyclomatic 47) src/electron/diagnosticSnapshot.js:143 — createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo has cyclomatic complexity 47 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createAccountSlotFetcher · ×1
  • createAccountSlotFetcher::fetchAccountSlots::collect (cyclomatic 47) src/shared/limits/accountSlotFetcher.js:177 — createAccountSlotFetcher::fetchAccountSlots::collect has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · panel.createNotchPanel.limitColumn (cyclomatic 46) · ×1
  • panel.createNotchPanel.limitColumn (cyclomatic 46) src/electron/renderer/notch/panel.js:857 — panel.createNotchPanel.limitColumn 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 · macWidgetSnapshot.buildQuota (cyclomatic 46) · ×1
  • macWidgetSnapshot.buildQuota (cyclomatic 46) src/shared/macWidgetSnapshot.js:239 — macWidgetSnapshot.buildQuota has cyclomatic complexity 46 (threshold 15). Of this number, 22 points are the body's own statements and 24 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · history.resolveMacWidgetHistory (cyclomatic 46) · ×1
  • history.resolveMacWidgetHistory (cyclomatic 46) src/electron/macWidget/history.js:85 — history.resolveMacWidgetHistory has cyclomatic complexity 46 (threshold 15). Of this number, 32 points are the body's own statements and 14 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 · setupCustomPricingUI (cyclomatic 46) · ×1
  • setupCustomPricingUI (cyclomatic 46) REDACTED:19422 — setupCustomPricingUI has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 4 of the 46 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 19522, a function literal at line 19573, openCustomPricingForm, …). 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 · createNotchPanel.limitColumn (cyclomatic 46) · ×1
  • createNotchPanel.limitColumn (cyclomatic 46) src/electron/renderer/notch/panel.js:857 — createNotchPanel.limitColumn has cyclomatic complexity 46 (threshold 15). Of this number, 45 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createManagedPlugins.transact · ×1
  • createManagedPlugins.transact::commit (cyclomatic 46) src/electron/plugins/managed.js:201 — createManagedPlugins.transact::commit 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 · usage.addUsageRowToPeriod (cyclomatic 45) · ×1
  • usage.addUsageRowToPeriod (cyclomatic 45) src/shared/usage.js:1257 — usage.addUsageRowToPeriod has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · identityIcon.normalizeIdentityIcon (cyclomatic 45) · ×1
  • identityIcon.normalizeIdentityIcon (cyclomatic 45) src/shared/plugins/identityIcon.js:10 — identityIcon.normalizeIdentityIcon has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.fetchOpenCodeProfile (cyclomatic 44) · ×1
  • limits.fetchOpenCodeProfile (cyclomatic 44) src/shared/providers/opencode/limits.js:332 — limits.fetchOpenCodeProfile has cyclomatic complexity 44 (threshold 15). Of this number, 40 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · t3SessionActivity.readT3Activities (cyclomatic 44) · ×1
  • t3SessionActivity.readT3Activities (cyclomatic 44) src/shared/t3SessionActivity.js:16 — t3SessionActivity.readT3Activities has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionMetadata.resolveSessionMetadata (cyclomatic 44) · ×1
  • sessionMetadata.resolveSessionMetadata (cyclomatic 44) src/shared/providers/grok/sessionMetadata.js:124 — sessionMetadata.resolveSessionMetadata has cyclomatic complexity 44 (threshold 15). Of this number, 42 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 · limits.linkMinimaxAccounts (cyclomatic 44) · ×1
  • limits.linkMinimaxAccounts (cyclomatic 44) src/shared/providers/minimax/limits.js:826 — limits.linkMinimaxAccounts has cyclomatic complexity 44 (threshold 15). Of this number, 40 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · historyModel.distribution (cyclomatic 44) · ×1
  • historyModel.distribution (cyclomatic 44) src/electron/renderer/limits/historyModel.js:62 — historyModel.distribution has cyclomatic complexity 44 (threshold 15). Of this number, 40 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 · parseGraphResult (cyclomatic 44) · ×1
  • parseGraphResult (cyclomatic 44) src/shared/history.js:159 — parseGraphResult has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · controller.createEdgeDockController.placeSurface (cyclomatic 43) · ×1
  • controller.createEdgeDockController.placeSurface (cyclomatic 43) src/electron/edgeDock/controller.js:821 — controller.createEdgeDockController.placeSurface has cyclomatic complexity 43 (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 · sessionActivity.readSessionActivity (cyclomatic 43) · ×1
  • sessionActivity.readSessionActivity (cyclomatic 43) src/shared/providers/claude/sessionActivity.js:46 — sessionActivity.readSessionActivity 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 · diagnosticSnapshot.createDiagnosticSnapshotBuilder.build (cyclomatic 43) · ×1
  • diagnosticSnapshot.createDiagnosticSnapshotBuilder.build (cyclomatic 43) src/electron/diagnosticSnapshot.js:261 — diagnosticSnapshot.createDiagnosticSnapshotBuilder.build has cyclomatic complexity 43 (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 · app.submitSubscription (cyclomatic 43) · ×1
  • app.submitSubscription (cyclomatic 43) REDACTED:4626 — app.submitSubscription 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · accountPanels.createCredentialPanel (cyclomatic 43) · ×1
  • accountPanels.createCredentialPanel (cyclomatic 43) src/electron/renderer/limits/accountPanels.js:88 — accountPanels.createCredentialPanel has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 6 of the 43 points are its own statements and the rest belongs to 10 function items inside it that branch (control, blockContent, a function literal at line 261, …). 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 · renderOpenCodeProfiles (cyclomatic 43) · ×1
  • renderOpenCodeProfiles (cyclomatic 43) REDACTED:18160 — renderOpenCodeProfiles has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 4 of the 43 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 18169, (anonymous)::endRename, (anonymous)::applyNaming, …). 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 · usage.addPeriodInto (cyclomatic 42) · ×1
  • usage.addPeriodInto (cyclomatic 42) src/shared/usage.js:1873 — usage.addPeriodInto has cyclomatic complexity 42 (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 · sessionUsageArchive.applySessionUsageArchive (cyclomatic 42) · ×1
  • sessionUsageArchive.applySessionUsageArchive (cyclomatic 42) src/shared/usage/sessionUsageArchive.js:460 — sessionUsageArchive.applySessionUsageArchive has cyclomatic complexity 42 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionDetail.parseCodexTranscriptData (cyclomatic 42) · ×1
  • sessionDetail.parseCodexTranscriptData (cyclomatic 42) src/shared/sessionDetail.js:205 — sessionDetail.parseCodexTranscriptData 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 · main.refreshSharedSubscriptionsNow (cyclomatic 42) · ×1
  • main.refreshSharedSubscriptionsNow (cyclomatic 42) src/electron/main.js:4370 — main.refreshSharedSubscriptionsNow 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 · resolveTrayLayout (cyclomatic 42) · ×1
  • resolveTrayLayout (cyclomatic 42) src/shared/trayLayout.js:1039 — resolveTrayLayout has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 6 of the 42 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 1056, 1041, 1136, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · sessions.readReasonixNativeSession (cyclomatic 41) · ×1
  • sessions.readReasonixNativeSession (cyclomatic 41) src/shared/providers/reasonix/sessions.js:309 — sessions.readReasonixNativeSession has cyclomatic complexity 41 (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 · zcodeDiscovery.discoverZcodeConnection (cyclomatic 41) · ×1
  • zcodeDiscovery.discoverZcodeConnection (cyclomatic 41) REDACTED:232 — zcodeDiscovery.discoverZcodeConnection has cyclomatic complexity 41 (threshold 15). Of this number, 36 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · syncContentRuntime.createSyncContentRuntime.configure (cyclomatic 41) · ×1
  • syncContentRuntime.createSyncContentRuntime.configure (cyclomatic 41) src/electron/syncContentRuntime.js:384 — syncContentRuntime.createSyncContentRuntime.configure has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 5 of the 41 points are its own statements and the rest belongs to one function literal inside it that branches (line 396). 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 · credentialCommands.createCredentialCommands.saveCredential (cyclomatic 41) · ×1
  • credentialCommands.createCredentialCommands.saveCredential (cyclomatic 41) src/electron/limits/credentialCommands.js:112 — credentialCommands.createCredentialCommands.saveCredential has cyclomatic complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtimeConfig.limitsConfigFromSettings (cyclomatic 41) · ×1
  • runtimeConfig.limitsConfigFromSettings (cyclomatic 41) src/electron/runtimeConfig.js:131 — runtimeConfig.limitsConfigFromSettings has cyclomatic complexity 41 (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 · main.startIcloudCollector (cyclomatic 41) · ×1
  • main.startIcloudCollector (cyclomatic 41) src/electron/main.js:4637 — main.startIcloudCollector has cyclomatic complexity 41 (threshold 15). Of this number, 19 points are the body's own statements and 22 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 · main.createWindow (cyclomatic 41) · ×1
  • main.createWindow (cyclomatic 41) src/electron/main.js:7891 — main.createWindow has cyclomatic complexity 41 (threshold 15). Of this number, 18 points are the body's own statements and 23 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · composer.createEdgeDockComposer.detail (cyclomatic 41) · ×1
  • composer.createEdgeDockComposer.detail (cyclomatic 41) src/electron/renderer/edgeDock/composer.js:350 — composer.createEdgeDockComposer.detail has cyclomatic complexity 41 (threshold 15). Of this number, 35 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createBusinessDataService.preflight (cyclomatic 41) · ×1
  • createBusinessDataService.preflight (cyclomatic 41) src/electron/plugins/businessData.js:115 — createBusinessDataService.preflight has cyclomatic complexity 41 (threshold 15). Of this number, 30 points are the body's own statements and 11 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 · createSyncContentRuntime.configure (cyclomatic 41) · ×1
  • createSyncContentRuntime.configure (cyclomatic 41) src/electron/syncContentRuntime.js:384 — createSyncContentRuntime.configure has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 5 of the 41 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 396, 411, 464). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · createEdgeDockComposer.detail (cyclomatic 41) · ×1
  • createEdgeDockComposer.detail (cyclomatic 41) src/electron/renderer/edgeDock/composer.js:350 — createEdgeDockComposer.detail has cyclomatic complexity 41 (threshold 15). Of this number, 35 points are the body's own statements and 6 belong to 12 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 · fetchVolcengineLimits (cyclomatic 41) · ×1
  • fetchVolcengineLimits (cyclomatic 41) src/shared/providers/volcengine/limits.js:511 — fetchVolcengineLimits has cyclomatic complexity 41 (threshold 15). Of this number, 35 points are the body's own statements and 6 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 · limits.fetchMinimaxLimits (cyclomatic 40) · ×1
  • limits.fetchMinimaxLimits (cyclomatic 40) src/shared/providers/minimax/limits.js:878 — limits.fetchMinimaxLimits has cyclomatic complexity 40 (threshold 15). Of this number, 28 points are the body's own statements and 12 belong to 6 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 · diagnosticReport.deriveDiagnosticFindings (cyclomatic 40) · ×1
  • diagnosticReport.deriveDiagnosticFindings (cyclomatic 40) src/shared/diagnosticReport.js:676 — diagnosticReport.deriveDiagnosticFindings has cyclomatic complexity 40 (threshold 15). Of this number, 39 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 · macWidgetSnapshot.buildTrend (cyclomatic 40) · ×1
  • macWidgetSnapshot.buildTrend (cyclomatic 40) src/shared/macWidgetSnapshot.js:461 — macWidgetSnapshot.buildTrend has cyclomatic complexity 40 (threshold 15). Of this number, 38 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 · createPluginSettingsPanel.catalogDialog (cyclomatic 40) · ×1
  • createPluginSettingsPanel.catalogDialog (cyclomatic 40) src/electron/renderer/pluginSettings.js:602 — createPluginSettingsPanel.catalogDialog has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 14 of the 40 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 631, (anonymous)::loadImage, a function literal at line 699, …). 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 · createIcloudSyncRuntime.reconcile (cyclomatic 40) · ×1
  • createIcloudSyncRuntime.reconcile (cyclomatic 40) src/electron/icloudSyncRuntime.js:225 — createIcloudSyncRuntime.reconcile has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 5 of the 40 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 236, 299, 292, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · initialSetup.initialSetupPlan (cyclomatic 39) · ×1
  • initialSetup.initialSetupPlan (cyclomatic 39) src/electron/plugins/initialSetup.js:90 — initialSetup.initialSetupPlan has cyclomatic complexity 39 (threshold 15). Of this number, 34 points are the body's own statements and 5 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 · presentation.statCell (cyclomatic 39) · ×1
  • presentation.statCell (cyclomatic 39) src/electron/renderer/edgeDock/presentation.js:740 — presentation.statCell 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 · businessData.createBusinessDataService.preflight (cyclomatic 39) · ×1
  • businessData.createBusinessDataService.preflight (cyclomatic 39) src/electron/plugins/businessData.js:115 — businessData.createBusinessDataService.preflight has cyclomatic complexity 39 (threshold 15). Of this number, 28 points are the body's own statements and 11 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 · panel.createNotchPanel.fitTabs (cyclomatic 39) · ×1
  • panel.createNotchPanel.fitTabs (cyclomatic 39) src/electron/renderer/notch/panel.js:117 — panel.createNotchPanel.fitTabs has cyclomatic complexity 39 (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 · icloudSyncRuntime.createIcloudSyncRuntime.reconcile (cyclomatic 39) · ×1
  • icloudSyncRuntime.createIcloudSyncRuntime.reconcile (cyclomatic 39) src/electron/icloudSyncRuntime.js:225 — icloudSyncRuntime.createIcloudSyncRuntime.reconcile has cyclomatic complexity 39 (threshold 15). Of this number, 18 points are the body's own statements and 21 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · createNotchPanel.fitTabs (cyclomatic 39) · ×1
  • createNotchPanel.fitTabs (cyclomatic 39) src/electron/renderer/notch/panel.js:117 — createNotchPanel.fitTabs has cyclomatic complexity 39 (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 · projectHubDevices (cyclomatic 39) · ×1
  • projectHubDevices (cyclomatic 39) src/shared/diagnosticReport.js:216 — projectHubDevices has cyclomatic complexity 39 (threshold 15). Of this number, 16 points are the body's own statements and 23 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · normalizeLimitProvider (cyclomatic 39) · ×1
  • normalizeLimitProvider (cyclomatic 39) src/shared/limits/core.js:485 — normalizeLimitProvider has cyclomatic complexity 39 (threshold 15). Of this number, 34 points are the body's own statements and 5 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · homeLimitAccounts (cyclomatic 39) · ×1
  • homeLimitAccounts (cyclomatic 39) src/electron/renderer/homeOverview.js:115 — homeLimitAccounts has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 4 of the 39 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 121, 117, 147, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · usage.mergeDeviceRecord (cyclomatic 38) · ×1
  • usage.mergeDeviceRecord (cyclomatic 38) src/shared/usage.js:1653 — usage.mergeDeviceRecord 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 · sessionDetail.consumeReplayLine (cyclomatic 38) · ×1
  • sessionDetail.consumeReplayLine (cyclomatic 38) src/shared/providers/reasonix/sessionDetail.js:622 — sessionDetail.consumeReplayLine has cyclomatic complexity 38 (threshold 15). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · collector.deriveClientHealth (cyclomatic 38) · ×1
  • collector.deriveClientHealth (cyclomatic 38) src/shared/collector.js:2318 — collector.deriveClientHealth 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 · app.renderViewSwitcher (cyclomatic 38) · ×1
  • app.renderViewSwitcher (cyclomatic 38) REDACTED:6651 — app.renderViewSwitcher has cyclomatic complexity 38 (threshold 15). Of this number, 20 points are the body's own statements and 18 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · windowText.limitWindowText (cyclomatic 38) · ×1
  • windowText.limitWindowText (cyclomatic 38) src/shared/limits/windowText.js:127 — windowText.limitWindowText 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 · backend.createBackend.call (cyclomatic 37) · ×1
  • backend.createBackend.call (cyclomatic 37) plugins/openai-api-credit/backend.cjs:5 — backend.createBackend.call has cyclomatic complexity 37 (threshold 15). Of this number, 33 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · data.buildNotchData (cyclomatic 37) · ×1
  • data.buildNotchData (cyclomatic 37) src/electron/notch/data.js:169 — data.buildNotchData has cyclomatic complexity 37 (threshold 15). Of this number, 34 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 · selfSync.createAntigravitySelfSync.maybeSyncAntigravity (cyclomatic 37) · ×1
  • selfSync.createAntigravitySelfSync.maybeSyncAntigravity (cyclomatic 37) src/shared/providers/antigravity/selfSync.js:156 — selfSync.createAntigravitySelfSync.maybeSyncAntigravity has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 11 of the 37 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 263, 194, 224, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · spendHistory.recordMimoCumulativeSpend (cyclomatic 37) · ×1
  • spendHistory.recordMimoCumulativeSpend (cyclomatic 37) src/shared/providers/mimo/spendHistory.js:21 — spendHistory.recordMimoCumulativeSpend 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 · icloudSync.createIcloudSyncStore.deleteDeviceNow (cyclomatic 37) · ×1
  • icloudSync.createIcloudSyncStore.deleteDeviceNow (cyclomatic 37) src/electron/icloudSync.js:997 — icloudSync.createIcloudSyncStore.deleteDeviceNow 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 · clientUsageArchive.netOutLiveUsage (cyclomatic 37) · ×1
  • clientUsageArchive.netOutLiveUsage (cyclomatic 37) src/shared/usage/clientUsageArchive.js:408 — clientUsageArchive.netOutLiveUsage 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 · pluginSettings.createPluginSettingsPanel.catalogDialog (cyclomatic 37) · ×1
  • pluginSettings.createPluginSettingsPanel.catalogDialog (cyclomatic 37) src/electron/renderer/pluginSettings.js:602 — pluginSettings.createPluginSettingsPanel.catalogDialog has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 13 of the 37 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 631, 643, 669, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · createLimitWindowsView.renderLimitProviderRow (cyclomatic 37) · ×1
  • createLimitWindowsView.renderLimitProviderRow (cyclomatic 37) src/electron/renderer/limits/windowsView.js:2546 — createLimitWindowsView.renderLimitProviderRow has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 2558, openHistory, a function literal at line 2584, …). 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 · createIcloudSyncStore.deleteDeviceNow (cyclomatic 37) · ×1
  • createIcloudSyncStore.deleteDeviceNow (cyclomatic 37) src/electron/icloudSync.js:997 — createIcloudSyncStore.deleteDeviceNow 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 · normalizeObservation (cyclomatic 37) · ×1
  • normalizeObservation (cyclomatic 37) src/shared/dailyHistoryArchive.js:25 — normalizeObservation 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 · fetchMimoAccount (cyclomatic 37) · ×1
  • fetchMimoAccount (cyclomatic 37) src/shared/providers/mimo/limits.js:280 — fetchMimoAccount has cyclomatic complexity 37 (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 · evaluator.evaluate (cyclomatic 36) · ×1
  • evaluator.evaluate (cyclomatic 36) plugins/quota-alerts/evaluator.cjs:24 — evaluator.evaluate 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 · sessionContext.readCodexSessionState (cyclomatic 36) · ×1
  • sessionContext.readCodexSessionState (cyclomatic 36) src/shared/providers/codex/sessionContext.js:109 — sessionContext.readCodexSessionState 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 · network.createPluginNetwork.request (cyclomatic 36) · ×1
  • network.createPluginNetwork.request (cyclomatic 36) src/electron/plugins/network.js:7 — network.createPluginNetwork.request has cyclomatic complexity 36 (threshold 15). Of this number, 34 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 · runtime.createPluginRuntime (cyclomatic 36) · ×1
  • runtime.createPluginRuntime (cyclomatic 36) src/electron/plugins/runtime.js:49 — runtime.createPluginRuntime has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 6 of the 36 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 323, 313, 170, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · accountSettings.assertAccountForm (cyclomatic 36) · ×1
  • accountSettings.assertAccountForm (cyclomatic 36) src/electron/limits/accountSettings.js:291 — accountSettings.assertAccountForm has cyclomatic complexity 36 (threshold 15). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app.renderCustomTrayItemCanvas (cyclomatic 36) · ×1
  • app.renderCustomTrayItemCanvas (cyclomatic 36) REDACTED:15934 — app.renderCustomTrayItemCanvas has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dock.animateRingResets (cyclomatic 36) · ×1
  • dock.animateRingResets (cyclomatic 36) REDACTED:1157 — dock.animateRingResets has cyclomatic complexity 36 (threshold 15). Of this number, 29 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · windowsView.createLimitWindowsView.renderLimitProviderRow (cyclomatic 36) · ×1
  • windowsView.createLimitWindowsView.renderLimitProviderRow (cyclomatic 36) src/electron/renderer/limits/windowsView.js:2546 — windowsView.createLimitWindowsView.renderLimitProviderRow has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 15 of the 36 points are its own statements and the rest belongs to 7 function items inside it that branch (openHistory, a function literal at line 2584, a function literal at line 2601, …). 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 · pluginContent.create.render (cyclomatic 36) · ×1
  • pluginContent.create.render (cyclomatic 36) src/electron/renderer/pluginContent.js:83 — pluginContent.create.render has cyclomatic complexity 36 (threshold 15). Of this number, 26 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 · renderAntigravityStatus (cyclomatic 36) · ×1
  • renderAntigravityStatus (cyclomatic 36) REDACTED:17239 — renderAntigravityStatus has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 17274, 17313, 17334, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · parseZcodeStartPlanBalances (cyclomatic 36) · ×1
  • parseZcodeStartPlanBalances (cyclomatic 36) src/shared/providers/zai/limits.js:757 — parseZcodeStartPlanBalances has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 14 of the 36 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 776, 829, 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 · dock.sessionsContainer (cyclomatic 35) · ×1
  • dock.sessionsContainer (cyclomatic 35) REDACTED:1575 — dock.sessionsContainer has cyclomatic complexity 35 (threshold 15). Of this number, 30 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · validRevisionLedger (cyclomatic 35) · ×1
  • validRevisionLedger (cyclomatic 35) src/electron/icloudSync.js:467 — validRevisionLedger has cyclomatic complexity 35 (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 · normalizeQuery (cyclomatic 35) · ×1
  • normalizeQuery (cyclomatic 35) src/shared/plugins/businessData.js:140 — normalizeQuery has cyclomatic complexity 35 (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 · createLocalUsageSource.notification (cyclomatic 35) · ×1
  • createLocalUsageSource.notification (cyclomatic 35) src/shared/providers/codex/localUsageSource.js:227 — createLocalUsageSource.notification has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · geometry.createEdgeDockIntent.tick (cyclomatic 34) · ×1
  • geometry.createEdgeDockIntent.tick (cyclomatic 34) src/electron/edgeDock/geometry.js:433 — geometry.createEdgeDockIntent.tick 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 · clientSources.clientSourceRoots (cyclomatic 34) · ×1
  • clientSources.clientSourceRoots (cyclomatic 34) src/shared/clientSources.js:187 — clientSources.clientSourceRoots has cyclomatic complexity 34 (threshold 15). Of this number, 30 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · t3SessionMetadata.readT3SessionMeta (cyclomatic 34) · ×1
  • t3SessionMetadata.readT3SessionMeta (cyclomatic 34) src/shared/t3SessionMetadata.js:125 — t3SessionMetadata.readT3SessionMeta has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · localUsageSource.createLocalUsageSource.notification (cyclomatic 34) · ×1
  • localUsageSource.createLocalUsageSource.notification (cyclomatic 34) src/shared/providers/codex/localUsageSource.js:227 — localUsageSource.createLocalUsageSource.notification 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 · probe.probe (cyclomatic 34) · ×1
  • probe.probe (cyclomatic 34) REDACTED:796 — probe.probe has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 916, 830, 852, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · limits.fetchMinimaxCodeRows (cyclomatic 34) · ×1
  • limits.fetchMinimaxCodeRows (cyclomatic 34) src/shared/providers/minimax/limits.js:653 — limits.fetchMinimaxCodeRows has cyclomatic complexity 34 (threshold 15). Of this number, 26 points are the body's own statements and 8 belong to 6 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 · panel.createNotchPanel.renderHome (cyclomatic 34) · ×1
  • panel.createNotchPanel.renderHome (cyclomatic 34) src/electron/renderer/notch/panel.js:710 — panel.createNotchPanel.renderHome has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 736, a function literal at line 766, a function literal at line 771, …). 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 · main.setupWidgetHeat (cyclomatic 34) · ×1
  • main.setupWidgetHeat (cyclomatic 34) site/scripts/main.js:1412 — main.setupWidgetHeat has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 1426, a function literal at line 1485, renderMonths). 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 · historyDatabase.createHistoryDatabase.noteDaily (cyclomatic 34) · ×1
  • historyDatabase.createHistoryDatabase.noteDaily (cyclomatic 34) src/electron/limits/historyDatabase.js:146 — historyDatabase.createHistoryDatabase.noteDaily 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 · helpPopover.createHelpPopover (cyclomatic 34) · ×1
  • helpPopover.createHelpPopover (cyclomatic 34) src/electron/renderer/helpPopover.js:13 — helpPopover.createHelpPopover has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 14 function items inside it that branch (open, unavailable, leave, …). 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 · trayComposer.createTrayComposer.sourceEditor (cyclomatic 34) · ×1
  • trayComposer.createTrayComposer.sourceEditor (cyclomatic 34) src/electron/renderer/trayComposer.js:786 — trayComposer.createTrayComposer.sourceEditor has cyclomatic complexity 34 (threshold 15). Of this number, 33 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 · trayComposer.createTrayComposer.renderItemPopover (cyclomatic 34) · ×1
  • trayComposer.createTrayComposer.renderItemPopover (cyclomatic 34) src/electron/renderer/trayComposer.js:1031 — trayComposer.createTrayComposer.renderItemPopover has cyclomatic complexity 34 (threshold 15). Of this number, 19 points are the body's own statements and 15 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.
D1 · Cyclomatic Complexity · renderCursorStatus (cyclomatic 34) · ×1
  • renderCursorStatus (cyclomatic 34) REDACTED:19174 — renderCursorStatus has cyclomatic complexity 34 (threshold 15). Of this number, 25 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createNotchPanel.renderHome (cyclomatic 34) · ×1
  • createNotchPanel.renderHome (cyclomatic 34) src/electron/renderer/notch/panel.js:710 — createNotchPanel.renderHome has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 736, a function literal at line 713, a function literal at line 766, …). 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 · createTrayComposer.sourceEditor (cyclomatic 34) · ×1
  • createTrayComposer.sourceEditor (cyclomatic 34) src/electron/renderer/trayComposer.js:786 — createTrayComposer.sourceEditor has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to 13 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createTrayComposer.renderItemPopover (cyclomatic 34) · ×1
  • createTrayComposer.renderItemPopover (cyclomatic 34) src/electron/renderer/trayComposer.js:1031 — createTrayComposer.renderItemPopover has cyclomatic complexity 34 (threshold 15). Of this number, 19 points are the body's own statements and 15 belong to 15 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 · nativeSessionRow (cyclomatic 34) · ×1
  • nativeSessionRow (cyclomatic 34) src/electron/renderer/sessionRows.js:481 — nativeSessionRow 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 · createHistoryDatabase.noteDaily (cyclomatic 34) · ×1
  • createHistoryDatabase.noteDaily (cyclomatic 34) src/electron/limits/historyDatabase.js:146 — createHistoryDatabase.noteDaily 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 · fetchGrokRpcBilling (cyclomatic 34) · ×1
  • fetchGrokRpcBilling (cyclomatic 34) src/shared/providers/grok/limits.js:513 — fetchGrokRpcBilling has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 6 of the 34 points are its own statements and the rest belongs to 10 function items inside it that branch ((anonymous)::handleMessage, (anonymous)::cleanup, a function literal at line 611, …). 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 · createEdgeDockIntent.tick (cyclomatic 34) · ×1
  • createEdgeDockIntent.tick (cyclomatic 34) src/electron/edgeDock/geometry.js:433 — createEdgeDockIntent.tick 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 · controller.createEdgeDockController.poll (cyclomatic 33) · ×1
  • controller.createEdgeDockController.poll (cyclomatic 33) src/electron/edgeDock/controller.js:1219 — controller.createEdgeDockController.poll 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 · sessionFiles.readDshSessionState (cyclomatic 33) · ×1
  • sessionFiles.readDshSessionState (cyclomatic 33) src/shared/providers/dsh/sessionFiles.js:404 — sessionFiles.readDshSessionState 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 · usageSource.createCursorUsageSource.refresh · ×1
  • usageSource.createCursorUsageSource.refresh::operation (cyclomatic 33) src/shared/providers/cursor/usageSource.js:113 — usageSource.createCursorUsageSource.refresh::operation 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 · arkcli.fetchArkcliLimits (cyclomatic 33) · ×1
  • arkcli.fetchArkcliLimits (cyclomatic 33) src/shared/providers/volcengine/arkcli.js:208 — arkcli.fetchArkcliLimits has cyclomatic complexity 33 (threshold 15). Of this number, 28 points are the body's own statements and 5 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 · main.setupFeatureStory (cyclomatic 33) · ×1
  • main.setupFeatureStory (cyclomatic 33) site/scripts/main.js:289 — main.setupFeatureStory has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 10 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (activate, a function literal at line 344, updateScrollSelection, …). 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 · main.setupEdgeDock (cyclomatic 33) · ×1
  • main.setupEdgeDock (cyclomatic 33) site/scripts/main.js:1223 — main.setupEdgeDock has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 1362, a function literal at line 1267, a function literal at line 1253, …). 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 · historyController.createLimitsHistoryController.open (cyclomatic 33) · ×1
  • historyController.createLimitsHistoryController.open (cyclomatic 33) src/electron/limits/historyController.js:247 — historyController.createLimitsHistoryController.open has cyclomatic complexity 33 (threshold 15). Of this number, 32 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 · accountSlotMigration.migrateAccountSlots (cyclomatic 33) · ×1
  • accountSlotMigration.migrateAccountSlots (cyclomatic 33) src/electron/limits/accountSlotMigration.js:14 — accountSlotMigration.migrateAccountSlots 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 · windowsView.createLimitWindowsView (cyclomatic 33) · ×1
  • windowsView.createLimitWindowsView (cyclomatic 33) src/electron/renderer/limits/windowsView.js:50 — windowsView.createLimitWindowsView has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 2 of the 33 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 2678, 2658, 2649, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · createEdgeDockController.poll (cyclomatic 33) · ×1
  • createEdgeDockController.poll (cyclomatic 33) src/electron/edgeDock/controller.js:1219 — createEdgeDockController.poll 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 · createLimitsHistoryController.open (cyclomatic 33) · ×1
  • createLimitsHistoryController.open (cyclomatic 33) src/electron/limits/historyController.js:247 — createLimitsHistoryController.open has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createLocalUsageSource.poll (cyclomatic 33) · ×1
  • createLocalUsageSource.poll (cyclomatic 33) src/shared/providers/codex/localUsageSource.js:327 — createLocalUsageSource.poll has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · syncPayload.buildSyncPayload (cyclomatic 32) · ×1
  • syncPayload.buildSyncPayload (cyclomatic 32) src/shared/syncPayload.js:186 — syncPayload.buildSyncPayload has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.zcodeRecordCumulativeSpend (cyclomatic 32) · ×1
  • limits.zcodeRecordCumulativeSpend (cyclomatic 32) src/shared/providers/zai/limits.js:564 — limits.zcodeRecordCumulativeSpend 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 · limits.parseStepfunUsage (cyclomatic 32) · ×1
  • limits.parseStepfunUsage (cyclomatic 32) src/shared/providers/stepfun/limits.js:50 — limits.parseStepfunUsage 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 · hubProfiles.prepareHubProfilePatch (cyclomatic 32) · ×1
  • hubProfiles.prepareHubProfilePatch (cyclomatic 32) src/electron/hubProfiles.js:39 — hubProfiles.prepareHubProfilePatch 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 · nativeMaterialVisibility.syncNativeMaterialVisibility (cyclomatic 32) · ×1
  • nativeMaterialVisibility.syncNativeMaterialVisibility (cyclomatic 32) src/electron/nativeMaterialVisibility.js:37 — nativeMaterialVisibility.syncNativeMaterialVisibility has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resetForecast.normalizeCodexResetForecast (cyclomatic 32) · ×1
  • resetForecast.normalizeCodexResetForecast (cyclomatic 32) src/electron/providers/codex/resetForecast.js:75 — resetForecast.normalizeCodexResetForecast has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · app.renderHomeLimitModule (cyclomatic 32) · ×1
  • app.renderHomeLimitModule (cyclomatic 32) REDACTED:6913 — app.renderHomeLimitModule 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 · app.clientHealthGroup (cyclomatic 32) · ×1
  • app.clientHealthGroup (cyclomatic 32) REDACTED:11699 — app.clientHealthGroup has cyclomatic complexity 32 (threshold 15). Of this number, 28 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 · dock.renderBubble (cyclomatic 32) · ×1
  • dock.renderBubble (cyclomatic 32) REDACTED:2139 — dock.renderBubble has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · providerPresentation.workbuddyCreditTotals (cyclomatic 32) · ×1
  • providerPresentation.workbuddyCreditTotals (cyclomatic 32) src/electron/renderer/limits/providerPresentation.js:690 — providerPresentation.workbuddyCreditTotals has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 697, 692). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · resetAnimator.createLimitResetAnimator.animate (cyclomatic 32) · ×1
  • resetAnimator.createLimitResetAnimator.animate (cyclomatic 32) src/electron/renderer/limits/resetAnimator.js:160 — resetAnimator.createLimitResetAnimator.animate has cyclomatic complexity 32 (threshold 15). Of this number, 26 points are the body's own statements and 6 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 · windowsView.createLimitWindowsView.thirdPartySpendNode (cyclomatic 32) · ×1
  • windowsView.createLimitWindowsView.thirdPartySpendNode (cyclomatic 32) src/electron/renderer/limits/windowsView.js:655 — windowsView.createLimitWindowsView.thirdPartySpendNode has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 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 · pluginCredentials.create.mount (cyclomatic 32) · ×1
  • pluginCredentials.create.mount (cyclomatic 32) src/electron/renderer/pluginCredentials.js:9 — pluginCredentials.create.mount has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 109, 97, 124). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · pluginUi.createHost.load (cyclomatic 32) · ×1
  • pluginUi.createHost.load (cyclomatic 32) src/electron/renderer/pluginUi.js:39 — pluginUi.createHost.load has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 5 of the 32 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 42, 56, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · createLimitWindowsView.thirdPartySpendNode (cyclomatic 32) · ×1
  • createLimitWindowsView.thirdPartySpendNode (cyclomatic 32) src/electron/renderer/limits/windowsView.js:655 — createLimitWindowsView.thirdPartySpendNode has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · normalizeDeviceRecord (cyclomatic 32) · ×1
  • normalizeDeviceRecord (cyclomatic 32) src/shared/usage.js:1412 — normalizeDeviceRecord has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · groupedSessionRows (cyclomatic 32) · ×1
  • groupedSessionRows (cyclomatic 32) src/electron/renderer/edgeDock/presentation.js:332 — groupedSessionRows has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 351, 339, 335, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · captureDailyHistoryArchive (cyclomatic 32) · ×1
  • captureDailyHistoryArchive (cyclomatic 32) src/shared/dailyHistoryArchive.js:328 — captureDailyHistoryArchive has cyclomatic complexity 32 (threshold 15). Of this number, 26 points are the body's own statements and 6 belong to 4 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.
D1 · Cyclomatic Complexity · parseGrokBilling (cyclomatic 32) · ×1
  • parseGrokBilling (cyclomatic 32) src/shared/providers/grok/limits.js:206 — parseGrokBilling has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createHost.load (cyclomatic 32) · ×1
  • createHost.load (cyclomatic 32) src/electron/renderer/pluginUi.js:39 — createHost.load has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 5 of the 32 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 42, (anonymous)::subscribe, (anonymous)::subscribe::dispose, …). 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 · sessionContext.applyLine (cyclomatic 31) · ×1
  • sessionContext.applyLine (cyclomatic 31) src/shared/providers/codex/sessionContext.js:42 — sessionContext.applyLine has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · limits.appendWorkbuddyRemovals (cyclomatic 31) · ×1
  • limits.appendWorkbuddyRemovals (cyclomatic 31) src/shared/providers/workbuddy/limits.js:522 — limits.appendWorkbuddyRemovals has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 543, localComplete, a function literal at line 532, …). 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 · arkcli.parseArkcliPlan (cyclomatic 31) · ×1
  • arkcli.parseArkcliPlan (cyclomatic 31) src/shared/providers/volcengine/arkcli.js:146 — arkcli.parseArkcliPlan has cyclomatic complexity 31 (threshold 15). Of this number, 29 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 · businessData.subscriptionForecast (cyclomatic 31) · ×1
  • businessData.subscriptionForecast (cyclomatic 31) src/shared/plugins/businessData.js:97 — businessData.subscriptionForecast has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · displayPreview.buildDisplayPreview (cyclomatic 31) · ×1
  • displayPreview.buildDisplayPreview (cyclomatic 31) src/electron/displayPreview.js:24 — displayPreview.buildDisplayPreview has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · diagnosticReport.renderReport (cyclomatic 31) · ×1
  • diagnosticReport.renderReport (cyclomatic 31) src/shared/diagnosticReport.js:977 — diagnosticReport.renderReport has cyclomatic complexity 31 (threshold 15). Of this number, 24 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · diagnosticSnapshot.createDiagnosticSnapshotBuilder (cyclomatic 31) · ×1
  • diagnosticSnapshot.createDiagnosticSnapshotBuilder (cyclomatic 31) src/electron/diagnosticSnapshot.js:111 — diagnosticSnapshot.createDiagnosticSnapshotBuilder has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · pluginSettings.createSettingsAutosave.flush (cyclomatic 31) · ×1
  • pluginSettings.createSettingsAutosave.flush (cyclomatic 31) src/electron/renderer/pluginSettings.js:54 — pluginSettings.createSettingsAutosave.flush has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pluginUi.createHost.mountRecord (cyclomatic 31) · ×1
  • pluginUi.createHost.mountRecord (cyclomatic 31) src/electron/renderer/pluginUi.js:176 — pluginUi.createHost.mountRecord has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · trayComposer.createTrayComposer.openPickerMenu (cyclomatic 31) · ×1
  • trayComposer.createTrayComposer.openPickerMenu (cyclomatic 31) src/electron/renderer/trayComposer.js:425 — trayComposer.createTrayComposer.openPickerMenu has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 8 function items inside it that branch (renderChoices, a function literal at line 508, a function literal at line 444, …). 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 · renderMimoStatus (cyclomatic 31) · ×1
  • renderMimoStatus (cyclomatic 31) REDACTED:17367 — renderMimoStatus has cyclomatic complexity 31 (threshold 15). Of this number, 20 points are the body's own statements and 11 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createSettingsAutosave.flush (cyclomatic 31) · ×1
  • createSettingsAutosave.flush (cyclomatic 31) src/electron/renderer/pluginSettings.js:54 — createSettingsAutosave.flush has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 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 · createTrayComposer.openPickerMenu (cyclomatic 31) · ×1
  • createTrayComposer.openPickerMenu (cyclomatic 31) src/electron/renderer/trayComposer.js:425 — createTrayComposer.openPickerMenu has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 12 function items inside it that branch (renderChoices, a function literal at line 508, a function literal at line 444, …). 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 · normalizeLimitWindow (cyclomatic 31) · ×1
  • normalizeLimitWindow (cyclomatic 31) src/shared/limits/core.js:173 — normalizeLimitWindow has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sessionSources (cyclomatic 31) · ×1
  • sessionSources (cyclomatic 31) src/shared/plugins/businessData.js:172 — sessionSources has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 183, allowed, id, …). 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 · createHost.mountRecord (cyclomatic 31) · ×1
  • createHost.mountRecord (cyclomatic 31) src/electron/renderer/pluginUi.js:176 — createHost.mountRecord has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs 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 · sessionRows.groupSubagentRows (cyclomatic 30) · ×1
  • sessionRows.groupSubagentRows (cyclomatic 30) src/electron/renderer/sessionRows.js:714 — sessionRows.groupSubagentRows has cyclomatic complexity 30 (threshold 15). Of this number, 20 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · trayLayout.resolveTrayLayout.items (cyclomatic 30) · ×1
  • trayLayout.resolveTrayLayout.items (cyclomatic 30) src/shared/trayLayout.js:1056 — trayLayout.resolveTrayLayout.items has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionMetadata.resolveSessionMetadata (cyclomatic 30) · ×1
  • sessionMetadata.resolveSessionMetadata (cyclomatic 30) src/shared/providers/codex/sessionMetadata.js:212 — sessionMetadata.resolveSessionMetadata has cyclomatic complexity 30 (threshold 15). Of this number, 20 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sessionMetadata.readTitles (cyclomatic 30) · ×1
  • sessionMetadata.readTitles (cyclomatic 30) src/shared/providers/cursor/sessionMetadata.js:106 — sessionMetadata.readTitles has cyclomatic complexity 30 (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 · localUsageSource.createLocalUsageSource.poll (cyclomatic 30) · ×1
  • localUsageSource.createLocalUsageSource.poll (cyclomatic 30) src/shared/providers/codex/localUsageSource.js:327 — localUsageSource.createLocalUsageSource.poll has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · clientUsageArchive.addClientUsage (cyclomatic 30) · ×1
  • clientUsageArchive.addClientUsage (cyclomatic 30) src/shared/usage/clientUsageArchive.js:261 — clientUsageArchive.addClientUsage 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 · main.startStatsStream (cyclomatic 30) · ×1
  • main.startStatsStream (cyclomatic 30) src/electron/main.js:5597 — main.startStatsStream 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 · app.closeSubscriptionEditor (cyclomatic 30) · ×1
  • app.closeSubscriptionEditor (cyclomatic 30) REDACTED:4277 — app.closeSubscriptionEditor has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 13 of the 30 points are its own statements and the rest belongs to 4 function items inside it that branch (restoreFocus, finish, onTransitionEnd, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · app.renderViewPreferences (cyclomatic 30) · ×1
  • app.renderViewPreferences (cyclomatic 30) REDACTED:10566 — app.renderViewPreferences has cyclomatic complexity 30 (threshold 15). Of this number, 28 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 · syncContentForm.createSyncContentForm.render (cyclomatic 30) · ×1
  • syncContentForm.createSyncContentForm.render (cyclomatic 30) src/electron/renderer/syncContentForm.js:65 — syncContentForm.createSyncContentForm.render 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 · WidgetFormat.tokens (cyclomatic 30) · ×1
  • WidgetFormat.tokens (cyclomatic 30) native/macos/TokenMonitorWidget/WidgetViewModel.swift:410 — WidgetFormat.tokens has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 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 · renderRows (cyclomatic 30) · ×1
  • renderRows (cyclomatic 30) REDACTED:3241 — renderRows has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 belong to 12 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 · applyAppearanceSettings (cyclomatic 30) · ×1
  • applyAppearanceSettings (cyclomatic 30) REDACTED:8301 — applyAppearanceSettings 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 · replaceMainWindow (cyclomatic 30) · ×1
  • replaceMainWindow (cyclomatic 30) src/electron/main.js:8055 — replaceMainWindow has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 2 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 8057, 8063, 8106). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · createNotchController.sync (cyclomatic 30) · ×1
  • createNotchController.sync (cyclomatic 30) src/electron/notch/controller.js:821 — createNotchController.sync has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 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 · zcodePlanBucketWindow (cyclomatic 30) · ×1
  • zcodePlanBucketWindow (cyclomatic 30) src/shared/providers/zai/limits.js:678 — zcodePlanBucketWindow has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · parseMimoPlanDetail (cyclomatic 30) · ×1
  • parseMimoPlanDetail (cyclomatic 30) src/shared/providers/mimo/limits.js:145 — parseMimoPlanDetail 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 · hubDelta.applyStatsPatch (cyclomatic 29) · ×1
  • hubDelta.applyStatsPatch (cyclomatic 29) src/shared/hubDelta.js:43 — hubDelta.applyStatsPatch has cyclomatic complexity 29 (threshold 15). Of this number, 26 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 · initialSetup.setupFields (cyclomatic 29) · ×1
  • initialSetup.setupFields (cyclomatic 29) src/electron/plugins/initialSetup.js:39 — initialSetup.setupFields has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · controller.createNotchController.wheeled (cyclomatic 29) · ×1
  • controller.createNotchController.wheeled (cyclomatic 29) src/electron/notch/controller.js:703 — controller.createNotchController.wheeled 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 · controller.createNotchController.sync (cyclomatic 29) · ×1
  • controller.createNotchController.sync (cyclomatic 29) src/electron/notch/controller.js:821 — controller.createNotchController.sync has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dailyHistoryArchive.periodLiveDay (cyclomatic 29) · ×1
  • dailyHistoryArchive.periodLiveDay (cyclomatic 29) src/shared/dailyHistoryArchive.js:405 — dailyHistoryArchive.periodLiveDay has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · limits.fetchQoderLimits (cyclomatic 29) · ×1
  • limits.fetchQoderLimits (cyclomatic 29) src/shared/providers/qoder/limits.js:242 — limits.fetchQoderLimits 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 · githubDiscovery.createGitHubDiscovery.repositoryReadme (cyclomatic 29) · ×1
  • githubDiscovery.createGitHubDiscovery.repositoryReadme (cyclomatic 29) src/electron/plugins/githubDiscovery.js:70 — githubDiscovery.createGitHubDiscovery.repositoryReadme 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 · catalogMedia.createCatalogMedia.load (cyclomatic 29) · ×1
  • catalogMedia.createCatalogMedia.load (cyclomatic 29) src/electron/plugins/catalogMedia.js:11 — catalogMedia.createCatalogMedia.load 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 · runtime.createPluginRuntime.changePackage (cyclomatic 29) · ×1
  • runtime.createPluginRuntime.changePackage (cyclomatic 29) src/electron/plugins/runtime.js:495 — runtime.createPluginRuntime.changePackage has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · readClaudeCredentials (cyclomatic 29) · ×1
  • readClaudeCredentials (cyclomatic 29) src/shared/providers/claude/limits.js:209 — readClaudeCredentials 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 · createNotchController.wheeled (cyclomatic 29) · ×1
  • createNotchController.wheeled (cyclomatic 29) src/electron/notch/controller.js:703 — createNotchController.wheeled 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 · createPluginRuntime.changePackage (cyclomatic 29) · ×1
  • createPluginRuntime.changePackage (cyclomatic 29) src/electron/plugins/runtime.js:495 — createPluginRuntime.changePackage has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to 12 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 · subagentGroupRow (cyclomatic 29) · ×1
  • subagentGroupRow (cyclomatic 29) src/electron/renderer/sessionRows.js:793 — subagentGroupRow has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to 15 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · balance.parseBalance (cyclomatic 28) · ×1
  • balance.parseBalance (cyclomatic 28) plugins/openai-api-credit/balance.cjs:6 — balance.parseBalance 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 · usage.preserveUntrackedClientUsage (cyclomatic 28) · ×1
  • usage.preserveUntrackedClientUsage (cyclomatic 28) src/shared/usage.js:1535 — usage.preserveUntrackedClientUsage 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 · sessionMetadata.readSessionMeta (cyclomatic 28) · ×1
  • sessionMetadata.readSessionMeta (cyclomatic 28) src/shared/providers/codex/sessionMetadata.js:115 — sessionMetadata.readSessionMeta 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 · collector.collectHistoryOnce (cyclomatic 28) · ×1
  • collector.collectHistoryOnce (cyclomatic 28) src/shared/collector.js:832 — collector.collectHistoryOnce has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · collector.ignoreDesktopTranscriptPath (cyclomatic 28) · ×1
  • collector.ignoreDesktopTranscriptPath (cyclomatic 28) src/shared/collector.js:1828 — collector.ignoreDesktopTranscriptPath 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 · tokenRatePresentation.createLiveTokenRateTracker.observe (cyclomatic 28) · ×1
  • tokenRatePresentation.createLiveTokenRateTracker.observe (cyclomatic 28) src/electron/renderer/tokenRatePresentation.js:139 — tokenRatePresentation.createLiveTokenRateTracker.observe 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 · catalog.createPluginCatalog.list (cyclomatic 28) · ×1
  • catalog.createPluginCatalog.list (cyclomatic 28) src/electron/plugins/catalog.js:40 — catalog.createPluginCatalog.list has cyclomatic complexity 28 (threshold 15). Of this number, 18 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · panel.createNotchPanel.renderPage (cyclomatic 28) · ×1
  • panel.createNotchPanel.renderPage (cyclomatic 28) src/electron/renderer/notch/panel.js:1323 — panel.createNotchPanel.renderPage has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · accounts.createCopilotAccounts.addAccount (cyclomatic 28) · ×1
  • accounts.createCopilotAccounts.addAccount (cyclomatic 28) src/electron/providers/copilot/accounts.js:40 — accounts.createCopilotAccounts.addAccount has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 41, 59). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · app.syncDockControls (cyclomatic 28) · ×1
  • app.syncDockControls (cyclomatic 28) REDACTED:14778 — app.syncDockControls has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · app.renderCopilotAccounts (cyclomatic 28) · ×1
  • app.renderCopilotAccounts (cyclomatic 28) REDACTED:18012 — app.renderCopilotAccounts has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 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 · dock.statCard (cyclomatic 28) · ×1
  • dock.statCard (cyclomatic 28) REDACTED:1835 — dock.statCard has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · aggregateHistory (cyclomatic 28) · ×1
  • aggregateHistory (cyclomatic 28) src/shared/usage.js:1818 — aggregateHistory has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createNotchPanel.renderPage (cyclomatic 28) · ×1
  • createNotchPanel.renderPage (cyclomatic 28) src/electron/renderer/notch/panel.js:1323 — createNotchPanel.renderPage has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createLimitsRuntime (cyclomatic 28) · ×1
  • createLimitsRuntime (cyclomatic 28) src/shared/limits/runtime.js:138 — createLimitsRuntime has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · parseGrokGrpcWebBilling (cyclomatic 28) · ×1
  • parseGrokGrpcWebBilling (cyclomatic 28) src/shared/providers/grok/limits.js:407 — parseGrokGrpcWebBilling has cyclomatic complexity 28 (threshold 15). Of this number, 20 points are the body's own statements and 8 belong to 11 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · createLiveTokenRateTracker.observe (cyclomatic 28) · ×1
  • createLiveTokenRateTracker.observe (cyclomatic 28) src/electron/renderer/tokenRatePresentation.js:139 — createLiveTokenRateTracker.observe has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 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 · items.normalizeItem (cyclomatic 27) · ×1
  • items.normalizeItem (cyclomatic 27) src/electron/renderer/edgeDock/items.js:87 — items.normalizeItem has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · renderer.createNotchRenderer.render (cyclomatic 27) · ×1
  • renderer.createNotchRenderer.render (cyclomatic 27) src/electron/renderer/notch/renderer.js:605 — renderer.createNotchRenderer.render 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · controller.createNotchController.poll (cyclomatic 27) · ×1
  • controller.createNotchController.poll (cyclomatic 27) src/electron/notch/controller.js:740 — controller.createNotchController.poll 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 · limits.fetchCodexLimits (cyclomatic 27) · ×1
  • limits.fetchCodexLimits (cyclomatic 27) src/shared/providers/codex/limits.js:1381 — limits.fetchCodexLimits has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sessionMetadata.applyLongLineFragments (cyclomatic 27) · ×1
  • sessionMetadata.applyLongLineFragments (cyclomatic 27) src/shared/providers/claude/sessionMetadata.js:435 — sessionMetadata.applyLongLineFragments 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 · sessionMetadata.readSessionTitle (cyclomatic 27) · ×1
  • sessionMetadata.readSessionTitle (cyclomatic 27) src/shared/providers/claude/sessionMetadata.js:540 — sessionMetadata.readSessionTitle 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 · sessionMetadata.applyT3SessionParents (cyclomatic 27) · ×1
  • sessionMetadata.applyT3SessionParents (cyclomatic 27) src/shared/sessionMetadata.js:379 — sessionMetadata.applyT3SessionParents has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (sessionMetadata.applyT3SessionParents::index) 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 · limits.windowsFromSummary (cyclomatic 27) · ×1
  • limits.windowsFromSummary (cyclomatic 27) src/shared/providers/hark/limits.js:83 — limits.windowsFromSummary 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 · credentialStore.readRegularFileNoFollow (cyclomatic 27) · ×1
  • credentialStore.readRegularFileNoFollow (cyclomatic 27) src/shared/credentialStore.js:96 — credentialStore.readRegularFileNoFollow 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 · sessionUsageArchive.addSessionBreakdown (cyclomatic 27) · ×1
  • sessionUsageArchive.addSessionBreakdown (cyclomatic 27) src/shared/usage/sessionUsageArchive.js:364 — sessionUsageArchive.addSessionBreakdown 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 · clientUsageArchive.mergeResidueIntoPeriod (cyclomatic 27) · ×1
  • clientUsageArchive.mergeResidueIntoPeriod (cyclomatic 27) src/shared/usage/clientUsageArchive.js:202 — clientUsageArchive.mergeResidueIntoPeriod has cyclomatic complexity 27 (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 · sessionDetail.parseCodebuddyTranscriptLines (cyclomatic 27) · ×1
  • sessionDetail.parseCodebuddyTranscriptLines (cyclomatic 27) src/shared/sessionDetail.js:311 — sessionDetail.parseCodebuddyTranscriptLines 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 · launchServicesRecovery.createMacWidgetLaunchServicesRecovery · ×1
  • launchServicesRecovery.createMacWidgetLaunchServicesRecovery::execute (cyclomatic 27) src/electron/macWidget/launchServicesRecovery.js:145 — launchServicesRecovery.createMacWidgetLaunchServicesRecovery::execute 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 · app.saveAccountCredential (cyclomatic 27) · ×1
  • app.saveAccountCredential (cyclomatic 27) REDACTED:12659 — app.saveAccountCredential 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, name the conditions: bind each compound test to a 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 · createPluginSettingsPanel.catalogPanel · ×1
  • createPluginSettingsPanel.catalogPanel::renderResults (cyclomatic 27) src/electron/renderer/pluginSettings.js:734 — createPluginSettingsPanel.catalogPanel::renderResults 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 · createPluginSettingsPanel.authorSettingsSection · ×1
  • createPluginSettingsPanel.authorSettingsSection::paint (cyclomatic 27) src/electron/renderer/pluginSettings.js:1179 — createPluginSettingsPanel.authorSettingsSection::paint 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 · fetchClaudeWebLimits (cyclomatic 27) · ×1
  • fetchClaudeWebLimits (cyclomatic 27) src/shared/providers/claude/limits.js:1139 — fetchClaudeWebLimits has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createNotchController.poll (cyclomatic 27) · ×1
  • createNotchController.poll (cyclomatic 27) src/electron/notch/controller.js:740 — createNotchController.poll 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 · accountSummary (cyclomatic 27) · ×1
  • accountSummary (cyclomatic 27) src/electron/renderer/edgeDock/presentation.js:124 — accountSummary 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 · createNotchRenderer.renderNotch (cyclomatic 27) · ×1
  • createNotchRenderer.renderNotch (cyclomatic 27) src/electron/renderer/notch/renderer.js:605 — createNotchRenderer.renderNotch has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parseZaiUsage (cyclomatic 27) · ×1
  • parseZaiUsage (cyclomatic 27) src/shared/providers/zai/limits.js:204 — parseZaiUsage has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · parseKimiUsage (cyclomatic 27) · ×1
  • parseKimiUsage (cyclomatic 27) src/shared/providers/kimi/limits.js:214 — parseKimiUsage 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 · createPanel.openEditor (cyclomatic 27) · ×1
  • createPanel.openEditor (cyclomatic 27) src/electron/renderer/limits/accountSlotsPanel.js:104 — createPanel.openEditor has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 16 function items inside it that branch ((anonymous)::submit, a function literal at line 105, (anonymous)::remap, …). 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 · Surface.Update (cyclomatic 26) · ×1
  • Surface.Update (cyclomatic 26) src/windows-dock/DockBackdrop.cs:114 — Surface.Update 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 · geometry.notchGeometry (cyclomatic 26) · ×1
  • geometry.notchGeometry (cyclomatic 26) src/electron/notch/geometry.js:29 — geometry.notchGeometry has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · limits.claudeWebAccountIdentity (cyclomatic 26) · ×1
  • limits.claudeWebAccountIdentity (cyclomatic 26) src/shared/providers/claude/limits.js:810 — limits.claudeWebAccountIdentity 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 · sessionActivity.projectSessionActivity (cyclomatic 26) · ×1
  • sessionActivity.projectSessionActivity (cyclomatic 26) src/shared/providers/codex/sessionActivity.js:214 — sessionActivity.projectSessionActivity has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · localUsageSource.createLocalUsageSource.subscribe (cyclomatic 26) · ×1
  • localUsageSource.createLocalUsageSource.subscribe (cyclomatic 26) src/shared/providers/codex/localUsageSource.js:134 — localUsageSource.createLocalUsageSource.subscribe 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 · limits.collectMimoCredentials (cyclomatic 26) · ×1
  • limits.collectMimoCredentials (cyclomatic 26) src/shared/providers/mimo/limits.js:493 — limits.collectMimoCredentials has cyclomatic complexity 26 (threshold 15). Of this number, 16 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 · runtime.createPluginRuntime.hostCall (cyclomatic 26) · ×1
  • runtime.createPluginRuntime.hostCall (cyclomatic 26) src/electron/plugins/runtime.js:133 — runtime.createPluginRuntime.hostCall 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 · deviceRuntime.createDeviceRuntime (cyclomatic 26) · ×1
  • deviceRuntime.createDeviceRuntime (cyclomatic 26) src/shared/usage/deviceRuntime.js:10 — deviceRuntime.createDeviceRuntime 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 · oauthLogin.runAntigravityOAuthLogin (cyclomatic 26) · ×1
  • oauthLogin.runAntigravityOAuthLogin (cyclomatic 26) REDACTED:23 — oauthLogin.runAntigravityOAuthLogin has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 50, settle, a function literal at line 80, …). 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 · selectControl.enhance (cyclomatic 26) · ×1
  • selectControl.enhance (cyclomatic 26) src/electron/renderer/selectControl.js:55 — selectControl.enhance 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. This shape REPEATS in the file: 3 other methods here (selectControl.enhance::sync, selectControl.enhance::anchorVisible, selectControl.enhance::handleKey) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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 · accountSlotsPanel.createPanel.openEditor (cyclomatic 26) · ×1
  • accountSlotsPanel.createPanel.openEditor (cyclomatic 26) src/electron/renderer/limits/accountSlotsPanel.js:104 — accountSlotsPanel.createPanel.openEditor has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 128, 105, 113, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · clientUsageArchive.addSessionBreakdown (cyclomatic 26) · ×1
  • clientUsageArchive.addSessionBreakdown (cyclomatic 26) src/shared/usage/clientUsageArchive.js:339 — clientUsageArchive.addSessionBreakdown 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 · sessionDetail.readSessionDetail (cyclomatic 26) · ×1
  • sessionDetail.readSessionDetail (cyclomatic 26) src/shared/sessionDetail.js:676 — sessionDetail.readSessionDetail 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 · main.isAllowedExternalUrl (cyclomatic 26) · ×1
  • main.isAllowedExternalUrl (cyclomatic 26) src/electron/main.js:7823 — main.isAllowedExternalUrl 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · app.renderLimits (cyclomatic 26) · ×1
  • app.renderLimits (cyclomatic 26) REDACTED:5167 — app.renderLimits 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, name the conditions: bind each compound test to a 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 · app.els.breakdown.addEventListener("click") (cyclomatic 26) · ×1
  • app.els.breakdown.addEventListener("click") (cyclomatic 26) REDACTED:14067 — app.els.breakdown.addEventListener("click") 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 · composer.createEdgeDockComposer.render (cyclomatic 26) · ×1
  • composer.createEdgeDockComposer.render (cyclomatic 26) src/electron/renderer/edgeDock/composer.js:477 — composer.createEdgeDockComposer.render has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · homeOverview.homeLimitAccountsForProviders (cyclomatic 26) · ×1
  • homeOverview.homeLimitAccountsForProviders (cyclomatic 26) src/electron/renderer/homeOverview.js:257 — homeOverview.homeLimitAccountsForProviders has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 280, 272, 273). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · windowsView.createLimitWindowsView.renderLimitProviderHead (cyclomatic 26) · ×1
  • windowsView.createLimitWindowsView.renderLimitProviderHead (cyclomatic 26) src/electron/renderer/limits/windowsView.js:2240 — windowsView.createLimitWindowsView.renderLimitProviderHead 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 · pluginSettings.createPluginSettingsPanel.catalogPanel · ×1
  • pluginSettings.createPluginSettingsPanel.catalogPanel::renderResults (cyclomatic 26) src/electron/renderer/pluginSettings.js:734 — pluginSettings.createPluginSettingsPanel.catalogPanel::renderResults 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 · (anonymous) (cyclomatic 26) · ×1
  • (anonymous) (cyclomatic 26) REDACTED:14067 — (anonymous) 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 · createLimitWindowsView.renderLimitProviderHead (cyclomatic 26) · ×1
  • createLimitWindowsView.renderLimitProviderHead (cyclomatic 26) src/electron/renderer/limits/windowsView.js:2240 — createLimitWindowsView.renderLimitProviderHead 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 · createPluginRuntime.hostCall (cyclomatic 26) · ×1
  • createPluginRuntime.hostCall (cyclomatic 26) src/electron/plugins/runtime.js:133 — createPluginRuntime.hostCall 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 · mergeCodexTransientWindows (cyclomatic 26) · ×1
  • mergeCodexTransientWindows (cyclomatic 26) src/shared/limits/core.js:717 — mergeCodexTransientWindows has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mergeOpenCodeProviderComponents (cyclomatic 26) · ×1
  • mergeOpenCodeProviderComponents (cyclomatic 26) src/shared/limits/core.js:897 — mergeOpenCodeProviderComponents has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to 10 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · createEdgeDockComposer.render (cyclomatic 26) · ×1
  • createEdgeDockComposer.render (cyclomatic 26) src/electron/renderer/edgeDock/composer.js:477 — createEdgeDockComposer.render has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 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 · createLocalUsageSource.subscribe (cyclomatic 26) · ×1
  • createLocalUsageSource.subscribe (cyclomatic 26) src/shared/providers/codex/localUsageSource.js:134 — createLocalUsageSource.subscribe 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 · backend.createBackend.scan (cyclomatic 25) · ×1
  • backend.createBackend.scan (cyclomatic 25) plugins/quota-alerts/backend.cjs:36 — backend.createBackend.scan has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · syncPayload.createSyncPayloadUploader.upload (cyclomatic 25) · ×1
  • syncPayload.createSyncPayloadUploader.upload (cyclomatic 25) src/shared/syncPayload.js:407 — syncPayload.createSyncPayloadUploader.upload has cyclomatic complexity 25 (threshold 15). Of this number, 20 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 · managed.createManagedPlugins.recoverTransaction (cyclomatic 25) · ×1
  • managed.createManagedPlugins.recoverTransaction (cyclomatic 25) src/electron/plugins/managed.js:81 — managed.createManagedPlugins.recoverTransaction 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 · failureDetail.classify (cyclomatic 25) · ×1
  • failureDetail.classify (cyclomatic 25) src/shared/limits/failureDetail.js:57 — failureDetail.classify has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · auth.codexManagedAccountMatchesIdentity (cyclomatic 25) · ×1
  • auth.codexManagedAccountMatchesIdentity (cyclomatic 25) src/shared/providers/codex/auth.js:90 — auth.codexManagedAccountMatchesIdentity 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 · sessionPromptCache.applyPromptCacheEntry (cyclomatic 25) · ×1
  • sessionPromptCache.applyPromptCacheEntry (cyclomatic 25) src/shared/sessionPromptCache.js:12 — sessionPromptCache.applyPromptCacheEntry has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionActivity.readSessionActivity (cyclomatic 25) · ×1
  • sessionActivity.readSessionActivity (cyclomatic 25) src/shared/providers/codex/sessionActivity.js:150 — sessionActivity.readSessionActivity has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dailyHistoryArchive.validateDailyHistoryArchiveDocument (cyclomatic 25) · ×1
  • dailyHistoryArchive.validateDailyHistoryArchiveDocument (cyclomatic 25) src/shared/dailyHistoryArchive.js:757 — dailyHistoryArchive.validateDailyHistoryArchiveDocument 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 · localUsageStore.createLocalUsageStore.observe (cyclomatic 25) · ×1
  • localUsageStore.createLocalUsageStore.observe (cyclomatic 25) src/shared/providers/codex/localUsageStore.js:69 — localUsageStore.createLocalUsageStore.observe 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 · localUsage.buildLocalUsageView (cyclomatic 25) · ×1
  • localUsage.buildLocalUsageView (cyclomatic 25) src/shared/providers/codex/localUsage.js:22 — localUsage.buildLocalUsageView 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 · sessionDetail.preflightJsonValue · ×1
  • sessionDetail.preflightJsonValue::parseValue (cyclomatic 25) src/shared/providers/reasonix/sessionDetail.js:509 — sessionDetail.preflightJsonValue::parseValue 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 · sessionDetail.readReasonixEventLog (cyclomatic 25) · ×1
  • sessionDetail.readReasonixEventLog (cyclomatic 25) src/shared/providers/reasonix/sessionDetail.js:757 — sessionDetail.readReasonixEventLog has cyclomatic complexity 25 (threshold 15). Of this number, 20 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 · lazySessions.createSessionBacking.measure (cyclomatic 25) · ×1
  • lazySessions.createSessionBacking.measure (cyclomatic 25) src/electron/plugins/lazySessions.js:57 — lazySessions.createSessionBacking.measure has cyclomatic complexity 25 (threshold 15). Of this number, 21 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 · tray.buildTrayMenuTemplate (cyclomatic 25) · ×1
  • tray.buildTrayMenuTemplate (cyclomatic 25) src/electron/tray.js:294 — tray.buildTrayMenuTemplate has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.setupLangMenu (cyclomatic 25) · ×1
  • main.setupLangMenu (cyclomatic 25) site/scripts/main.js:1087 — main.setupLangMenu has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 1136, a function literal at line 1126, a function literal at line 1144, …). 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 · syncContent.normalizeSharedSyncValue (cyclomatic 25) · ×1
  • syncContent.normalizeSharedSyncValue (cyclomatic 25) src/shared/syncContent.js:37 — syncContent.normalizeSharedSyncValue has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 59, 46, 53, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · icloudSync.createIcloudSyncStore.writeDeviceNow (cyclomatic 25) · ×1
  • icloudSync.createIcloudSyncStore.writeDeviceNow (cyclomatic 25) src/electron/icloudSync.js:912 — icloudSync.createIcloudSyncStore.writeDeviceNow 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 · windowsBackdrop.syncWindowsBackdrop (cyclomatic 25) · ×1
  • windowsBackdrop.syncWindowsBackdrop (cyclomatic 25) src/electron/windowsBackdrop.js:144 — windowsBackdrop.syncWindowsBackdrop has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · historyController.createLimitsHistoryController.register (cyclomatic 25) · ×1
  • historyController.createLimitsHistoryController.register (cyclomatic 25) src/electron/limits/historyController.js:317 — historyController.createLimitsHistoryController.register has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 343, 319, 326, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · anchorSeed.deviceRecordFromAnchor (cyclomatic 25) · ×1
  • anchorSeed.deviceRecordFromAnchor (cyclomatic 25) src/shared/anchorSeed.js:26 — anchorSeed.deviceRecordFromAnchor has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · deviceFlow.pollForAccessToken (cyclomatic 25) · ×1
  • deviceFlow.pollForAccessToken (cyclomatic 25) src/shared/providers/copilot/deviceFlow.js:146 — deviceFlow.pollForAccessToken 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 · macScrollGesture.createMacScrollGestureMonitor.subscribe.monitorBlock (cyclomatic 25) · ×1
  • macScrollGesture.createMacScrollGestureMonitor.subscribe.monitorBlock (cyclomatic 25) src/electron/notch/macScrollGesture.js:54 — macScrollGesture.createMacScrollGestureMonitor.subscribe.monitorBlock has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.persistBoundsSoon (cyclomatic 25) · ×1
  • main.persistBoundsSoon (cyclomatic 25) src/electron/main.js:2586 — main.persistBoundsSoon has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 2593). 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.adoptOrphanedSubscriptions (cyclomatic 25) · ×1
  • main.adoptOrphanedSubscriptions (cyclomatic 25) src/electron/main.js:4283 — main.adoptOrphanedSubscriptions has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 4292). 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · app.settingsSectionSummary (cyclomatic 25) · ×1
  • app.settingsSectionSummary (cyclomatic 25) REDACTED:943 — app.settingsSectionSummary 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 · app.renderLiveTokenRate (cyclomatic 25) · ×1
  • app.renderLiveTokenRate (cyclomatic 25) REDACTED:1262 — app.renderLiveTokenRate has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · history.render (cyclomatic 25) · ×1
  • history.render (cyclomatic 25) src/electron/renderer/limits/history.js:145 — history.render has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 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 · pluginSettings.createPluginSettingsPanel.packagePanel (cyclomatic 25) · ×1
  • pluginSettings.createPluginSettingsPanel.packagePanel (cyclomatic 25) src/electron/renderer/pluginSettings.js:518 — pluginSettings.createPluginSettingsPanel.packagePanel has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pluginSettings.createPluginSettingsPanel.replaceContent (cyclomatic 25) · ×1
  • pluginSettings.createPluginSettingsPanel.replaceContent (cyclomatic 25) src/electron/renderer/pluginSettings.js:1331 — pluginSettings.createPluginSettingsPanel.replaceContent has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · usageCharts.heatmapSvg (cyclomatic 25) · ×1
  • usageCharts.heatmapSvg (cyclomatic 25) src/electron/renderer/usageCharts.js:602 — usageCharts.heatmapSvg has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · startCollector.performTick · ×1
  • startCollector.performTick::onProgress (cyclomatic 25) src/shared/collector.js:3259 — startCollector.performTick::onProgress 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 · createPluginSettingsPanel.packagePanel (cyclomatic 25) · ×1
  • createPluginSettingsPanel.packagePanel (cyclomatic 25) src/electron/renderer/pluginSettings.js:518 — createPluginSettingsPanel.packagePanel has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createPluginSettingsPanel.replaceContent (cyclomatic 25) · ×1
  • createPluginSettingsPanel.replaceContent (cyclomatic 25) src/electron/renderer/pluginSettings.js:1331 — createPluginSettingsPanel.replaceContent has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mergeCodexResetCredits (cyclomatic 25) · ×1
  • mergeCodexResetCredits (cyclomatic 25) src/shared/providers/codex/limits.js:431 — mergeCodexResetCredits 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 · createIcloudSyncStore.writeDeviceNow (cyclomatic 25) · ×1
  • createIcloudSyncStore.writeDeviceNow (cyclomatic 25) src/electron/icloudSync.js:912 — createIcloudSyncStore.writeDeviceNow 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 · sessionRowsFor (cyclomatic 25) · ×1
  • sessionRowsFor (cyclomatic 25) src/electron/renderer/edgeDock/presentation.js:274 — sessionRowsFor has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to one function literal inside it that branches (line 275). 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 · normalizeResetCreditGrants (cyclomatic 25) · ×1
  • normalizeResetCreditGrants (cyclomatic 25) src/shared/limits/core.js:384 — normalizeResetCreditGrants has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · graphFromDailyHistoryArchive (cyclomatic 25) · ×1
  • graphFromDailyHistoryArchive (cyclomatic 25) src/shared/dailyHistoryArchive.js:672 — graphFromDailyHistoryArchive has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 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 · parsePiTranscriptLines (cyclomatic 25) · ×1
  • parsePiTranscriptLines (cyclomatic 25) src/shared/sessionDetail.js:410 — parsePiTranscriptLines has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parseClineLimits (cyclomatic 25) · ×1
  • parseClineLimits (cyclomatic 25) src/shared/providers/cline/limits.js:248 — parseClineLimits has cyclomatic complexity 25 (threshold 15). Of this number, 23 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 · createManagedPlugins.recoverTransaction (cyclomatic 25) · ×1
  • createManagedPlugins.recoverTransaction (cyclomatic 25) src/electron/plugins/managed.js:81 — createManagedPlugins.recoverTransaction 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 · fetchCopilotAccountLimits (cyclomatic 25) · ×1
  • fetchCopilotAccountLimits (cyclomatic 25) src/shared/providers/copilot/limits.js:388 — fetchCopilotAccountLimits 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 · createLimitsHistoryController.register (cyclomatic 25) · ×1
  • createLimitsHistoryController.register (cyclomatic 25) src/electron/limits/historyController.js:317 — createLimitsHistoryController.register has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 343, 319, 326, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · hubDelta.createStatsStreamReceiver.receive (cyclomatic 24) · ×1
  • hubDelta.createStatsStreamReceiver.receive (cyclomatic 24) src/shared/hubDelta.js:96 — hubDelta.createStatsStreamReceiver.receive 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 · package.parsePackage (cyclomatic 24) · ×1
  • package.parsePackage (cyclomatic 24) src/electron/plugins/package.js:30 — package.parsePackage 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 · trayLayout.resolveTextItem (cyclomatic 24) · ×1
  • trayLayout.resolveTextItem (cyclomatic 24) src/shared/trayLayout.js:976 — trayLayout.resolveTextItem 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 · catalogSources.parseIndex.plugins (cyclomatic 24) · ×1
  • catalogSources.parseIndex.plugins (cyclomatic 24) src/electron/plugins/catalogSources.js:52 — catalogSources.parseIndex.plugins has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · controller.createNotchController.refreshLayout (cyclomatic 24) · ×1
  • controller.createNotchController.refreshLayout (cyclomatic 24) src/electron/notch/controller.js:463 — controller.createNotchController.refreshLayout 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 · data.summaryLayout (cyclomatic 24) · ×1
  • data.summaryLayout (cyclomatic 24) src/electron/notch/data.js:31 — data.summaryLayout has cyclomatic complexity 24 (threshold 15). Of this number, 21 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 · sessionFiles.resolveSessionFile (cyclomatic 24) · ×1
  • sessionFiles.resolveSessionFile (cyclomatic 24) src/shared/sessionFiles.js:167 — sessionFiles.resolveSessionFile 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 · sessionMetadata.resolveSessionMetadata · ×1
  • sessionMetadata.resolveSessionMetadata::applyFile (cyclomatic 24) src/shared/providers/claude/sessionMetadata.js:696 — sessionMetadata.resolveSessionMetadata::applyFile 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. This shape REPEATS in the file: one other method here (sessionMetadata.resolveSessionMetadata) 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 · dailyHistoryArchive.captureLiveDailyHistory (cyclomatic 24) · ×1
  • dailyHistoryArchive.captureLiveDailyHistory (cyclomatic 24) src/shared/dailyHistoryArchive.js:611 — dailyHistoryArchive.captureLiveDailyHistory has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · collector.startCollector.setupWatchers · ×1
  • collector.startCollector.setupWatchers::handleWatchEvent (cyclomatic 24) src/shared/collector.js:3864 — collector.startCollector.setupWatchers::handleWatchEvent 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.runTokscaleSubcommand (cyclomatic 24) · ×1
  • auth.runTokscaleSubcommand (cyclomatic 24) src/shared/providers/cursor/auth.js:189 — auth.runTokscaleSubcommand has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 199, 258, 244, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · auth.runCursorLogin (cyclomatic 24) · ×1
  • auth.runCursorLogin (cyclomatic 24) src/shared/providers/cursor/auth.js:284 — auth.runCursorLogin has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 298). 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 · limits.fetchClineLimits (cyclomatic 24) · ×1
  • limits.fetchClineLimits (cyclomatic 24) src/shared/providers/cline/limits.js:450 — limits.fetchClineLimits 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 · limits.parseDevinUsage (cyclomatic 24) · ×1
  • limits.parseDevinUsage (cyclomatic 24) src/shared/providers/devin/limits.js:253 — limits.parseDevinUsage has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · limits.fetchMistralLimits (cyclomatic 24) · ×1
  • limits.fetchMistralLimits (cyclomatic 24) src/shared/providers/mistral/limits.js:119 — limits.fetchMistralLimits has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 127, 124, 127, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · runtime.createLimitsRuntime.applyAttempt (cyclomatic 24) · ×1
  • runtime.createLimitsRuntime.applyAttempt (cyclomatic 24) src/shared/limits/runtime.js:587 — runtime.createLimitsRuntime.applyAttempt 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 · lazySessions.buildSessionIndex (cyclomatic 24) · ×1
  • lazySessions.buildSessionIndex (cyclomatic 24) src/electron/plugins/lazySessions.js:163 — lazySessions.buildSessionIndex has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · businessData.createBusinessDataService.publish (cyclomatic 24) · ×1
  • businessData.createBusinessDataService.publish (cyclomatic 24) src/electron/plugins/businessData.js:548 — businessData.createBusinessDataService.publish has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · main.setupHeroHome (cyclomatic 24) · ×1
  • main.setupHeroHome (cyclomatic 24) site/scripts/main.js:1017 — main.setupHeroHome has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 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 · icloudSyncRuntime.createIcloudSyncRuntime.writeDevice (cyclomatic 24) · ×1
  • icloudSyncRuntime.createIcloudSyncRuntime.writeDevice (cyclomatic 24) src/electron/icloudSyncRuntime.js:383 — icloudSyncRuntime.createIcloudSyncRuntime.writeDevice has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · accountSlotsPanel.createPanel.rowFor (cyclomatic 24) · ×1
  • accountSlotsPanel.createPanel.rowFor (cyclomatic 24) src/electron/renderer/limits/accountSlotsPanel.js:174 — accountSlotsPanel.createPanel.rowFor has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 195, a function literal at line 255, rename, …). 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 · transcriptReader.readDshTranscriptRecords (cyclomatic 24) · ×1
  • transcriptReader.readDshTranscriptRecords (cyclomatic 24) src/shared/providers/dsh/transcriptReader.js:108 — transcriptReader.readDshTranscriptRecords has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent branch into its 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.renderBreakdown (cyclomatic 24) · ×1
  • dashboard.renderBreakdown (cyclomatic 24) src/electron/renderer/dashboard.js:391 — dashboard.renderBreakdown has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 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 · displaySettings.create (cyclomatic 24) · ×1
  • displaySettings.create (cyclomatic 24) src/electron/renderer/displaySettings.js:18 — displaySettings.create has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the 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 · providerPresentation.limitProviderCompactWindows (cyclomatic 24) · ×1
  • providerPresentation.limitProviderCompactWindows (cyclomatic 24) src/electron/renderer/limits/providerPresentation.js:267 — providerPresentation.limitProviderCompactWindows has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 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 · animateBreakdownFrom (cyclomatic 24) · ×1
  • animateBreakdownFrom (cyclomatic 24) REDACTED:2186 — animateBreakdownFrom has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · init (cyclomatic 24) · ×1
  • init (cyclomatic 24) REDACTED:13857 — init has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · addCodexManagedAccount (cyclomatic 24) · ×1
  • addCodexManagedAccount (cyclomatic 24) src/electron/main.js:1911 — addCodexManagedAccount 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 · collectorAnchorTrust (cyclomatic 24) · ×1
  • collectorAnchorTrust (cyclomatic 24) src/shared/collector.js:2503 — collectorAnchorTrust has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · fetchClaudeLimits (cyclomatic 24) · ×1
  • fetchClaudeLimits (cyclomatic 24) src/shared/providers/claude/limits.js:1489 — fetchClaudeLimits 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 · createNotchController.refreshLayout (cyclomatic 24) · ×1
  • createNotchController.refreshLayout (cyclomatic 24) src/electron/notch/controller.js:463 — createNotchController.refreshLayout 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 · createLimitsRuntime.applyAttempt (cyclomatic 24) · ×1
  • createLimitsRuntime.applyAttempt (cyclomatic 24) src/shared/limits/runtime.js:587 — createLimitsRuntime.applyAttempt has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs 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 · createBusinessDataService.publish (cyclomatic 24) · ×1
  • createBusinessDataService.publish (cyclomatic 24) src/electron/plugins/businessData.js:548 — createBusinessDataService.publish has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · parseOllamaUsageHtml (cyclomatic 24) · ×1
  • parseOllamaUsageHtml (cyclomatic 24) src/shared/providers/ollama/limits.js:169 — parseOllamaUsageHtml has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 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 · createIcloudSyncRuntime.writeDevice (cyclomatic 24) · ×1
  • createIcloudSyncRuntime.writeDevice (cyclomatic 24) src/electron/icloudSyncRuntime.js:383 — createIcloudSyncRuntime.writeDevice has cyclomatic complexity 24 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · createLocalUsageSource.discover (cyclomatic 24) · ×1
  • createLocalUsageSource.discover (cyclomatic 24) src/shared/providers/codex/localUsageSource.js:189 — createLocalUsageSource.discover 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 · createPanel.rowFor (cyclomatic 24) · ×1
  • createPanel.rowFor (cyclomatic 24) src/electron/renderer/limits/accountSlotsPanel.js:174 — createPanel.rowFor has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 195, a function literal at line 255, rename, …). 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 · usage.addClientModelUsage (cyclomatic 23) · ×1
  • usage.addClientModelUsage (cyclomatic 23) src/shared/usage.js:1467 — usage.addClientModelUsage 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 · placementSettings.placementPatch (cyclomatic 23) · ×1
  • placementSettings.placementPatch (cyclomatic 23) src/electron/plugins/placementSettings.js:44 — placementSettings.placementPatch has cyclomatic complexity 23 (threshold 15). Of this number, 20 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 · macVibrancyMask.applyVibrancyMask (cyclomatic 23) · ×1
  • macVibrancyMask.applyVibrancyMask (cyclomatic 23) src/electron/edgeDock/macVibrancyMask.js:131 — macVibrancyMask.applyVibrancyMask 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 · controller.createEdgeDockController.setVisible (cyclomatic 23) · ×1
  • controller.createEdgeDockController.setVisible (cyclomatic 23) src/electron/edgeDock/controller.js:367 — controller.createEdgeDockController.setVisible 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 · limits.runClaudeCapturedCommand (cyclomatic 23) · ×1
  • limits.runClaudeCapturedCommand (cyclomatic 23) src/shared/providers/claude/limits.js:2134 — limits.runClaudeCapturedCommand 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 5 function literals inside it that branch (lines 2136, 2147, 2165, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · auth.upgradeCodexManagedAccountIdentity (cyclomatic 23) · ×1
  • auth.upgradeCodexManagedAccountIdentity (cyclomatic 23) src/shared/providers/codex/auth.js:123 — auth.upgradeCodexManagedAccountIdentity 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 · paths.projectCwds (cyclomatic 23) · ×1
  • paths.projectCwds (cyclomatic 23) src/shared/providers/senpi/paths.js:41 — paths.projectCwds 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 · sessionMetadata.sessionMetadataMap (cyclomatic 23) · ×1
  • sessionMetadata.sessionMetadataMap (cyclomatic 23) src/shared/sessionMetadata.js:313 — sessionMetadata.sessionMetadataMap has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · localUsageSource.createLocalUsageSource.discover (cyclomatic 23) · ×1
  • localUsageSource.createLocalUsageSource.discover (cyclomatic 23) src/shared/providers/codex/localUsageSource.js:189 — localUsageSource.createLocalUsageSource.discover has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · collector.spawnTokscaleJson (cyclomatic 23) · ×1
  • collector.spawnTokscaleJson (cyclomatic 23) src/shared/collector.js:252 — collector.spawnTokscaleJson 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 8 function literals inside it that branch (lines 307, 255, 272, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · oauth.fetchRemoteSnapshot (cyclomatic 23) · ×1
  • oauth.fetchRemoteSnapshot (cyclomatic 23) REDACTED:478 — oauth.fetchRemoteSnapshot 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 · limits.fetchAntigravityLimits (cyclomatic 23) · ×1
  • limits.fetchAntigravityLimits (cyclomatic 23) src/shared/providers/antigravity/limits.js:108 — limits.fetchAntigravityLimits has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.fetchGrokLimits (cyclomatic 23) · ×1
  • limits.fetchGrokLimits (cyclomatic 23) src/shared/providers/grok/limits.js:758 — limits.fetchGrokLimits 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 · limits.refreshMinimaxCodeSession (cyclomatic 23) · ×1
  • limits.refreshMinimaxCodeSession (cyclomatic 23) src/shared/providers/minimax/limits.js:477 — limits.refreshMinimaxCodeSession 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 · limits.parseOllamaIncludedBalance (cyclomatic 23) · ×1
  • limits.parseOllamaIncludedBalance (cyclomatic 23) src/shared/providers/ollama/limits.js:304 — limits.parseOllamaIncludedBalance 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 · limits.fetchAlibabaLimits (cyclomatic 23) · ×1
  • limits.fetchAlibabaLimits (cyclomatic 23) src/shared/providers/alibaba/limits.js:935 — limits.fetchAlibabaLimits 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 · syncContent.createSessionTitleSyncNegotiator.negotiate (cyclomatic 23) · ×1
  • syncContent.createSessionTitleSyncNegotiator.negotiate (cyclomatic 23) src/shared/syncContent.js:135 — syncContent.createSessionTitleSyncNegotiator.negotiate 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 · sessionUsageArchive.addArchivedSession (cyclomatic 23) · ×1
  • sessionUsageArchive.addArchivedSession (cyclomatic 23) src/shared/usage/sessionUsageArchive.js:397 — sessionUsageArchive.addArchivedSession 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 · historySource.parseDeviceHistories (cyclomatic 23) · ×1
  • historySource.parseDeviceHistories (cyclomatic 23) src/electron/historySource.js:13 — historySource.parseDeviceHistories has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 16). 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 · oauth.verifyIdentity (cyclomatic 23) · ×1
  • oauth.verifyIdentity (cyclomatic 23) src/shared/providers/workbuddy/oauth.js:109 — oauth.verifyIdentity 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 · historyStore.createLimitsHistoryStore.record (cyclomatic 23) · ×1
  • historyStore.createLimitsHistoryStore.record (cyclomatic 23) src/electron/limits/historyStore.js:108 — historyStore.createLimitsHistoryStore.record 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 · historyStore.readBoundedRegularFileNoFollow (cyclomatic 23) · ×1
  • historyStore.readBoundedRegularFileNoFollow (cyclomatic 23) src/electron/macWidget/historyStore.js:154 — historyStore.readBoundedRegularFileNoFollow has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.fetchStats (cyclomatic 23) · ×1
  • main.fetchStats (cyclomatic 23) src/electron/main.js:7294 — main.fetchStats has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · app.renderHomeSessionModule (cyclomatic 23) · ×1
  • app.renderHomeSessionModule (cyclomatic 23) REDACTED:7151 — app.renderHomeSessionModule 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 · app.renderHome (cyclomatic 23) · ×1
  • app.renderHome (cyclomatic 23) REDACTED:7673 — app.renderHome has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 7700, 7723, 7722). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · windowsView.createLimitWindowsView.limitProviderPlan (cyclomatic 23) · ×1
  • windowsView.createLimitWindowsView.limitProviderPlan (cyclomatic 23) src/electron/renderer/limits/windowsView.js:2032 — windowsView.createLimitWindowsView.limitProviderPlan has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · pluginContent.create.renderOne (cyclomatic 23) · ×1
  • pluginContent.create.renderOne (cyclomatic 23) src/electron/renderer/pluginContent.js:44 — pluginContent.create.renderOne has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pluginUi.createHost.release (cyclomatic 23) · ×1
  • pluginUi.createHost.release (cyclomatic 23) src/electron/renderer/pluginUi.js:232 — pluginUi.createHost.release has cyclomatic complexity 23 (threshold 15). 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, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · usageCharts.modelVendorFor (cyclomatic 23) · ×1
  • usageCharts.modelVendorFor (cyclomatic 23) src/electron/renderer/usageCharts.js:441 — usageCharts.modelVendorFor has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · renderCodexAccounts (cyclomatic 23) · ×1
  • renderCodexAccounts (cyclomatic 23) REDACTED:16858 — renderCodexAccounts has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createLimitWindowsView.limitProviderPlan (cyclomatic 23) · ×1
  • createLimitWindowsView.limitProviderPlan (cyclomatic 23) src/electron/renderer/limits/windowsView.js:2032 — createLimitWindowsView.limitProviderPlan has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createPluginSettingsPanel.authorSettingsSection (cyclomatic 23) · ×1
  • createPluginSettingsPanel.authorSettingsSection (cyclomatic 23) src/electron/renderer/pluginSettings.js:1106 — createPluginSettingsPanel.authorSettingsSection 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 · createEdgeDockController.setVisible (cyclomatic 23) · ×1
  • createEdgeDockController.setVisible (cyclomatic 23) src/electron/edgeDock/controller.js:367 — createEdgeDockController.setVisible has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · runCodexLoginWithCommand (cyclomatic 23) · ×1
  • runCodexLoginWithCommand (cyclomatic 23) src/shared/providers/codex/limits.js:681 — runCodexLoginWithCommand has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body's own statements and 9 belong to 8 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sanitizeDiagnosticSnapshot (cyclomatic 23) · ×1
  • sanitizeDiagnosticSnapshot (cyclomatic 23) src/shared/diagnosticReport.js:741 — sanitizeDiagnosticSnapshot 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 · buildLimitWindow (cyclomatic 23) · ×1
  • buildLimitWindow (cyclomatic 23) src/shared/macWidgetSnapshot.js:172 — buildLimitWindow has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createHost.release (cyclomatic 23) · ×1
  • createHost.release (cyclomatic 23) src/electron/renderer/pluginUi.js:232 — createHost.release has cyclomatic complexity 23 (threshold 15). 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, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · usage.mergeUnpricedMaps (cyclomatic 22) · ×1
  • usage.mergeUnpricedMaps (cyclomatic 22) src/shared/usage.js:423 — usage.mergeUnpricedMaps 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 · usage.sessionFromRow (cyclomatic 22) · ×1
  • usage.sessionFromRow (cyclomatic 22) src/shared/usage.js:860 — usage.sessionFromRow has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sessionActivityProjection.codexActivityCandidates (cyclomatic 22) · ×1
  • sessionActivityProjection.codexActivityCandidates (cyclomatic 22) src/shared/sessionActivityProjection.js:132 — sessionActivityProjection.codexActivityCandidates 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 · manifest.normalizeSkins (cyclomatic 22) · ×1
  • manifest.normalizeSkins (cyclomatic 22) src/shared/plugins/manifest.js:22 — manifest.normalizeSkins 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 · usageItems.parseWindowKey (cyclomatic 22) · ×1
  • usageItems.parseWindowKey (cyclomatic 22) src/shared/limits/usageItems.js:71 — usageItems.parseWindowKey has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · presentation.sessionSourceRows (cyclomatic 22) · ×1
  • presentation.sessionSourceRows (cyclomatic 22) src/electron/renderer/edgeDock/presentation.js:236 — presentation.sessionSourceRows 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 · limits.runClaudePosixProbe (cyclomatic 22) · ×1
  • limits.runClaudePosixProbe (cyclomatic 22) src/shared/providers/claude/limits.js:2048 — limits.runClaudePosixProbe 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 · sessionDetail.consumeTypedRecord (cyclomatic 22) · ×1
  • sessionDetail.consumeTypedRecord (cyclomatic 22) src/shared/providers/reasonix/sessionDetail.js:382 — sessionDetail.consumeTypedRecord has cyclomatic complexity 22 (threshold 15). Of this number, 18 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 · sessions.buildNativeView (cyclomatic 22) · ×1
  • sessions.buildNativeView (cyclomatic 22) src/shared/providers/reasonix/sessions.js:502 — sessions.buildNativeView 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 · desktop.readMimoDesktopAccount (cyclomatic 22) · ×1
  • desktop.readMimoDesktopAccount (cyclomatic 22) src/shared/providers/mimo/desktop.js:60 — desktop.readMimoDesktopAccount has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · membership.readMimoMembershipPlan (cyclomatic 22) · ×1
  • membership.readMimoMembershipPlan (cyclomatic 22) src/shared/providers/mimo/membership.js:26 — membership.readMimoMembershipPlan has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · limits.fetchOllamaLimits (cyclomatic 22) · ×1
  • limits.fetchOllamaLimits (cyclomatic 22) src/shared/providers/ollama/limits.js:561 — limits.fetchOllamaLimits 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 · limits.parseAllowanceWindow (cyclomatic 22) · ×1
  • limits.parseAllowanceWindow (cyclomatic 22) src/shared/providers/notion/limits.js:132 — limits.parseAllowanceWindow 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 · desktop.readManusDesktopSession (cyclomatic 22) · ×1
  • desktop.readManusDesktopSession (cyclomatic 22) src/shared/providers/manus/desktop.js:89 — desktop.readManusDesktopSession has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · limits.fetchHarkLimits (cyclomatic 22) · ×1
  • limits.fetchHarkLimits (cyclomatic 22) src/shared/providers/hark/limits.js:133 — limits.fetchHarkLimits has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the 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 · limits.fetchOpendesignLimits (cyclomatic 22) · ×1
  • limits.fetchOpendesignLimits (cyclomatic 22) src/shared/providers/opendesign/limits.js:65 — limits.fetchOpendesignLimits has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 76, 75). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · burnRate.nextLimitsUrgencyRefresh (cyclomatic 22) · ×1
  • burnRate.nextLimitsUrgencyRefresh (cyclomatic 22) src/shared/limits/burnRate.js:180 — burnRate.nextLimitsUrgencyRefresh 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 · backend.createPluginBackends.start (cyclomatic 22) · ×1
  • backend.createPluginBackends.start (cyclomatic 22) src/electron/plugins/backend.js:14 — backend.createPluginBackends.start has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 31, 48). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · syncContentRuntime.createSyncContentRuntime.recoverStorage (cyclomatic 22) · ×1
  • syncContentRuntime.createSyncContentRuntime.recoverStorage (cyclomatic 22) src/electron/syncContentRuntime.js:162 — syncContentRuntime.createSyncContentRuntime.recoverStorage has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · windowsBackdrop.createWindowsDockBackdrop.start (cyclomatic 22) · ×1
  • windowsBackdrop.createWindowsDockBackdrop.start (cyclomatic 22) src/electron/edgeDock/windowsBackdrop.js:62 — windowsBackdrop.createWindowsDockBackdrop.start has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 80, 77, 74, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · historyModel.historyReadings (cyclomatic 22) · ×1
  • historyModel.historyReadings (cyclomatic 22) src/electron/renderer/limits/historyModel.js:19 — historyModel.historyReadings has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionDetailResolver.resolveSessionDetailForPlatform (cyclomatic 22) · ×1
  • sessionDetailResolver.resolveSessionDetailForPlatform (cyclomatic 22) src/shared/sessionDetailResolver.js:22 — sessionDetailResolver.resolveSessionDetailForPlatform has cyclomatic complexity 22 (threshold 15). Of this number, 17 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 · historyStore.cacheHistory (cyclomatic 22) · ×1
  • historyStore.cacheHistory (cyclomatic 22) src/electron/macWidget/historyStore.js:108 — historyStore.cacheHistory has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · serviceStatus.summarizeOpenCodeProvider (cyclomatic 22) · ×1
  • serviceStatus.summarizeOpenCodeProvider (cyclomatic 22) src/electron/serviceStatus.js:418 — serviceStatus.summarizeOpenCodeProvider has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · themePresets.themeCssVarEntries (cyclomatic 22) · ×1
  • themePresets.themeCssVarEntries (cyclomatic 22) src/electron/renderer/themePresets.js:148 — themePresets.themeCssVarEntries 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 · app.clientHealthActions (cyclomatic 22) · ×1
  • app.clientHealthActions (cyclomatic 22) REDACTED:11915 — app.clientHealthActions has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dashboard.renderActivity (cyclomatic 22) · ×1
  • dashboard.renderActivity (cyclomatic 22) src/electron/renderer/dashboard.js:492 — dashboard.renderActivity has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · pluginCredentials.create.mount.paint (cyclomatic 22) · ×1
  • pluginCredentials.create.mount.paint (cyclomatic 22) src/electron/renderer/pluginCredentials.js:39 — pluginCredentials.create.mount.paint has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · WidgetVendorIdentity.modelVendor (cyclomatic 22) · ×1
  • WidgetVendorIdentity.modelVendor (cyclomatic 22) native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:647 — WidgetVendorIdentity.modelVendor 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 · (anonymous) (cyclomatic 22) · ×1
  • (anonymous) (cyclomatic 22) REDACTED:15377 — (anonymous) 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 · providerCellNode (cyclomatic 22) · ×1
  • providerCellNode (cyclomatic 22) REDACTED:792 — providerCellNode has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · createEdgeDockController.createSurface (cyclomatic 22) · ×1
  • createEdgeDockController.createSurface (cyclomatic 22) src/electron/edgeDock/controller.js:602 — createEdgeDockController.createSurface has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · readCodexRpcWithCommand (cyclomatic 22) · ×1
  • readCodexRpcWithCommand (cyclomatic 22) src/shared/providers/codex/limits.js:1059 — readCodexRpcWithCommand has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createNotchController.animateShell (cyclomatic 22) · ×1
  • createNotchController.animateShell (cyclomatic 22) src/electron/notch/controller.js:580 — createNotchController.animateShell has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · createLimitsRuntime.reconfigure (cyclomatic 22) · ×1
  • createLimitsRuntime.reconfigure (cyclomatic 22) src/shared/limits/runtime.js:1006 — createLimitsRuntime.reconfigure 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 · createSyncContentRuntime.recoverStorage (cyclomatic 22) · ×1
  • createSyncContentRuntime.recoverStorage (cyclomatic 22) src/electron/syncContentRuntime.js:162 — createSyncContentRuntime.recoverStorage has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 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 · slotAccounts (cyclomatic 22) · ×1
  • slotAccounts (cyclomatic 22) src/shared/limits/accountSlotFetcher.js:68 — slotAccounts has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to 12 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · createMacLiquidGlass · ×1
  • createMacLiquidGlass::update (cyclomatic 22) src/electron/macLiquidGlass.js:187 — createMacLiquidGlass::update 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 · usage.mergeNormalizedPeriods (cyclomatic 21) · ×1
  • usage.mergeNormalizedPeriods (cyclomatic 21) src/shared/usage.js:2227 — usage.mergeNormalizedPeriods 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 · syncDisplayStats.composeLocalSyncStats (cyclomatic 21) · ×1
  • syncDisplayStats.composeLocalSyncStats (cyclomatic 21) src/electron/syncDisplayStats.js:114 — syncDisplayStats.composeLocalSyncStats has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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 · hubDelta.statsPatch · ×1
  • hubDelta.statsPatch::visit (cyclomatic 21) src/shared/hubDelta.js:12 — hubDelta.statsPatch::visit 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 · presentation.normalizePresentation (cyclomatic 21) · ×1
  • presentation.normalizePresentation (cyclomatic 21) src/shared/plugins/presentation.js:5 — presentation.normalizePresentation 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 · trayLayout.createTrayLayoutItem (cyclomatic 21) · ×1
  • trayLayout.createTrayLayoutItem (cyclomatic 21) src/shared/trayLayout.js:251 — trayLayout.createTrayLayoutItem 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 · catalogSources.createCatalogSources (cyclomatic 21) · ×1
  • catalogSources.createCatalogSources (cyclomatic 21) src/electron/plugins/catalogSources.js:93 — catalogSources.createCatalogSources 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 · controller.createNotchController.paintBlur (cyclomatic 21) · ×1
  • controller.createNotchController.paintBlur (cyclomatic 21) src/electron/notch/controller.js:417 — controller.createNotchController.paintBlur 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 · controller.createNotchController.startScrollMonitor (cyclomatic 21) · ×1
  • controller.createNotchController.startScrollMonitor (cyclomatic 21) src/electron/notch/controller.js:664 — controller.createNotchController.startScrollMonitor has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 670, 675). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · controller.createEdgeDockController.createSurface (cyclomatic 21) · ×1
  • controller.createEdgeDockController.createSurface (cyclomatic 21) src/electron/edgeDock/controller.js:602 — controller.createEdgeDockController.createSurface has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 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 · limits.claudeOauthAccountIdentity (cyclomatic 21) · ×1
  • limits.claudeOauthAccountIdentity (cyclomatic 21) src/shared/providers/claude/limits.js:1282 — limits.claudeOauthAccountIdentity 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 · customScanPaths.validCustomScanPaths (cyclomatic 21) · ×1
  • customScanPaths.validCustomScanPaths (cyclomatic 21) src/shared/customScanPaths.js:61 — customScanPaths.validCustomScanPaths has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · t3SessionMetadata.t3TitleQueries (cyclomatic 21) · ×1
  • t3SessionMetadata.t3TitleQueries (cyclomatic 21) src/shared/t3SessionMetadata.js:80 — t3SessionMetadata.t3TitleQueries 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 · session.readMessageActivity (cyclomatic 21) · ×1
  • session.readMessageActivity (cyclomatic 21) src/shared/providers/opencode/session.js:101 — session.readMessageActivity 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 · session.readSessionEventsCurrent (cyclomatic 21) · ×1
  • session.readSessionEventsCurrent (cyclomatic 21) src/shared/providers/opencode/session.js:378 — session.readSessionEventsCurrent 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 · sessionDetail.parseJsonNumber (cyclomatic 21) · ×1
  • sessionDetail.parseJsonNumber (cyclomatic 21) src/shared/providers/reasonix/sessionDetail.js:483 — sessionDetail.parseJsonNumber 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 · limits.parseMistralSubscription (cyclomatic 21) · ×1
  • limits.parseMistralSubscription (cyclomatic 21) src/shared/providers/mistral/limits.js:55 — limits.parseMistralSubscription has cyclomatic complexity 21 (threshold 15). Of this number, 16 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 · arkcli.resolveArkcliCommand (cyclomatic 21) · ×1
  • arkcli.resolveArkcliCommand (cyclomatic 21) src/shared/providers/volcengine/arkcli.js:35 — arkcli.resolveArkcliCommand 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 · limits.fetchManusLimits (cyclomatic 21) · ×1
  • limits.fetchManusLimits (cyclomatic 21) src/shared/providers/manus/limits.js:134 — limits.fetchManusLimits 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 · limits.createPluginLimits.reconcile (cyclomatic 21) · ×1
  • limits.createPluginLimits.reconcile (cyclomatic 21) src/electron/plugins/limits.js:41 — limits.createPluginLimits.reconcile has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 belong to 5 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.
D1 · Cyclomatic Complexity · i18n.localeFromTag (cyclomatic 21) · ×1
  • i18n.localeFromTag (cyclomatic 21) src/electron/renderer/i18n.js:17804 — i18n.localeFromTag 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 · syncContentRuntime.createSyncContentRuntime.publishPatch (cyclomatic 21) · ×1
  • syncContentRuntime.createSyncContentRuntime.publishPatch (cyclomatic 21) src/electron/syncContentRuntime.js:523 — syncContentRuntime.createSyncContentRuntime.publishPatch has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 528). 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 · domReconcile.create.patch (cyclomatic 21) · ×1
  • domReconcile.create.patch (cyclomatic 21) src/electron/renderer/domReconcile.js:48 — domReconcile.create.patch 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 · hubBuildComparison.compareHubBuild (cyclomatic 21) · ×1
  • hubBuildComparison.compareHubBuild (cyclomatic 21) src/shared/hubBuildComparison.js:28 — hubBuildComparison.compareHubBuild 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 · icloudSync.validSubscriptionDocument (cyclomatic 21) · ×1
  • icloudSync.validSubscriptionDocument (cyclomatic 21) src/electron/icloudSync.js:385 — icloudSync.validSubscriptionDocument 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 · icloudSync.createIcloudSyncStore.discoverDevices (cyclomatic 21) · ×1
  • icloudSync.createIcloudSyncStore.discoverDevices (cyclomatic 21) src/electron/icloudSync.js:694 — icloudSync.createIcloudSyncStore.discoverDevices 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 · icloudSync.createIcloudSyncStore.discoverSubscriptions (cyclomatic 21) · ×1
  • icloudSync.createIcloudSyncStore.discoverSubscriptions (cyclomatic 21) src/electron/icloudSync.js:1154 — icloudSync.createIcloudSyncStore.discoverSubscriptions 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 · transcriptReader.frameRange (cyclomatic 21) · ×1
  • transcriptReader.frameRange (cyclomatic 21) src/shared/providers/dsh/transcriptReader.js:13 — transcriptReader.frameRange has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · bridge.prepareMacWidgetSnapshot (cyclomatic 21) · ×1
  • bridge.prepareMacWidgetSnapshot (cyclomatic 21) src/electron/macWidget/bridge.js:58 — bridge.prepareMacWidgetSnapshot 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 · main.normalizeCodexManagedAccounts (cyclomatic 21) · ×1
  • main.normalizeCodexManagedAccounts (cyclomatic 21) src/electron/main.js:1165 — main.normalizeCodexManagedAccounts 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.addAntigravityManagedAccount (cyclomatic 21) · ×1
  • main.addAntigravityManagedAccount (cyclomatic 21) src/electron/main.js:1417 — main.addAntigravityManagedAccount 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · app.renderSessionDetail (cyclomatic 21) · ×1
  • app.renderSessionDetail (cyclomatic 21) REDACTED:5577 — app.renderSessionDetail 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 · app.setupHomeActivityHover (cyclomatic 21) · ×1
  • app.setupHomeActivityHover (cyclomatic 21) REDACTED:7395 — app.setupHomeActivityHover has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 7 function items inside it that branch (showAtPoint, scheduleSpotlight, hide, …). 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 · app.window.tokenMonitor.onStatsPush() (cyclomatic 21) · ×1
  • app.window.tokenMonitor.onStatsPush() (cyclomatic 21) REDACTED:15377 — app.window.tokenMonitor.onStatsPush() 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 · app.renderWorkbuddyStatus (cyclomatic 21) · ×1
  • app.renderWorkbuddyStatus (cyclomatic 21) REDACTED:17122 — app.renderWorkbuddyStatus has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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 · windowsView.createLimitWindowsView.providerSpendNode (cyclomatic 21) · ×1
  • windowsView.createLimitWindowsView.providerSpendNode (cyclomatic 21) src/electron/renderer/limits/windowsView.js:601 — windowsView.createLimitWindowsView.providerSpendNode has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · startCollector.setupWatchers · ×1
  • startCollector.setupWatchers::handleWatchEvent (cyclomatic 21) src/shared/collector.js:3864 — startCollector.setupWatchers::handleWatchEvent 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 · createLimitWindowsView.providerSpendNode (cyclomatic 21) · ×1
  • createLimitWindowsView.providerSpendNode (cyclomatic 21) src/electron/renderer/limits/windowsView.js:601 — createLimitWindowsView.providerSpendNode has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · normalizeCodexUsagePayload (cyclomatic 21) · ×1
  • normalizeCodexUsagePayload (cyclomatic 21) src/shared/providers/codex/limits.js:165 — normalizeCodexUsagePayload 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 · createNotchController.paintBlur (cyclomatic 21) · ×1
  • createNotchController.paintBlur (cyclomatic 21) src/electron/notch/controller.js:417 — createNotchController.paintBlur 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 · createNotchController.startScrollMonitor (cyclomatic 21) · ×1
  • createNotchController.startScrollMonitor (cyclomatic 21) src/electron/notch/controller.js:664 — createNotchController.startScrollMonitor has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 670, shouldTrack). 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 · createIcloudSyncStore.discoverDevices (cyclomatic 21) · ×1
  • createIcloudSyncStore.discoverDevices (cyclomatic 21) src/electron/icloudSync.js:694 — createIcloudSyncStore.discoverDevices 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 · createIcloudSyncStore.discoverSubscriptions (cyclomatic 21) · ×1
  • createIcloudSyncStore.discoverSubscriptions (cyclomatic 21) src/electron/icloudSync.js:1154 — createIcloudSyncStore.discoverSubscriptions has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs 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 · normalizeProviderResetCredits (cyclomatic 21) · ×1
  • normalizeProviderResetCredits (cyclomatic 21) src/shared/limits/core.js:349 — normalizeProviderResetCredits 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 · createSyncContentRuntime.publishPatch (cyclomatic 21) · ×1
  • createSyncContentRuntime.publishPatch (cyclomatic 21) src/electron/syncContentRuntime.js:523 — createSyncContentRuntime.publishPatch has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 528). 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 · activityStatsForPeriod (cyclomatic 21) · ×1
  • activityStatsForPeriod (cyclomatic 21) src/electron/renderer/homeOverview.js:396 — activityStatsForPeriod has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · compactLimitSelection (cyclomatic 21) · ×1
  • compactLimitSelection (cyclomatic 21) src/shared/trayText.js:247 — compactLimitSelection has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · createSyncPayloadUploader · ×1
  • createSyncPayloadUploader::upload (cyclomatic 21) src/shared/syncPayload.js:407 — createSyncPayloadUploader::upload 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 · clientHealth.normalizeClientHealth (cyclomatic 20) · ×1
  • clientHealth.normalizeClientHealth (cyclomatic 20) src/shared/clientHealth.js:462 — clientHealth.normalizeClientHealth 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 · usage.normalizeSessionModelComponents (cyclomatic 20) · ×1
  • usage.normalizeSessionModelComponents (cyclomatic 20) src/shared/usage.js:637 — usage.normalizeSessionModelComponents 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 · trayText.pickConfiguredLimitProviders (cyclomatic 20) · ×1
  • trayText.pickConfiguredLimitProviders (cyclomatic 20) src/shared/trayText.js:373 — trayText.pickConfiguredLimitProviders has cyclomatic complexity 20 (threshold 15). Of this number, 17 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 · credentials.normalizeCredentials (cyclomatic 20) · ×1
  • credentials.normalizeCredentials (cyclomatic 20) src/shared/plugins/credentials.js:6 — credentials.normalizeCredentials has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 12). 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 · presentation.groupedSessionRows.rows (cyclomatic 20) · ×1
  • presentation.groupedSessionRows.rows (cyclomatic 20) src/electron/renderer/edgeDock/presentation.js:351 — presentation.groupedSessionRows.rows 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 · geometry.notchBounds (cyclomatic 20) · ×1
  • geometry.notchBounds (cyclomatic 20) src/electron/notch/geometry.js:72 — geometry.notchBounds 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 · sessionFiles.scanZstdFrames (cyclomatic 20) · ×1
  • sessionFiles.scanZstdFrames (cyclomatic 20) src/shared/providers/dsh/sessionFiles.js:163 — sessionFiles.scanZstdFrames 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 · sessionIdentity.nativeIdForFile (cyclomatic 20) · ×1
  • sessionIdentity.nativeIdForFile (cyclomatic 20) src/shared/providers/codex/sessionIdentity.js:10 — sessionIdentity.nativeIdForFile 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 · extension.findExtensionSessions (cyclomatic 20) · ×1
  • extension.findExtensionSessions (cyclomatic 20) src/shared/providers/codebuddy/extension.js:222 — extension.findExtensionSessions 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 · limits.fetchFactoryWithToken (cyclomatic 20) · ×1
  • limits.fetchFactoryWithToken (cyclomatic 20) src/shared/providers/factory/limits.js:220 — limits.fetchFactoryWithToken has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 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 · limits.fetchKiroLimits (cyclomatic 20) · ×1
  • limits.fetchKiroLimits (cyclomatic 20) REDACTED:371 — limits.fetchKiroLimits 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 · businessData.sessionSources.contexts (cyclomatic 20) · ×1
  • businessData.sessionSources.contexts (cyclomatic 20) src/shared/plugins/businessData.js:183 — businessData.sessionSources.contexts 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 · panel.createNotchPanel.renderLimits (cyclomatic 20) · ×1
  • panel.createNotchPanel.renderLimits (cyclomatic 20) src/electron/renderer/notch/panel.js:984 — panel.createNotchPanel.renderLimits has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1004, a function literal at line 1033, a function literal at line 991, …). 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 · panel.createNotchPanel.breakdownColumn (cyclomatic 20) · ×1
  • panel.createNotchPanel.breakdownColumn (cyclomatic 20) src/electron/renderer/notch/panel.js:1224 — panel.createNotchPanel.breakdownColumn has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 1242, colorFor, labelFor, …). 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 · sessionUsageArchive.pruneExpiredSessionUsagePeriods (cyclomatic 20) · ×1
  • sessionUsageArchive.pruneExpiredSessionUsagePeriods (cyclomatic 20) src/shared/usage/sessionUsageArchive.js:168 — sessionUsageArchive.pruneExpiredSessionUsagePeriods 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 · sessionUsageArchiveStore.readSessionUsageArchiveSnapshot (cyclomatic 20) · ×1
  • sessionUsageArchiveStore.readSessionUsageArchiveSnapshot (cyclomatic 20) src/shared/usage/sessionUsageArchiveStore.js:97 — sessionUsageArchiveStore.readSessionUsageArchiveSnapshot 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 · localAuth.createWorkbuddyLocalAuth.request (cyclomatic 20) · ×1
  • localAuth.createWorkbuddyLocalAuth.request (cyclomatic 20) src/electron/providers/workbuddy/localAuth.js:353 — localAuth.createWorkbuddyLocalAuth.request 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 · historyModel.observationPoints (cyclomatic 20) · ×1
  • historyModel.observationPoints (cyclomatic 20) src/electron/renderer/limits/historyModel.js:159 — historyModel.observationPoints 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 · managedAccounts.createClaudeManagedAccounts.resolved (cyclomatic 20) · ×1
  • managedAccounts.createClaudeManagedAccounts.resolved (cyclomatic 20) src/electron/providers/claude/managedAccounts.js:168 — managedAccounts.createClaudeManagedAccounts.resolved has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 169, 192, 193). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · main.performCodexSystemAccountSwitch (cyclomatic 20) · ×1
  • main.performCodexSystemAccountSwitch (cyclomatic 20) src/electron/main.js:2047 — main.performCodexSystemAccountSwitch has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the 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: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.limitsHistoryPayload (cyclomatic 20) · ×1
  • main.limitsHistoryPayload (cyclomatic 20) src/electron/main.js:3337 — main.limitsHistoryPayload has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.runAppUpdateCheck (cyclomatic 20) · ×1
  • main.runAppUpdateCheck (cyclomatic 20) src/electron/main.js:7589 — main.runAppUpdateCheck has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · app.renderSubscriptionRows (cyclomatic 20) · ×1
  • app.renderSubscriptionRows (cyclomatic 20) REDACTED:3920 — app.renderSubscriptionRows has cyclomatic complexity 20 (threshold 15). Of this number, 14 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 · app.onPreferenceOrderKeydown (cyclomatic 20) · ×1
  • app.onPreferenceOrderKeydown (cyclomatic 20) REDACTED:13420 — app.onPreferenceOrderKeydown 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 · app.thirdPartyProfileErrorText (cyclomatic 20) · ×1
  • app.thirdPartyProfileErrorText (cyclomatic 20) REDACTED:18845 — app.thirdPartyProfileErrorText 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 · diagnosticsPanel.createDiagnosticsPanel.render (cyclomatic 20) · ×1
  • diagnosticsPanel.createDiagnosticsPanel.render (cyclomatic 20) src/electron/renderer/diagnosticsPanel.js:61 — diagnosticsPanel.createDiagnosticsPanel.render 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 · windowsView.createLimitWindowsView.codexResetForecastTooltip (cyclomatic 20) · ×1
  • windowsView.createLimitWindowsView.codexResetForecastTooltip (cyclomatic 20) src/electron/renderer/limits/windowsView.js:2393 — windowsView.createLimitWindowsView.codexResetForecastTooltip has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · usageCharts.contribHeatmap (cyclomatic 20) · ×1
  • usageCharts.contribHeatmap (cyclomatic 20) src/electron/renderer/usageCharts.js:243 — usageCharts.contribHeatmap 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 · renderHomeTrendsModule (cyclomatic 20) · ×1
  • renderHomeTrendsModule (cyclomatic 20) REDACTED:7537 — renderHomeTrendsModule has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 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 · getSyncContentRuntime · ×1
  • getSyncContentRuntime::request (cyclomatic 20) src/electron/main.js:3947 — getSyncContentRuntime::request 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 · createLimitWindowsView.codexResetForecastTooltip (cyclomatic 20) · ×1
  • createLimitWindowsView.codexResetForecastTooltip (cyclomatic 20) src/electron/renderer/limits/windowsView.js:2393 — createLimitWindowsView.codexResetForecastTooltip has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createNotchPanel.renderLimits (cyclomatic 20) · ×1
  • createNotchPanel.renderLimits (cyclomatic 20) src/electron/renderer/notch/panel.js:984 — createNotchPanel.renderLimits 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 8 function items inside it that branch (fitLimitPlans, a function literal at line 1033, a function literal at line 991, …). 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 · createNotchPanel.breakdownColumn (cyclomatic 20) · ×1
  • createNotchPanel.breakdownColumn (cyclomatic 20) src/electron/renderer/notch/panel.js:1224 — createNotchPanel.breakdownColumn has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 1242, colorFor, labelFor, …). 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 · createHub (cyclomatic 20) · ×1
  • createHub (cyclomatic 20) REDACTED:53 — createHub has cyclomatic complexity 20 (threshold 15). Of this number, 17 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 · createWorkbuddyLocalAuth.request (cyclomatic 20) · ×1
  • createWorkbuddyLocalAuth.request (cyclomatic 20) src/electron/providers/workbuddy/localAuth.js:353 — createWorkbuddyLocalAuth.request 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 · paths.normalizeWindowsPath (cyclomatic 19) · ×1
  • paths.normalizeWindowsPath (cyclomatic 19) src/shared/providers/reasonix/paths.js:74 — paths.normalizeWindowsPath 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 · accountIdentity.sameAccount (cyclomatic 19) · ×1
  • accountIdentity.sameAccount (cyclomatic 19) src/electron/renderer/accountIdentity.js:176 — accountIdentity.sameAccount 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 · presentation.buildEdgeDockCells (cyclomatic 19) · ×1
  • presentation.buildEdgeDockCells (cyclomatic 19) src/electron/renderer/edgeDock/presentation.js:881 — presentation.buildEdgeDockCells 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 · renderer.createNotchRenderer.notchNumber (cyclomatic 19) · ×1
  • renderer.createNotchRenderer.notchNumber (cyclomatic 19) src/electron/renderer/notch/renderer.js:79 — renderer.createNotchRenderer.notchNumber has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · controller.createEdgeDockController.syncRefresh (cyclomatic 19) · ×1
  • controller.createEdgeDockController.syncRefresh (cyclomatic 19) src/electron/edgeDock/controller.js:1027 — controller.createEdgeDockController.syncRefresh 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 · controller.createEdgeDockController.setCells (cyclomatic 19) · ×1
  • controller.createEdgeDockController.setCells (cyclomatic 19) src/electron/edgeDock/controller.js:1647 — controller.createEdgeDockController.setCells 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 · accountSlots.normalizeAccountSlots (cyclomatic 19) · ×1
  • accountSlots.normalizeAccountSlots (cyclomatic 19) src/shared/limits/accountSlots.js:21 — accountSlots.normalizeAccountSlots 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 · providerHelpers.fetchJson (cyclomatic 19) · ×1
  • providerHelpers.fetchJson (cyclomatic 19) REDACTED:186 — providerHelpers.fetchJson 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 · limits.windowsCodexStoreCandidates (cyclomatic 19) · ×1
  • limits.windowsCodexStoreCandidates (cyclomatic 19) src/shared/providers/codex/limits.js:840 — limits.windowsCodexStoreCandidates 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 · session.readSessionMeta (cyclomatic 19) · ×1
  • session.readSessionMeta (cyclomatic 19) src/shared/providers/opencode/session.js:174 — session.readSessionMeta 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 · limits.mapAntigravitySnapshot (cyclomatic 19) · ×1
  • limits.mapAntigravitySnapshot (cyclomatic 19) src/shared/providers/antigravity/limits.js:47 — limits.mapAntigravitySnapshot has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.parseDirectQuotaSnapshots (cyclomatic 19) · ×1
  • limits.parseDirectQuotaSnapshots (cyclomatic 19) src/shared/providers/copilot/limits.js:150 — limits.parseDirectQuotaSnapshots 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 · limits.minimaxCodeAuthState (cyclomatic 19) · ×1
  • limits.minimaxCodeAuthState (cyclomatic 19) src/shared/providers/minimax/limits.js:433 — limits.minimaxCodeAuthState 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 · credentials.createPluginCredentials.commit (cyclomatic 19) · ×1
  • credentials.createPluginCredentials.commit (cyclomatic 19) src/electron/plugins/credentials.js:52 — credentials.createPluginCredentials.commit 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 · runtime.createLimitsRuntime.dispatchIntent (cyclomatic 19) · ×1
  • runtime.createLimitsRuntime.dispatchIntent (cyclomatic 19) src/shared/limits/runtime.js:799 — runtime.createLimitsRuntime.dispatchIntent has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · runtime.createLimitsRuntime.clear (cyclomatic 19) · ×1
  • runtime.createLimitsRuntime.clear (cyclomatic 19) src/shared/limits/runtime.js:953 — runtime.createLimitsRuntime.clear 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 · runtime.createLimitsRuntime.reconfigure (cyclomatic 19) · ×1
  • runtime.createLimitsRuntime.reconfigure (cyclomatic 19) src/shared/limits/runtime.js:1006 — runtime.createLimitsRuntime.reconfigure 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 · businessData.createBusinessDataService.dependency (cyclomatic 19) · ×1
  • businessData.createBusinessDataService.dependency (cyclomatic 19) src/electron/plugins/businessData.js:59 — businessData.createBusinessDataService.dependency has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · settings.createPluginSettingsStore.read (cyclomatic 19) · ×1
  • settings.createPluginSettingsStore.read (cyclomatic 19) src/electron/plugins/settings.js:24 — settings.createPluginSettingsStore.read 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 · deviceRuntime.createDeviceRuntime.usageRuntimeOptions (cyclomatic 19) · ×1
  • deviceRuntime.createDeviceRuntime.usageRuntimeOptions (cyclomatic 19) src/shared/usage/deviceRuntime.js:74 — deviceRuntime.createDeviceRuntime.usageRuntimeOptions has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · oauth.authRequest (cyclomatic 19) · ×1
  • oauth.authRequest (cyclomatic 19) src/shared/providers/workbuddy/oauth.js:157 — oauth.authRequest 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 164). 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 · managedAccounts.createWorkbuddyManagedAccounts.resolveCredential (cyclomatic 19) · ×1
  • managedAccounts.createWorkbuddyManagedAccounts.resolveCredential (cyclomatic 19) src/electron/providers/workbuddy/managedAccounts.js:135 — managedAccounts.createWorkbuddyManagedAccounts.resolveCredential has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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 · modelAliasPresentation.projectModelAliasStats (cyclomatic 19) · ×1
  • modelAliasPresentation.projectModelAliasStats (cyclomatic 19) src/electron/modelAliasPresentation.js:376 — modelAliasPresentation.projectModelAliasStats has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · workspaces.listCodexWorkspaces (cyclomatic 19) · ×1
  • workspaces.listCodexWorkspaces (cyclomatic 19) src/shared/providers/codex/workspaces.js:47 — workspaces.listCodexWorkspaces 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 · transcriptReader.detailRecord (cyclomatic 19) · ×1
  • transcriptReader.detailRecord (cyclomatic 19) src/shared/providers/dsh/transcriptReader.js:80 — transcriptReader.detailRecord 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 · serviceStatus.summarizeInstatusProvider (cyclomatic 19) · ×1
  • serviceStatus.summarizeInstatusProvider (cyclomatic 19) src/electron/serviceStatus.js:357 — serviceStatus.summarizeInstatusProvider has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · main.persistThirdPartyAccountKey (cyclomatic 19) · ×1
  • main.persistThirdPartyAccountKey (cyclomatic 19) src/electron/main.js:5792 — main.persistThirdPartyAccountKey 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: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · app.renderSettingsAppUpdateRow (cyclomatic 19) · ×1
  • app.renderSettingsAppUpdateRow (cyclomatic 19) REDACTED:1776 — app.renderSettingsAppUpdateRow 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 · app.animateRowNumber (cyclomatic 19) · ×1
  • app.animateRowNumber (cyclomatic 19) REDACTED:2105 — app.animateRowNumber has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · app.beginSubscriptionEdit (cyclomatic 19) · ×1
  • app.beginSubscriptionEdit (cyclomatic 19) REDACTED:4588 — app.beginSubscriptionEdit 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 · app.syncHubConnectionUi (cyclomatic 19) · ×1
  • app.syncHubConnectionUi (cyclomatic 19) REDACTED:9817 — app.syncHubConnectionUi 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 · app.limitProviderSettingsRenderSignature (cyclomatic 19) · ×1
  • app.limitProviderSettingsRenderSignature (cyclomatic 19) REDACTED:12989 — app.limitProviderSettingsRenderSignature 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 4 function items inside it that branch (providerSignature, deviceSignature, a function literal at line 13005, …). 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 · app.deliverTrayProviderIcons (cyclomatic 19) · ×1
  • app.deliverTrayProviderIcons (cyclomatic 19) REDACTED:16632 — app.deliverTrayProviderIcons 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 · displaySettingsPreview.create.show (cyclomatic 19) · ×1
  • displaySettingsPreview.create.show (cyclomatic 19) REDACTED:87 — displaySettingsPreview.create.show has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · windowsView.createLimitWindowsView.renderCodexResetForecast (cyclomatic 19) · ×1
  • windowsView.createLimitWindowsView.renderCodexResetForecast (cyclomatic 19) src/electron/renderer/limits/windowsView.js:2464 — windowsView.createLimitWindowsView.renderCodexResetForecast 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 · pluginSettings.createPluginSettingsPanel.pluginCard (cyclomatic 19) · ×1
  • pluginSettings.createPluginSettingsPanel.pluginCard (cyclomatic 19) src/electron/renderer/pluginSettings.js:1019 — pluginSettings.createPluginSettingsPanel.pluginCard has cyclomatic complexity 19 (threshold 15). Of this number, 15 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 · qoderCollectionSettings.create (cyclomatic 19) · ×1
  • qoderCollectionSettings.create (cyclomatic 19) src/electron/renderer/qoderCollectionSettings.js:8 — qoderCollectionSettings.create has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · homeLimitRows (cyclomatic 19) · ×1
  • homeLimitRows (cyclomatic 19) REDACTED:6828 — homeLimitRows has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 8 function items inside it that branch (accountName, accountColor, a function literal at line 6839, …). 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 · sendPush (cyclomatic 19) · ×1
  • sendPush (cyclomatic 19) src/electron/main.js:5240 — sendPush has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, 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 · createLimitWindowsView.renderCodexResetForecast (cyclomatic 19) · ×1
  • createLimitWindowsView.renderCodexResetForecast (cyclomatic 19) src/electron/renderer/limits/windowsView.js:2464 — createLimitWindowsView.renderCodexResetForecast 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 · createPluginSettingsPanel.pluginCard (cyclomatic 19) · ×1
  • createPluginSettingsPanel.pluginCard (cyclomatic 19) src/electron/renderer/pluginSettings.js:1019 — createPluginSettingsPanel.pluginCard has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 12 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createEdgeDockController.syncRefresh (cyclomatic 19) · ×1
  • createEdgeDockController.syncRefresh (cyclomatic 19) src/electron/edgeDock/controller.js:1027 — createEdgeDockController.syncRefresh 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 · createEdgeDockController.setCells (cyclomatic 19) · ×1
  • createEdgeDockController.setCells (cyclomatic 19) src/electron/edgeDock/controller.js:1647 — createEdgeDockController.setCells 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 · normalizeResetCreditExpirations (cyclomatic 19) · ×1
  • normalizeResetCreditExpirations (cyclomatic 19) src/shared/limits/core.js:327 — normalizeResetCreditExpirations 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 · normalizeProviderUsageSummary (cyclomatic 19) · ×1
  • normalizeProviderUsageSummary (cyclomatic 19) src/shared/limits/core.js:432 — normalizeProviderUsageSummary has cyclomatic complexity 19 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · createLimitsRuntime.dispatchIntent (cyclomatic 19) · ×1
  • createLimitsRuntime.dispatchIntent (cyclomatic 19) src/shared/limits/runtime.js:799 — createLimitsRuntime.dispatchIntent has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 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 · createLimitsRuntime.clear (cyclomatic 19) · ×1
  • createLimitsRuntime.clear (cyclomatic 19) src/shared/limits/runtime.js:953 — createLimitsRuntime.clear 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 · createNotchRenderer.notchNumber (cyclomatic 19) · ×1
  • createNotchRenderer.notchNumber (cyclomatic 19) src/electron/renderer/notch/renderer.js:79 — createNotchRenderer.notchNumber has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · createBusinessDataService.dependency (cyclomatic 19) · ×1
  • createBusinessDataService.dependency (cyclomatic 19) src/electron/plugins/businessData.js:59 — createBusinessDataService.dependency has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · parseKimiMembershipStats (cyclomatic 19) · ×1
  • parseKimiMembershipStats (cyclomatic 19) src/shared/providers/kimi/limits.js:365 — parseKimiMembershipStats 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 · fetchCommandcodeLimits (cyclomatic 19) · ×1
  • fetchCommandcodeLimits (cyclomatic 19) src/shared/providers/commandcode/limits.js:399 — fetchCommandcodeLimits 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 · trayText.formatTrayText (cyclomatic 18) · ×1
  • trayText.formatTrayText (cyclomatic 18) src/shared/trayText.js:437 — trayText.formatTrayText 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 · sessionActivityProjection.applyActivityPatch (cyclomatic 18) · ×1
  • sessionActivityProjection.applyActivityPatch (cyclomatic 18) src/shared/sessionActivityProjection.js:202 — sessionActivityProjection.applyActivityPatch 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 · uploadDelta.createUploadBaselines.prepare (cyclomatic 18) · ×1
  • uploadDelta.createUploadBaselines.prepare (cyclomatic 18) src/shared/uploadDelta.js:41 — uploadDelta.createUploadBaselines.prepare 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 · syncPayload.serializeSyncPayload (cyclomatic 18) · ×1
  • syncPayload.serializeSyncPayload (cyclomatic 18) src/shared/syncPayload.js:278 — syncPayload.serializeSyncPayload 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 · settings.validateSetting (cyclomatic 18) · ×1
  • settings.validateSetting (cyclomatic 18) src/shared/plugins/settings.js:17 — settings.validateSetting 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 · controller.createNotchController.send (cyclomatic 18) · ×1
  • controller.createNotchController.send (cyclomatic 18) src/electron/notch/controller.js:293 — controller.createNotchController.send 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 · controller.createNotchController.paint (cyclomatic 18) · ×1
  • controller.createNotchController.paint (cyclomatic 18) src/electron/notch/controller.js:350 — controller.createNotchController.paint 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 · controller.createNotchController.animateShell (cyclomatic 18) · ×1
  • controller.createNotchController.animateShell (cyclomatic 18) src/electron/notch/controller.js:580 — controller.createNotchController.animateShell 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 · limits.refreshClaudeAccessToken (cyclomatic 18) · ×1
  • limits.refreshClaudeAccessToken (cyclomatic 18) src/shared/providers/claude/limits.js:591 — limits.refreshClaudeAccessToken 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 · limits.codexCommandSourceDetail (cyclomatic 18) · ×1
  • limits.codexCommandSourceDetail (cyclomatic 18) src/shared/providers/codex/limits.js:916 — limits.codexCommandSourceDetail 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 · limits.normalizeCodexManagedAccounts (cyclomatic 18) · ×1
  • limits.normalizeCodexManagedAccounts (cyclomatic 18) src/shared/providers/codex/limits.js:1136 — limits.normalizeCodexManagedAccounts has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 1138). 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 · extension.readConversation (cyclomatic 18) · ×1
  • extension.readConversation (cyclomatic 18) src/shared/providers/codebuddy/extension.js:129 — extension.readConversation has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessions.sidecarCandidates (cyclomatic 18) · ×1
  • sessions.sidecarCandidates (cyclomatic 18) src/shared/providers/reasonix/sessions.js:202 — sessions.sidecarCandidates has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessions.projectEntry (cyclomatic 18) · ×1
  • sessions.projectEntry (cyclomatic 18) src/shared/providers/reasonix/sessions.js:451 — sessions.projectEntry 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 · limits.scanGrokProto (cyclomatic 18) · ×1
  • limits.scanGrokProto (cyclomatic 18) src/shared/providers/grok/limits.js:364 — limits.scanGrokProto 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 · limits.parseMinimaxCodePlan (cyclomatic 18) · ×1
  • limits.parseMinimaxCodePlan (cyclomatic 18) src/shared/providers/minimax/limits.js:183 — limits.parseMinimaxCodePlan has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.parseUsage (cyclomatic 18) · ×1
  • limits.parseUsage (cyclomatic 18) src/shared/providers/typesafe/limits.js:213 — limits.parseUsage 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 · limits.requestOllamaJson (cyclomatic 18) · ×1
  • limits.requestOllamaJson (cyclomatic 18) src/shared/providers/ollama/limits.js:371 — limits.requestOllamaJson 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 is NOT this file's highest cyclomatic complexity: limits.looksSignedOut (cyclomatic 21) 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 · limits.fetchStepfunLimits (cyclomatic 18) · ×1
  • limits.fetchStepfunLimits (cyclomatic 18) src/shared/providers/stepfun/limits.js:133 — limits.fetchStepfunLimits has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.normalizeNotionCookieHeader (cyclomatic 18) · ×1
  • limits.normalizeNotionCookieHeader (cyclomatic 18) src/shared/providers/notion/limits.js:40 — limits.normalizeNotionCookieHeader 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 · limits.fetchNotionLimits (cyclomatic 18) · ×1
  • limits.fetchNotionLimits (cyclomatic 18) src/shared/providers/notion/limits.js:186 — limits.fetchNotionLimits has cyclomatic complexity 18 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · runtime.createLimitsRuntime.providerRows (cyclomatic 18) · ×1
  • runtime.createLimitsRuntime.providerRows (cyclomatic 18) src/shared/limits/runtime.js:351 — runtime.createLimitsRuntime.providerRows has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · businessData.validSubscription (cyclomatic 18) · ×1
  • businessData.validSubscription (cyclomatic 18) src/shared/plugins/businessData.js:57 — businessData.validSubscription has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · businessData.createBusinessDataService.lazyPage (cyclomatic 18) · ×1
  • businessData.createBusinessDataService.lazyPage (cyclomatic 18) src/electron/plugins/businessData.js:363 — businessData.createBusinessDataService.lazyPage has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · docs.watchTopic (cyclomatic 18) · ×1
  • docs.watchTopic (cyclomatic 18) site/scripts/docs.js:308 — docs.watchTopic has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (mark, a function literal at line 332, a function literal at line 325, …). 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 · diagnosticSnapshot.diagnosticHubTarget (cyclomatic 18) · ×1
  • diagnosticSnapshot.diagnosticHubTarget (cyclomatic 18) src/electron/diagnosticSnapshot.js:45 — diagnosticSnapshot.diagnosticHubTarget 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 · diagnosticSnapshot.diagnosticStreamDetailCode (cyclomatic 18) · ×1
  • diagnosticSnapshot.diagnosticStreamDetailCode (cyclomatic 18) src/electron/diagnosticSnapshot.js:78 — diagnosticSnapshot.diagnosticStreamDetailCode 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 · floatingBubble.clampBounds (cyclomatic 18) · ×1
  • floatingBubble.clampBounds (cyclomatic 18) src/electron/floatingBubble.js:98 — floatingBubble.clampBounds 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 · historySource.devicesWithLocalHistory (cyclomatic 18) · ×1
  • historySource.devicesWithLocalHistory (cyclomatic 18) src/electron/historySource.js:48 — historySource.devicesWithLocalHistory has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · retainedWindow.createRetainedWindow (cyclomatic 18) · ×1
  • retainedWindow.createRetainedWindow (cyclomatic 18) src/electron/retainedWindow.js:11 — retainedWindow.createRetainedWindow has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 62, a function literal at line 17, a function literal at line 20, …). 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 · historyModel.sameCycle (cyclomatic 18) · ×1
  • historyModel.sameCycle (cyclomatic 18) src/electron/renderer/limits/historyModel.js:9 — historyModel.sameCycle 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 · main.hydrateCodexManagedWorkspaceLabels (cyclomatic 18) · ×1
  • main.hydrateCodexManagedWorkspaceLabels (cyclomatic 18) src/electron/main.js:1229 — main.hydrateCodexManagedWorkspaceLabels has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1274, 1236, 1247, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.updateTrayDisplay (cyclomatic 18) · ×1
  • main.updateTrayDisplay (cyclomatic 18) src/electron/main.js:5390 — main.updateTrayDisplay has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · app.performFixedPeriodHistoryLoad (cyclomatic 18) · ×1
  • app.performFixedPeriodHistoryLoad (cyclomatic 18) REDACTED:6367 — app.performFixedPeriodHistoryLoad has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · app.updateViewSwitcherOpenState (cyclomatic 18) · ×1
  • app.updateViewSwitcherOpenState (cyclomatic 18) REDACTED:6614 — app.updateViewSwitcherOpenState 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 · app.updateSyncDeviceRow (cyclomatic 18) · ×1
  • app.updateSyncDeviceRow (cyclomatic 18) REDACTED:9558 — app.updateSyncDeviceRow 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 · app.createTrayComposer (cyclomatic 18) · ×1
  • app.createTrayComposer (cyclomatic 18) REDACTED:16479 — app.createTrayComposer has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 16512, 16490, 16497, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · app.appendNamedApiProfileRow (cyclomatic 18) · ×1
  • app.appendNamedApiProfileRow (cyclomatic 18) REDACTED:18869 — app.appendNamedApiProfileRow has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (finishRename, a function literal at line 18889, a function literal at line 18966, …). 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 · windowsView.createLimitWindowsView.limitWindowNode (cyclomatic 18) · ×1
  • windowsView.createLimitWindowsView.limitWindowNode (cyclomatic 18) src/electron/renderer/limits/windowsView.js:909 — windowsView.createLimitWindowsView.limitWindowNode 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 · pluginMainPages.create.render (cyclomatic 18) · ×1
  • pluginMainPages.create.render (cyclomatic 18) src/electron/renderer/pluginMainPages.js:17 — pluginMainPages.create.render has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 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 · renderClaudeWebAccounts (cyclomatic 18) · ×1
  • renderClaudeWebAccounts (cyclomatic 18) REDACTED:17792 — renderClaudeWebAccounts has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 14 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · spawnTokscaleHelp (cyclomatic 18) · ×1
  • spawnTokscaleHelp (cyclomatic 18) src/shared/collector.js:330 — spawnTokscaleHelp has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 369, a function literal at line 361, (anonymous)::finish, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · createLimitWindowsView.limitWindowNode (cyclomatic 18) · ×1
  • createLimitWindowsView.limitWindowNode (cyclomatic 18) src/electron/renderer/limits/windowsView.js:909 — createLimitWindowsView.limitWindowNode 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 · createPluginSettingsPanel.refreshCatalog (cyclomatic 18) · ×1
  • createPluginSettingsPanel.refreshCatalog (cyclomatic 18) src/electron/renderer/pluginSettings.js:824 — createPluginSettingsPanel.refreshCatalog has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 828, 835, 825, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · mapCodexRateLimitsToProvider (cyclomatic 18) · ×1
  • mapCodexRateLimitsToProvider (cyclomatic 18) src/shared/providers/codex/limits.js:528 — mapCodexRateLimitsToProvider 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 · createNotchController.send (cyclomatic 18) · ×1
  • createNotchController.send (cyclomatic 18) src/electron/notch/controller.js:293 — createNotchController.send 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 · createNotchController.paint (cyclomatic 18) · ×1
  • createNotchController.paint (cyclomatic 18) src/electron/notch/controller.js:350 — createNotchController.paint 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 · createLimitsRuntime.providerRows (cyclomatic 18) · ×1
  • createLimitsRuntime.providerRows (cyclomatic 18) src/shared/limits/runtime.js:351 — createLimitsRuntime.providerRows has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 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 · createBusinessDataService.lazyPage (cyclomatic 18) · ×1
  • createBusinessDataService.lazyPage (cyclomatic 18) src/electron/plugins/businessData.js:363 — createBusinessDataService.lazyPage has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · withGrokPathHints (cyclomatic 18) · ×1
  • withGrokPathHints (cyclomatic 18) src/shared/providers/grok/limits.js:466 — withGrokPathHints has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · probe (cyclomatic 18) · ×1
  • probe (cyclomatic 18) src/shared/providers/cursor/probe.js:335 — probe 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 · parseKiroUsage (cyclomatic 18) · ×1
  • parseKiroUsage (cyclomatic 18) REDACTED:149 — parseKiroUsage 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 · createLocalUsageSource.connect (cyclomatic 18) · ×1
  • createLocalUsageSource.connect (cyclomatic 18) src/shared/providers/codex/localUsageSource.js:280 — createLocalUsageSource.connect has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 306, a function literal at line 289, active, …). 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 · drawDistribution (cyclomatic 18) · ×1
  • drawDistribution (cyclomatic 18) src/electron/renderer/limits/history.js:98 — drawDistribution has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · clientHealth.classifyClientSyncDetailCode (cyclomatic 17) · ×1
  • clientHealth.classifyClientSyncDetailCode (cyclomatic 17) src/shared/clientHealth.js:116 — clientHealth.classifyClientSyncDetailCode 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 · usage.reconcileCursorAutoGlobalModels (cyclomatic 17) · ×1
  • usage.reconcileCursorAutoGlobalModels (cyclomatic 17) src/shared/usage.js:989 — usage.reconcileCursorAutoGlobalModels 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 · hubProtocol.prepareSseFanout (cyclomatic 17) · ×1
  • hubProtocol.prepareSseFanout (cyclomatic 17) src/shared/hubProtocol.js:199 — hubProtocol.prepareSseFanout 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 · syncPayload.postSyncPayload (cyclomatic 17) · ×1
  • syncPayload.postSyncPayload (cyclomatic 17) src/shared/syncPayload.js:338 — syncPayload.postSyncPayload 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 · accountIdentity.dedupeAccounts (cyclomatic 17) · ×1
  • accountIdentity.dedupeAccounts (cyclomatic 17) src/electron/renderer/accountIdentity.js:293 — accountIdentity.dedupeAccounts 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 · controller.createEdgeDockController.buildWindows (cyclomatic 17) · ×1
  • controller.createEdgeDockController.buildWindows (cyclomatic 17) src/electron/edgeDock/controller.js:933 — controller.createEdgeDockController.buildWindows 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 · data.numericMeasure (cyclomatic 17) · ×1
  • data.numericMeasure (cyclomatic 17) src/electron/notch/data.js:71 — data.numericMeasure 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 · web.parseWindowObj (cyclomatic 17) · ×1
  • web.parseWindowObj (cyclomatic 17) src/shared/providers/opencode/web.js:94 — web.parseWindowObj 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 · paths.senpiTopology (cyclomatic 17) · ×1
  • paths.senpiTopology (cyclomatic 17) src/shared/providers/senpi/paths.js:87 — paths.senpiTopology 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 · selfSync.removeOwnedAntigravitySyncLock (cyclomatic 17) · ×1
  • selfSync.removeOwnedAntigravitySyncLock (cyclomatic 17) src/shared/providers/antigravity/selfSync.js:57 — selfSync.removeOwnedAntigravitySyncLock 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 · desktopSessionTitles.readDesktopSessionTitles (cyclomatic 17) · ×1
  • desktopSessionTitles.readDesktopSessionTitles (cyclomatic 17) src/shared/providers/claude/desktopSessionTitles.js:73 — desktopSessionTitles.readDesktopSessionTitles has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dailyHistoryArchive.normalizeDailyHistoryArchive (cyclomatic 17) · ×1
  • dailyHistoryArchive.normalizeDailyHistoryArchive (cyclomatic 17) src/shared/dailyHistoryArchive.js:206 — dailyHistoryArchive.normalizeDailyHistoryArchive 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 · dailyHistoryArchive.withReconciledGraphCosts (cyclomatic 17) · ×1
  • dailyHistoryArchive.withReconciledGraphCosts (cyclomatic 17) src/shared/dailyHistoryArchive.js:540 — dailyHistoryArchive.withReconciledGraphCosts 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 one function literal inside it that branches (line 542). 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 · localUsageSource.createLocalUsageSource.connect (cyclomatic 17) · ×1
  • localUsageSource.createLocalUsageSource.connect (cyclomatic 17) src/shared/providers/codex/localUsageSource.js:280 — localUsageSource.createLocalUsageSource.connect has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 306, active, a function literal at line 288, …). 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 · collector.watchClientRootsForClients (cyclomatic 17) · ×1
  • collector.watchClientRootsForClients (cyclomatic 17) src/shared/collector.js:1603 — collector.watchClientRootsForClients 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 · collector.startCollector.loop (cyclomatic 17) · ×1
  • collector.startCollector.loop (cyclomatic 17) src/shared/collector.js:3962 — collector.startCollector.loop has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · limits.fetchCursorLimits (cyclomatic 17) · ×1
  • limits.fetchCursorLimits (cyclomatic 17) src/shared/providers/cursor/limits.js:267 — limits.fetchCursorLimits has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · probe.quotaSummaryWindows (cyclomatic 17) · ×1
  • probe.quotaSummaryWindows (cyclomatic 17) REDACTED:483 — probe.quotaSummaryWindows has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · limits.factoryWindow (cyclomatic 17) · ×1
  • limits.factoryWindow (cyclomatic 17) src/shared/providers/factory/limits.js:66 — limits.factoryWindow 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 · limits.readAuthJson (cyclomatic 17) · ×1
  • limits.readAuthJson (cyclomatic 17) src/shared/providers/grok/limits.js:52 — limits.readAuthJson has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · limits.fetchCopilotLimits (cyclomatic 17) · ×1
  • limits.fetchCopilotLimits (cyclomatic 17) src/shared/providers/copilot/limits.js:359 — limits.fetchCopilotLimits has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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 · balanceHistory.normalizedCompactEntry (cyclomatic 17) · ×1
  • balanceHistory.normalizedCompactEntry (cyclomatic 17) src/shared/providers/deepseek/balanceHistory.js:77 — balanceHistory.normalizedCompactEntry has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · limits.fetchToolSpends (cyclomatic 17) · ×1
  • limits.fetchToolSpends (cyclomatic 17) src/shared/providers/deepseek/limits.js:66 — limits.fetchToolSpends has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · limits.minimaxCodeAuthFiles (cyclomatic 17) · ×1
  • limits.minimaxCodeAuthFiles (cyclomatic 17) src/shared/providers/minimax/limits.js:395 — limits.minimaxCodeAuthFiles 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 · arkcli.runArkcli (cyclomatic 17) · ×1
  • arkcli.runArkcli (cyclomatic 17) src/shared/providers/volcengine/arkcli.js:82 — arkcli.runArkcli has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 86, 134, 93, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · accountSlotFetcher.createAccountSlotFetcher (cyclomatic 17) · ×1
  • accountSlotFetcher.createAccountSlotFetcher (cyclomatic 17) src/shared/limits/accountSlotFetcher.js:128 — accountSlotFetcher.createAccountSlotFetcher has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (fetchAccount, a function literal at line 132). 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 · lazySessions.createSessionBacking.pin (cyclomatic 17) · ×1
  • lazySessions.createSessionBacking.pin (cyclomatic 17) src/electron/plugins/lazySessions.js:111 — lazySessions.createSessionBacking.pin has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · businessData.createBusinessDataService.subscribe (cyclomatic 17) · ×1
  • businessData.createBusinessDataService.subscribe (cyclomatic 17) src/electron/plugins/businessData.js:577 — businessData.createBusinessDataService.subscribe has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · runtime.createPluginRuntime.confirmContentSwitch (cyclomatic 17) · ×1
  • runtime.createPluginRuntime.confirmContentSwitch (cyclomatic 17) src/electron/plugins/runtime.js:579 — runtime.createPluginRuntime.confirmContentSwitch has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · panel.createNotchPanel.paintStatus (cyclomatic 17) · ×1
  • panel.createNotchPanel.paintStatus (cyclomatic 17) src/electron/renderer/notch/panel.js:514 — panel.createNotchPanel.paintStatus 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 · panel.createNotchPanel.applyScroll (cyclomatic 17) · ×1
  • panel.createNotchPanel.applyScroll (cyclomatic 17) src/electron/renderer/notch/panel.js:1427 — panel.createNotchPanel.applyScroll 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 · icloudSync.validDeviceDocument (cyclomatic 17) · ×1
  • icloudSync.validDeviceDocument (cyclomatic 17) src/electron/icloudSync.js:348 — icloudSync.validDeviceDocument 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 · networkProxy.parseNoProxyEntry (cyclomatic 17) · ×1
  • networkProxy.parseNoProxyEntry (cyclomatic 17) REDACTED:150 — networkProxy.parseNoProxyEntry 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 · credentialCommands.draftFor (cyclomatic 17) · ×1
  • credentialCommands.draftFor (cyclomatic 17) src/electron/limits/credentialCommands.js:49 — credentialCommands.draftFor 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 · accountSlotService.createAccountSlotService.mutate (cyclomatic 17) · ×1
  • accountSlotService.createAccountSlotService.mutate (cyclomatic 17) src/electron/limits/accountSlotService.js:136 — accountSlotService.createAccountSlotService.mutate 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 137). 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 · accountSlotsPanel.createPanel.render (cyclomatic 17) · ×1
  • accountSlotsPanel.createPanel.render (cyclomatic 17) src/electron/renderer/limits/accountSlotsPanel.js:276 — accountSlotsPanel.createPanel.render has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 279). 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 · appUpdater.textOutsideHtmlMarkup (cyclomatic 17) · ×1
  • appUpdater.textOutsideHtmlMarkup (cyclomatic 17) src/shared/appUpdater.js:253 — appUpdater.textOutsideHtmlMarkup 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 · clientUsageArchive.normalizeArchivedClientUsage (cyclomatic 17) · ×1
  • clientUsageArchive.normalizeArchivedClientUsage (cyclomatic 17) src/shared/usage/clientUsageArchive.js:99 — clientUsageArchive.normalizeArchivedClientUsage 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 · clientUsageArchive.captureArchivedClientUsage (cyclomatic 17) · ×1
  • clientUsageArchive.captureArchivedClientUsage (cyclomatic 17) src/shared/usage/clientUsageArchive.js:134 — clientUsageArchive.captureArchivedClientUsage 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 · sessionDetail.parseClaudeTranscriptLines (cyclomatic 17) · ×1
  • sessionDetail.parseClaudeTranscriptLines (cyclomatic 17) src/shared/sessionDetail.js:146 — sessionDetail.parseClaudeTranscriptLines has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · historyStore.pruneMacWidgetHistoryCaches (cyclomatic 17) · ×1
  • historyStore.pruneMacWidgetHistoryCaches (cyclomatic 17) src/electron/macWidget/historyStore.js:240 — historyStore.pruneMacWidgetHistoryCaches has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · serviceStatus.summarizeStatuspageProvider (cyclomatic 17) · ×1
  • serviceStatus.summarizeStatuspageProvider (cyclomatic 17) src/electron/serviceStatus.js:198 — serviceStatus.summarizeStatuspageProvider 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 · main.deleteDeviceFromCurrentSync (cyclomatic 17) · ×1
  • main.deleteDeviceFromCurrentSync (cyclomatic 17) src/electron/main.js:3837 — main.deleteDeviceFromCurrentSync 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.saveSubscriptions (cyclomatic 17) · ×1
  • main.saveSubscriptions (cyclomatic 17) src/electron/main.js:4541 — main.saveSubscriptions has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 4570). 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.edgeDockLiveRateSample (cyclomatic 17) · ×1
  • main.edgeDockLiveRateSample (cyclomatic 17) src/electron/main.js:6227 — main.edgeDockLiveRateSample 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.cursorStatusValue (cyclomatic 17) · ×1
  • main.cursorStatusValue (cyclomatic 17) src/electron/main.js:8211 — main.cursorStatusValue has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 8221, 8246). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.app.whenReady().then() (cyclomatic 17) · ×1
  • main.app.whenReady().then() (cyclomatic 17) src/electron/main.js:8255 — main.app.whenReady().then() 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. This shape REPEATS in the file: one other method here (main.app.whenReady().then()::applySettingsPatch) 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. This is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · historyDatabase.createHistoryDatabase.rememberInterruptions (cyclomatic 17) · ×1
  • historyDatabase.createHistoryDatabase.rememberInterruptions (cyclomatic 17) src/electron/limits/historyDatabase.js:343 — historyDatabase.createHistoryDatabase.rememberInterruptions 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 · app.renderSessionGroupDetail (cyclomatic 17) · ×1
  • app.renderSessionGroupDetail (cyclomatic 17) REDACTED:5805 — app.renderSessionGroupDetail has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · app.renderWslPanel (cyclomatic 17) · ×1
  • app.renderWslPanel (cyclomatic 17) REDACTED:12039 — app.renderWslPanel 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 · app.apiKeyAccountStatusText (cyclomatic 17) · ×1
  • app.apiKeyAccountStatusText (cyclomatic 17) REDACTED:17660 — app.apiKeyAccountStatusText 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 · dock.renderRail (cyclomatic 17) · ×1
  • dock.renderRail (cyclomatic 17) REDACTED:1300 — dock.renderRail has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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 · dock.appendLiveRate (cyclomatic 17) · ×1
  • dock.appendLiveRate (cyclomatic 17) REDACTED:1769 — dock.appendLiveRate has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · railNumberRoll.create.play (cyclomatic 17) · ×1
  • railNumberRoll.create.play (cyclomatic 17) src/electron/renderer/edgeDock/railNumberRoll.js:48 — railNumberRoll.create.play has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · accountPanels.syncCredentialFields (cyclomatic 17) · ×1
  • accountPanels.syncCredentialFields (cyclomatic 17) src/electron/renderer/limits/accountPanels.js:45 — accountPanels.syncCredentialFields 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 · history.drawTrend (cyclomatic 17) · ×1
  • history.drawTrend (cyclomatic 17) src/electron/renderer/limits/history.js:53 — history.drawTrend has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · providerPresentation.pluginLimitSettingsStatus (cyclomatic 17) · ×1
  • providerPresentation.pluginLimitSettingsStatus (cyclomatic 17) src/electron/renderer/limits/providerPresentation.js:653 — providerPresentation.pluginLimitSettingsStatus 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 · windowsView.createLimitWindowsView.genericCreditWindowNode (cyclomatic 17) · ×1
  • windowsView.createLimitWindowsView.genericCreditWindowNode (cyclomatic 17) src/electron/renderer/limits/windowsView.js:976 — windowsView.createLimitWindowsView.genericCreditWindowNode 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 · pluginCredentials.create.mount.run (cyclomatic 17) · ×1
  • pluginCredentials.create.mount.run (cyclomatic 17) src/electron/renderer/pluginCredentials.js:71 — pluginCredentials.create.mount.run 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 · pluginCredentials.create.mount.update (cyclomatic 17) · ×1
  • pluginCredentials.create.mount.update (cyclomatic 17) src/electron/renderer/pluginCredentials.js:135 — pluginCredentials.create.mount.update 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 · WidgetHeatmapLayoutCalculator.make (cyclomatic 17) · ×1
  • WidgetHeatmapLayoutCalculator.make (cyclomatic 17) native/macos/TokenMonitorWidget/WidgetViewModel.swift:129 — WidgetHeatmapLayoutCalculator.make 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 · loadClientSources (cyclomatic 17) · ×1
  • loadClientSources (cyclomatic 17) REDACTED:11463 — loadClientSources has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · refreshEdgeDockDerivedPeriods (cyclomatic 17) · ×1
  • refreshEdgeDockDerivedPeriods (cyclomatic 17) src/electron/main.js:6300 — refreshEdgeDockDerivedPeriods has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 6318, 6337). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · startCollector.loop (cyclomatic 17) · ×1
  • startCollector.loop (cyclomatic 17) src/shared/collector.js:3962 — startCollector.loop has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · createLimitWindowsView.genericCreditWindowNode (cyclomatic 17) · ×1
  • createLimitWindowsView.genericCreditWindowNode (cyclomatic 17) src/electron/renderer/limits/windowsView.js:976 — createLimitWindowsView.genericCreditWindowNode 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 · createNotchPanel.paintStatus (cyclomatic 17) · ×1
  • createNotchPanel.paintStatus (cyclomatic 17) src/electron/renderer/notch/panel.js:514 — createNotchPanel.paintStatus 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 · createNotchPanel.applyScroll (cyclomatic 17) · ×1
  • createNotchPanel.applyScroll (cyclomatic 17) src/electron/renderer/notch/panel.js:1427 — createNotchPanel.applyScroll 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 · createEdgeDockController.buildWindows (cyclomatic 17) · ×1
  • createEdgeDockController.buildWindows (cyclomatic 17) src/electron/edgeDock/controller.js:933 — createEdgeDockController.buildWindows 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 · createPluginRuntime.confirmContentSwitch (cyclomatic 17) · ×1
  • createPluginRuntime.confirmContentSwitch (cyclomatic 17) src/electron/plugins/runtime.js:579 — createPluginRuntime.confirmContentSwitch has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 4 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.
D1 · Cyclomatic Complexity · parseTeamSummary (cyclomatic 17) · ×1
  • parseTeamSummary (cyclomatic 17) src/shared/providers/alibaba/limits.js:499 — parseTeamSummary 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 · normalizeComponentSummary (cyclomatic 17) · ×1
  • normalizeComponentSummary (cyclomatic 17) src/shared/dailyHistoryArchive.js:127 — normalizeComponentSummary has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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 · createBusinessDataService.subscribe (cyclomatic 17) · ×1
  • createBusinessDataService.subscribe (cyclomatic 17) src/electron/plugins/businessData.js:577 — createBusinessDataService.subscribe has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · animateHeatmapEntry (cyclomatic 17) · ×1
  • animateHeatmapEntry (cyclomatic 17) src/electron/renderer/dashboard.js:142 — animateHeatmapEntry has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 8 function items inside it that branch (startWhenVisible, a function literal at line 168, a function literal at line 179, …). 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 · createHistoryDatabase.rememberInterruptions (cyclomatic 17) · ×1
  • createHistoryDatabase.rememberInterruptions (cyclomatic 17) src/electron/limits/historyDatabase.js:343 — createHistoryDatabase.rememberInterruptions 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 · parseCommandcodeSubscription (cyclomatic 17) · ×1
  • parseCommandcodeSubscription (cyclomatic 17) src/shared/providers/commandcode/limits.js:280 — parseCommandcodeSubscription 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 · createPanel.render (cyclomatic 17) · ×1
  • createPanel.render (cyclomatic 17) src/electron/renderer/limits/accountSlotsPanel.js:276 — createPanel.render has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 279, 278, 282, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · loadApi (cyclomatic 17) · ×1
  • loadApi (cyclomatic 17) src/electron/macLiquidGlass.js:8 — loadApi has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 18 function items inside it that branch (setPath, getBounds, loadPathApi, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · clientHealth.normalizeClientHealthEntry (cyclomatic 16) · ×1
  • clientHealth.normalizeClientHealthEntry (cyclomatic 16) src/shared/clientHealth.js:410 — clientHealth.normalizeClientHealthEntry 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 · sessionRows.grokBotSessionIdsForMaps (cyclomatic 16) · ×1
  • sessionRows.grokBotSessionIdsForMaps (cyclomatic 16) src/electron/renderer/sessionRows.js:435 — sessionRows.grokBotSessionIdsForMaps has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · appearance.normalizeAppearance (cyclomatic 16) · ×1
  • appearance.normalizeAppearance (cyclomatic 16) src/shared/plugins/appearance.js:6 — appearance.normalizeAppearance 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 · trayLayout.selectWindow (cyclomatic 16) · ×1
  • trayLayout.selectWindow (cyclomatic 16) src/shared/trayLayout.js:809 — trayLayout.selectWindow 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 · fixedPeriodRanges.derivePeriod (cyclomatic 16) · ×1
  • fixedPeriodRanges.derivePeriod (cyclomatic 16) src/electron/renderer/fixedPeriodRanges.js:579 — fixedPeriodRanges.derivePeriod 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 · controller.createEdgeDockController.syncRailPointer (cyclomatic 16) · ×1
  • controller.createEdgeDockController.syncRailPointer (cyclomatic 16) src/electron/edgeDock/controller.js:459 — controller.createEdgeDockController.syncRailPointer has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · controller.createEdgeDockController.placeBubble (cyclomatic 16) · ×1
  • controller.createEdgeDockController.placeBubble (cyclomatic 16) src/electron/edgeDock/controller.js:1168 — controller.createEdgeDockController.placeBubble 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 · limits.readCodexUsageOrRpc (cyclomatic 16) · ×1
  • limits.readCodexUsageOrRpc (cyclomatic 16) src/shared/providers/codex/limits.js:1211 — limits.readCodexUsageOrRpc has cyclomatic complexity 16 (threshold 15). Of this number, 13 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 · profiles.moveCredential (cyclomatic 16) · ×1
  • profiles.moveCredential (cyclomatic 16) src/shared/providers/opencode/profiles.js:185 — profiles.moveCredential 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 · sessionMetadata.readKimiStateMetadata (cyclomatic 16) · ×1
  • sessionMetadata.readKimiStateMetadata (cyclomatic 16) src/shared/providers/kimi/sessionMetadata.js:155 — sessionMetadata.readKimiStateMetadata 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 · paths.catpawDataSources (cyclomatic 16) · ×1
  • paths.catpawDataSources (cyclomatic 16) src/shared/providers/catpaw/paths.js:28 — paths.catpawDataSources has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · selfSync.repairAntigravitySyncLock (cyclomatic 16) · ×1
  • selfSync.repairAntigravitySyncLock (cyclomatic 16) src/shared/providers/antigravity/selfSync.js:106 — selfSync.repairAntigravitySyncLock 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 · subagents.findSubagentSessionFile (cyclomatic 16) · ×1
  • subagents.findSubagentSessionFile (cyclomatic 16) src/shared/providers/codebuddy/subagents.js:91 — subagents.findSubagentSessionFile 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 item inside it that branches (walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · sessionFiles.findCodexSessionFiles (cyclomatic 16) · ×1
  • sessionFiles.findCodexSessionFiles (cyclomatic 16) src/shared/sessionFiles.js:117 — sessionFiles.findCodexSessionFiles has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · sessionActivity.discoverFilesUncached · ×1
  • sessionActivity.discoverFilesUncached::accept (cyclomatic 16) src/shared/providers/codex/sessionActivity.js:54 — sessionActivity.discoverFilesUncached::accept 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 · sessionActivity.discoverFiles (cyclomatic 16) · ×1
  • sessionActivity.discoverFiles (cyclomatic 16) src/shared/providers/codex/sessionActivity.js:106 — sessionActivity.discoverFiles 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 · sessionMetadata.projectFromWorkspaceUris (cyclomatic 16) · ×1
  • sessionMetadata.projectFromWorkspaceUris (cyclomatic 16) src/shared/providers/antigravity/sessionMetadata.js:62 — sessionMetadata.projectFromWorkspaceUris 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 · sessionMetadata.readTurnEnds (cyclomatic 16) · ×1
  • sessionMetadata.readTurnEnds (cyclomatic 16) src/shared/providers/cursor/sessionMetadata.js:48 — sessionMetadata.readTurnEnds 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 · sessionMetadata.resolveSessionMetadata (cyclomatic 16) · ×1
  • sessionMetadata.resolveSessionMetadata (cyclomatic 16) src/shared/providers/zcode/sessionMetadata.js:112 — sessionMetadata.resolveSessionMetadata 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 cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessionMetadata.applyT3SessionParents · ×1
  • sessionMetadata.applyT3SessionParents::index (cyclomatic 16) src/shared/sessionMetadata.js:417 — sessionMetadata.applyT3SessionParents::index has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (sessionMetadata.applyT3SessionParents) 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 · localUsage.priceLocalSessionDetail (cyclomatic 16) · ×1
  • localUsage.priceLocalSessionDetail (cyclomatic 16) src/shared/providers/codex/localUsage.js:153 — localUsage.priceLocalSessionDetail 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, name the conditions: bind each compound test to a 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 · sessionDetail.findSessionEventFile (cyclomatic 16) · ×1
  • sessionDetail.findSessionEventFile (cyclomatic 16) src/shared/providers/reasonix/sessionDetail.js:864 — sessionDetail.findSessionEventFile 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 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 · limits.parseFactoryTokenRateLimits (cyclomatic 16) · ×1
  • limits.parseFactoryTokenRateLimits (cyclomatic 16) src/shared/providers/factory/limits.js:91 — limits.parseFactoryTokenRateLimits has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (appendPool, a function literal at line 96). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · session.mintMimoServiceSession (cyclomatic 16) · ×1
  • session.mintMimoServiceSession (cyclomatic 16) src/shared/providers/mimo/session.js:245 — session.mintMimoServiceSession 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 · limits.parseQoderUsage (cyclomatic 16) · ×1
  • limits.parseQoderUsage (cyclomatic 16) src/shared/providers/qoder/limits.js:199 — limits.parseQoderUsage 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 · limits.selectFundedRow (cyclomatic 16) · ×1
  • limits.selectFundedRow (cyclomatic 16) src/shared/providers/deepseek/limits.js:34 — limits.selectFundedRow 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 · limits.fetchDevinLimits (cyclomatic 16) · ×1
  • limits.fetchDevinLimits (cyclomatic 16) src/shared/providers/devin/limits.js:311 — limits.fetchDevinLimits 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 · limits.billingAction (cyclomatic 16) · ×1
  • limits.billingAction (cyclomatic 16) src/shared/providers/typesafe/limits.js:175 — limits.billingAction 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 · cli.validatePersonalCLIUsage (cyclomatic 16) · ×1
  • cli.validatePersonalCLIUsage (cyclomatic 16) src/shared/providers/alibaba/cli.js:89 — cli.validatePersonalCLIUsage 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 · limits.parseNotionSpaces (cyclomatic 16) · ×1
  • limits.parseNotionSpaces (cyclomatic 16) src/shared/providers/notion/limits.js:96 — limits.parseNotionSpaces 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 · burnRate.recordLimitsSample (cyclomatic 16) · ×1
  • burnRate.recordLimitsSample (cyclomatic 16) src/shared/limits/burnRate.js:105 — burnRate.recordLimitsSample 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 · runtime.createLimitsRuntime.scheduleResetTimer (cyclomatic 16) · ×1
  • runtime.createLimitsRuntime.scheduleResetTimer (cyclomatic 16) src/shared/limits/runtime.js:425 — runtime.createLimitsRuntime.scheduleResetTimer has cyclomatic complexity 16 (threshold 15). 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.
D1 · Cyclomatic Complexity · tokenRatePresentation.selectLiveTokenRatePeriods (cyclomatic 16) · ×1
  • tokenRatePresentation.selectLiveTokenRatePeriods (cyclomatic 16) src/electron/renderer/tokenRatePresentation.js:398 — tokenRatePresentation.selectLiveTokenRatePeriods has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · panel.createNotchPanel (cyclomatic 16) · ×1
  • panel.createNotchPanel (cyclomatic 16) src/electron/renderer/notch/panel.js:41 — panel.createNotchPanel has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 258, 1487, 60). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · panel.createNotchPanel.renderSessions (cyclomatic 16) · ×1
  • panel.createNotchPanel.renderSessions (cyclomatic 16) src/electron/renderer/notch/panel.js:1139 — panel.createNotchPanel.renderSessions 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 · titleSync.createAgentTitleSync.acquire (cyclomatic 16) · ×1
  • titleSync.createAgentTitleSync.acquire (cyclomatic 16) src/agent/titleSync.js:45 — titleSync.createAgentTitleSync.acquire 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 · archiveReconciliation.resolveOmpForkParents (cyclomatic 16) · ×1
  • archiveReconciliation.resolveOmpForkParents (cyclomatic 16) src/shared/providers/omp/archiveReconciliation.js:21 — archiveReconciliation.resolveOmpForkParents 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 · sessionUsageArchiveStore.createSessionUsageArchiveStore.mutateArchive (cyclomatic 16) · ×1
  • sessionUsageArchiveStore.createSessionUsageArchiveStore.mutateArchive (cyclomatic 16) src/shared/usage/sessionUsageArchiveStore.js:347 — sessionUsageArchiveStore.createSessionUsageArchiveStore.mutateArchive 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 · diagnosticReport.projectClientHealth (cyclomatic 16) · ×1
  • diagnosticReport.projectClientHealth (cyclomatic 16) src/shared/diagnosticReport.js:108 — diagnosticReport.projectClientHealth 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 3 function literals inside it that branch (lines 115, 121, 161). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · diagnosticReport.formatDiagnosticReport (cyclomatic 16) · ×1
  • diagnosticReport.formatDiagnosticReport (cyclomatic 16) src/shared/diagnosticReport.js:1094 — diagnosticReport.formatDiagnosticReport 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 · hubProfiles.initializeHubProfiles (cyclomatic 16) · ×1
  • hubProfiles.initializeHubProfiles (cyclomatic 16) src/electron/hubProfiles.js:9 — hubProfiles.initializeHubProfiles has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · icloudSync.createIcloudSyncStore.writeSubscriptionsNow (cyclomatic 16) · ×1
  • icloudSync.createIcloudSyncStore.writeSubscriptionsNow (cyclomatic 16) src/electron/icloudSync.js:1212 — icloudSync.createIcloudSyncStore.writeSubscriptionsNow 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 · modelAliasPresentation.collectStatsModelIds (cyclomatic 16) · ×1
  • modelAliasPresentation.collectStatsModelIds (cyclomatic 16) src/electron/modelAliasPresentation.js:100 — modelAliasPresentation.collectStatsModelIds has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · managedAccounts.createClaudeManagedAccounts (cyclomatic 16) · ×1
  • managedAccounts.createClaudeManagedAccounts (cyclomatic 16) src/electron/providers/claude/managedAccounts.js:13 — managedAccounts.createClaudeManagedAccounts has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 57, 62). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · deviceFlow.normalizeDeviceCodeResponse (cyclomatic 16) · ×1
  • deviceFlow.normalizeDeviceCodeResponse (cyclomatic 16) src/shared/providers/copilot/deviceFlow.js:105 — deviceFlow.normalizeDeviceCodeResponse 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 · usageHost.createUsageHostCoordinator.create.onMessage (cyclomatic 16) · ×1
  • usageHost.createUsageHostCoordinator.create.onMessage (cyclomatic 16) src/shared/usage/usageHost.js:175 — usageHost.createUsageHostCoordinator.create.onMessage 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 · sessionDetail.groupEvents (cyclomatic 16) · ×1
  • sessionDetail.groupEvents (cyclomatic 16) src/shared/sessionDetail.js:503 — sessionDetail.groupEvents 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 · statsPresentation.projectLimitProviderForDisplay (cyclomatic 16) · ×1
  • statsPresentation.projectLimitProviderForDisplay (cyclomatic 16) src/electron/limits/statsPresentation.js:51 — statsPresentation.projectLimitProviderForDisplay 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 · serviceStatus.parseFeedEntries (cyclomatic 16) · ×1
  • serviceStatus.parseFeedEntries (cyclomatic 16) src/electron/serviceStatus.js:267 — serviceStatus.parseFeedEntries has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · serviceStatus.summarizeAtomFeedProvider (cyclomatic 16) · ×1
  • serviceStatus.summarizeAtomFeedProvider (cyclomatic 16) src/electron/serviceStatus.js:291 — serviceStatus.summarizeAtomFeedProvider has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.normalizeLanguageSetting (cyclomatic 16) · ×1
  • main.normalizeLanguageSetting (cyclomatic 16) src/electron/main.js:2281 — main.normalizeLanguageSetting 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 is NOT this file's highest cyclomatic complexity: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · main.configureNativeAppUpdater (cyclomatic 16) · ×1
  • main.configureNativeAppUpdater (cyclomatic 16) src/electron/main.js:7425 — main.configureNativeAppUpdater 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 7469, 7448, 7441). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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: main.getSyncContentRuntime (cyclomatic 28) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · app.captureBreakdownMotion (cyclomatic 16) · ×1
  • app.captureBreakdownMotion (cyclomatic 16) REDACTED:2077 — app.captureBreakdownMotion 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 · app.bindTrendTooltip (cyclomatic 16) · ×1
  • app.bindTrendTooltip (cyclomatic 16) REDACTED:5974 — app.bindTrendTooltip has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 6044, position, select, …). 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 · app.renderSyncPanelDevices (cyclomatic 16) · ×1
  • app.renderSyncPanelDevices (cyclomatic 16) REDACTED:9462 — app.renderSyncPanelDevices has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · app.syncHubProfileControls (cyclomatic 16) · ×1
  • app.syncHubProfileControls (cyclomatic 16) REDACTED:9847 — app.syncHubProfileControls 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 · app.patchRenderedNode (cyclomatic 16) · ×1
  • app.patchRenderedNode (cyclomatic 16) REDACTED:11525 — app.patchRenderedNode 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 · app.createDockItemsComposer (cyclomatic 16) · ×1
  • app.createDockItemsComposer (cyclomatic 16) REDACTED:14830 — app.createDockItemsComposer has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 14845, 14850, 14848, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · app.renderCustomTrayLayout (cyclomatic 16) · ×1
  • app.renderCustomTrayLayout (cyclomatic 16) REDACTED:16132 — app.renderCustomTrayLayout has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · app.trayComposerProviderChoices (cyclomatic 16) · ×1
  • app.trayComposerProviderChoices (cyclomatic 16) REDACTED:16253 — app.trayComposerProviderChoices has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · app.updateOpenCodeProfilesStatus (cyclomatic 16) · ×1
  • app.updateOpenCodeProfilesStatus (cyclomatic 16) REDACTED:18649 — app.updateOpenCodeProfilesStatus 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 · contentBlur.create.update (cyclomatic 16) · ×1
  • contentBlur.create.update (cyclomatic 16) src/electron/renderer/contentBlur.js:121 — contentBlur.create.update 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 · homeOverview.homeDeviceRows (cyclomatic 16) · ×1
  • homeOverview.homeDeviceRows (cyclomatic 16) src/electron/renderer/homeOverview.js:221 — homeOverview.homeDeviceRows has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 224, 238). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · qoderDisplay.groupRows (cyclomatic 16) · ×1
  • qoderDisplay.groupRows (cyclomatic 16) src/electron/renderer/qoderDisplay.js:15 — qoderDisplay.groupRows has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · rowDragController.createRowDragController.finishRowDrag (cyclomatic 16) · ×1
  • rowDragController.createRowDragController.finishRowDrag (cyclomatic 16) src/electron/renderer/rowDragController.js:284 — rowDragController.createRowDragController.finishRowDrag has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 292). 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 · syncContentForm.createSyncContentForm.toggle (cyclomatic 16) · ×1
  • syncContentForm.createSyncContentForm.toggle (cyclomatic 16) src/electron/renderer/syncContentForm.js:185 — syncContentForm.createSyncContentForm.toggle 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 one function literal inside it that branches (line 191). 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 · syncDevicePanel.deviceRows (cyclomatic 16) · ×1
  • syncDevicePanel.deviceRows (cyclomatic 16) src/electron/renderer/syncDevicePanel.js:30 — syncDevicePanel.deviceRows has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 35, 55, 33). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · usageCharts.statCardColumnWidths (cyclomatic 16) · ×1
  • usageCharts.statCardColumnWidths (cyclomatic 16) src/electron/renderer/usageCharts.js:653 — usageCharts.statCardColumnWidths 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 · addProjectInto (cyclomatic 16) · ×1
  • addProjectInto (cyclomatic 16) src/shared/usage.js:463 — addProjectInto 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 · createNotchPanel.renderSessions (cyclomatic 16) · ×1
  • createNotchPanel.renderSessions (cyclomatic 16) src/electron/renderer/notch/panel.js:1139 — createNotchPanel.renderSessions has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 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 · createEdgeDockController.syncRailPointer (cyclomatic 16) · ×1
  • createEdgeDockController.syncRailPointer (cyclomatic 16) src/electron/edgeDock/controller.js:459 — createEdgeDockController.syncRailPointer has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · createEdgeDockController.placeBubble (cyclomatic 16) · ×1
  • createEdgeDockController.placeBubble (cyclomatic 16) src/electron/edgeDock/controller.js:1168 — createEdgeDockController.placeBubble 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 · codexAdditionalRateLimitWindows (cyclomatic 16) · ×1
  • codexAdditionalRateLimitWindows (cyclomatic 16) src/shared/providers/codex/limits.js:102 — codexAdditionalRateLimitWindows 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 · createNotchController.layout (cyclomatic 16) · ×1
  • createNotchController.layout (cyclomatic 16) src/electron/notch/controller.js:203 — createNotchController.layout 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 · projectLimitsDiagnostics (cyclomatic 16) · ×1
  • projectLimitsDiagnostics (cyclomatic 16) src/shared/diagnosticReport.js:298 — projectLimitsDiagnostics has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 306). 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 · createIcloudSyncStore.writeSubscriptionsNow (cyclomatic 16) · ×1
  • createIcloudSyncStore.writeSubscriptionsNow (cyclomatic 16) src/electron/icloudSync.js:1212 — createIcloudSyncStore.writeSubscriptionsNow 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 · createLimitsRuntime.scheduleResetTimer (cyclomatic 16) · ×1
  • createLimitsRuntime.scheduleResetTimer (cyclomatic 16) src/shared/limits/runtime.js:425 — createLimitsRuntime.scheduleResetTimer has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 433, 436, 442). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · sessionModelTooltipEntries (cyclomatic 16) · ×1
  • sessionModelTooltipEntries (cyclomatic 16) src/electron/renderer/sessionRows.js:247 — sessionModelTooltipEntries has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 9 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 · dailyBarsChart (cyclomatic 16) · ×1
  • dailyBarsChart (cyclomatic 16) src/electron/renderer/usageCharts.js:129 — dailyBarsChart has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 4 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.
D1 · Cyclomatic Complexity · createSessionUsageArchiveStore.mutateArchive (cyclomatic 16) · ×1
  • createSessionUsageArchiveStore.mutateArchive (cyclomatic 16) src/shared/usage/sessionUsageArchiveStore.js:347 — createSessionUsageArchiveStore.mutateArchive 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 · createUsageHostCoordinator.create.onMessage (cyclomatic 16) · ×1
  • createUsageHostCoordinator.create.onMessage (cyclomatic 16) src/shared/usage/usageHost.js:175 — createUsageHostCoordinator.create.onMessage 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 · createRowDragController.finishRowDrag (cyclomatic 16) · ×1
  • createRowDragController.finishRowDrag (cyclomatic 16) src/electron/renderer/rowDragController.js:284 — createRowDragController.finishRowDrag has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 292). 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.
D10 · Test Quality · No assertions · ×1
  • No assertions: the shared native watcher delivers activity-only registry and T3 WAL writes tests/shared/watcherNativeEvents.test.js:30 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D2 · Cognitive Complexity · windowsView.createLimitWindowsView.renderProviderWindows (cognitive 498) · ×1
  • windowsView.createLimitWindowsView.renderProviderWindows (cognitive 498) src/electron/renderer/limits/windowsView.js:1030 — windowsView.createLimitWindowsView.renderProviderWindows has cognitive complexity 498 (threshold 15). Drivers by points: if/else 129 (267 pts), boolean chains 113, ternaries 22 (65 pts), loops 24 (53 pts) (nesting depth added 210). Of this number, 481 points are the body's own statements and 17 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLimitWindowsView.renderProviderWindows (cognitive 498) · ×1
  • createLimitWindowsView.renderProviderWindows (cognitive 498) src/electron/renderer/limits/windowsView.js:1030 — createLimitWindowsView.renderProviderWindows has cognitive complexity 498 (threshold 15). Drivers by points: if/else 129 (267 pts), boolean chains 109, ternaries 24 (69 pts), loops 24 (53 pts) (nesting depth added 212). Of this number, 476 points are the body's own statements and 22 belong to 35 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 · setupCursorAccountUI (cognitive 282) · ×1
  • setupCursorAccountUI (cognitive 282) REDACTED:19600 — setupCursorAccountUI has cognitive complexity 282 (threshold 15). Drivers by points: if/else 89 (161 pts), boolean chains 55, ternaries 21 (47 pts), error handling 7 (15 pts), loops 2 (4 pts) (nesting depth added 108). Of this number, 19 points are the body's own statements and 263 belong to 78 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) · ×1
  • (anonymous)::applySettingsPatch (cognitive 264) src/electron/main.js:8498 — (anonymous)::applySettingsPatch has cognitive complexity 264 (threshold 15). Drivers by points: other 114, if/else 47 (57 pts), boolean chains 43, ternaries 31, error handling 6 (13 pts), loops 3 (6 pts) (nesting depth added 20). 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 · collectUsageOnce (cognitive 216) · ×1
  • collectUsageOnce (cognitive 216) src/shared/collector.js:947 — collectUsageOnce has cognitive complexity 216 (threshold 15). Drivers by points: if/else 47 (89 pts), boolean chains 50, ternaries 24 (40 pts), loops 10 (25 pts), error handling 6 (11 pts), other 1 (nesting depth added 78). Of this number, 194 points are the body's own statements and 22 belong to 25 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 · collector.startCollector.performTick (cognitive 215) · ×1
  • collector.startCollector.performTick (cognitive 215) src/shared/collector.js:3137 — collector.startCollector.performTick has cognitive complexity 215 (threshold 15). Drivers by points: if/else 57 (114 pts), boolean chains 47, loops 9 (30 pts), ternaries 14 (20 pts), error handling 3 (4 pts) (nesting depth added 85). Of this number, 175 points are the body's own statements and 40 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 · startCollector.performTick (cognitive 184) · ×1
  • startCollector.performTick (cognitive 184) src/shared/collector.js:3137 — startCollector.performTick has cognitive complexity 184 (threshold 15). Drivers by points: if/else 57 (113 pts), boolean chains 46, ternaries 20 (34 pts), loops 9 (30 pts), error handling 3 (4 pts), other 2 (nesting depth added 92). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizePeriod (cognitive 158) · ×1
  • normalizePeriod (cognitive 158) src/shared/usage.js:1031 — normalizePeriod has cognitive complexity 158 (threshold 15). Drivers by points: if/else 30 (82 pts), boolean chains 28, loops 9 (20 pts), ternaries 7 (19 pts), other 9 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createHistoryDatabase.recordActions (cognitive 155) · ×1
  • createHistoryDatabase.recordActions (cognitive 155) src/electron/limits/historyDatabase.js:208 — createHistoryDatabase.recordActions has cognitive complexity 155 (threshold 15). Drivers by points: if/else 28 (94 pts), boolean chains 37, ternaries 4 (15 pts), loops 4 (9 pts) (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · projectResource (cognitive 151) · ×1
  • projectResource (cognitive 151) src/shared/plugins/businessData.js:252 — projectResource has cognitive complexity 151 (threshold 15). Drivers by points: ternaries 21 (60 pts), if/else 24 (43 pts), loops 10 (26 pts), boolean chains 19, other 3 (nesting depth added 74). Of this number, 143 points are the body's own statements and 8 belong to 23 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 · historyDatabase.createHistoryDatabase.recordActions (cognitive 150) · ×1
  • historyDatabase.createHistoryDatabase.recordActions (cognitive 150) src/electron/limits/historyDatabase.js:208 — historyDatabase.createHistoryDatabase.recordActions has cognitive complexity 150 (threshold 15). Drivers by points: if/else 28 (94 pts), boolean chains 35, ternaries 3 (12 pts), loops 4 (9 pts) (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trayLayout.normalizeItem (cognitive 148) · ×1
  • trayLayout.normalizeItem (cognitive 148) src/shared/trayLayout.js:382 — trayLayout.normalizeItem has cognitive complexity 148 (threshold 15). Drivers by points: ternaries 40 (118 pts), if/else 12 (14 pts), boolean chains 8, loops 3 (8 pts) (nesting depth added 85). Of this number, 141 points are the body's own statements and 7 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 · manifest.normalizeManifest (cognitive 139) · ×1
  • manifest.normalizeManifest (cognitive 139) src/shared/plugins/manifest.js:59 — manifest.normalizeManifest has cognitive complexity 139 (threshold 15). Drivers by points: if/else 42 (63 pts), boolean chains 49, ternaries 8 (14 pts), loops 9 (10 pts), error handling 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createHistoryDatabase.adopt (cognitive 139) · ×1
  • createHistoryDatabase.adopt (cognitive 139) src/electron/limits/historyDatabase.js:376 — createHistoryDatabase.adopt has cognitive complexity 139 (threshold 15). Drivers by points: if/else 23 (71 pts), loops 14 (31 pts), boolean chains 21, ternaries 4 (14 pts), other 2 (nesting depth added 75). Most of this is not in the body itself: 7 of the 139 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 387, (anonymous)::sourceFor, a function literal at line 396, …). 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 · fetchMinimaxCodeLimits (cognitive 137) · ×1
  • fetchMinimaxCodeLimits (cognitive 137) src/shared/providers/minimax/limits.js:524 — fetchMinimaxCodeLimits has cognitive complexity 137 (threshold 15). Drivers by points: if/else 23 (72 pts), ternaries 10 (27 pts), boolean chains 18, error handling 6 (16 pts), other 3, loops 1 (nesting depth added 76). Of this number, 92 points are the body's own statements and 45 belong to 7 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · historyDatabase.createHistoryDatabase.adopt (cognitive 135) · ×1
  • historyDatabase.createHistoryDatabase.adopt (cognitive 135) src/electron/limits/historyDatabase.js:376 — historyDatabase.createHistoryDatabase.adopt has cognitive complexity 135 (threshold 15). Drivers by points: if/else 23 (71 pts), loops 14 (31 pts), boolean chains 21, ternaries 3 (12 pts) (nesting depth added 74). Most of this is not in the body itself: 7 of the 135 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 387, 395, 396, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · projectRows.projectRowsForPeriod (cognitive 127) · ×1
  • projectRows.projectRowsForPeriod (cognitive 127) src/electron/renderer/projectRows.js:61 — projectRows.projectRowsForPeriod has cognitive complexity 127 (threshold 15). Drivers by points: if/else 23 (56 pts), boolean chains 44, loops 7 (15 pts), ternaries 10 (12 pts) (nesting depth added 43). Of this number, 98 points are the body's own statements and 29 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 · deltaValue (cognitive 123) · ×1
  • deltaValue (cognitive 123) src/shared/usage.js:2292 — deltaValue has cognitive complexity 123 (threshold 15). Drivers by points: if/else 29 (56 pts), boolean chains 34, ternaries 11 (28 pts), other 3, loops 1 (2 pts) (nesting depth added 45). Of this number, 119 points are the body's own statements and 4 belong to 6 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · mask.rasterizeMask (cognitive 121) · ×1
  • mask.rasterizeMask (cognitive 121) src/electron/edgeDock/mask.js:49 — mask.rasterizeMask has cognitive complexity 121 (threshold 15). Drivers by points: if/else 22 (68 pts), loops 15 (41 pts), boolean chains 8, ternaries 1 (4 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.applySessionMetadata (cognitive 121) · ×1
  • sessionMetadata.applySessionMetadata (cognitive 121) src/shared/sessionMetadata.js:471 — sessionMetadata.applySessionMetadata has cognitive complexity 121 (threshold 15). Drivers by points: if/else 31 (89 pts), boolean chains 26, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · t3SessionMetadata.readT3SessionRelationResult (cognitive 119) · ×1
  • t3SessionMetadata.readT3SessionRelationResult (cognitive 119) src/shared/t3SessionMetadata.js:217 — t3SessionMetadata.readT3SessionRelationResult has cognitive complexity 119 (threshold 15). Drivers by points: if/else 24 (57 pts), loops 11 (31 pts), boolean chains 17, ternaries 4 (9 pts), error handling 2 (5 pts) (nesting depth added 61). Of this number, 106 points are the body's own statements and 13 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 · watchPolicyEntries (cognitive 119) · ×1
  • watchPolicyEntries (cognitive 119) src/shared/collector.js:1895 — watchPolicyEntries has cognitive complexity 119 (threshold 15). Drivers by points: boolean chains 57, if/else 41 (46 pts), loops 5 (6 pts), error handling 3 (5 pts), ternaries 5 (nesting depth added 8). Of this number, 34 points are the body's own statements and 85 belong to 66 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 · renderLimitProviderCheckboxesNow (cognitive 118) · ×1
  • renderLimitProviderCheckboxesNow (cognitive 118) REDACTED:12404 — renderLimitProviderCheckboxesNow has cognitive complexity 118 (threshold 15). Drivers by points: if/else 30 (67 pts), ternaries 10 (24 pts), boolean chains 20, loops 5 (7 pts) (nesting depth added 53). Of this number, 107 points are the body's own statements and 11 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 · staticSvg.validateStaticSvg (cognitive 116) · ×1
  • staticSvg.validateStaticSvg (cognitive 116) src/shared/plugins/staticSvg.js:14 — staticSvg.validateStaticSvg has cognitive complexity 116 (threshold 15). Drivers by points: if/else 35 (88 pts), boolean chains 21, loops 3 (7 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateRow (cognitive 113) · ×1
  • updateRow (cognitive 113) REDACTED:2787 — updateRow has cognitive complexity 113 (threshold 15). Drivers by points: boolean chains 48, if/else 31 (38 pts), ternaries 21 (24 pts), loops 1 (3 pts) (nesting depth added 12). Of this number, 110 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · sessionMetadata.resolveSessionMetadata (cognitive 112) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 112) src/shared/providers/antigravity/sessionMetadata.js:145 — sessionMetadata.resolveSessionMetadata has cognitive complexity 112 (threshold 15). Drivers by points: if/else 21 (54 pts), boolean chains 25, loops 8 (21 pts), ternaries 5 (12 pts) (nesting depth added 53). Of this number, 111 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 · main.app.whenReady().then() · ×1
  • main.app.whenReady().then()::applySettingsPatch (cognitive 110) src/electron/main.js:8498 — main.app.whenReady().then()::applySettingsPatch has cognitive complexity 110 (threshold 15). Drivers by points: if/else 47 (57 pts), boolean chains 42, loops 3 (6 pts), error handling 2 (4 pts), ternaries 1 (nesting depth added 15). 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 (main.app.whenReady().then()) 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 · limits.fetchZaiLimits (cognitive 109) · ×1
  • limits.fetchZaiLimits (cognitive 109) src/shared/providers/zai/limits.js:320 — limits.fetchZaiLimits has cognitive complexity 109 (threshold 15). Drivers by points: ternaries 27 (57 pts), boolean chains 26, if/else 10 (18 pts), error handling 2 (8 pts) (nesting depth added 44). Of this number, 31 points are the body's own statements and 78 belong to 4 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · pluginSettings.createPluginSettingsPanel.render (cognitive 108) · ×1
  • pluginSettings.createPluginSettingsPanel.render (cognitive 108) src/electron/renderer/pluginSettings.js:1392 — pluginSettings.createPluginSettingsPanel.render has cognitive complexity 108 (threshold 15). Drivers by points: if/else 34 (60 pts), ternaries 6 (22 pts), loops 8 (14 pts), boolean chains 12 (nesting depth added 48). Of this number, 56 points are the body's own statements and 52 belong to 9 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 · createPluginSettingsPanel.render (cognitive 107) · ×1
  • createPluginSettingsPanel.render (cognitive 107) src/electron/renderer/pluginSettings.js:1392 — createPluginSettingsPanel.render has cognitive complexity 107 (threshold 15). Drivers by points: if/else 34 (60 pts), ternaries 7 (21 pts), loops 8 (14 pts), boolean chains 12 (nesting depth added 46). Of this number, 56 points are the body's own statements and 51 belong to 24 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 · fetch (cognitive 107) · ×1
  • fetch (cognitive 107) worker/src/index.js:462 — fetch has cognitive complexity 107 (threshold 15). Drivers by points: if/else 31 (51 pts), boolean chains 27, error handling 7 (15 pts), ternaries 6 (14 pts) (nesting depth added 36). Of this number, 90 points are the body's own statements and 17 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collector.propagateTodayProjects (cognitive 106) · ×1
  • collector.propagateTodayProjects (cognitive 106) src/shared/collector.js:693 — collector.propagateTodayProjects has cognitive complexity 106 (threshold 15). Drivers by points: if/else 28 (76 pts), boolean chains 27, loops 2 (3 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.createLimitsRuntime.commitRows (cognitive 106) · ×1
  • runtime.createLimitsRuntime.commitRows (cognitive 106) src/shared/limits/runtime.js:644 — runtime.createLimitsRuntime.commitRows has cognitive complexity 106 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 26, loops 7 (13 pts), ternaries 4 (10 pts) (nesting depth added 38). Of this number, 101 points are the body's own statements and 5 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 · createLimitsRuntime.commitRows (cognitive 105) · ×1
  • createLimitsRuntime.commitRows (cognitive 105) src/shared/limits/runtime.js:644 — createLimitsRuntime.commitRows has cognitive complexity 105 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 26, loops 7 (13 pts), ternaries 5 (9 pts) (nesting depth added 36). Of this number, 98 points are the body's own statements and 7 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 · createHub.handleRequest (cognitive 102) · ×1
  • createHub.handleRequest (cognitive 102) REDACTED:395 — createHub.handleRequest has cognitive complexity 102 (threshold 15). Drivers by points: if/else 33 (62 pts), boolean chains 19, ternaries 6 (13 pts), error handling 4 (8 pts) (nesting depth added 40). Of this number, 85 points are the body's own statements and 17 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchClaudeAccountsLimits (cognitive 101) · ×1
  • fetchClaudeAccountsLimits (cognitive 101) src/shared/providers/claude/limits.js:1363 — fetchClaudeAccountsLimits has cognitive complexity 101 (threshold 15). Drivers by points: if/else 20 (42 pts), boolean chains 32, ternaries 8 (15 pts), error handling 4 (8 pts), loops 3 (4 pts) (nesting depth added 34). Of this number, 85 points are the body's own statements and 16 belong to 21 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchOpenCodeLimits (cognitive 100) · ×1
  • fetchOpenCodeLimits (cognitive 100) src/shared/providers/opencode/limits.js:104 — fetchOpenCodeLimits has cognitive complexity 100 (threshold 15). Drivers by points: if/else 24 (45 pts), boolean chains 40, ternaries 7 (12 pts), loops 2 (3 pts) (nesting depth added 27). Of this number, 99 points are the body's own statements and 1 belongs to 17 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginSettings.createPluginSettingsPanel.pluginDetail (cognitive 98) · ×1
  • pluginSettings.createPluginSettingsPanel.pluginDetail (cognitive 98) src/electron/renderer/pluginSettings.js:1211 — pluginSettings.createPluginSettingsPanel.pluginDetail has cognitive complexity 98 (threshold 15). Drivers by points: if/else 31 (49 pts), loops 8 (19 pts), boolean chains 16, ternaries 5 (14 pts) (nesting depth added 38). Of this number, 95 points are the body's own statements and 3 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 · createPluginSettingsPanel.pluginDetail (cognitive 98) · ×1
  • createPluginSettingsPanel.pluginDetail (cognitive 98) src/electron/renderer/pluginSettings.js:1211 — createPluginSettingsPanel.pluginDetail has cognitive complexity 98 (threshold 15). Drivers by points: if/else 31 (49 pts), loops 8 (19 pts), boolean chains 15, ternaries 5 (14 pts), other 1 (nesting depth added 38). Of this number, 95 points are the body's own statements and 3 belong to 24 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 · sessionUsageArchive.updateSessionUsageArchive (cognitive 94) · ×1
  • sessionUsageArchive.updateSessionUsageArchive (cognitive 94) src/shared/usage/sessionUsageArchive.js:223 — sessionUsageArchive.updateSessionUsageArchive has cognitive complexity 94 (threshold 15). Drivers by points: if/else 17 (46 pts), boolean chains 24, ternaries 8 (17 pts), loops 4 (7 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchMinimaxApiLimits (cognitive 91) · ×1
  • limits.fetchMinimaxApiLimits (cognitive 91) src/shared/providers/minimax/limits.js:701 — limits.fetchMinimaxApiLimits has cognitive complexity 91 (threshold 15). Drivers by points: if/else 15 (39 pts), ternaries 13 (33 pts), boolean chains 16, error handling 1 (2 pts), loops 1 (nesting depth added 45). Of this number, 89 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 · clientHealthGroup (cognitive 89) · ×1
  • clientHealthGroup (cognitive 89) REDACTED:11699 — clientHealthGroup has cognitive complexity 89 (threshold 15). Drivers by points: if/else 19 (43 pts), ternaries 7 (26 pts), loops 5 (13 pts), error handling 2 (6 pts), boolean chains 1 (nesting depth added 55). Of this number, 77 points are the body's own statements and 12 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 · createNotchRenderer.notchSummary (cognitive 89) · ×1
  • createNotchRenderer.notchSummary (cognitive 89) src/electron/renderer/notch/renderer.js:250 — createNotchRenderer.notchSummary has cognitive complexity 89 (threshold 15). Drivers by points: if/else 22 (42 pts), ternaries 11 (27 pts), boolean chains 11, loops 4 (9 pts) (nesting depth added 41). Of this number, 88 points are the body's own statements and 1 belongs 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 · createSyncContentRuntime.configure (cognitive 88) · ×1
  • createSyncContentRuntime.configure (cognitive 88) src/electron/syncContentRuntime.js:384 — createSyncContentRuntime.configure has cognitive complexity 88 (threshold 15). Drivers by points: if/else 24 (54 pts), error handling 6 (16 pts), boolean chains 10, ternaries 4 (8 pts) (nesting depth added 44). Most of this is not in the body itself: 5 of the 88 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 396, 411, 464). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · sessionMetadata.resolveSessionMetadata (cognitive 87) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 87) src/shared/providers/cursor/sessionMetadata.js:195 — sessionMetadata.resolveSessionMetadata has cognitive complexity 87 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 11 (36 pts), boolean chains 12, ternaries 1 (nesting depth added 49). Of this number, 84 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 · renderToolPreferencesNow (cognitive 86) · ×1
  • renderToolPreferencesNow (cognitive 86) REDACTED:12192 — renderToolPreferencesNow has cognitive complexity 86 (threshold 15). Drivers by points: ternaries 21 (48 pts), if/else 15 (26 pts), boolean chains 10, loops 2 (nesting depth added 38). Of this number, 78 points are the body's own statements and 8 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · syncContentRuntime.createSyncContentRuntime.configure (cognitive 85) · ×1
  • syncContentRuntime.createSyncContentRuntime.configure (cognitive 85) src/electron/syncContentRuntime.js:384 — syncContentRuntime.createSyncContentRuntime.configure has cognitive complexity 85 (threshold 15). Drivers by points: if/else 24 (54 pts), error handling 6 (16 pts), boolean chains 8, ternaries 3 (7 pts) (nesting depth added 44). Most of this is not in the body itself: 4 of the 85 points are its own statements and the rest belongs to one function literal inside it that branches (line 396). 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 · server.createHub.handleRequest (cognitive 85) · ×1
  • server.createHub.handleRequest (cognitive 85) REDACTED:395 — server.createHub.handleRequest has cognitive complexity 85 (threshold 15). Drivers by points: if/else 28 (51 pts), boolean chains 18, ternaries 5 (10 pts), error handling 3 (6 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionDetail.parseDshDetailRecords (cognitive 85) · ×1
  • sessionDetail.parseDshDetailRecords (cognitive 85) src/shared/providers/dsh/sessionDetail.js:109 — sessionDetail.parseDshDetailRecords has cognitive complexity 85 (threshold 15). Drivers by points: if/else 15 (35 pts), ternaries 10 (30 pts), boolean chains 16, loops 3 (4 pts) (nesting depth added 41). Of this number, 84 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 · macLiquidGlass.createMacLiquidGlass (cognitive 81) · ×1
  • macLiquidGlass.createMacLiquidGlass (cognitive 81) src/electron/macLiquidGlass.js:122 — macLiquidGlass.createMacLiquidGlass has cognitive complexity 81 (threshold 15). Drivers by points: if/else 29 (44 pts), ternaries 13 (25 pts), boolean chains 11, error handling 1 (nesting depth added 27). Of this number, 42 points are the body's own statements and 39 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 · renderAppContent (cognitive 81) · ×1
  • renderAppContent (cognitive 81) REDACTED:7803 — renderAppContent has cognitive complexity 81 (threshold 15). Drivers by points: if/else 35 (45 pts), boolean chains 17, ternaries 8 (17 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mergeSession (cognitive 81) · ×1
  • mergeSession (cognitive 81) src/shared/usage.js:723 — mergeSession has cognitive complexity 81 (threshold 15). Drivers by points: if/else 31 (44 pts), boolean chains 33, loops 3, other 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderer.createNotchRenderer.notchSummary (cognitive 80) · ×1
  • renderer.createNotchRenderer.notchSummary (cognitive 80) src/electron/renderer/notch/renderer.js:250 — renderer.createNotchRenderer.notchSummary has cognitive complexity 80 (threshold 15). Drivers by points: if/else 22 (42 pts), ternaries 7 (18 pts), boolean chains 11, loops 4 (9 pts) (nesting depth added 36). Of this number, 79 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 · providerPresentation.limitProviderStatusLabel (cognitive 80) · ×1
  • providerPresentation.limitProviderStatusLabel (cognitive 80) src/electron/renderer/limits/providerPresentation.js:450 — providerPresentation.limitProviderStatusLabel has cognitive complexity 80 (threshold 15). Drivers by points: if/else 25 (37 pts), ternaries 11 (34 pts), boolean chains 9 (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 · aggregateDevices (cognitive 80) · ×1
  • aggregateDevices (cognitive 80) src/shared/usage.js:1963 — aggregateDevices has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 16 (32 pts), loops 13 (25 pts), if/else 6 (13 pts), boolean chains 10 (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 · t3SessionActivity.readT3Activities (cognitive 77) · ×1
  • t3SessionActivity.readT3Activities (cognitive 77) src/shared/t3SessionActivity.js:16 — t3SessionActivity.readT3Activities has cognitive complexity 77 (threshold 15). Drivers by points: if/else 12 (30 pts), ternaries 5 (24 pts), boolean chains 10, error handling 3 (7 pts), loops 3 (6 pts) (nesting depth added 44). 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 · syncSettingsForm (cognitive 77) · ×1
  • syncSettingsForm (cognitive 77) REDACTED:10080 — syncSettingsForm has cognitive complexity 77 (threshold 15). Drivers by points: if/else 26 (28 pts), ternaries 14 (22 pts), boolean chains 16, loops 8, other 3 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · startCollector.runTick (cognitive 76) · ×1
  • startCollector.runTick (cognitive 76) src/shared/collector.js:3545 — startCollector.runTick has cognitive complexity 76 (threshold 15). Drivers by points: if/else 20 (35 pts), ternaries 10 (19 pts), boolean chains 16, error handling 2 (5 pts), loops 1 (nesting depth added 27). Of this number, 72 points are the body's own statements and 4 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 · createManagedPlugins.transact · ×1
  • createManagedPlugins.transact::commit (cognitive 75) src/electron/plugins/managed.js:201 — createManagedPlugins.transact::commit has cognitive complexity 75 (threshold 15). Drivers by points: if/else 26 (47 pts), boolean chains 16, error handling 4 (9 pts), ternaries 1 (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 · managed.createManagedPlugins.transact · ×1
  • managed.createManagedPlugins.transact::commit (cognitive 74) src/electron/plugins/managed.js:201 — managed.createManagedPlugins.transact::commit has cognitive complexity 74 (threshold 15). Drivers by points: if/else 26 (47 pts), boolean chains 18, error handling 4 (9 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · netOutLiveUsage (cognitive 74) · ×1
  • netOutLiveUsage (cognitive 74) src/shared/usage/clientUsageArchive.js:408 — netOutLiveUsage has cognitive complexity 74 (threshold 15). Drivers by points: if/else 14 (42 pts), loops 7 (16 pts), boolean chains 14, ternaries 1 (2 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · macWidgetSnapshot.buildTrend (cognitive 72) · ×1
  • macWidgetSnapshot.buildTrend (cognitive 72) src/shared/macWidgetSnapshot.js:461 — macWidgetSnapshot.buildTrend has cognitive complexity 72 (threshold 15). Drivers by points: ternaries 8 (29 pts), boolean chains 19, if/else 8 (14 pts), loops 4 (10 pts) (nesting depth added 33). Of this number, 70 points are the body's own statements and 2 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 · parseCodexTranscriptData (cognitive 72) · ×1
  • parseCodexTranscriptData (cognitive 72) src/shared/sessionDetail.js:205 — parseCodexTranscriptData has cognitive complexity 72 (threshold 15). Drivers by points: if/else 17 (40 pts), ternaries 5 (15 pts), boolean chains 14, error handling 1 (2 pts), loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.fetchBailianCLI (cognitive 71) · ×1
  • cli.fetchBailianCLI (cognitive 71) src/shared/providers/alibaba/cli.js:101 — cli.fetchBailianCLI has cognitive complexity 71 (threshold 15). Drivers by points: if/else 20 (43 pts), boolean chains 19, ternaries 3 (6 pts), loops 2 (3 pts) (nesting depth added 27). Of this number, 70 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseGraphResult (cognitive 71) · ×1
  • parseGraphResult (cognitive 71) src/shared/history.js:159 — parseGraphResult has cognitive complexity 71 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 15, ternaries 7 (15 pts), loops 4 (9 pts), other 5 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.resolveSessionMetadata (cognitive 70) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 70) src/shared/providers/grok/sessionMetadata.js:124 — sessionMetadata.resolveSessionMetadata has cognitive complexity 70 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 12, ternaries 7 (12 pts), loops 4 (6 pts), error handling 2 (5 pts) (nesting depth added 29). Of this number, 67 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 · sessionUsageArchive.normalizeSessionUsageArchive (cognitive 70) · ×1
  • sessionUsageArchive.normalizeSessionUsageArchive (cognitive 70) src/shared/usage/sessionUsageArchive.js:88 — sessionUsageArchive.normalizeSessionUsageArchive has cognitive complexity 70 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 23, loops 3 (6 pts), ternaries 3 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderOpenCodeProfiles (cognitive 70) · ×1
  • renderOpenCodeProfiles (cognitive 70) REDACTED:18160 — renderOpenCodeProfiles has cognitive complexity 70 (threshold 15). Drivers by points: if/else 25 (49 pts), ternaries 6 (11 pts), boolean chains 5, loops 2 (4 pts), error handling 1 (nesting depth added 31). Most of this is not in the body itself: 3 of the 70 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 18169, (anonymous)::applyNaming, (anonymous)::applyRename, …). 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 · composer.createEdgeDockComposer.detail (cognitive 69) · ×1
  • composer.createEdgeDockComposer.detail (cognitive 69) src/electron/renderer/edgeDock/composer.js:350 — composer.createEdgeDockComposer.detail has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 13 (34 pts), if/else 19 (26 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 29). Of this number, 59 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createEdgeDockController.registerIpc (cognitive 69) · ×1
  • createEdgeDockController.registerIpc (cognitive 69) src/electron/edgeDock/controller.js:1353 — createEdgeDockController.registerIpc has cognitive complexity 69 (threshold 15). Drivers by points: if/else 34 (38 pts), boolean chains 21, error handling 6 (8 pts), other 1, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 1 of the 69 points is its own statement and the rest belongs to 20 function literals inside it that branch (lines 1369, 1405, 1456, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · collector.startCollector.runTick (cognitive 68) · ×1
  • collector.startCollector.runTick (cognitive 68) src/shared/collector.js:3545 — collector.startCollector.runTick has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 15, ternaries 8 (15 pts), error handling 1 (2 pts), loops 1 (nesting depth added 23). Of this number, 64 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 · runtime.createPluginRuntime.registerIpc (cognitive 68) · ×1
  • runtime.createPluginRuntime.registerIpc (cognitive 68) src/electron/plugins/runtime.js:606 — runtime.createPluginRuntime.registerIpc has cognitive complexity 68 (threshold 15). Drivers by points: if/else 32 (35 pts), boolean chains 21, ternaries 7, loops 3, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 68 points is its own statement and the rest belongs to 25 function items inside it that branch (a function literal at line 654, a function literal at line 716, a function literal at line 614, …). 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 · startCollector (cognitive 68) · ×1
  • startCollector (cognitive 68) src/shared/collector.js:2762 — startCollector has cognitive complexity 68 (threshold 15). Drivers by points: boolean chains 25, if/else 14 (19 pts), ternaries 11 (19 pts), error handling 2 (4 pts), loops 1 (nesting depth added 15). Of this number, 45 points are the body's own statements and 23 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 · createNotchPanel.limitColumn (cognitive 68) · ×1
  • createNotchPanel.limitColumn (cognitive 68) src/electron/renderer/notch/panel.js:857 — createNotchPanel.limitColumn has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 17 (32 pts), if/else 16 (24 pts), boolean chains 11, loops 1 (nesting depth added 23). Of this number, 67 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createPluginRuntime.registerIpc (cognitive 68) · ×1
  • createPluginRuntime.registerIpc (cognitive 68) src/electron/plugins/runtime.js:606 — createPluginRuntime.registerIpc has cognitive complexity 68 (threshold 15). Drivers by points: if/else 32 (35 pts), boolean chains 21, ternaries 7, loops 3, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 68 points is its own statement and the rest belongs to 69 function items inside it that branch (a function literal at line 654, a function literal at line 614, a function literal at line 716, …). 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 · panel.createNotchPanel.limitColumn (cognitive 67) · ×1
  • panel.createNotchPanel.limitColumn (cognitive 67) src/electron/renderer/notch/panel.js:857 — panel.createNotchPanel.limitColumn has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 14 (31 pts), if/else 16 (24 pts), boolean chains 11, loops 1 (nesting depth added 25). Of this number, 66 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 · sessionMetadata.resolveSessionMetadata (cognitive 66) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 66) src/shared/providers/dsh/sessionMetadata.js:29 — sessionMetadata.resolveSessionMetadata has cognitive complexity 66 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 15, ternaries 5 (9 pts), error handling 2 (5 pts), 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 · collector.deriveClientHealth (cognitive 66) · ×1
  • collector.deriveClientHealth (cognitive 66) src/shared/collector.js:2318 — collector.deriveClientHealth has cognitive complexity 66 (threshold 15). Drivers by points: if/else 17 (40 pts), boolean chains 14, ternaries 5 (11 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderCursorStatus (cognitive 66) · ×1
  • renderCursorStatus (cognitive 66) REDACTED:19174 — renderCursorStatus has cognitive complexity 66 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 9 (23 pts), boolean chains 9, error handling 2 (9 pts), loops 1 (2 pts) (nesting depth added 32). Of this number, 36 points are the body's own statements and 30 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · createEdgeDockComposer.detail (cognitive 66) · ×1
  • createEdgeDockComposer.detail (cognitive 66) src/electron/renderer/edgeDock/composer.js:350 — createEdgeDockComposer.detail has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 13 (31 pts), if/else 19 (26 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 26). Of this number, 56 points are the body's own statements and 10 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · businessData.createBusinessDataService.queryInternal (cognitive 65) · ×1
  • businessData.createBusinessDataService.queryInternal (cognitive 65) src/electron/plugins/businessData.js:406 — businessData.createBusinessDataService.queryInternal has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 13, ternaries 5 (8 pts), loops 2 (5 pts), error handling 2 (3 pts) (nesting depth added 20). 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 · createBusinessDataService.queryInternal (cognitive 65) · ×1
  • createBusinessDataService.queryInternal (cognitive 65) src/electron/plugins/businessData.js:406 — createBusinessDataService.queryInternal has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 13, ternaries 5 (8 pts), loops 2 (5 pts), error handling 2 (3 pts) (nesting depth added 20). Of this number, 64 points are the body's own statements and 1 belongs 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 · t3SessionMetadata.readT3SessionMeta (cognitive 64) · ×1
  • t3SessionMetadata.readT3SessionMeta (cognitive 64) src/shared/t3SessionMetadata.js:125 — t3SessionMetadata.readT3SessionMeta has cognitive complexity 64 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 9, loops 5 (8 pts), error handling 3 (6 pts), ternaries 1 (4 pts) (nesting depth added 31). Of this number, 61 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 · limits.fetchWorkbuddyAccount (cognitive 64) · ×1
  • limits.fetchWorkbuddyAccount (cognitive 64) src/shared/providers/workbuddy/limits.js:390 — limits.fetchWorkbuddyAccount has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 22 (24 pts), boolean chains 22, if/else 10 (13 pts), error handling 3 (4 pts), loops 1 (nesting depth added 6). Of this number, 35 points are the body's own statements and 29 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · applyTokscaleSessionMetadata (cognitive 64) · ×1
  • applyTokscaleSessionMetadata (cognitive 64) src/shared/sessionMetadata.js:85 — applyTokscaleSessionMetadata has cognitive complexity 64 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 15, ternaries 6 (11 pts), other 7, loops 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 · diagnosticSnapshot.createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo (cognitive 63) · ×1
  • diagnosticSnapshot.createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo (cognitive 63) src/electron/diagnosticSnapshot.js:143 — diagnosticSnapshot.createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 23 (43 pts), boolean chains 17, if/else 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 · renderHomeLimitModule (cognitive 63) · ×1
  • renderHomeLimitModule (cognitive 63) REDACTED:6913 — renderHomeLimitModule has cognitive complexity 63 (threshold 15). Drivers by points: if/else 13 (31 pts), ternaries 6 (19 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderViewPreferences (cognitive 63) · ×1
  • renderViewPreferences (cognitive 63) REDACTED:10566 — renderViewPreferences has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 14 (40 pts), if/else 12 (20 pts), boolean chains 2, loops 1 (nesting depth added 34). Of this number, 59 points are the body's own statements and 4 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 · renderCustomTrayItemCanvas (cognitive 62) · ×1
  • renderCustomTrayItemCanvas (cognitive 62) REDACTED:15934 — renderCustomTrayItemCanvas has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 12 (25 pts), boolean chains 9 (nesting depth added 24). Of this number, 54 points are the body's own statements and 8 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 · createBusinessDataService.preflight (cognitive 62) · ×1
  • createBusinessDataService.preflight (cognitive 62) src/electron/plugins/businessData.js:115 — createBusinessDataService.preflight has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 6 (12 pts), ternaries 5 (12 pts), boolean chains 9, other 2 (nesting depth added 23). Of this number, 48 points are the body's own statements and 14 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 · pluginSettings.createPluginSettingsPanel.authorSettingsSection (cognitive 61) · ×1
  • pluginSettings.createPluginSettingsPanel.authorSettingsSection (cognitive 61) src/electron/renderer/pluginSettings.js:1106 — pluginSettings.createPluginSettingsPanel.authorSettingsSection has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 15, ternaries 5 (13 pts), loops 2 (4 pts) (nesting depth added 24). Of this number, 46 points are the body's own statements and 15 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 · providerCell (cognitive 61) · ×1
  • providerCell (cognitive 61) src/electron/renderer/edgeDock/presentation.js:537 — providerCell has cognitive complexity 61 (threshold 15). Drivers by points: boolean chains 30, ternaries 23, if/else 3 (7 pts), loops 1 (nesting depth added 4). Of this number, 47 points are the body's own statements and 14 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · probe.probe (cognitive 60) · ×1
  • probe.probe (cognitive 60) REDACTED:796 — probe.probe has cognitive complexity 60 (threshold 15). Drivers by points: if/else 11 (27 pts), error handling 5 (12 pts), boolean chains 11, loops 3 (5 pts), ternaries 3 (5 pts) (nesting depth added 27). Of this number, 17 points are the body's own statements and 43 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 · businessData.createBusinessDataService.preflight (cognitive 60) · ×1
  • businessData.createBusinessDataService.preflight (cognitive 60) src/electron/plugins/businessData.js:115 — businessData.createBusinessDataService.preflight has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 6 (12 pts), ternaries 5 (12 pts), boolean chains 9 (nesting depth added 23). Of this number, 46 points are the body's own statements and 14 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 · sessionUsageArchive.applySessionUsageArchive (cognitive 60) · ×1
  • sessionUsageArchive.applySessionUsageArchive (cognitive 60) src/shared/usage/sessionUsageArchive.js:460 — sessionUsageArchive.applySessionUsageArchive has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 14, ternaries 5 (8 pts), loops 6 (7 pts) (nesting depth added 21). Of this number, 53 points are the body's own statements and 7 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 · historyModel.distribution (cognitive 60) · ×1
  • historyModel.distribution (cognitive 60) src/electron/renderer/limits/historyModel.js:62 — historyModel.distribution has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 20, loops 2, ternaries 1 (2 pts) (nesting depth added 18). Of this number, 56 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · controller.createEdgeDockController.registerIpc (cognitive 59) · ×1
  • controller.createEdgeDockController.registerIpc (cognitive 59) src/electron/edgeDock/controller.js:1353 — controller.createEdgeDockController.registerIpc has cognitive complexity 59 (threshold 15). Drivers by points: if/else 32 (33 pts), boolean chains 19, error handling 5 (6 pts), ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 59 points is its own statement and the rest belongs to 18 function literals inside it that branch (lines 1369, 1405, 1456, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · sessionMetadata.readSessionMeta (cognitive 59) · ×1
  • sessionMetadata.readSessionMeta (cognitive 59) src/shared/providers/codex/sessionMetadata.js:115 — sessionMetadata.readSessionMeta has cognitive complexity 59 (threshold 15). Drivers by points: if/else 11 (29 pts), ternaries 4 (13 pts), loops 4 (7 pts), boolean chains 5, error handling 2 (5 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.setupSmartDownloads (cognitive 59) · ×1
  • main.setupSmartDownloads (cognitive 59) site/scripts/main.js:882 — main.setupSmartDownloads has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 24, error handling 4, loops 4, ternaries 2 (nesting depth added 3). Of this number, 16 points are the body's own statements and 43 belong to 14 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · dock.sessionsContainer (cognitive 59) · ×1
  • dock.sessionsContainer (cognitive 59) REDACTED:1575 — dock.sessionsContainer has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 7 (19 pts), boolean chains 11, loops 1 (nesting depth added 25). Of this number, 47 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 · subscriptionAccountChoices (cognitive 58) · ×1
  • subscriptionAccountChoices (cognitive 58) REDACTED:3683 — subscriptionAccountChoices has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 15, loops 3, ternaries 2 (3 pts) (nesting depth added 19). Of this number, 39 points are the body's own statements and 19 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderMimoStatus (cognitive 58) · ×1
  • renderMimoStatus (cognitive 58) REDACTED:17367 — renderMimoStatus has cognitive complexity 58 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 6 (16 pts), boolean chains 10, error handling 1 (5 pts), loops 1 (2 pts) (nesting depth added 30). Of this number, 32 points are the body's own statements and 26 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 · setupCustomPricingUI (cognitive 58) · ×1
  • setupCustomPricingUI (cognitive 58) REDACTED:19422 — setupCustomPricingUI has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 13, loops 8 (10 pts), ternaries 6 (9 pts), error handling 2, other 2 (nesting depth added 11). Most of this is not in the body itself: 4 of the 58 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 19522, a function literal at line 19573, openCustomPricingForm, …). 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 · normalizeSession (cognitive 58) · ×1
  • normalizeSession (cognitive 58) src/shared/usage.js:901 — normalizeSession has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 19, loops 3 (6 pts), other 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 · sessionRowsForPeriod (cognitive 58) · ×1
  • sessionRowsForPeriod (cognitive 58) src/electron/renderer/sessionRows.js:583 — sessionRowsForPeriod has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 30, ternaries 14 (16 pts), if/else 7 (9 pts), other 2, loops 1 (nesting depth added 4). Most of this is not in the body itself: 15 of the 58 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 596, 694, 688). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · evaluator.evaluate (cognitive 57) · ×1
  • evaluator.evaluate (cognitive 57) plugins/quota-alerts/evaluator.cjs:24 — evaluator.evaluate has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 10, loops 4 (6 pts), ternaries 2 (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 · aggregateLimits (cognitive 57) · ×1
  • aggregateLimits (cognitive 57) src/shared/limits/core.js:993 — aggregateLimits has cognitive complexity 57 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 23, loops 5 (6 pts), ternaries 1 (2 pts) (nesting depth added 17). Of this number, 51 points are the body's own statements and 6 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolveTrayLayout (cognitive 57) · ×1
  • resolveTrayLayout (cognitive 57) src/shared/trayLayout.js:1039 — resolveTrayLayout has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 10 (21 pts), if/else 11 (18 pts), boolean chains 17, other 1 (nesting depth added 18). Most of this is not in the body itself: 5 of the 57 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 1056, 1041, 1136, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · parseUsageSummary (cognitive 57) · ×1
  • parseUsageSummary (cognitive 57) src/shared/providers/cursor/probe.js:158 — parseUsageSummary has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 23, ternaries 22, if/else 7 (9 pts), other 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · usage.normalizeClientName (cognitive 56) · ×1
  • usage.normalizeClientName (cognitive 56) src/shared/usage.js:285 — usage.normalizeClientName has cognitive complexity 56 (threshold 15). Drivers by points: if/else 43, boolean chains 11, loops 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 · usage.addPeriodInto (cognitive 56) · ×1
  • usage.addPeriodInto (cognitive 56) src/shared/usage.js:1873 — usage.addPeriodInto has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 17, loops 12 (17 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.readTitles (cognitive 56) · ×1
  • sessionMetadata.readTitles (cognitive 56) src/shared/providers/cursor/sessionMetadata.js:106 — sessionMetadata.readTitles has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (26 pts), error handling 8 (15 pts), loops 5 (12 pts), boolean chains 3 (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 · zcodeDiscovery.discoverZcodeConnection (cognitive 56) · ×1
  • zcodeDiscovery.discoverZcodeConnection (cognitive 56) REDACTED:232 — zcodeDiscovery.discoverZcodeConnection has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 19, ternaries 6 (12 pts) (nesting depth added 16). Of this number, 48 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · accountSlotFetcher.createAccountSlotFetcher.fetchAccountSlots · ×1
  • accountSlotFetcher.createAccountSlotFetcher.fetchAccountSlots::collect (cognitive 56) src/shared/limits/accountSlotFetcher.js:177 — accountSlotFetcher.createAccountSlotFetcher.fetchAccountSlots::collect has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 17, ternaries 5 (10 pts), loops 4 (6 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 · credentialCommands.createCredentialCommands.saveCredential (cognitive 56) · ×1
  • credentialCommands.createCredentialCommands.saveCredential (cognitive 56) src/electron/limits/credentialCommands.js:112 — credentialCommands.createCredentialCommands.saveCredential has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 12, error handling 2 (3 pts), loops 2, ternaries 2 (nesting depth added 16). Of this number, 54 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 · pluginUi.createHost.load (cognitive 56) · ×1
  • pluginUi.createHost.load (cognitive 56) src/electron/renderer/pluginUi.js:39 — pluginUi.createHost.load has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (26 pts), error handling 4 (11 pts), loops 4 (9 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 26). Most of this is not in the body itself: 4 of the 56 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 42, 56, 86, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · beginRoll (cognitive 56) · ×1
  • beginRoll (cognitive 56) src/electron/tokenNumberAnimation.js:198 — beginRoll has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 13, ternaries 10 (12 pts), loops 5 (7 pts), other 5 (nesting depth added 7). Of this number, 21 points are the body's own statements and 35 belong to 26 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 · createAccountSlotFetcher · ×1
  • createAccountSlotFetcher::fetchAccountSlots::collect (cognitive 56) src/shared/limits/accountSlotFetcher.js:177 — createAccountSlotFetcher::fetchAccountSlots::collect has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 17, ternaries 5 (10 pts), loops 4 (6 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 · createHost.load (cognitive 56) · ×1
  • createHost.load (cognitive 56) src/electron/renderer/pluginUi.js:39 — createHost.load has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (26 pts), error handling 4 (11 pts), loops 4 (9 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 26). Most of this is not in the body itself: 4 of the 56 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 42, (anonymous)::subscribe, (anonymous)::subscribe::dispose, …). 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 · readSettings (cognitive 55) · ×1
  • readSettings (cognitive 55) src/electron/main.js:2738 — readSettings has cognitive complexity 55 (threshold 15). Drivers by points: if/else 29 (31 pts), boolean chains 12, ternaries 5 (7 pts), error handling 3 (4 pts), other 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · presentation.statCell (cognitive 54) · ×1
  • presentation.statCell (cognitive 54) src/electron/renderer/edgeDock/presentation.js:740 — presentation.statCell has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 20 (36 pts), boolean chains 15, if/else 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionDetail.preflightJsonValue · ×1
  • sessionDetail.preflightJsonValue::parseValue (cognitive 54) src/shared/providers/reasonix/sessionDetail.js:509 — sessionDetail.preflightJsonValue::parseValue has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (46 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transcriptReader.readDshTranscriptRecords (cognitive 54) · ×1
  • transcriptReader.readDshTranscriptRecords (cognitive 54) src/shared/providers/dsh/transcriptReader.js:108 — transcriptReader.readDshTranscriptRecords has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (32 pts), ternaries 4 (9 pts), loops 4 (8 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 31). Of this number, 49 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 · pageSettings.render (cognitive 54) · ×1
  • pageSettings.render (cognitive 54) src/electron/renderer/notch/pageSettings.js:63 — pageSettings.render has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (23 pts), ternaries 10 (17 pts), boolean chains 12, error handling 1, loops 1 (nesting depth added 10). Of this number, 18 points are the body's own statements and 36 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 · createTrayComposer.renderItemPopover (cognitive 54) · ×1
  • createTrayComposer.renderItemPopover (cognitive 54) src/electron/renderer/trayComposer.js:1031 — createTrayComposer.renderItemPopover has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 7 (18 pts), boolean chains 12 (nesting depth added 20). Of this number, 29 points are the body's own statements and 25 belong to 15 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 · usage.addUsageRowToPeriod (cognitive 53) · ×1
  • usage.addUsageRowToPeriod (cognitive 53) src/shared/usage.js:1257 — usage.addUsageRowToPeriod has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 21, ternaries 4 (7 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 · trayComposer.createTrayComposer.renderItemPopover (cognitive 53) · ×1
  • trayComposer.createTrayComposer.renderItemPopover (cognitive 53) src/electron/renderer/trayComposer.js:1031 — trayComposer.createTrayComposer.renderItemPopover has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 7 (19 pts), boolean chains 10 (nesting depth added 21). Of this number, 29 points are the body's own statements and 24 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 · createPluginSettingsPanel.catalogDialog (cognitive 53) · ×1
  • createPluginSettingsPanel.catalogDialog (cognitive 53) src/electron/renderer/pluginSettings.js:602 — createPluginSettingsPanel.catalogDialog has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (27 pts), loops 4 (7 pts), ternaries 5 (7 pts), boolean chains 6, error handling 4 (6 pts) (nesting depth added 12). Most of this is not in the body itself: 15 of the 53 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 631, (anonymous)::loadImage, a function literal at line 699, …). 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 · buildQuota (cognitive 53) · ×1
  • buildQuota (cognitive 53) src/shared/macWidgetSnapshot.js:239 — buildQuota has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 14 (24 pts), boolean chains 21, if/else 4 (6 pts), loops 2 (nesting depth added 12). Of this number, 30 points are the body's own statements and 23 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usageSource.createCursorUsageSource.refresh · ×1
  • usageSource.createCursorUsageSource.refresh::operation (cognitive 52) src/shared/providers/cursor/usageSource.js:113 — usageSource.createCursorUsageSource.refresh::operation has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 11, loops 4 (11 pts), ternaries 2 (7 pts), error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.submitSubscription (cognitive 52) · ×1
  • app.submitSubscription (cognitive 52) REDACTED:4626 — app.submitSubscription has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 19, ternaries 11 (13 pts) (nesting depth added 9). Of this number, 50 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 · mergeDeviceRecord (cognitive 52) · ×1
  • mergeDeviceRecord (cognitive 52) src/shared/usage.js:1653 — mergeDeviceRecord has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 16 (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 · sessionActivity.readSessionActivity (cognitive 51) · ×1
  • sessionActivity.readSessionActivity (cognitive 51) src/shared/providers/claude/sessionActivity.js:46 — sessionActivity.readSessionActivity has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 13, ternaries 6 (13 pts), error handling 3 (4 pts), loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · refreshSharedSubscriptionsNow (cognitive 51) · ×1
  • refreshSharedSubscriptionsNow (cognitive 51) src/electron/main.js:4370 — refreshSharedSubscriptionsNow has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 19, ternaries 5 (9 pts), error handling 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deriveDiagnosticFindings (cognitive 51) · ×1
  • deriveDiagnosticFindings (cognitive 51) src/shared/diagnosticReport.js:676 — deriveDiagnosticFindings has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 18, ternaries 3 (8 pts), loops 2 (nesting depth added 15). Of this number, 50 points are the body's own statements and 1 belongs 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 · hubDelta.applyStatsPatch (cognitive 50) · ×1
  • hubDelta.applyStatsPatch (cognitive 50) src/shared/hubDelta.js:43 — hubDelta.applyStatsPatch has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (33 pts), ternaries 3 (8 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 22). Of this number, 47 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · identityIcon.normalizeIdentityIcon (cognitive 50) · ×1
  • identityIcon.normalizeIdentityIcon (cognitive 50) src/shared/plugins/identityIcon.js:10 — identityIcon.normalizeIdentityIcon has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 9, loops 3 (6 pts), error handling 2 (3 pts), ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · initialSetup.initialSetupPlan (cognitive 50) · ×1
  • initialSetup.initialSetupPlan (cognitive 50) src/electron/plugins/initialSetup.js:90 — initialSetup.initialSetupPlan has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 16, error handling 1 (4 pts), loops 2 (3 pts) (nesting depth added 17). Of this number, 47 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 · sessionContext.readCodexSessionState (cognitive 50) · ×1
  • sessionContext.readCodexSessionState (cognitive 50) src/shared/providers/codex/sessionContext.js:109 — sessionContext.readCodexSessionState has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 12, loops 4 (8 pts), ternaries 3 (5 pts), error handling 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preserveUntrackedClientUsage (cognitive 50) · ×1
  • preserveUntrackedClientUsage (cognitive 50) src/shared/usage.js:1535 — preserveUntrackedClientUsage has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (31 pts), boolean chains 11, loops 4 (8 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 · createDiagnosticSnapshotBuilder.build (cognitive 50) · ×1
  • createDiagnosticSnapshotBuilder.build (cognitive 50) src/electron/diagnosticSnapshot.js:261 — createDiagnosticSnapshotBuilder.build has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 27, ternaries 11 (14 pts), other 6, if/else 3 (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 · limits.fetchVolcengineLimits (cognitive 49) · ×1
  • limits.fetchVolcengineLimits (cognitive 49) src/shared/providers/volcengine/limits.js:511 — limits.fetchVolcengineLimits has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 14, if/else 10 (14 pts), error handling 2 (4 pts) (nesting depth added 13). Of this number, 46 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 · islands.HeroDashboard (cognitive 49) · ×1
  • islands.HeroDashboard (cognitive 49) site/scripts/islands.jsx:487 — islands.HeroDashboard has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 19 (27 pts), if/else 17, boolean chains 5 (nesting depth added 8). Most of this is not in the body itself: 14 of the 49 points are its own statements and the rest belongs to 13 function items inside it that branch (moveHeatFocus, updateHeatTooltip, a function literal at line 604, …). 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 · renderExternalProviderStatus (cognitive 49) · ×1
  • renderExternalProviderStatus (cognitive 49) REDACTED:17902 — renderExternalProviderStatus has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 30, if/else 12, ternaries 5 (6 pts), other 1 (nesting depth added 1). Of this number, 46 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · createLimitWindowsView.renderLimitProviderRow (cognitive 49) · ×1
  • createLimitWindowsView.renderLimitProviderRow (cognitive 49) src/electron/renderer/limits/windowsView.js:2546 — createLimitWindowsView.renderLimitProviderRow has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 15, error handling 1 (2 pts) (nesting depth added 16). Most of this is not in the body itself: 9 of the 49 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 2558, openHistory, a function literal at line 2584, …). 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 · createPluginSettingsPanel.catalogPanel · ×1
  • createPluginSettingsPanel.catalogPanel::renderResults (cognitive 49) src/electron/renderer/pluginSettings.js:734 — createPluginSettingsPanel.catalogPanel::renderResults has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (32 pts), ternaries 2 (7 pts), boolean chains 6, loops 2 (3 pts), other 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 · normalizeProviderBalance (cognitive 49) · ×1
  • normalizeProviderBalance (cognitive 49) src/shared/limits/core.js:234 — normalizeProviderBalance has cognitive complexity 49 (threshold 15). Drivers by points: other 24, boolean chains 18, ternaries 5, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · createEdgeDockIntent.tick (cognitive 49) · ×1
  • createEdgeDockIntent.tick (cognitive 49) src/electron/edgeDock/geometry.js:433 — createEdgeDockIntent.tick has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 10, ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchOpenCodeProfile (cognitive 49) · ×1
  • fetchOpenCodeProfile (cognitive 49) src/shared/providers/opencode/limits.js:332 — fetchOpenCodeProfile has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 22, if/else 10 (15 pts), ternaries 8 (11 pts), error handling 1 (nesting depth added 8). Of this number, 45 points are the body's own statements and 4 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 · hubProfiles.prepareHubProfilePatch (cognitive 48) · ×1
  • hubProfiles.prepareHubProfilePatch (cognitive 48) src/electron/hubProfiles.js:39 — hubProfiles.prepareHubProfilePatch has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 15, error handling 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginContent.create.render (cognitive 48) · ×1
  • pluginContent.create.render (cognitive 48) src/electron/renderer/pluginContent.js:83 — pluginContent.create.render has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 12, loops 7 (8 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 16). Of this number, 38 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginSettings.createPluginSettingsPanel.catalogPanel · ×1
  • pluginSettings.createPluginSettingsPanel.catalogPanel::renderResults (cognitive 48) src/electron/renderer/pluginSettings.js:734 — pluginSettings.createPluginSettingsPanel.catalogPanel::renderResults has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (32 pts), ternaries 2 (7 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createEdgeDockController.placeSurface (cognitive 48) · ×1
  • createEdgeDockController.placeSurface (cognitive 48) src/electron/edgeDock/controller.js:821 — createEdgeDockController.placeSurface has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 14, error handling 3 (7 pts), ternaries 6, other 2 (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 · createNotchController.sync (cognitive 48) · ×1
  • createNotchController.sync (cognitive 48) src/electron/notch/controller.js:821 — createNotchController.sync has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 7, error handling 2 (7 pts), ternaries 4 (6 pts), loops 2 (4 pts) (nesting depth added 19). Of this number, 35 points are the body's own statements and 13 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 · trayLayout.resolveTrayLayout.items (cognitive 47) · ×1
  • trayLayout.resolveTrayLayout.items (cognitive 47) src/shared/trayLayout.js:1056 — trayLayout.resolveTrayLayout.items has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 11 (18 pts), boolean chains 9 (nesting depth added 19). Of this number, 34 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 · geometry.createEdgeDockIntent.tick (cognitive 47) · ×1
  • geometry.createEdgeDockIntent.tick (cognitive 47) src/electron/edgeDock/geometry.js:433 — geometry.createEdgeDockIntent.tick has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionActivity.discoverFilesUncached (cognitive 47) · ×1
  • sessionActivity.discoverFilesUncached (cognitive 47) src/shared/providers/codex/sessionActivity.js:46 — sessionActivity.discoverFilesUncached has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 5 (12 pts), loops 5 (11 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 20). Of this number, 32 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 · main.setupWidgetHeat (cognitive 47) · ×1
  • main.setupWidgetHeat (cognitive 47) site/scripts/main.js:1412 — main.setupWidgetHeat has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 8, loops 4 (6 pts), ternaries 3, error handling 1 (nesting depth added 14). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 1485, a function literal at line 1426, renderMonths). 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 · windowText.limitWindowText (cognitive 47) · ×1
  • windowText.limitWindowText (cognitive 47) src/shared/limits/windowText.js:127 — windowText.limitWindowText has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 11, ternaries 5 (9 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 · settings.normalizeSettings (cognitive 46) · ×1
  • settings.normalizeSettings (cognitive 46) src/shared/plugins/settings.js:33 — settings.normalizeSettings has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 16, loops 2 (3 pts) (nesting depth added 11). Most of this is not in the body itself: 8 of the 46 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 39, 77, 58, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · controller.createNotchController.sync (cognitive 46) · ×1
  • controller.createNotchController.sync (cognitive 46) src/electron/notch/controller.js:821 — controller.createNotchController.sync has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 7, ternaries 4 (7 pts), error handling 1 (4 pts), loops 2 (4 pts) (nesting depth added 18). Of this number, 33 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 · controller.createEdgeDockController.placeSurface (cognitive 46) · ×1
  • controller.createEdgeDockController.placeSurface (cognitive 46) src/electron/edgeDock/controller.js:821 — controller.createEdgeDockController.placeSurface has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 14, error handling 3 (7 pts), ternaries 5 (6 pts) (nesting depth added 9). 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 · data.buildNotchData (cognitive 46) · ×1
  • data.buildNotchData (cognitive 46) src/electron/notch/data.js:169 — data.buildNotchData has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 10 (14 pts), boolean chains 10, loops 3 (5 pts) (nesting depth added 14). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.createWindow (cognitive 46) · ×1
  • main.createWindow (cognitive 46) src/electron/main.js:7891 — main.createWindow has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (28 pts), ternaries 9 (10 pts), boolean chains 7, loops 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 30 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · createPluginSettingsPanel.replaceContent (cognitive 46) · ×1
  • createPluginSettingsPanel.replaceContent (cognitive 46) src/electron/renderer/pluginSettings.js:1331 — createPluginSettingsPanel.replaceContent has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 6 (10 pts), ternaries 4 (7 pts), boolean chains 5 (nesting depth added 18). Of this number, 45 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createNotchPanel.fitTabs (cognitive 46) · ×1
  • createNotchPanel.fitTabs (cognitive 46) src/electron/renderer/notch/panel.js:117 — createNotchPanel.fitTabs has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 11, ternaries 8 (11 pts), loops 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · paths.projectCwds (cognitive 45) · ×1
  • paths.projectCwds (cognitive 45) src/shared/providers/senpi/paths.js:41 — paths.projectCwds has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 6, error handling 3 (6 pts), ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lazySessions.createSessionBacking.measure (cognitive 45) · ×1
  • lazySessions.createSessionBacking.measure (cognitive 45) src/electron/plugins/lazySessions.js:57 — lazySessions.createSessionBacking.measure has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 6, loops 3 (5 pts), error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 21). Of this number, 40 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.startStatsStream (cognitive 45) · ×1
  • main.startStatsStream (cognitive 45) src/electron/main.js:5597 — main.startStatsStream has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 9, loops 2 (3 pts), ternaries 2 (3 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 · windowsView.createLimitWindowsView.renderLimitProviderRow (cognitive 45) · ×1
  • windowsView.createLimitWindowsView.renderLimitProviderRow (cognitive 45) src/electron/renderer/limits/windowsView.js:2546 — windowsView.createLimitWindowsView.renderLimitProviderRow has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 13 (nesting depth added 15). Most of this is not in the body itself: 14 of the 45 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 2584, openHistory, a function literal at line 2573, …). 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 · createPluginSettingsPanel.authorSettingsSection (cognitive 45) · ×1
  • createPluginSettingsPanel.authorSettingsSection (cognitive 45) src/electron/renderer/pluginSettings.js:1106 — createPluginSettingsPanel.authorSettingsSection has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (32 pts), ternaries 14 (25 pts), boolean chains 14, loops 4 (6 pts), other 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchMimoAccount (cognitive 45) · ×1
  • fetchMimoAccount (cognitive 45) src/shared/providers/mimo/limits.js:280 — fetchMimoAccount has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 17, ternaries 9 (12 pts), error handling 5 (11 pts), if/else 4, other 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 · fetchWorkbuddyLimits (cognitive 45) · ×1
  • fetchWorkbuddyLimits (cognitive 45) src/shared/providers/workbuddy/limits.js:554 — fetchWorkbuddyLimits has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 28, if/else 6 (11 pts), ternaries 4, loops 2 (nesting depth added 5). Of this number, 33 points are the body's own statements and 12 belong to 8 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · hubDelta.statsPatch · ×1
  • hubDelta.statsPatch::visit (cognitive 44) src/shared/hubDelta.js:12 — hubDelta.statsPatch::visit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 3 (9 pts), boolean chains 7 (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 · limits.fetchAlibabaLimits (cognitive 44) · ×1
  • limits.fetchAlibabaLimits (cognitive 44) src/shared/providers/alibaba/limits.js:935 — limits.fetchAlibabaLimits has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 9 (17 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagnosticReport.renderReport (cognitive 44) · ×1
  • diagnosticReport.renderReport (cognitive 44) src/shared/diagnosticReport.js:977 — diagnosticReport.renderReport has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 11, loops 6 (10 pts), if/else 5 (6 pts) (nesting depth added 12). Of this number, 30 points are the body's own statements and 14 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 · accountSlotService.createAccountSlotService.save (cognitive 44) · ×1
  • accountSlotService.createAccountSlotService.save (cognitive 44) src/electron/limits/accountSlotService.js:64 — accountSlotService.createAccountSlotService.save has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 23, ternaries 9 (13 pts), if/else 8 (nesting depth added 4). None of this is in the body itself: all 44 points belong to 4 function literals inside it that branch (lines 78, 65, 122, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sessionDetail.parseCodebuddyTranscriptLines (cognitive 44) · ×1
  • sessionDetail.parseCodebuddyTranscriptLines (cognitive 44) src/shared/sessionDetail.js:311 — sessionDetail.parseCodebuddyTranscriptLines has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 10, error handling 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · displaySettings.create (cognitive 44) · ×1
  • displaySettings.create (cognitive 44) src/electron/renderer/displaySettings.js:18 — displaySettings.create has cognitive complexity 44 (threshold 15). Drivers by points: loops 9 (20 pts), if/else 6 (14 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 21). Of this number, 39 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · sessionRows.groupSubagentRows (cognitive 43) · ×1
  • sessionRows.groupSubagentRows (cognitive 43) src/electron/renderer/sessionRows.js:714 — sessionRows.groupSubagentRows has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 6 (9 pts), loops 5, boolean chains 4 (nesting depth added 14). Of this number, 29 points are the body's own statements and 14 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionActivityProjection.codexActivityCandidates (cognitive 43) · ×1
  • sessionActivityProjection.codexActivityCandidates (cognitive 43) src/shared/sessionActivityProjection.js:132 — sessionActivityProjection.codexActivityCandidates has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 8 (17 pts), boolean chains 5 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · controller.createNotchController (cognitive 43) · ×1
  • controller.createNotchController (cognitive 43) src/electron/notch/controller.js:95 — controller.createNotchController has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 14, error handling 1, loops 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 903, 941, 959, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · sessionMetadata.applyLongLineFragments (cognitive 43) · ×1
  • sessionMetadata.applyLongLineFragments (cognitive 43) src/shared/providers/claude/sessionMetadata.js:435 — sessionMetadata.applyLongLineFragments has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (26 pts), error handling 2 (7 pts), boolean chains 6, ternaries 2 (4 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 · sessionMetadata.resolveSessionMetadata (cognitive 43) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 43) src/shared/providers/devin/sessionMetadata.js:94 — sessionMetadata.resolveSessionMetadata has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (33 pts), boolean chains 5, loops 2 (3 pts), ternaries 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchCursorAccountLimits (cognitive 43) · ×1
  • limits.fetchCursorAccountLimits (cognitive 43) src/shared/providers/cursor/limits.js:141 — limits.fetchCursorAccountLimits has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 19, if/else 13 (16 pts), ternaries 6 (8 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 · runtime.createPluginRuntime.changePackage (cognitive 43) · ×1
  • runtime.createPluginRuntime.changePackage (cognitive 43) src/electron/plugins/runtime.js:495 — runtime.createPluginRuntime.changePackage has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 7, loops 5 (6 pts), error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 13). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionUsageArchive.addSessionBreakdown (cognitive 43) · ×1
  • sessionUsageArchive.addSessionBreakdown (cognitive 43) src/shared/usage/sessionUsageArchive.js:364 — sessionUsageArchive.addSessionBreakdown has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 9 (22 pts), if/else 8 (12 pts), boolean chains 8, 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 · accountSlotMigration.migrateAccountSlots (cognitive 43) · ×1
  • accountSlotMigration.migrateAccountSlots (cognitive 43) src/electron/limits/accountSlotMigration.js:14 — accountSlotMigration.migrateAccountSlots has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 15, ternaries 2 (6 pts), loops 3 (5 pts) (nesting depth added 15). Of this number, 40 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 · pluginSettings.createPluginSettingsPanel.replaceContent (cognitive 43) · ×1
  • pluginSettings.createPluginSettingsPanel.replaceContent (cognitive 43) src/electron/renderer/pluginSettings.js:1331 — pluginSettings.createPluginSettingsPanel.replaceContent has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 6 (10 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 17). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startIcloudCollector (cognitive 43) · ×1
  • startIcloudCollector (cognitive 43) src/electron/main.js:4637 — startIcloudCollector has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 14, error handling 2 (3 pts), ternaries 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 25 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createPluginRuntime (cognitive 43) · ×1
  • createPluginRuntime (cognitive 43) src/electron/plugins/runtime.js:49 — createPluginRuntime has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 7, boolean chains 6, error handling 3, ternaries 3 (nesting depth added 8). Most of this is not in the body itself: 5 of the 43 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 323, a function literal at line 313, changed, …). 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 · createPluginRuntime.changePackage (cognitive 43) · ×1
  • createPluginRuntime.changePackage (cognitive 43) src/electron/plugins/runtime.js:495 — createPluginRuntime.changePackage has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 7, loops 5 (6 pts), error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 13). Of this number, 42 points are the body's own statements and 1 belongs to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parsePiTranscriptLines (cognitive 43) · ×1
  • parsePiTranscriptLines (cognitive 43) src/shared/sessionDetail.js:410 — parsePiTranscriptLines has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 6 (17 pts), if/else 7 (15 pts), boolean chains 7, error handling 1 (2 pts), loops 1, other 1 (nesting depth added 20). Of this number, 42 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanZstdFrames (cognitive 43) · ×1
  • scanZstdFrames (cognitive 43) src/shared/providers/dsh/sessionFiles.js:163 — scanZstdFrames has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (29 pts), ternaries 5 (11 pts), loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo (cognitive 43) · ×1
  • createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo (cognitive 43) src/electron/diagnosticSnapshot.js:143 — createDiagnosticSnapshotBuilder.diagnosticRuntimeInfo has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 23, boolean chains 17, if/else 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 · session.readSessionMeta (cognitive 42) · ×1
  • session.readSessionMeta (cognitive 42) src/shared/providers/opencode/session.js:174 — session.readSessionMeta has cognitive complexity 42 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 3 (9 pts), loops 3 (6 pts), error handling 2 (5 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchMinimaxLimits (cognitive 42) · ×1
  • limits.fetchMinimaxLimits (cognitive 42) src/shared/providers/minimax/limits.js:878 — limits.fetchMinimaxLimits has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 16, if/else 7 (12 pts), ternaries 8 (9 pts), loops 2 (5 pts) (nesting depth added 9). Of this number, 34 points are the body's own statements and 8 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 · panel.createNotchPanel.fitTabs (cognitive 42) · ×1
  • panel.createNotchPanel.fitTabs (cognitive 42) src/electron/renderer/notch/panel.js:117 — panel.createNotchPanel.fitTabs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 11, ternaries 6 (7 pts), loops 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · history.resolveMacWidgetHistory (cognitive 42) · ×1
  • history.resolveMacWidgetHistory (cognitive 42) src/electron/macWidget/history.js:85 — history.resolveMacWidgetHistory has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 18, if/else 13 (15 pts), ternaries 6 (7 pts), error handling 1 (2 pts) (nesting depth added 4). Of this number, 30 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · fetchMinimaxCodeRows (cognitive 42) · ×1
  • fetchMinimaxCodeRows (cognitive 42) src/shared/providers/minimax/limits.js:653 — fetchMinimaxCodeRows has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 19, if/else 7 (11 pts), ternaries 5 (10 pts), error handling 1, loops 1 (nesting depth added 9). Of this number, 32 points are the body's own statements and 10 belong to 13 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · selfSync.createAntigravitySelfSync.maybeSyncAntigravity (cognitive 41) · ×1
  • selfSync.createAntigravitySelfSync.maybeSyncAntigravity (cognitive 41) src/shared/providers/antigravity/selfSync.js:156 — selfSync.createAntigravitySelfSync.maybeSyncAntigravity has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (28 pts), boolean chains 8, error handling 2 (3 pts), ternaries 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 25 belong to 7 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · sessionActivity.readSessionActivity (cognitive 41) · ×1
  • sessionActivity.readSessionActivity (cognitive 41) src/shared/providers/codex/sessionActivity.js:150 — sessionActivity.readSessionActivity has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 8, ternaries 4 (8 pts), error handling 1 (4 pts), loops 2 (nesting depth added 18). Of this number, 40 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 · dailyHistoryArchive.captureDailyHistoryArchive (cognitive 41) · ×1
  • dailyHistoryArchive.captureDailyHistoryArchive (cognitive 41) src/shared/dailyHistoryArchive.js:328 — dailyHistoryArchive.captureDailyHistoryArchive has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 13, loops 5 (10 pts), ternaries 1 (2 pts) (nesting depth added 13). Of this number, 37 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 · sessions.readReasonixNativeSession (cognitive 41) · ×1
  • sessions.readReasonixNativeSession (cognitive 41) src/shared/providers/reasonix/sessions.js:309 — sessions.readReasonixNativeSession has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 25 (26 pts), boolean chains 11, if/else 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ignoreDesktopTranscriptPath (cognitive 41) · ×1
  • ignoreDesktopTranscriptPath (cognitive 41) src/shared/collector.js:1828 — ignoreDesktopTranscriptPath has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 11, ternaries 3 (8 pts), error handling 2 (5 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 · createNotchRenderer.renderNotch (cognitive 41) · ×1
  • createNotchRenderer.renderNotch (cognitive 41) src/electron/renderer/notch/renderer.js:605 — createNotchRenderer.renderNotch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (9 pts), boolean chains 8, ternaries 4 (6 pts) (nesting depth added 15). Of this number, 40 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createIcloudSyncRuntime.reconcile (cognitive 41) · ×1
  • createIcloudSyncRuntime.reconcile (cognitive 41) src/electron/icloudSyncRuntime.js:225 — createIcloudSyncRuntime.reconcile has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 15, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 7). Most of this is not in the body itself: 4 of the 41 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 236, 299, 292, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · items.normalizeItem (cognitive 40) · ×1
  • items.normalizeItem (cognitive 40) src/electron/renderer/edgeDock/items.js:87 — items.normalizeItem has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 8 (20 pts), boolean chains 10, if/else 7 (10 pts) (nesting depth added 15). Of this number, 38 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 · controller.createEdgeDockController.poll (cognitive 40) · ×1
  • controller.createEdgeDockController.poll (cognitive 40) src/electron/edgeDock/controller.js:1219 — controller.createEdgeDockController.poll has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 13, ternaries 5 (12 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 · sessionDetail.consumeReplayLine (cognitive 40) · ×1
  • sessionDetail.consumeReplayLine (cognitive 40) src/shared/providers/reasonix/sessionDetail.js:622 — sessionDetail.consumeReplayLine has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 12, ternaries 5 (7 pts), error handling 2 (nesting depth added 8). Of this number, 39 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 · tokenRatePresentation.createLiveTokenRateTracker.observe (cognitive 40) · ×1
  • tokenRatePresentation.createLiveTokenRateTracker.observe (cognitive 40) src/electron/renderer/tokenRatePresentation.js:139 — tokenRatePresentation.createLiveTokenRateTracker.observe has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 11, loops 2 (6 pts), 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 · themePresets.themeCssVarEntries (cognitive 40) · ×1
  • themePresets.themeCssVarEntries (cognitive 40) src/electron/renderer/themePresets.js:148 — themePresets.themeCssVarEntries has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 13 (26 pts), if/else 4 (8 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginSettings.createPluginSettingsPanel.catalogDialog (cognitive 40) · ×1
  • pluginSettings.createPluginSettingsPanel.catalogDialog (cognitive 40) src/electron/renderer/pluginSettings.js:602 — pluginSettings.createPluginSettingsPanel.catalogDialog has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 6, loops 3 (5 pts), ternaries 4 (5 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 12 of the 40 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 631, 643, 688, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · renderViewSwitcher (cognitive 40) · ×1
  • renderViewSwitcher (cognitive 40) REDACTED:6651 — renderViewSwitcher has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 9 (12 pts), boolean chains 8, loops 1 (nesting depth added 5). Of this number, 21 points are the body's own statements and 19 belong to 13 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 · readClaudeCredentials (cognitive 40) · ×1
  • readClaudeCredentials (cognitive 40) src/shared/providers/claude/limits.js:209 — readClaudeCredentials has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 10, error handling 4 (9 pts), ternaries 1 (2 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 · createEdgeDockController.poll (cognitive 40) · ×1
  • createEdgeDockController.poll (cognitive 40) src/electron/edgeDock/controller.js:1219 — createEdgeDockController.poll has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 15, if/else 8 (14 pts), ternaries 5 (10 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 · graphFromDailyHistoryArchive (cognitive 40) · ×1
  • graphFromDailyHistoryArchive (cognitive 40) src/shared/dailyHistoryArchive.js:672 — graphFromDailyHistoryArchive has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (9 pts), ternaries 6 (9 pts), boolean chains 7 (nesting depth added 15). Of this number, 37 points are the body's own statements and 3 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 · createLocalUsageSource.notification (cognitive 40) · ×1
  • createLocalUsageSource.notification (cognitive 40) src/shared/providers/codex/localUsageSource.js:227 — createLocalUsageSource.notification has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 12, ternaries 2 (3 pts), 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 · accountIdentity.dedupeAccounts (cognitive 39) · ×1
  • accountIdentity.dedupeAccounts (cognitive 39) src/electron/renderer/accountIdentity.js:293 — accountIdentity.dedupeAccounts has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 4 (6 pts), ternaries 1 (5 pts), boolean chains 4 (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 · lazySessions.buildSessionIndex (cognitive 39) · ×1
  • lazySessions.buildSessionIndex (cognitive 39) src/electron/plugins/lazySessions.js:163 — lazySessions.buildSessionIndex has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 3 (9 pts), loops 5 (8 pts), boolean chains 6 (nesting depth added 19). Of this number, 37 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · accountSettings.assertAccountForm (cognitive 39) · ×1
  • accountSettings.assertAccountForm (cognitive 39) src/electron/limits/accountSettings.js:291 — accountSettings.assertAccountForm has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 12, loops 3 (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 · deviceFlow.pollForAccessToken (cognitive 39) · ×1
  • deviceFlow.pollForAccessToken (cognitive 39) src/shared/providers/copilot/deviceFlow.js:146 — deviceFlow.pollForAccessToken has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 7, ternaries 4 (7 pts), error handling 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startCollector.performTick · ×1
  • startCollector.performTick::onProgress (cognitive 39) src/shared/collector.js:3259 — startCollector.performTick::onProgress has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 6 (14 pts), boolean chains 3, loops 1 (3 pts), 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 · createTrayComposer.sourceEditor (cognitive 39) · ×1
  • createTrayComposer.sourceEditor (cognitive 39) src/electron/renderer/trayComposer.js:786 — createTrayComposer.sourceEditor has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 12, ternaries 6 (11 pts) (nesting depth added 8). Of this number, 37 points are the body's own statements and 2 belong to 13 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchGrokRpcBilling (cognitive 39) · ×1
  • fetchGrokRpcBilling (cognitive 39) src/shared/providers/grok/limits.js:513 — fetchGrokRpcBilling has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 9, error handling 4 (7 pts), ternaries 1 (2 pts), loops 1, other 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 39 points are its own statements and the rest belongs to 10 function items inside it that branch ((anonymous)::handleMessage, a function literal at line 611, (anonymous)::cleanup, …). 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 · createLiveTokenRateTracker.observe (cognitive 39) · ×1
  • createLiveTokenRateTracker.observe (cognitive 39) src/electron/renderer/tokenRatePresentation.js:139 — createLiveTokenRateTracker.observe has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 10, loops 2 (6 pts), ternaries 1 (nesting depth added 12). Of this number, 37 points are the body's own statements and 2 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · buildSyncPayload (cognitive 39) · ×1
  • buildSyncPayload (cognitive 39) src/shared/syncPayload.js:186 — buildSyncPayload has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 10). Of this number, 37 points are the body's own statements and 2 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · presentation.sessionSourceRows (cognitive 38) · ×1
  • presentation.sessionSourceRows (cognitive 38) src/electron/renderer/edgeDock/presentation.js:236 — presentation.sessionSourceRows has cognitive complexity 38 (threshold 15). Drivers by points: if/else 5 (15 pts), ternaries 2 (9 pts), boolean chains 8, loops 4 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · desktopSessionTitles.readDesktopSessionTitles (cognitive 38) · ×1
  • desktopSessionTitles.readDesktopSessionTitles (cognitive 38) src/shared/providers/claude/desktopSessionTitles.js:73 — desktopSessionTitles.readDesktopSessionTitles has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (13 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (nesting depth added 21). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · arkcli.fetchArkcliLimits (cognitive 38) · ×1
  • arkcli.fetchArkcliLimits (cognitive 38) src/shared/providers/volcengine/arkcli.js:208 — arkcli.fetchArkcliLimits has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 10, loops 4 (7 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 7). Of this number, 33 points are the body's own statements and 5 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 · syncContent.normalizeSharedSyncValue (cognitive 38) · ×1
  • syncContent.normalizeSharedSyncValue (cognitive 38) src/shared/syncContent.js:37 — syncContent.normalizeSharedSyncValue has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 4 (10 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 17). Most of this is not in the body itself: 10 of the 38 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 59, 53, 76, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · historyModel.observationPoints (cognitive 38) · ×1
  • historyModel.observationPoints (cognitive 38) src/electron/renderer/limits/historyModel.js:159 — historyModel.observationPoints has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 7 (24 pts), if/else 3 (8 pts), boolean chains 3, loops 2 (3 pts) (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 · windowsView.createLimitWindowsView.thirdPartySpendNode (cognitive 38) · ×1
  • windowsView.createLimitWindowsView.thirdPartySpendNode (cognitive 38) src/electron/renderer/limits/windowsView.js:655 — windowsView.createLimitWindowsView.thirdPartySpendNode has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 10 (15 pts), if/else 10 (13 pts), boolean chains 10 (nesting depth added 8). Of this number, 35 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 · trayComposer.createTrayComposer.openPickerMenu (cognitive 38) · ×1
  • trayComposer.createTrayComposer.openPickerMenu (cognitive 38) src/electron/renderer/trayComposer.js:425 — trayComposer.createTrayComposer.openPickerMenu has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 5 (9 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 9). Most of this is not in the body itself: 4 of the 38 points are its own statements and the rest belongs to 8 function items inside it that branch (renderChoices, a function literal at line 508, focusOption, …). 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 · clientHealthActions (cognitive 38) · ×1
  • clientHealthActions (cognitive 38) REDACTED:11915 — clientHealthActions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 4 (10 pts), boolean chains 7, error handling 2 (6 pts) (nesting depth added 17). Of this number, 18 points are the body's own statements and 20 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderCodexAccounts (cognitive 38) · ×1
  • renderCodexAccounts (cognitive 38) REDACTED:16858 — renderCodexAccounts has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 10, ternaries 3 (7 pts), error handling 1 (4 pts), loops 1 (2 pts) (nesting depth added 14). Of this number, 17 points are the body's own statements and 21 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 · collectHistoryOnce (cognitive 38) · ×1
  • collectHistoryOnce (cognitive 38) src/shared/collector.js:832 — collectHistoryOnce has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, ternaries 5 (6 pts), error handling 3 (5 pts) (nesting depth added 11). Of this number, 33 points are the body's own statements and 5 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 · projectHubDevices (cognitive 38) · ×1
  • projectHubDevices (cognitive 38) src/shared/diagnosticReport.js:216 — projectHubDevices has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 17, ternaries 11, if/else 6 (8 pts), loops 1, other 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 21 belong to 7 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 · trayText.pickConfiguredLimitProviders (cognitive 37) · ×1
  • trayText.pickConfiguredLimitProviders (cognitive 37) src/shared/trayText.js:373 — trayText.pickConfiguredLimitProviders has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 4 (10 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 19). Of this number, 28 points are the body's own statements and 9 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 · renderer.createNotchRenderer.render (cognitive 37) · ×1
  • renderer.createNotchRenderer.render (cognitive 37) src/electron/renderer/notch/renderer.js:605 — renderer.createNotchRenderer.render has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (9 pts), boolean chains 8, ternaries 2 (nesting depth added 13). Of this number, 36 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 · t3SessionMetadata.t3TitleQueries (cognitive 37) · ×1
  • t3SessionMetadata.t3TitleQueries (cognitive 37) src/shared/t3SessionMetadata.js:80 — t3SessionMetadata.t3TitleQueries has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 8 (25 pts), boolean chains 6, if/else 4 (6 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · extension.findExtensionSessions (cognitive 37) · ×1
  • extension.findExtensionSessions (cognitive 37) src/shared/providers/codebuddy/extension.js:222 — extension.findExtensionSessions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 4 (10 pts), boolean chains 7, ternaries 1 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.applyT3SessionParents (cognitive 37) · ×1
  • sessionMetadata.applyT3SessionParents (cognitive 37) src/shared/sessionMetadata.js:379 — sessionMetadata.applyT3SessionParents has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 19, loops 7 (11 pts), ternaries 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sessionMetadata.applyT3SessionParents::index) 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 · limits.linkMinimaxAccounts (cognitive 37) · ×1
  • limits.linkMinimaxAccounts (cognitive 37) src/shared/providers/minimax/limits.js:826 — limits.linkMinimaxAccounts has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 24, if/else 7 (8 pts), ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 3). Of this number, 36 points are the body's own statements and 1 belongs to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · runtime.createLimitsRuntime.clear (cognitive 37) · ×1
  • runtime.createLimitsRuntime.clear (cognitive 37) src/shared/limits/runtime.js:953 — runtime.createLimitsRuntime.clear has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (11 pts), boolean chains 6, ternaries 2 (4 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 · catalog.createPluginCatalog.list (cognitive 37) · ×1
  • catalog.createPluginCatalog.list (cognitive 37) src/electron/plugins/catalog.js:40 — catalog.createPluginCatalog.list has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 9 (24 pts), boolean chains 11, loops 2 (nesting depth added 15). Of this number, 28 points are the body's own statements and 9 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 · domReconcile.create.patch (cognitive 37) · ×1
  • domReconcile.create.patch (cognitive 37) src/electron/renderer/domReconcile.js:48 — domReconcile.create.patch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (8 pts), boolean chains 4, 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 · main.setupHeroHome (cognitive 37) · ×1
  • main.setupHeroHome (cognitive 37) site/scripts/main.js:1017 — main.setupHeroHome has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 6 (14 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 14). Of this number, 16 points are the body's own statements and 21 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 · diagnosticSnapshot.createDiagnosticSnapshotBuilder.build (cognitive 37) · ×1
  • diagnosticSnapshot.createDiagnosticSnapshotBuilder.build (cognitive 37) src/electron/diagnosticSnapshot.js:261 — diagnosticSnapshot.createDiagnosticSnapshotBuilder.build has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 27, ternaries 6 (7 pts), if/else 3 (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 · app.renderCopilotAccounts (cognitive 37) · ×1
  • app.renderCopilotAccounts (cognitive 37) REDACTED:18012 — app.renderCopilotAccounts has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 8, loops 2 (3 pts), error handling 2, ternaries 1 (nesting depth added 11). Of this number, 25 points are the body's own statements and 12 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 · trayComposer.createTrayComposer.sourceEditor (cognitive 37) · ×1
  • trayComposer.createTrayComposer.sourceEditor (cognitive 37) src/electron/renderer/trayComposer.js:786 — trayComposer.createTrayComposer.sourceEditor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 12, ternaries 5 (9 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 · renderRows (cognitive 37) · ×1
  • renderRows (cognitive 37) REDACTED:3241 — renderRows has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 8, ternaries 6 (8 pts), loops 2 (3 pts), other 1 (nesting depth added 10). Of this number, 30 points are the body's own statements and 7 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLimitWindowsView.thirdPartySpendNode (cognitive 37) · ×1
  • createLimitWindowsView.thirdPartySpendNode (cognitive 37) src/electron/renderer/limits/windowsView.js:655 — createLimitWindowsView.thirdPartySpendNode has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 10 (13 pts), boolean chains 10 (nesting depth added 7). Of this number, 34 points are the body's own statements and 3 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 · createSettingsAutosave.flush (cognitive 37) · ×1
  • createSettingsAutosave.flush (cognitive 37) src/electron/renderer/pluginSettings.js:54 — createSettingsAutosave.flush has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7, loops 5 (7 pts), ternaries 3 (6 pts), error handling 1 (nesting depth added 11). Of this number, 34 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 · normalizeLimitProvider (cognitive 37) · ×1
  • normalizeLimitProvider (cognitive 37) src/shared/limits/core.js:485 — normalizeLimitProvider has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, ternaries 10, other 6 (nesting depth added 2). Of this number, 30 points are the body's own statements and 7 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · createLimitsRuntime.clear (cognitive 37) · ×1
  • createLimitsRuntime.clear (cognitive 37) src/shared/limits/runtime.js:953 — createLimitsRuntime.clear has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (11 pts), boolean chains 6, ternaries 2 (4 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 · clientSourceRoots (cognitive 37) · ×1
  • clientSourceRoots (cognitive 37) src/shared/clientSources.js:187 — clientSourceRoots has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 16, ternaries 10 (13 pts), if/else 6 (7 pts), loops 1 (nesting depth added 4). Of this number, 30 points are the body's own statements and 7 belong to 20 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 · parseKimiUsage (cognitive 37) · ×1
  • parseKimiUsage (cognitive 37) src/shared/providers/kimi/limits.js:214 — parseKimiUsage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 5 (11 pts), boolean chains 7, other 5, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchRemoteSnapshot (cognitive 37) · ×1
  • fetchRemoteSnapshot (cognitive 37) REDACTED:478 — fetchRemoteSnapshot has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 4 (8 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 16). Of this number, 36 points are the body's own statements and 1 belongs to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLocalUsageSource.discover (cognitive 37) · ×1
  • createLocalUsageSource.discover (cognitive 37) src/shared/providers/codex/localUsageSource.js:189 — createLocalUsageSource.discover has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 6 (9 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 15). Of this number, 34 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 · sessionActivity.projectSessionActivity (cognitive 36) · ×1
  • sessionActivity.projectSessionActivity (cognitive 36) src/shared/providers/codex/sessionActivity.js:214 — sessionActivity.projectSessionActivity has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (13 pts), loops 3 (5 pts), ternaries 3 (5 pts) (nesting depth added 11). 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.
D2 · Cognitive Complexity · localUsageSource.createLocalUsageSource.discover (cognitive 36) · ×1
  • localUsageSource.createLocalUsageSource.discover (cognitive 36) src/shared/providers/codex/localUsageSource.js:189 — localUsageSource.createLocalUsageSource.discover has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (8 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 15). Of this number, 33 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 · burnRate.nextLimitsUrgencyRefresh (cognitive 36) · ×1
  • burnRate.nextLimitsUrgencyRefresh (cognitive 36) src/shared/limits/burnRate.js:180 — burnRate.nextLimitsUrgencyRefresh has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 5, loops 2 (3 pts), ternaries 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.setupFeatureStory (cognitive 36) · ×1
  • main.setupFeatureStory (cognitive 36) site/scripts/main.js:289 — main.setupFeatureStory has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 8, ternaries 3 (6 pts), loops 2 (nesting depth added 4). Most of this is not in the body itself: 8 of the 36 points are its own statements and the rest belongs to 6 function items inside it that branch (activate, a function literal at line 344, updateScrollSelection, …). 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 · app.settingsSectionSummary (cognitive 36) · ×1
  • app.settingsSectionSummary (cognitive 36) REDACTED:943 — app.settingsSectionSummary has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 7 (16 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dock.animateRingResets (cognitive 36) · ×1
  • dock.animateRingResets (cognitive 36) REDACTED:1157 — dock.animateRingResets has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 7, loops 5 (6 pts), ternaries 1 (2 pts) (nesting depth added 9). Of this number, 30 points are the body's own statements and 6 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 · dock.statCard (cognitive 36) · ×1
  • dock.statCard (cognitive 36) REDACTED:1835 — dock.statCard has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 6 (10 pts), boolean chains 7, loops 4 (7 pts) (nesting depth added 10). Of this number, 24 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 36) · ×1
  • (anonymous) (cognitive 36) REDACTED:15377 — (anonymous) has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (30 pts), ternaries 2 (4 pts), boolean chains 1, other 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeResetCreditGrants (cognitive 36) · ×1
  • normalizeResetCreditGrants (cognitive 36) src/shared/limits/core.js:384 — normalizeResetCreditGrants has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (22 pts), other 8, if/else 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 12). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · homeLimitAccounts (cognitive 36) · ×1
  • homeLimitAccounts (cognitive 36) src/electron/renderer/homeOverview.js:115 — homeLimitAccounts has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 25, ternaries 7 (8 pts), if/else 1, loops 1, other 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 36 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 121, 117, 147, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Surface.Update (cognitive 35) · ×1
  • Surface.Update (cognitive 35) src/windows-dock/DockBackdrop.cs:114 — Surface.Update has cognitive complexity 35 (threshold 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 · usage.mergeUnpricedMaps (cognitive 35) · ×1
  • usage.mergeUnpricedMaps (cognitive 35) src/shared/usage.js:423 — usage.mergeUnpricedMaps has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 10, loops 4 (6 pts), ternaries 2 (5 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 · usage.addClientModelUsage (cognitive 35) · ×1
  • usage.addClientModelUsage (cognitive 35) src/shared/usage.js:1467 — usage.addClientModelUsage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 11, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · manifest.normalizeSkins (cognitive 35) · ×1
  • manifest.normalizeSkins (cognitive 35) src/shared/plugins/manifest.js:22 — manifest.normalizeSkins has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 7, loops 3 (6 pts), ternaries 2 (4 pts), error handling 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · initialSetup.setupFields (cognitive 35) · ×1
  • initialSetup.setupFields (cognitive 35) src/electron/plugins/initialSetup.js:39 — initialSetup.setupFields has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 15, ternaries 4 (11 pts), if/else 4 (5 pts), loops 3 (4 pts) (nesting depth added 9). Of this number, 31 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · localUsage.buildLocalUsageView (cognitive 35) · ×1
  • localUsage.buildLocalUsageView (cognitive 35) src/shared/providers/codex/localUsage.js:22 — localUsage.buildLocalUsageView has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 9, loops 4 (6 pts), ternaries 3 (6 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 · localUsageSource.createLocalUsageSource.notification (cognitive 35) · ×1
  • localUsageSource.createLocalUsageSource.notification (cognitive 35) src/shared/providers/codex/localUsageSource.js:227 — localUsageSource.createLocalUsageSource.notification has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 11, 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 · arkcli.parseArkcliPlan (cognitive 35) · ×1
  • arkcli.parseArkcliPlan (cognitive 35) src/shared/providers/volcengine/arkcli.js:146 — arkcli.parseArkcliPlan has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 9, ternaries 4 (7 pts), loops 1 (nesting depth added 10). Of this number, 33 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 · limits.windowsFromSummary (cognitive 35) · ×1
  • limits.windowsFromSummary (cognitive 35) src/shared/providers/hark/limits.js:83 — limits.windowsFromSummary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 7, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.createPluginRuntime.hostCall (cognitive 35) · ×1
  • runtime.createPluginRuntime.hostCall (cognitive 35) src/electron/plugins/runtime.js:133 — runtime.createPluginRuntime.hostCall has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nativeMaterialVisibility.syncNativeMaterialVisibility (cognitive 35) · ×1
  • nativeMaterialVisibility.syncNativeMaterialVisibility (cognitive 35) src/electron/nativeMaterialVisibility.js:37 — nativeMaterialVisibility.syncNativeMaterialVisibility has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 11, ternaries 6 (10 pts), error handling 1 (2 pts) (nesting depth added 8). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · clientUsageArchive.addClientUsage (cognitive 35) · ×1
  • clientUsageArchive.addClientUsage (cognitive 35) src/shared/usage/clientUsageArchive.js:261 — clientUsageArchive.addClientUsage has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 16, if/else 8 (12 pts), loops 5 (7 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · resetAnimator.createLimitResetAnimator.animate (cognitive 35) · ×1
  • resetAnimator.createLimitResetAnimator.animate (cognitive 35) src/electron/renderer/limits/resetAnimator.js:160 — resetAnimator.createLimitResetAnimator.animate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 5 (7 pts), boolean chains 6 (nesting depth added 12). Of this number, 30 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginSettings.createPluginSettingsPanel.packagePanel (cognitive 35) · ×1
  • pluginSettings.createPluginSettingsPanel.packagePanel (cognitive 35) src/electron/renderer/pluginSettings.js:518 — pluginSettings.createPluginSettingsPanel.packagePanel has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 11 (21 pts), if/else 9, boolean chains 5 (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 · applyAppearanceSettings (cognitive 35) · ×1
  • applyAppearanceSettings (cognitive 35) REDACTED:8301 — applyAppearanceSettings has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, loops 4 (5 pts), ternaries 4 (5 pts), other 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 · replaceMainWindow (cognitive 35) · ×1
  • replaceMainWindow (cognitive 35) src/electron/main.js:8055 — replaceMainWindow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 9, error handling 2 (4 pts), ternaries 2 (nesting depth added 9). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 8057, 8063, 8106). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · fetchClaudeWebLimits (cognitive 35) · ×1
  • fetchClaudeWebLimits (cognitive 35) src/shared/providers/claude/limits.js:1139 — fetchClaudeWebLimits has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7, error handling 4 (6 pts), ternaries 2 (nesting depth added 8). 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 · runClaudeCapturedCommand (cognitive 35) · ×1
  • runClaudeCapturedCommand (cognitive 35) src/shared/providers/claude/limits.js:2134 — runClaudeCapturedCommand has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 6, error handling 2 (6 pts) (nesting depth added 12). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 2147, a function literal at line 2136, (anonymous)::kill, …). 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 · createTrayComposer.openPickerMenu (cognitive 35) · ×1
  • createTrayComposer.openPickerMenu (cognitive 35) src/electron/renderer/trayComposer.js:425 — createTrayComposer.openPickerMenu has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 5 (8 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 8). Most of this is not in the body itself: 4 of the 35 points are its own statements and the rest belongs to 12 function items inside it that branch (renderChoices, a function literal at line 508, focusOption, …). 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 · createNotchController.poll (cognitive 35) · ×1
  • createNotchController.poll (cognitive 35) src/electron/notch/controller.js:740 — createNotchController.poll has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 9, ternaries 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createPluginRuntime.hostCall (cognitive 35) · ×1
  • createPluginRuntime.hostCall (cognitive 35) src/electron/plugins/runtime.js:133 — createPluginRuntime.hostCall has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLimitsRuntime.providerRows (cognitive 35) · ×1
  • createLimitsRuntime.providerRows (cognitive 35) src/shared/limits/runtime.js:351 — createLimitsRuntime.providerRows has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 4 (8 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 16). Of this number, 27 points are the body's own statements and 8 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 · subagentGroupRow (cognitive 35) · ×1
  • subagentGroupRow (cognitive 35) src/electron/renderer/sessionRows.js:793 — subagentGroupRow has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 7, if/else 4 (7 pts), loops 4 (6 pts) (nesting depth added 6). Of this number, 33 points are the body's own statements and 2 belong to 15 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · readDshSessionState (cognitive 35) · ×1
  • readDshSessionState (cognitive 35) src/shared/providers/dsh/sessionFiles.js:404 — readDshSessionState has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 6 (10 pts), boolean chains 9, error handling 3 (4 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 · limits.windowsCodexStoreCandidates (cognitive 34) · ×1
  • limits.windowsCodexStoreCandidates (cognitive 34) src/shared/providers/codex/limits.js:840 — limits.windowsCodexStoreCandidates has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 6, ternaries 2 (6 pts), loops 3 (5 pts), error handling 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · localUsageSource.createLocalUsageSource.subscribe (cognitive 34) · ×1
  • localUsageSource.createLocalUsageSource.subscribe (cognitive 34) src/shared/providers/codex/localUsageSource.js:134 — localUsageSource.createLocalUsageSource.subscribe has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 7, 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 · limits.parseStepfunUsage (cognitive 34) · ×1
  • limits.parseStepfunUsage (cognitive 34) src/shared/providers/stepfun/limits.js:50 — limits.parseStepfunUsage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 11, ternaries 2 (4 pts), loops 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · clientUsageArchive.mergeResidueIntoPeriod (cognitive 34) · ×1
  • clientUsageArchive.mergeResidueIntoPeriod (cognitive 34) src/shared/usage/clientUsageArchive.js:202 — clientUsageArchive.mergeResidueIntoPeriod has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 14, if/else 6 (10 pts), loops 6 (10 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 · createLimitsRuntime.reconfigure (cognitive 34) · ×1
  • createLimitsRuntime.reconfigure (cognitive 34) src/shared/limits/runtime.js:1006 — createLimitsRuntime.reconfigure has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (7 pts), ternaries 3 (6 pts), other 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeQuery (cognitive 34) · ×1
  • normalizeQuery (cognitive 34) src/shared/plugins/businessData.js:140 — normalizeQuery has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 13, if/else 10 (12 pts), other 7, loops 2 (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 · createLocalUsageSource.subscribe (cognitive 34) · ×1
  • createLocalUsageSource.subscribe (cognitive 34) src/shared/providers/codex/localUsageSource.js:134 — createLocalUsageSource.subscribe has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 7, 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 · backend.createBackend.call (cognitive 33) · ×1
  • backend.createBackend.call (cognitive 33) plugins/openai-api-credit/backend.cjs:5 — backend.createBackend.call has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 10, ternaries 6 (8 pts), error handling 2 (nesting depth added 4). 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, 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 · placementSettings.placementPatch (cognitive 33) · ×1
  • placementSettings.placementPatch (cognitive 33) src/electron/plugins/placementSettings.js:44 — placementSettings.placementPatch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 11). Of this number, 30 points are the body's own statements and 3 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 · controller.createNotchController.poll (cognitive 33) · ×1
  • controller.createNotchController.poll (cognitive 33) src/electron/notch/controller.js:740 — controller.createNotchController.poll has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 8, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionPromptCache.applyPromptCacheEntry (cognitive 33) · ×1
  • sessionPromptCache.applyPromptCacheEntry (cognitive 33) src/shared/sessionPromptCache.js:12 — sessionPromptCache.applyPromptCacheEntry has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9, ternaries 4 (9 pts) (nesting depth added 11). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.sessionMetadataMap (cognitive 33) · ×1
  • sessionMetadata.sessionMetadataMap (cognitive 33) src/shared/sessionMetadata.js:313 — sessionMetadata.sessionMetadataMap has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 7, loops 5 (6 pts), ternaries 1 (nesting depth added 11). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.scanGrokProto (cognitive 33) · ×1
  • limits.scanGrokProto (cognitive 33) src/shared/providers/grok/limits.js:364 — limits.scanGrokProto has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchGrokLimits (cognitive 33) · ×1
  • limits.fetchGrokLimits (cognitive 33) src/shared/providers/grok/limits.js:758 — limits.fetchGrokLimits has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 9, ternaries 3 (8 pts), error handling 3 (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 · limits.parseMistralSubscription (cognitive 33) · ×1
  • limits.parseMistralSubscription (cognitive 33) src/shared/providers/mistral/limits.js:55 — limits.parseMistralSubscription has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 6, loops 3, ternaries 1 (2 pts) (nesting depth added 13). Of this number, 24 points are the body's own statements and 9 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 · credentialStore.readRegularFileNoFollow (cognitive 33) · ×1
  • credentialStore.readRegularFileNoFollow (cognitive 33) src/shared/credentialStore.js:96 — credentialStore.readRegularFileNoFollow has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 11, error handling 2 (3 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · displayPreview.buildDisplayPreview (cognitive 33) · ×1
  • displayPreview.buildDisplayPreview (cognitive 33) src/electron/displayPreview.js:24 — displayPreview.buildDisplayPreview has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 14 (21 pts), boolean chains 9, if/else 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 · historyStore.createLimitsHistoryStore.record (cognitive 33) · ×1
  • historyStore.createLimitsHistoryStore.record (cognitive 33) src/electron/limits/historyStore.js:108 — historyStore.createLimitsHistoryStore.record has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (8 pts), ternaries 3 (8 pts), loops 3 (6 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginCredentials.create.mount (cognitive 33) · ×1
  • pluginCredentials.create.mount (cognitive 33) src/electron/renderer/pluginCredentials.js:9 — pluginCredentials.create.mount has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, loops 4, error handling 3, ternaries 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 109, 97, 124). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · pluginSettings.createSettingsAutosave.flush (cognitive 33) · ×1
  • pluginSettings.createSettingsAutosave.flush (cognitive 33) src/electron/renderer/pluginSettings.js:54 — pluginSettings.createSettingsAutosave.flush has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7, loops 5 (7 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 9). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeDeviceRecord (cognitive 33) · ×1
  • normalizeDeviceRecord (cognitive 33) src/shared/usage.js:1412 — normalizeDeviceRecord has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 5, ternaries 3, loops 1, other 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · renderBubble (cognitive 33) · ×1
  • renderBubble (cognitive 33) REDACTED:2139 — renderBubble has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 9, ternaries 6 (7 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · createNotchPanel.renderHome (cognitive 33) · ×1
  • createNotchPanel.renderHome (cognitive 33) src/electron/renderer/notch/panel.js:710 — createNotchPanel.renderHome has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 13, boolean chains 9, if/else 8 (9 pts), loops 1 (2 pts) (nesting depth added 2). Most of this is not in the body itself: 13 of the 33 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 736, a function literal at line 766, a function literal at line 771, …). 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 · nativeSessionRow (cognitive 33) · ×1
  • nativeSessionRow (cognitive 33) src/electron/renderer/sessionRows.js:481 — nativeSessionRow has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 19, ternaries 12, 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 · usage.mergeNormalizedPeriods (cognitive 32) · ×1
  • usage.mergeNormalizedPeriods (cognitive 32) src/shared/usage.js:2227 — usage.mergeNormalizedPeriods has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 8, loops 3 (6 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 · presentation.normalizePresentation (cognitive 32) · ×1
  • presentation.normalizePresentation (cognitive 32) src/shared/plugins/presentation.js:5 — presentation.normalizePresentation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 8 (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 · limits.fetchCodexLimits (cognitive 32) · ×1
  • limits.fetchCodexLimits (cognitive 32) src/shared/providers/codex/limits.js:1381 — limits.fetchCodexLimits has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, ternaries 3 (4 pts), error handling 1 (2 pts), loops 2 (nesting depth added 6). Of this number, 22 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sessionDetail.readReasonixEventLog (cognitive 32) · ×1
  • sessionDetail.readReasonixEventLog (cognitive 32) src/shared/providers/reasonix/sessionDetail.js:757 — sessionDetail.readReasonixEventLog has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, error handling 3 (4 pts), loops 2 (nesting depth added 8). Of this number, 25 points are the body's own statements and 7 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 · panel.createNotchPanel.renderHome (cognitive 32) · ×1
  • panel.createNotchPanel.renderHome (cognitive 32) src/electron/renderer/notch/panel.js:710 — panel.createNotchPanel.renderHome has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11, boolean chains 10, if/else 8 (9 pts), loops 1 (2 pts) (nesting depth added 2). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 736, a function literal at line 766, a function literal at line 771, …). 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 · main.adoptOrphanedSubscriptions (cognitive 32) · ×1
  • main.adoptOrphanedSubscriptions (cognitive 32) src/electron/main.js:4283 — main.adoptOrphanedSubscriptions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 11, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 8). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to one function literal inside it that branches (line 4292). 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 · dashboard.renderBreakdown (cognitive 32) · ×1
  • dashboard.renderBreakdown (cognitive 32) src/electron/renderer/dashboard.js:391 — dashboard.renderBreakdown has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 10, if/else 6 (8 pts), loops 2 (3 pts) (nesting depth added 9). Of this number, 21 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 · WidgetFormat.tokens (cognitive 32) · ×1
  • WidgetFormat.tokens (cognitive 32) native/macos/TokenMonitorWidget/WidgetViewModel.swift:410 — WidgetFormat.tokens has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, if/else 10 (11 pts), ternaries 3 (4 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 3). Of this number, 30 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: 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 · renderAntigravityStatus (cognitive 32) · ×1
  • renderAntigravityStatus (cognitive 32) REDACTED:17239 — renderAntigravityStatus has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 15, if/else 9, ternaries 6, error handling 1 (2 pts) (nesting depth added 1). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 17274, 17334, 17313, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · addCodexManagedAccount (cognitive 32) · ×1
  • addCodexManagedAccount (cognitive 32) src/electron/main.js:1911 — addCodexManagedAccount has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (19 pts), error handling 6 (10 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseZcodeStartPlanBalances (cognitive 32) · ×1
  • parseZcodeStartPlanBalances (cognitive 32) src/shared/providers/zai/limits.js:757 — parseZcodeStartPlanBalances has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (11 pts), ternaries 4 (7 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 14 of the 32 points are its own statements and the rest belongs to 18 function literals inside it that branch (lines 776, 829, 778, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · subscriptionForecast (cognitive 32) · ×1
  • subscriptionForecast (cognitive 32) src/shared/plugins/businessData.js:97 — subscriptionForecast has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 13, ternaries 3 (4 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · createLocalUsageSource.poll (cognitive 32) · ×1
  • createLocalUsageSource.poll (cognitive 32) src/shared/providers/codex/localUsageSource.js:327 — createLocalUsageSource.poll has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 9, error handling 2 (4 pts), other 2, ternaries 2 (nesting depth added 6). 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, 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 · runCursorLogin (cognitive 32) · ×1
  • runCursorLogin (cognitive 32) src/shared/providers/cursor/auth.js:284 — runCursorLogin has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9, ternaries 4 (6 pts), loops 1 (2 pts) (nesting depth added 9). Most of this is not in the body itself: 2 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 298). 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 · catalogSources.createCatalogSources (cognitive 31) · ×1
  • catalogSources.createCatalogSources (cognitive 31) src/electron/plugins/catalogSources.js:93 — catalogSources.createCatalogSources has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 4 (9 pts), boolean chains 8, loops 3 (4 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 · failureDetail.classify (cognitive 31) · ×1
  • failureDetail.classify (cognitive 31) src/shared/limits/failureDetail.js:57 — failureDetail.classify has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 6 (12 pts), boolean chains 7 (nesting depth added 8). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · customScanPaths.validCustomScanPaths (cognitive 31) · ×1
  • customScanPaths.validCustomScanPaths (cognitive 31) src/shared/customScanPaths.js:61 — customScanPaths.validCustomScanPaths has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 3 (8 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 14). Of this number, 29 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 · deviceRuntime.createDeviceRuntime (cognitive 31) · ×1
  • deviceRuntime.createDeviceRuntime (cognitive 31) src/shared/usage/deviceRuntime.js:10 — deviceRuntime.createDeviceRuntime has cognitive complexity 31 (threshold 15). Drivers by points: error handling 6 (11 pts), boolean chains 10, if/else 6 (7 pts), ternaries 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · icloudSync.createIcloudSyncStore.deleteDeviceNow (cognitive 31) · ×1
  • icloudSync.createIcloudSyncStore.deleteDeviceNow (cognitive 31) src/electron/icloudSync.js:997 — icloudSync.createIcloudSyncStore.deleteDeviceNow has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, if/else 7 (8 pts), loops 2, 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 · historyController.createLimitsHistoryController.open (cognitive 31) · ×1
  • historyController.createLimitsHistoryController.open (cognitive 31) src/electron/limits/historyController.js:247 — historyController.createLimitsHistoryController.open has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 9, loops 1 (2 pts), error handling 1 (nesting depth added 5). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: 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 · accountSlotsPanel.createPanel.openEditor (cognitive 31) · ×1
  • accountSlotsPanel.createPanel.openEditor (cognitive 31) src/electron/renderer/limits/accountSlotsPanel.js:104 — accountSlotsPanel.createPanel.openEditor has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 7 (9 pts), boolean chains 6, loops 1 (nesting depth added 8). None of this is in the body itself: all 31 points belong to 4 function literals inside it that branch (lines 128, 113, 105, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · clientUsageArchive.captureArchivedClientUsage (cognitive 31) · ×1
  • clientUsageArchive.captureArchivedClientUsage (cognitive 31) src/shared/usage/clientUsageArchive.js:134 — clientUsageArchive.captureArchivedClientUsage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · clientUsageArchive.addSessionBreakdown (cognitive 31) · ×1
  • clientUsageArchive.addSessionBreakdown (cognitive 31) src/shared/usage/clientUsageArchive.js:339 — clientUsageArchive.addSessionBreakdown has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 9, ternaries 4 (8 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · historyDatabase.createHistoryDatabase.rememberInterruptions (cognitive 31) · ×1
  • historyDatabase.createHistoryDatabase.rememberInterruptions (cognitive 31) src/electron/limits/historyDatabase.js:343 — historyDatabase.createHistoryDatabase.rememberInterruptions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (9 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.renderHomeSessionModule (cognitive 31) · ×1
  • app.renderHomeSessionModule (cognitive 31) REDACTED:7151 — app.renderHomeSessionModule has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 5 (11 pts), boolean chains 7, 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 · app.window.tokenMonitor.onStatsPush() (cognitive 31) · ×1
  • app.window.tokenMonitor.onStatsPush() (cognitive 31) REDACTED:15377 — app.window.tokenMonitor.onStatsPush() has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · windowsView.createLimitWindowsView (cognitive 31) · ×1
  • windowsView.createLimitWindowsView (cognitive 31) src/electron/renderer/limits/windowsView.js:50 — windowsView.createLimitWindowsView has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 16 (19 pts), boolean chains 12 (nesting depth added 3). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 13 function literals inside it that branch (lines 2678, 2658, 2649, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · windowsView.createLimitWindowsView.providerSpendNode (cognitive 31) · ×1
  • windowsView.createLimitWindowsView.providerSpendNode (cognitive 31) src/electron/renderer/limits/windowsView.js:601 — windowsView.createLimitWindowsView.providerSpendNode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 5 (9 pts), boolean chains 4 (nesting depth added 11). Of this number, 27 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 · createLimitWindowsView.providerSpendNode (cognitive 31) · ×1
  • createLimitWindowsView.providerSpendNode (cognitive 31) src/electron/renderer/limits/windowsView.js:601 — createLimitWindowsView.providerSpendNode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 5 (9 pts), boolean chains 4 (nesting depth added 11). Of this number, 27 points are the body's own statements and 4 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 · fetchClaudeLimits (cognitive 31) · ×1
  • fetchClaudeLimits (cognitive 31) src/shared/providers/claude/limits.js:1489 — fetchClaudeLimits has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 6 (8 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 · createIcloudSyncStore.deleteDeviceNow (cognitive 31) · ×1
  • createIcloudSyncStore.deleteDeviceNow (cognitive 31) src/electron/icloudSync.js:997 — createIcloudSyncStore.deleteDeviceNow has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, if/else 7 (8 pts), loops 2, 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 · collectMimoCredentials (cognitive 31) · ×1
  • collectMimoCredentials (cognitive 31) src/shared/providers/mimo/limits.js:493 — collectMimoCredentials has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 8, ternaries 3 (4 pts), loops 2 (nesting depth added 7). Of this number, 21 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseOllamaUsageHtml (cognitive 31) · ×1
  • parseOllamaUsageHtml (cognitive 31) src/shared/providers/ollama/limits.js:169 — parseOllamaUsageHtml has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 7, if/else 2 (4 pts), other 3, loops 2 (nesting depth added 8). Of this number, 27 points are the body's own statements and 4 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 · createLimitsHistoryController.open (cognitive 31) · ×1
  • createLimitsHistoryController.open (cognitive 31) src/electron/limits/historyController.js:247 — createLimitsHistoryController.open has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 9, loops 1 (2 pts), error handling 1 (nesting depth added 5). Of this number, 30 points are the body's own statements and 1 belongs to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · syncPayload.createSyncPayloadUploader.upload (cognitive 30) · ×1
  • syncPayload.createSyncPayloadUploader.upload (cognitive 30) src/shared/syncPayload.js:407 — syncPayload.createSyncPayloadUploader.upload has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, error handling 2 (4 pts), ternaries 3 (nesting depth added 9). Of this number, 20 points are the body's own statements and 10 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 · trayLayout.resolveTextItem (cognitive 30) · ×1
  • trayLayout.resolveTextItem (cognitive 30) src/shared/trayLayout.js:976 — trayLayout.resolveTextItem has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5 (10 pts), boolean chains 9 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · controller.createNotchController.paintBlur (cognitive 30) · ×1
  • controller.createNotchController.paintBlur (cognitive 30) src/electron/notch/controller.js:417 — controller.createNotchController.paintBlur has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data.summaryLayout (cognitive 30) · ×1
  • data.summaryLayout (cognitive 30) src/electron/notch/data.js:31 — data.summaryLayout has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 10 (12 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 10). Of this number, 25 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 · session.readSessionEventsCurrent (cognitive 30) · ×1
  • session.readSessionEventsCurrent (cognitive 30) src/shared/providers/opencode/session.js:378 — session.readSessionEventsCurrent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts), boolean chains 5, 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 · limits.fetchAntigravityLimits (cognitive 30) · ×1
  • limits.fetchAntigravityLimits (cognitive 30) src/shared/providers/antigravity/limits.js:108 — limits.fetchAntigravityLimits has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (8 pts), ternaries 3 (6 pts), error handling 2 (3 pts) (nesting depth added 7). Of this number, 25 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 · arkcli.resolveArkcliCommand (cognitive 30) · ×1
  • arkcli.resolveArkcliCommand (cognitive 30) src/shared/providers/volcengine/arkcli.js:35 — arkcli.resolveArkcliCommand has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (8 pts), ternaries 4 (7 pts), loops 2 (3 pts), 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 · runtime.createLimitsRuntime.reconfigure (cognitive 30) · ×1
  • runtime.createLimitsRuntime.reconfigure (cognitive 30) src/shared/limits/runtime.js:1006 — runtime.createLimitsRuntime.reconfigure has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (7 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · panel.createNotchPanel.renderPage (cognitive 30) · ×1
  • panel.createNotchPanel.renderPage (cognitive 30) src/electron/renderer/notch/panel.js:1323 — panel.createNotchPanel.renderPage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 5, ternaries 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · diagnosticSnapshot.createDiagnosticSnapshotBuilder (cognitive 30) · ×1
  • diagnosticSnapshot.createDiagnosticSnapshotBuilder (cognitive 30) src/electron/diagnosticSnapshot.js:111 — diagnosticSnapshot.createDiagnosticSnapshotBuilder has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 30. To reduce it, name the conditions: bind each compound test to a 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 · sessionDetail.parseClaudeTranscriptLines (cognitive 30) · ×1
  • sessionDetail.parseClaudeTranscriptLines (cognitive 30) src/shared/sessionDetail.js:146 — sessionDetail.parseClaudeTranscriptLines has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 14). 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 · sessionDetail.groupEvents (cognitive 30) · ×1
  • sessionDetail.groupEvents (cognitive 30) src/shared/sessionDetail.js:503 — sessionDetail.groupEvents has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 3 (9 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.runAppUpdateCheck (cognitive 30) · ×1
  • main.runAppUpdateCheck (cognitive 30) src/electron/main.js:7589 — main.runAppUpdateCheck has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 5, error handling 1 (nesting depth added 10). Of this number, 18 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 · aggregateHistory (cognitive 30) · ×1
  • aggregateHistory (cognitive 30) src/shared/usage.js:1818 — aggregateHistory has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 8, ternaries 2 (4 pts), other 2, loops 1 (nesting depth added 10). Of this number, 28 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 · createNotchPanel.renderPage (cognitive 30) · ×1
  • createNotchPanel.renderPage (cognitive 30) src/electron/renderer/notch/panel.js:1323 — createNotchPanel.renderPage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 5, ternaries 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · createNotchController.paintBlur (cognitive 30) · ×1
  • createNotchController.paintBlur (cognitive 30) src/electron/notch/controller.js:417 — createNotchController.paintBlur has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createNotchController.refreshLayout (cognitive 30) · ×1
  • createNotchController.refreshLayout (cognitive 30) src/electron/notch/controller.js:463 — createNotchController.refreshLayout has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 6, ternaries 2 (6 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 · createLimitsRuntime (cognitive 30) · ×1
  • createLimitsRuntime (cognitive 30) src/shared/limits/runtime.js:138 — createLimitsRuntime has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (6 pts), ternaries 6, other 3, loops 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 · normalizeObservation (cognitive 30) · ×1
  • normalizeObservation (cognitive 30) src/shared/dailyHistoryArchive.js:25 — normalizeObservation has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 13, boolean chains 10, other 5, if/else 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 · periodLiveDay (cognitive 30) · ×1
  • periodLiveDay (cognitive 30) src/shared/dailyHistoryArchive.js:405 — periodLiveDay has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, ternaries 8 (9 pts), if/else 4 (5 pts), loops 2 (3 pts) (nesting depth added 3). Of this number, 29 points are the body's own statements and 1 belongs 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 · zcodeRecordCumulativeSpend (cognitive 30) · ×1
  • zcodeRecordCumulativeSpend (cognitive 30) src/shared/providers/zai/limits.js:564 — zcodeRecordCumulativeSpend has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (10 pts), error handling 2 (3 pts), loops 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 · createHistoryDatabase.rememberInterruptions (cognitive 30) · ×1
  • createHistoryDatabase.rememberInterruptions (cognitive 30) src/electron/limits/historyDatabase.js:343 — createHistoryDatabase.rememberInterruptions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (8 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · readSessionDetail (cognitive 30) · ×1
  • readSessionDetail (cognitive 30) src/shared/sessionDetail.js:676 — readSessionDetail has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, ternaries 7 (8 pts), error handling 2 (3 pts) (nesting depth added 4). Of this number, 29 points are the body's own statements and 1 belongs to 5 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 · createManagedPlugins.recoverTransaction (cognitive 30) · ×1
  • createManagedPlugins.recoverTransaction (cognitive 30) src/electron/plugins/managed.js:81 — createManagedPlugins.recoverTransaction has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 9 (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 · createMacLiquidGlass · ×1
  • createMacLiquidGlass::update (cognitive 30) src/electron/macLiquidGlass.js:187 — createMacLiquidGlass::update has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 9 (16 pts), if/else 9 (11 pts), boolean chains 2, other 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 · balance.parseBalance (cognitive 29) · ×1
  • balance.parseBalance (cognitive 29) plugins/openai-api-credit/balance.cjs:6 — balance.parseBalance has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 9, ternaries 2 (4 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 · usage.reconcileCursorAutoGlobalModels (cognitive 29) · ×1
  • usage.reconcileCursorAutoGlobalModels (cognitive 29) src/shared/usage.js:989 — usage.reconcileCursorAutoGlobalModels has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (8 pts), boolean chains 6 (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 · controller.createEdgeDockController.buildWindows (cognitive 29) · ×1
  • controller.createEdgeDockController.buildWindows (cognitive 29) src/electron/edgeDock/controller.js:933 — controller.createEdgeDockController.buildWindows has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 4 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionFiles.resolveSessionFile (cognitive 29) · ×1
  • sessionFiles.resolveSessionFile (cognitive 29) src/shared/sessionFiles.js:167 — sessionFiles.resolveSessionFile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.resolveSessionMetadata (cognitive 29) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 29) src/shared/providers/codex/sessionMetadata.js:212 — sessionMetadata.resolveSessionMetadata has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (9 pts), ternaries 4, loops 3 (nesting depth added 2). Of this number, 19 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.applyT3SessionParents · ×1
  • sessionMetadata.applyT3SessionParents::index (cognitive 29) src/shared/sessionMetadata.js:417 — sessionMetadata.applyT3SessionParents::index has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (17 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sessionMetadata.applyT3SessionParents) 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 · sessions.buildNativeView (cognitive 29) · ×1
  • sessions.buildNativeView (cognitive 29) src/shared/providers/reasonix/sessions.js:502 — sessions.buildNativeView has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (7 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · spendHistory.recordMimoCumulativeSpend (cognitive 29) · ×1
  • spendHistory.recordMimoCumulativeSpend (cognitive 29) src/shared/providers/mimo/spendHistory.js:21 — spendHistory.recordMimoCumulativeSpend has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 14, if/else 10 (11 pts), error handling 2 (3 pts), loops 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 · limits.fetchQoderLimits (cognitive 29) · ×1
  • limits.fetchQoderLimits (cognitive 29) src/shared/providers/qoder/limits.js:242 — limits.fetchQoderLimits has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 8, if/else 6 (7 pts), error handling 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 · runtime.createLimitsRuntime.providerRows (cognitive 29) · ×1
  • runtime.createLimitsRuntime.providerRows (cognitive 29) src/shared/limits/runtime.js:351 — runtime.createLimitsRuntime.providerRows has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 13). Of this number, 27 points are the body's own statements and 2 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · runtime.createPluginRuntime.confirmContentSwitch (cognitive 29) · ×1
  • runtime.createPluginRuntime.confirmContentSwitch (cognitive 29) src/electron/plugins/runtime.js:579 — runtime.createPluginRuntime.confirmContentSwitch has cognitive complexity 29 (threshold 15). Drivers by points: loops 3 (12 pts), if/else 4 (11 pts), boolean chains 5, ternaries 1 (nesting depth added 16). Of this number, 26 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 · syncContentRuntime.createSyncContentRuntime.publishPatch (cognitive 29) · ×1
  • syncContentRuntime.createSyncContentRuntime.publishPatch (cognitive 29) src/electron/syncContentRuntime.js:523 — syncContentRuntime.createSyncContentRuntime.publishPatch has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (9 pts), boolean chains 7, error handling 1 (2 pts), loops 1 (nesting depth added 11). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 528). 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 · resetForecast.normalizeCodexResetForecast (cognitive 29) · ×1
  • resetForecast.normalizeCodexResetForecast (cognitive 29) src/electron/providers/codex/resetForecast.js:75 — resetForecast.normalizeCodexResetForecast has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 13, if/else 2 (nesting depth added 3). 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: 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 · pluginMainPages.create.render (cognitive 29) · ×1
  • pluginMainPages.create.render (cognitive 29) src/electron/renderer/pluginMainPages.js:17 — pluginMainPages.create.render has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (4 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 14). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 38). 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 · pluginUi.createHost.release (cognitive 29) · ×1
  • pluginUi.createHost.release (cognitive 29) src/electron/renderer/pluginUi.js:232 — pluginUi.createHost.release has cognitive complexity 29 (threshold 15). Drivers by points: loops 10 (14 pts), if/else 6 (8 pts), boolean chains 3, error handling 1 (2 pts), ternaries 2 (nesting depth added 7). Of this number, 27 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · animateBreakdownFrom (cognitive 29) · ×1
  • animateBreakdownFrom (cognitive 29) REDACTED:2186 — animateBreakdownFrom has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 8, ternaries 2 (3 pts), loops 2, other 1 (nesting depth added 8). Of this number, 25 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init (cognitive 29) · ×1
  • init (cognitive 29) REDACTED:13857 — init has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 3 (6 pts), error handling 4, boolean chains 3, other 1 (nesting depth added 5). Of this number, 25 points are the body's own statements and 4 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · appendNamedApiProfileRow (cognitive 29) · ×1
  • appendNamedApiProfileRow (cognitive 29) REDACTED:18869 — appendNamedApiProfileRow has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (25 pts), error handling 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 10). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to 6 function items inside it that branch (finishRename, a function literal at line 18889, a function literal at line 18966, …). 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 · groupedSessionRows (cognitive 29) · ×1
  • groupedSessionRows (cognitive 29) src/electron/renderer/edgeDock/presentation.js:332 — groupedSessionRows has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 21, ternaries 6, if/else 1, other 1. Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 351, 339, 335, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · createLimitsRuntime.applyAttempt (cognitive 29) · ×1
  • createLimitsRuntime.applyAttempt (cognitive 29) src/shared/limits/runtime.js:587 — createLimitsRuntime.applyAttempt has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 10, ternaries 2 (5 pts), loops 1 (2 pts) (nesting depth added 8). Of this number, 28 points are the body's own statements and 1 belongs 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 · captureLiveDailyHistory (cognitive 29) · ×1
  • captureLiveDailyHistory (cognitive 29) src/shared/dailyHistoryArchive.js:611 — captureLiveDailyHistory has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 12, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · zcodePlanBucketWindow (cognitive 29) · ×1
  • zcodePlanBucketWindow (cognitive 29) src/shared/providers/zai/limits.js:678 — zcodePlanBucketWindow has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 10, ternaries 3, other 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · createHistoryDatabase.noteDaily (cognitive 29) · ×1
  • createHistoryDatabase.noteDaily (cognitive 29) src/electron/limits/historyDatabase.js:146 — createHistoryDatabase.noteDaily has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 19, ternaries 7, if/else 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 · parseGrokBilling (cognitive 29) · ×1
  • parseGrokBilling (cognitive 29) src/shared/providers/grok/limits.js:206 — parseGrokBilling has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 8, other 6, if/else 4 (5 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 · parseClineLimits (cognitive 29) · ×1
  • parseClineLimits (cognitive 29) src/shared/providers/cline/limits.js:248 — parseClineLimits has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 8, other 4, loops 1, ternaries 1 (nesting depth added 7). Of this number, 27 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 · createHost.release (cognitive 29) · ×1
  • createHost.release (cognitive 29) src/electron/renderer/pluginUi.js:232 — createHost.release has cognitive complexity 29 (threshold 15). Drivers by points: loops 10 (14 pts), if/else 6 (8 pts), boolean chains 3, error handling 1 (2 pts), ternaries 2 (nesting depth added 7). Of this number, 27 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · backend.createBackend.scan (cognitive 28) · ×1
  • backend.createBackend.scan (cognitive 28) plugins/quota-alerts/backend.cjs:36 — backend.createBackend.scan has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, ternaries 4, loops 2 (nesting depth added 5). Of this number, 26 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sessionMetadata.readKimiSessionStateFiles (cognitive 28) · ×1
  • sessionMetadata.readKimiSessionStateFiles (cognitive 28) src/shared/providers/kimi/sessionMetadata.js:74 — sessionMetadata.readKimiSessionStateFiles has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), error handling 2 (5 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.readSessionTitle (cognitive 28) · ×1
  • sessionMetadata.readSessionTitle (cognitive 28) src/shared/providers/claude/sessionMetadata.js:540 — sessionMetadata.readSessionTitle has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 10, error handling 2 (3 pts), if/else 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionContext.applyLine (cognitive 28) · ×1
  • sessionContext.applyLine (cognitive 28) src/shared/providers/codex/sessionContext.js:42 — sessionContext.applyLine has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 11, 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.
D2 · Cognitive Complexity · sessionMetadata.resolveSessionMetadata (cognitive 28) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 28) src/shared/providers/zcode/sessionMetadata.js:112 — sessionMetadata.resolveSessionMetadata has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 13). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionDetail.parseJsonNumber (cognitive 28) · ×1
  • sessionDetail.parseJsonNumber (cognitive 28) src/shared/providers/reasonix/sessionDetail.js:483 — sessionDetail.parseJsonNumber has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8, loops 3 (6 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 · sessions.sidecarCandidates (cognitive 28) · ×1
  • sessions.sidecarCandidates (cognitive 28) src/shared/providers/reasonix/sessions.js:202 — sessions.sidecarCandidates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 12). 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 · limits.parseZaiUsage (cognitive 28) · ×1
  • limits.parseZaiUsage (cognitive 28) src/shared/providers/zai/limits.js:204 — limits.parseZaiUsage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9, ternaries 5 (7 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 · limits.minimaxCodeAuthFiles (cognitive 28) · ×1
  • limits.minimaxCodeAuthFiles (cognitive 28) src/shared/providers/minimax/limits.js:395 — limits.minimaxCodeAuthFiles has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 3 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 12). 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 · panel.createNotchPanel (cognitive 28) · ×1
  • panel.createNotchPanel (cognitive 28) src/electron/renderer/notch/panel.js:41 — panel.createNotchPanel has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 3 (5 pts), loops 3, boolean chains 2 (nesting depth added 13). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 258, 1487, 60). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · tray.buildTrayMenuTemplate (cognitive 28) · ×1
  • tray.buildTrayMenuTemplate (cognitive 28) src/electron/tray.js:294 — tray.buildTrayMenuTemplate has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 16 (19 pts), boolean chains 7, if/else 1 (2 pts) (nesting depth added 4). Of this number, 15 points are the body's own statements and 13 belong to 7 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 · main.setupEdgeDock (cognitive 28) · ×1
  • main.setupEdgeDock (cognitive 28) site/scripts/main.js:1223 — main.setupEdgeDock has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12, boolean chains 8, ternaries 4 (5 pts), loops 3 (nesting depth added 1). Most of this is not in the body itself: 7 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 1267, a function literal at line 1362, a function literal at line 1253, …). 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 · windowsBackdrop.createWindowsDockBackdrop.start (cognitive 28) · ×1
  • windowsBackdrop.createWindowsDockBackdrop.start (cognitive 28) src/electron/edgeDock/windowsBackdrop.js:62 — windowsBackdrop.createWindowsDockBackdrop.start has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, ternaries 2 (4 pts), error handling 2 (3 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 7 of the 28 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 80, 77, 74, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · historyStore.createLimitsHistoryStore.adoptions (cognitive 28) · ×1
  • historyStore.createLimitsHistoryStore.adoptions (cognitive 28) src/electron/limits/historyStore.js:78 — historyStore.createLimitsHistoryStore.adoptions has cognitive complexity 28 (threshold 15). Drivers by points: loops 4 (10 pts), ternaries 2 (10 pts), if/else 2 (6 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · launchServicesRecovery.createMacWidgetLaunchServicesRecovery · ×1
  • launchServicesRecovery.createMacWidgetLaunchServicesRecovery::execute (cognitive 28) src/electron/macWidget/launchServicesRecovery.js:145 — launchServicesRecovery.createMacWidgetLaunchServicesRecovery::execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 6, ternaries 3 (5 pts), error handling 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · helpPopover.createHelpPopover (cognitive 28) · ×1
  • helpPopover.createHelpPopover (cognitive 28) src/electron/renderer/helpPopover.js:13 — helpPopover.createHelpPopover has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17, boolean chains 11. None of this is in the body itself: all 28 points belong to 14 function items inside it that branch (open, blur, a function literal at line 105, …). 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 · renderSubscriptionRows (cognitive 28) · ×1
  • renderSubscriptionRows (cognitive 28) REDACTED:3920 — renderSubscriptionRows has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 6 (11 pts), boolean chains 2, loops 1 (nesting depth added 11). Of this number, 19 points are the body's own statements and 9 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 · renderHomeSettingsList (cognitive 28) · ×1
  • renderHomeSettingsList (cognitive 28) REDACTED:10943 — renderHomeSettingsList has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (22 pts), if/else 2 (4 pts), boolean chains 1, 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 · deliverTrayProviderIcons (cognitive 28) · ×1
  • deliverTrayProviderIcons (cognitive 28) REDACTED:16632 — deliverTrayProviderIcons has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createPluginRuntime.confirmContentSwitch (cognitive 28) · ×1
  • createPluginRuntime.confirmContentSwitch (cognitive 28) src/electron/plugins/runtime.js:579 — createPluginRuntime.confirmContentSwitch has cognitive complexity 28 (threshold 15). Drivers by points: loops 3 (12 pts), if/else 4 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 16). Of this number, 26 points are the body's own statements and 2 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 · mergeCodexTransientWindows (cognitive 28) · ×1
  • mergeCodexTransientWindows (cognitive 28) src/shared/limits/core.js:717 — mergeCodexTransientWindows has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, ternaries 5 (6 pts), loops 2 (3 pts) (nesting depth added 6). Of this number, 22 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 · sessionSources (cognitive 28) · ×1
  • sessionSources (cognitive 28) src/shared/plugins/businessData.js:172 — sessionSources has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 11, if/else 5 (nesting depth added 1). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 183, allowed, id, …). 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 · createSyncContentRuntime.publishPatch (cognitive 28) · ×1
  • createSyncContentRuntime.publishPatch (cognitive 28) src/electron/syncContentRuntime.js:523 — createSyncContentRuntime.publishPatch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, ternaries 4 (8 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 528). 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 · sessionActivityProjection.applyActivityPatch (cognitive 27) · ×1
  • sessionActivityProjection.applyActivityPatch (cognitive 27) src/shared/sessionActivityProjection.js:202 — sessionActivityProjection.applyActivityPatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data.numericMeasure (cognitive 27) · ×1
  • data.numericMeasure (cognitive 27) src/electron/notch/data.js:71 — data.numericMeasure has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 7 (10 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 · collector.watchEntriesExceed (cognitive 27) · ×1
  • collector.watchEntriesExceed (cognitive 27) src/shared/collector.js:2618 — collector.watchEntriesExceed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 3 (8 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · desktop.readMimoDesktopAccount (cognitive 27) · ×1
  • desktop.readMimoDesktopAccount (cognitive 27) src/shared/providers/mimo/desktop.js:60 — desktop.readMimoDesktopAccount has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, error handling 3 (4 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 6). Of this number, 22 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 · limits.fetchMistralLimits (cognitive 27) · ×1
  • limits.fetchMistralLimits (cognitive 27) src/shared/providers/mistral/limits.js:119 — limits.fetchMistralLimits has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 8, if/else 5 (6 pts), error handling 2 (3 pts) (nesting depth added 5). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 127, 124, 127, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · icloudSync.createIcloudSyncStore.discoverDevices (cognitive 27) · ×1
  • icloudSync.createIcloudSyncStore.discoverDevices (cognitive 27) src/electron/icloudSync.js:694 — icloudSync.createIcloudSyncStore.discoverDevices has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, ternaries 3 (6 pts), 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 · accounts.createCopilotAccounts.addAccount (cognitive 27) · ×1
  • accounts.createCopilotAccounts.addAccount (cognitive 27) src/electron/providers/copilot/accounts.js:40 — accounts.createCopilotAccounts.addAccount has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 9 (11 pts), ternaries 3, loops 1 (2 pts) (nesting depth added 3). None of this is in the body itself: all 27 points belong to 2 function literals inside it that branch (lines 41, 59). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · appUpdater.textOutsideHtmlMarkup (cognitive 27) · ×1
  • appUpdater.textOutsideHtmlMarkup (cognitive 27) src/shared/appUpdater.js:253 — appUpdater.textOutsideHtmlMarkup has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 4, 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 · clientUsageArchive.applyArchivedClientUsage (cognitive 27) · ×1
  • clientUsageArchive.applyArchivedClientUsage (cognitive 27) src/shared/usage/clientUsageArchive.js:502 — clientUsageArchive.applyArchivedClientUsage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 3 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.renderLiveTokenRate (cognitive 27) · ×1
  • app.renderLiveTokenRate (cognitive 27) REDACTED:1262 — app.renderLiveTokenRate has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (14 pts), if/else 6 (7 pts), boolean chains 5, loops 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.
D2 · Cognitive Complexity · app.renderHome (cognitive 27) · ×1
  • app.renderHome (cognitive 27) REDACTED:7673 — app.renderHome has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 5, loops 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 13 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · app.syncDockControls (cognitive 27) · ×1
  • app.syncDockControls (cognitive 27) REDACTED:14778 — app.syncDockControls has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, boolean chains 7, loops 3, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · providerPresentation.limitProviderCompactWindows (cognitive 27) · ×1
  • providerPresentation.limitProviderCompactWindows (cognitive 27) src/electron/renderer/limits/providerPresentation.js:267 — providerPresentation.limitProviderCompactWindows has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (9 pts), if/else 7 (8 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 308, a function literal at line 271, a function literal at line 283, …). 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 · pluginContent.create.renderOne (cognitive 27) · ×1
  • pluginContent.create.renderOne (cognitive 27) src/electron/renderer/pluginContent.js:44 — pluginContent.create.renderOne has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, loops 2 (nesting depth added 5). Of this number, 21 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 · renderSettingsAppUpdateRow (cognitive 27) · ×1
  • renderSettingsAppUpdateRow (cognitive 27) REDACTED:1776 — renderSettingsAppUpdateRow has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 9, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderLimits (cognitive 27) · ×1
  • renderLimits (cognitive 27) REDACTED:5167 — renderLimits has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 16, if/else 5 (6 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 2). Of this number, 22 points are the body's own statements and 5 belong to 6 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 · persistBoundsSoon (cognitive 27) · ×1
  • persistBoundsSoon (cognitive 27) src/electron/main.js:2586 — persistBoundsSoon has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 2593). 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 · readCodexRpcWithCommand (cognitive 27) · ×1
  • readCodexRpcWithCommand (cognitive 27) src/shared/providers/codex/limits.js:1059 — readCodexRpcWithCommand has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 7). Of this number, 25 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validRevisionLedger (cognitive 27) · ×1
  • validRevisionLedger (cognitive 27) src/electron/icloudSync.js:467 — validRevisionLedger has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 8 (10 pts), loops 1, other 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 · createIcloudSyncStore.discoverDevices (cognitive 27) · ×1
  • createIcloudSyncStore.discoverDevices (cognitive 27) src/electron/icloudSync.js:694 — createIcloudSyncStore.discoverDevices has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, ternaries 3 (6 pts), 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 · createHost.mountRecord (cognitive 27) · ×1
  • createHost.mountRecord (cognitive 27) src/electron/renderer/pluginUi.js:176 — createHost.mountRecord has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 8, error handling 1 (nesting depth added 3). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: 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 · render (cognitive 27) · ×1
  • render (cognitive 27) src/electron/renderer/limits/history.js:145 — render has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 8, if/else 4 (6 pts), loops 1 (nesting depth added 4). Of this number, 24 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · fixedPeriodRanges.derivePeriod (cognitive 26) · ×1
  • fixedPeriodRanges.derivePeriod (cognitive 26) src/electron/renderer/fixedPeriodRanges.js:579 — fixedPeriodRanges.derivePeriod has cognitive complexity 26 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 3 (8 pts), boolean chains 4, ternaries 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 · paths.senpiTopology (cognitive 26) · ×1
  • paths.senpiTopology (cognitive 26) src/shared/providers/senpi/paths.js:87 — paths.senpiTopology has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 3, 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 · sessionIdentity.nativeIdForFile (cognitive 26) · ×1
  • sessionIdentity.nativeIdForFile (cognitive 26) src/shared/providers/codex/sessionIdentity.js:10 — sessionIdentity.nativeIdForFile has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 6 (8 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 · probe.quotaSummaryWindows (cognitive 26) · ×1
  • probe.quotaSummaryWindows (cognitive 26) REDACTED:483 — probe.quotaSummaryWindows has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 4 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). Of this number, 21 points are the body's own statements and 5 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 · limits.requestOllamaJson (cognitive 26) · ×1
  • limits.requestOllamaJson (cognitive 26) src/shared/providers/ollama/limits.js:371 — limits.requestOllamaJson has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 4 (6 pts), boolean chains 4, error handling 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · burnRate.recordLimitsSample (cognitive 26) · ×1
  • burnRate.recordLimitsSample (cognitive 26) src/shared/limits/burnRate.js:105 — burnRate.recordLimitsSample has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.createLimitsRuntime.applyAttempt (cognitive 26) · ×1
  • runtime.createLimitsRuntime.applyAttempt (cognitive 26) src/shared/limits/runtime.js:587 — runtime.createLimitsRuntime.applyAttempt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 10, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.setupDashboard (cognitive 26) · ×1
  • main.setupDashboard (cognitive 26) site/scripts/main.js:390 — main.setupDashboard has cognitive complexity 26 (threshold 15). Drivers by points: if/else 42 (56 pts), ternaries 16 (36 pts), loops 21 (29 pts), boolean chains 13 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (main.setupDashboard::heatmapSvg) 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 · titleSync.createAgentTitleSync.acquire (cognitive 26) · ×1
  • titleSync.createAgentTitleSync.acquire (cognitive 26) src/agent/titleSync.js:45 — titleSync.createAgentTitleSync.acquire has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 4 (8 pts), boolean chains 2, 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 · sessionUsageArchive.addArchivedSession (cognitive 26) · ×1
  • sessionUsageArchive.addArchivedSession (cognitive 26) src/shared/usage/sessionUsageArchive.js:397 — sessionUsageArchive.addArchivedSession has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 11, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionDeviceSources.projectSessionDeviceSessions (cognitive 26) · ×1
  • sessionDeviceSources.projectSessionDeviceSessions (cognitive 26) src/electron/sessionDeviceSources.js:7 — sessionDeviceSources.projectSessionDeviceSessions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 6, loops 3 (6 pts), ternaries 2 (5 pts) (nesting depth added 12). Of this number, 23 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 · historyDatabase.createHistoryDatabase.noteDaily (cognitive 26) · ×1
  • historyDatabase.createHistoryDatabase.noteDaily (cognitive 26) src/electron/limits/historyDatabase.js:146 — historyDatabase.createHistoryDatabase.noteDaily has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 18, ternaries 4 (5 pts), if/else 3 (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 · app.closeSubscriptionEditor (cognitive 26) · ×1
  • app.closeSubscriptionEditor (cognitive 26) REDACTED:4277 — app.closeSubscriptionEditor has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9, ternaries 5 (nesting depth added 1). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to 4 function items inside it that branch (restoreFocus, finish, onTransitionEnd, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · composer.createEdgeDockComposer.render (cognitive 26) · ×1
  • composer.createEdgeDockComposer.render (cognitive 26) src/electron/renderer/edgeDock/composer.js:477 — composer.createEdgeDockComposer.render has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 7, loops 1 (nesting depth added 1). Of this number, 21 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · pluginSettings.createPluginSettingsPanel.initialSetupControls (cognitive 26) · ×1
  • pluginSettings.createPluginSettingsPanel.initialSetupControls (cognitive 26) src/electron/renderer/pluginSettings.js:467 — pluginSettings.createPluginSettingsPanel.initialSetupControls has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (17 pts), if/else 4 (7 pts), boolean chains 1, 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 · saveAccountCredential (cognitive 26) · ×1
  • saveAccountCredential (cognitive 26) REDACTED:12659 — saveAccountCredential has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 9 (10 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 2). Of this number, 24 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · getSyncContentRuntime · ×1
  • getSyncContentRuntime::request (cognitive 26) src/electron/main.js:3947 — getSyncContentRuntime::request has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4 (7 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLimitWindowsView.renderCodexResetForecast (cognitive 26) · ×1
  • createLimitWindowsView.renderCodexResetForecast (cognitive 26) src/electron/renderer/limits/windowsView.js:2464 — createLimitWindowsView.renderCodexResetForecast has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 7, boolean chains 5 (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 · observationsFromGraphs (cognitive 26) · ×1
  • observationsFromGraphs (cognitive 26) src/shared/dailyHistoryArchive.js:289 — observationsFromGraphs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 2 (7 pts), ternaries 2 (7 pts), loops 3 (6 pts), boolean chains 3, other 3 (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 · createSyncContentRuntime.recoverStorage (cognitive 26) · ×1
  • createSyncContentRuntime.recoverStorage (cognitive 26) src/electron/syncContentRuntime.js:162 — createSyncContentRuntime.recoverStorage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, error handling 2 (4 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 6). Of this number, 23 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.
D2 · Cognitive Complexity · paths.normalizeWindowsPath (cognitive 25) · ×1
  • paths.normalizeWindowsPath (cognitive 25) src/shared/providers/reasonix/paths.js:74 — paths.normalizeWindowsPath has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5, 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 · package.parsePackage (cognitive 25) · ×1
  • package.parsePackage (cognitive 25) src/electron/plugins/package.js:30 — package.parsePackage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, loops 3 (4 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · managed.createManagedPlugins.recoverTransaction (cognitive 25) · ×1
  • managed.createManagedPlugins.recoverTransaction (cognitive 25) src/electron/plugins/managed.js:81 — managed.createManagedPlugins.recoverTransaction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4 (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 · controller.createNotchController.wheeled (cognitive 25) · ×1
  • controller.createNotchController.wheeled (cognitive 25) src/electron/notch/controller.js:703 — controller.createNotchController.wheeled has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 6, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · limits.runClaudePosixProbe (cognitive 25) · ×1
  • limits.runClaudePosixProbe (cognitive 25) src/shared/providers/claude/limits.js:2048 — limits.runClaudePosixProbe has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (6 pts), ternaries 5 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.readMessageActivity (cognitive 25) · ×1
  • session.readMessageActivity (cognitive 25) src/shared/providers/opencode/session.js:101 — session.readMessageActivity has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, ternaries 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchKiroLimits (cognitive 25) · ×1
  • limits.fetchKiroLimits (cognitive 25) REDACTED:371 — limits.fetchKiroLimits has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, ternaries 3 (6 pts), error handling 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 · limits.appendWorkbuddyRemovals (cognitive 25) · ×1
  • limits.appendWorkbuddyRemovals (cognitive 25) src/shared/providers/workbuddy/limits.js:522 — limits.appendWorkbuddyRemovals has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 17, if/else 7, ternaries 1. 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 (localComplete, a function literal at line 543, a function literal at line 532, …). 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 · credentials.createPluginCredentials.forget (cognitive 25) · ×1
  • credentials.createPluginCredentials.forget (cognitive 25) src/electron/plugins/credentials.js:86 — credentials.createPluginCredentials.forget has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 3 (7 pts), boolean chains 3, 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 · businessData.createBusinessDataService.publish (cognitive 25) · ×1
  • businessData.createBusinessDataService.publish (cognitive 25) src/electron/plugins/businessData.js:548 — businessData.createBusinessDataService.publish has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, loops 6, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backend.createPluginBackends.start (cognitive 25) · ×1
  • backend.createPluginBackends.start (cognitive 25) src/electron/plugins/backend.js:14 — backend.createPluginBackends.start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 31, 48). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · syncContentRuntime.createSyncContentRuntime.recoverStorage (cognitive 25) · ×1
  • syncContentRuntime.createSyncContentRuntime.recoverStorage (cognitive 25) src/electron/syncContentRuntime.js:162 — syncContentRuntime.createSyncContentRuntime.recoverStorage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, error handling 2 (4 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 6). Of this number, 22 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · docs.watchTopic (cognitive 25) · ×1
  • docs.watchTopic (cognitive 25) site/scripts/docs.js:308 — docs.watchTopic has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 7, loops 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 332, mark, a function literal at line 325, …). 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 · oauthLogin.runAntigravityOAuthLogin (cognitive 25) · ×1
  • oauthLogin.runAntigravityOAuthLogin (cognitive 25) REDACTED:23 — oauthLogin.runAntigravityOAuthLogin has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, if/else 11, ternaries 2, error handling 1. Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 50, settle, a function literal at line 80, …). 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 · transcriptReader.detailRecord (cognitive 25) · ×1
  • transcriptReader.detailRecord (cognitive 25) src/shared/providers/dsh/transcriptReader.js:80 — transcriptReader.detailRecord has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (9 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionDetailResolver.resolveSessionDetailForPlatform (cognitive 25) · ×1
  • sessionDetailResolver.resolveSessionDetailForPlatform (cognitive 25) src/shared/sessionDetailResolver.js:22 — sessionDetailResolver.resolveSessionDetailForPlatform has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (9 pts), if/else 3 (5 pts), error handling 1, loops 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · historyStore.readBoundedRegularFileNoFollow (cognitive 25) · ×1
  • historyStore.readBoundedRegularFileNoFollow (cognitive 25) src/electron/macWidget/historyStore.js:154 — historyStore.readBoundedRegularFileNoFollow has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · historyStore.pruneMacWidgetHistoryCaches (cognitive 25) · ×1
  • historyStore.pruneMacWidgetHistoryCaches (cognitive 25) src/electron/macWidget/historyStore.js:240 — historyStore.pruneMacWidgetHistoryCaches has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 3 (5 pts), boolean chains 4, loops 2 (nesting depth added 9). Of this number, 22 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · contentBlur.create.update (cognitive 25) · ×1
  • contentBlur.create.update (cognitive 25) src/electron/renderer/contentBlur.js:121 — contentBlur.create.update has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (8 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · homeOverview.homeLimitAccountsForProviders (cognitive 25) · ×1
  • homeOverview.homeLimitAccountsForProviders (cognitive 25) src/electron/renderer/homeOverview.js:257 — homeOverview.homeLimitAccountsForProviders has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, ternaries 4 (8 pts), if/else 1 (2 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 280, 272, 273). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · providerPresentation.pluginLimitSettingsStatus (cognitive 25) · ×1
  • providerPresentation.pluginLimitSettingsStatus (cognitive 25) src/electron/renderer/limits/providerPresentation.js:653 — providerPresentation.pluginLimitSettingsStatus has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 7, boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · windowsView.createLimitWindowsView.codexResetForecastTooltip (cognitive 25) · ×1
  • windowsView.createLimitWindowsView.codexResetForecastTooltip (cognitive 25) src/electron/renderer/limits/windowsView.js:2393 — windowsView.createLimitWindowsView.codexResetForecastTooltip has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 6). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginSettings.createPluginSettingsPanel.pluginCard (cognitive 25) · ×1
  • pluginSettings.createPluginSettingsPanel.pluginCard (cognitive 25) src/electron/renderer/pluginSettings.js:1019 — pluginSettings.createPluginSettingsPanel.pluginCard has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). Of this number, 21 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginUi.createHost.mountRecord (cognitive 25) · ×1
  • pluginUi.createHost.mountRecord (cognitive 25) src/electron/renderer/pluginUi.js:176 — pluginUi.createHost.mountRecord has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 8, 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 · qoderCollectionSettings.create (cognitive 25) · ×1
  • qoderCollectionSettings.create (cognitive 25) src/electron/renderer/qoderCollectionSettings.js:8 — qoderCollectionSettings.create has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 2 (4 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 11). Of this number, 14 points are the body's own statements and 11 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 · onPreferenceOrderKeydown (cognitive 25) · ×1
  • onPreferenceOrderKeydown (cognitive 25) REDACTED:13420 — onPreferenceOrderKeydown has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (8 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchStats (cognitive 25) · ×1
  • fetchStats (cognitive 25) src/electron/main.js:7294 — fetchStats has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, ternaries 4 (6 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · createLimitWindowsView.codexResetForecastTooltip (cognitive 25) · ×1
  • createLimitWindowsView.codexResetForecastTooltip (cognitive 25) src/electron/renderer/limits/windowsView.js:2393 — createLimitWindowsView.codexResetForecastTooltip has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 6). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeSessionModelComponents (cognitive 25) · ×1
  • normalizeSessionModelComponents (cognitive 25) src/shared/usage.js:637 — normalizeSessionModelComponents has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, loops 4 (5 pts), ternaries 1 (nesting depth added 7). Of this number, 24 points are the body's own statements and 1 belongs 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 · createPluginSettingsPanel.initialSetupControls (cognitive 25) · ×1
  • createPluginSettingsPanel.initialSetupControls (cognitive 25) src/electron/renderer/pluginSettings.js:467 — createPluginSettingsPanel.initialSetupControls has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 4 (7 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createPluginSettingsPanel.packagePanel (cognitive 25) · ×1
  • createPluginSettingsPanel.packagePanel (cognitive 25) src/electron/renderer/pluginSettings.js:518 — createPluginSettingsPanel.packagePanel has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11, if/else 9, boolean chains 5. Of this number, 22 points are the body's own statements and 3 belong to 6 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 · createNotchController.wheeled (cognitive 25) · ×1
  • createNotchController.wheeled (cognitive 25) src/electron/notch/controller.js:703 — createNotchController.wheeled has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 6, ternaries 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · validateDailyHistoryArchiveDocument (cognitive 25) · ×1
  • validateDailyHistoryArchiveDocument (cognitive 25) src/shared/dailyHistoryArchive.js:757 — validateDailyHistoryArchiveDocument has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (8 pts), loops 3, error handling 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 · createBusinessDataService.publish (cognitive 25) · ×1
  • createBusinessDataService.publish (cognitive 25) src/electron/plugins/businessData.js:548 — createBusinessDataService.publish has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 6, boolean chains 4, ternaries 3 (4 pts), error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchClineLimits (cognitive 25) · ×1
  • fetchClineLimits (cognitive 25) src/shared/providers/cline/limits.js:450 — fetchClineLimits has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), ternaries 6, error handling 3 (4 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 · createEdgeDockComposer.render (cognitive 25) · ×1
  • createEdgeDockComposer.render (cognitive 25) src/electron/renderer/edgeDock/composer.js:477 — createEdgeDockComposer.render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10, boolean chains 7, ternaries 7, loops 1. Of this number, 21 points are the body's own statements and 4 belong to 6 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · parseOllamaIncludedBalance (cognitive 25) · ×1
  • parseOllamaIncludedBalance (cognitive 25) src/shared/providers/ollama/limits.js:304 — parseOllamaIncludedBalance has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8, ternaries 6 (8 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 · trayLayout.createTrayLayoutItem (cognitive 24) · ×1
  • trayLayout.createTrayLayoutItem (cognitive 24) src/shared/trayLayout.js:251 — trayLayout.createTrayLayoutItem has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, ternaries 6 (10 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · presentation.accountSummary (cognitive 24) · ×1
  • presentation.accountSummary (cognitive 24) src/electron/renderer/edgeDock/presentation.js:124 — presentation.accountSummary has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, ternaries 9 (12 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · presentation.buildEdgeDockCells (cognitive 24) · ×1
  • presentation.buildEdgeDockCells (cognitive 24) src/electron/renderer/edgeDock/presentation.js:881 — presentation.buildEdgeDockCells has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 7, ternaries 4 (6 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 · controller.createNotchController.refreshLayout (cognitive 24) · ×1
  • controller.createNotchController.refreshLayout (cognitive 24) src/electron/notch/controller.js:463 — controller.createNotchController.refreshLayout has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 6 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · controller.createEdgeDockController.createSurface (cognitive 24) · ×1
  • controller.createEdgeDockController.createSurface (cognitive 24) src/electron/edgeDock/controller.js:602 — controller.createEdgeDockController.createSurface has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 7 (9 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 4). Of this number, 16 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · usageEvents.createCursorUsageEventIndex.readCursorUsageEvents (cognitive 24) · ×1
  • usageEvents.createCursorUsageEventIndex.readCursorUsageEvents (cognitive 24) src/shared/providers/cursor/usageEvents.js:82 — usageEvents.createCursorUsageEventIndex.readCursorUsageEvents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchOllamaLimits (cognitive 24) · ×1
  • limits.fetchOllamaLimits (cognitive 24) src/shared/providers/ollama/limits.js:561 — limits.fetchOllamaLimits has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, ternaries 4 (6 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · desktop.readManusDesktopSession (cognitive 24) · ×1
  • desktop.readManusDesktopSession (cognitive 24) src/shared/providers/manus/desktop.js:89 — desktop.readManusDesktopSession has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 3 (4 pts), ternaries 4 (nesting depth added 4). 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: 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 · businessData.createBusinessDataService.lazyPage (cognitive 24) · ×1
  • businessData.createBusinessDataService.lazyPage (cognitive 24) src/electron/plugins/businessData.js:363 — businessData.createBusinessDataService.lazyPage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5, loops 2 (nesting depth added 6). Of this number, 21 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 · panel.createNotchPanel.paintStatus (cognitive 24) · ×1
  • panel.createNotchPanel.paintStatus (cognitive 24) src/electron/renderer/notch/panel.js:514 — panel.createNotchPanel.paintStatus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (5 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · panel.createNotchPanel.breakdownColumn (cognitive 24) · ×1
  • panel.createNotchPanel.breakdownColumn (cognitive 24) src/electron/renderer/notch/panel.js:1224 — panel.createNotchPanel.breakdownColumn has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 5, if/else 2, loops 1 (nesting depth added 5). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (labelFor, colorFor, a function literal at line 1242, …). 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 · diagnosticReport.projectLimitsDiagnostics.providers (cognitive 24) · ×1
  • diagnosticReport.projectLimitsDiagnostics.providers (cognitive 24) src/shared/diagnosticReport.js:306 — diagnosticReport.projectLimitsDiagnostics.providers has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (19 pts), boolean chains 5 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · windowsBackdrop.syncWindowsBackdrop (cognitive 24) · ×1
  • windowsBackdrop.syncWindowsBackdrop (cognitive 24) src/electron/windowsBackdrop.js:144 — windowsBackdrop.syncWindowsBackdrop has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 9 (10 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 2). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · anchorSeed.deviceRecordFromAnchor (cognitive 24) · ×1
  • anchorSeed.deviceRecordFromAnchor (cognitive 24) src/shared/anchorSeed.js:26 — anchorSeed.deviceRecordFromAnchor has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 6, if/else 5, error handling 1 (2 pts) (nesting depth added 2). Of this number, 18 points are the body's own statements and 6 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 · selectControl.enhance (cognitive 24) · ×1
  • selectControl.enhance (cognitive 24) src/electron/renderer/selectControl.js:55 — selectControl.enhance has cognitive complexity 24 (threshold 15). Drivers by points: if/else 98 (121 pts), boolean chains 64, ternaries 12 (14 pts), loops 9 (11 pts) (nesting depth added 27). 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 · accountSlotsPanel.createPanel.rowFor (cognitive 24) · ×1
  • accountSlotsPanel.createPanel.rowFor (cognitive 24) src/electron/renderer/limits/accountSlotsPanel.js:174 — accountSlotsPanel.createPanel.rowFor has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 4 (5 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 195, a function literal at line 255, rename, …). 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 · main.normalizeCodexManagedAccounts (cognitive 24) · ×1
  • main.normalizeCodexManagedAccounts (cognitive 24) src/electron/main.js:1165 — main.normalizeCodexManagedAccounts has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (7 pts), ternaries 2 (4 pts), 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 · app.updateOpenCodeProfilesStatus (cognitive 24) · ×1
  • app.updateOpenCodeProfilesStatus (cognitive 24) REDACTED:18649 — app.updateOpenCodeProfilesStatus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, 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 · windowsView.createLimitWindowsView.limitProviderPlan (cognitive 24) · ×1
  • windowsView.createLimitWindowsView.limitProviderPlan (cognitive 24) src/electron/renderer/limits/windowsView.js:2032 — windowsView.createLimitWindowsView.limitProviderPlan has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (7 pts), ternaries 4 (6 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 · windowsView.createLimitWindowsView.renderLimitProviderHead (cognitive 24) · ×1
  • windowsView.createLimitWindowsView.renderLimitProviderHead (cognitive 24) src/electron/renderer/limits/windowsView.js:2240 — windowsView.createLimitWindowsView.renderLimitProviderHead has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9, ternaries 4 (5 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 · rowDragController.createRowDragController.finishRowDrag (cognitive 24) · ×1
  • rowDragController.createRowDragController.finishRowDrag (cognitive 24) src/electron/renderer/rowDragController.js:284 — rowDragController.createRowDragController.finishRowDrag has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (6 pts), boolean chains 1, error handling 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 292). 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 · usageCharts.heatmapSvg (cognitive 24) · ×1
  • usageCharts.heatmapSvg (cognitive 24) src/electron/renderer/usageCharts.js:602 — usageCharts.heatmapSvg has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, ternaries 7, if/else 2. Of this number, 19 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · collectorAnchorTrust (cognitive 24) · ×1
  • collectorAnchorTrust (cognitive 24) src/shared/collector.js:2503 — collectorAnchorTrust has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 9 (11 pts), other 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · startCollector.setupWatchers · ×1
  • startCollector.setupWatchers::handleWatchEvent (cognitive 24) src/shared/collector.js:3864 — startCollector.setupWatchers::handleWatchEvent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, ternaries 2 (4 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.
D2 · Cognitive Complexity · createLimitWindowsView.limitProviderPlan (cognitive 24) · ×1
  • createLimitWindowsView.limitProviderPlan (cognitive 24) src/electron/renderer/limits/windowsView.js:2032 — createLimitWindowsView.limitProviderPlan has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (7 pts), ternaries 4 (6 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 · createLimitWindowsView.renderLimitProviderHead (cognitive 24) · ×1
  • createLimitWindowsView.renderLimitProviderHead (cognitive 24) src/electron/renderer/limits/windowsView.js:2240 — createLimitWindowsView.renderLimitProviderHead has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9, ternaries 4 (5 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 · createPluginSettingsPanel.pluginCard (cognitive 24) · ×1
  • createPluginSettingsPanel.pluginCard (cognitive 24) src/electron/renderer/pluginSettings.js:1019 — createPluginSettingsPanel.pluginCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). Of this number, 20 points are the body's own statements and 4 belong to 12 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · createEdgeDockController.createSurface (cognitive 24) · ×1
  • createEdgeDockController.createSurface (cognitive 24) src/electron/edgeDock/controller.js:602 — createEdgeDockController.createSurface has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 7 (8 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 3). Of this number, 16 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sessionRowsFor (cognitive 24) · ×1
  • sessionRowsFor (cognitive 24) src/electron/renderer/edgeDock/presentation.js:274 — sessionRowsFor has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 20, ternaries 3, other 1. None of this is in the body itself: all 24 points belong to one function literal inside it that branches (line 275). 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 · parseMinimaxCodePlan (cognitive 24) · ×1
  • parseMinimaxCodePlan (cognitive 24) src/shared/providers/minimax/limits.js:183 — parseMinimaxCodePlan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (8 pts), boolean chains 7, loops 1 (nesting depth added 7). Of this number, 19 points are the body's own statements and 5 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 · createBusinessDataService.lazyPage (cognitive 24) · ×1
  • createBusinessDataService.lazyPage (cognitive 24) src/electron/plugins/businessData.js:363 — createBusinessDataService.lazyPage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5, loops 2 (nesting depth added 6). Of this number, 21 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 · consumeTypedRecord (cognitive 24) · ×1
  • consumeTypedRecord (cognitive 24) src/shared/providers/reasonix/sessionDetail.js:382 — consumeTypedRecord has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (9 pts), ternaries 2 (4 pts) (nesting depth added 4). Of this number, 20 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 · createSyncPayloadUploader · ×1
  • createSyncPayloadUploader::upload (cognitive 24) src/shared/syncPayload.js:407 — createSyncPayloadUploader::upload has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, ternaries 4 (6 pts), 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 · probe (cognitive 24) · ×1
  • probe (cognitive 24) src/shared/providers/cursor/probe.js:335 — probe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 8 (11 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createRowDragController.finishRowDrag (cognitive 24) · ×1
  • createRowDragController.finishRowDrag (cognitive 24) src/electron/renderer/rowDragController.js:284 — createRowDragController.finishRowDrag has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (6 pts), boolean chains 1, error handling 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 292). 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 · createPanel.rowFor (cognitive 24) · ×1
  • createPanel.rowFor (cognitive 24) src/electron/renderer/limits/accountSlotsPanel.js:174 — createPanel.rowFor has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 4 (5 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 195, a function literal at line 255, rename, …). 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 · runTokscaleSubcommand (cognitive 24) · ×1
  • runTokscaleSubcommand (cognitive 24) src/shared/providers/cursor/auth.js:189 — runTokscaleSubcommand has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 6, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 199, a function literal at line 258, (anonymous)::finish, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · drawTrend (cognitive 24) · ×1
  • drawTrend (cognitive 24) src/electron/renderer/limits/history.js:53 — drawTrend has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 5 (7 pts), boolean chains 3, loops 2 (nesting depth added 8). Of this number, 19 points are the body's own statements and 5 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 · core.mergeOpenCodeProviderComponents (cognitive 23) · ×1
  • core.mergeOpenCodeProviderComponents (cognitive 23) src/shared/limits/core.js:897 — core.mergeOpenCodeProviderComponents has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (9 pts), loops 2 (3 pts), if/else 1 (nesting depth added 4). 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 · hubDelta.createStatsStreamReceiver.receive (cognitive 23) · ×1
  • hubDelta.createStatsStreamReceiver.receive (cognitive 23) src/shared/hubDelta.js:96 — hubDelta.createStatsStreamReceiver.receive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 9 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.resolveSessionMetadata (cognitive 23) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 23) src/shared/providers/claude/sessionMetadata.js:643 — sessionMetadata.resolveSessionMetadata has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 15 (19 pts), boolean chains 18, if/else 7 (11 pts), loops 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (sessionMetadata.resolveSessionMetadata::applyFile) 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 · extension.readConversation (cognitive 23) · ×1
  • extension.readConversation (cognitive 23) src/shared/providers/codebuddy/extension.js:129 — extension.readConversation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (5 pts), boolean chains 4, error handling 2 (3 pts), loops 2 (nesting depth added 7). Of this number, 16 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · localUsageSource.createLocalUsageSource.poll (cognitive 23) · ×1
  • localUsageSource.createLocalUsageSource.poll (cognitive 23) src/shared/providers/codex/localUsageSource.js:327 — localUsageSource.createLocalUsageSource.poll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 2, 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 · collector.startCollector.setupWatchers · ×1
  • collector.startCollector.setupWatchers::handleWatchEvent (cognitive 23) src/shared/collector.js:3864 — collector.startCollector.setupWatchers::handleWatchEvent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 10, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · limits.fetchFactoryWithToken (cognitive 23) · ×1
  • limits.fetchFactoryWithToken (cognitive 23) src/shared/providers/factory/limits.js:220 — limits.fetchFactoryWithToken has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), ternaries 2 (5 pts), error handling 2 (4 pts), loops 1 (nesting depth added 7). Of this number, 19 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 · limits.fetchDevinLimits (cognitive 23) · ×1
  • limits.fetchDevinLimits (cognitive 23) src/shared/providers/devin/limits.js:311 — limits.fetchDevinLimits has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (7 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.parseUsage (cognitive 23) · ×1
  • limits.parseUsage (cognitive 23) src/shared/providers/typesafe/limits.js:213 — limits.parseUsage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, ternaries 4 (6 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.findByKey (cognitive 23) · ×1
  • limits.findByKey (cognitive 23) src/shared/providers/alibaba/limits.js:263 — limits.findByKey has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 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 · limits.fetchHarkLimits (cognitive 23) · ×1
  • limits.fetchHarkLimits (cognitive 23) src/shared/providers/hark/limits.js:133 — limits.fetchHarkLimits has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (7 pts), ternaries 4, error handling 2 (3 pts) (nesting depth added 3). Of this number, 20 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: 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 · credentials.createPluginCredentials.commit (cognitive 23) · ×1
  • credentials.createPluginCredentials.commit (cognitive 23) src/electron/plugins/credentials.js:52 — credentials.createPluginCredentials.commit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, loops 1 (2 pts), ternaries 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 · tray.trayIconOpaqueBounds (cognitive 23) · ×1
  • tray.trayIconOpaqueBounds (cognitive 23) src/electron/tray.js:153 — tray.trayIconOpaqueBounds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.setupLangMenu (cognitive 23) · ×1
  • main.setupLangMenu (cognitive 23) site/scripts/main.js:1087 — main.setupLangMenu has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 1136, a function literal at line 1144, a function literal at line 1113, …). 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 · deviceState.mergeUsagePart (cognitive 23) · ×1
  • deviceState.mergeUsagePart (cognitive 23) src/shared/usage/deviceState.js:65 — deviceState.mergeUsagePart has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 2 (5 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 · icloudSync.createIcloudSyncStore.discoverSubscriptions (cognitive 23) · ×1
  • icloudSync.createIcloudSyncStore.discoverSubscriptions (cognitive 23) src/electron/icloudSync.js:1154 — icloudSync.createIcloudSyncStore.discoverSubscriptions has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (6 pts), ternaries 3 (5 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · icloudSyncRuntime.createIcloudSyncRuntime.writeDevice (cognitive 23) · ×1
  • icloudSyncRuntime.createIcloudSyncRuntime.writeDevice (cognitive 23) src/electron/icloudSyncRuntime.js:383 — icloudSyncRuntime.createIcloudSyncRuntime.writeDevice has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, ternaries 2, error handling 1 (nesting depth added 2). 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, 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 · historyModel.historyReadings (cognitive 23) · ×1
  • historyModel.historyReadings (cognitive 23) src/electron/renderer/limits/historyModel.js:19 — historyModel.historyReadings has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 9, if/else 2 (nesting depth added 4). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · historyController.createLimitsHistoryController.register (cognitive 23) · ×1
  • historyController.createLimitsHistoryController.register (cognitive 23) src/electron/limits/historyController.js:317 — historyController.createLimitsHistoryController.register has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8 (nesting depth added 2). None of this is in the body itself: all 23 points belong to 6 function literals inside it that branch (lines 343, 326, 319, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · main.isAllowedExternalUrl (cognitive 23) · ×1
  • main.isAllowedExternalUrl (cognitive 23) src/electron/main.js:7823 — main.isAllowedExternalUrl has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 10, 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 · app.homeLimitRows (cognitive 23) · ×1
  • app.homeLimitRows (cognitive 23) REDACTED:6828 — app.homeLimitRows has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 6, if/else 4 (6 pts) (nesting depth added 6). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 6867, 6857, 6839, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · displaySettingsPreview.create (cognitive 23) · ×1
  • displaySettingsPreview.create (cognitive 23) REDACTED:4 — displaySettingsPreview.create has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, loops 2 (nesting depth added 10). None of this is in the body itself: all 23 points belong to 4 function literals inside it that branch (lines 31, 28, 40, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · usageCharts.contribHeatmap (cognitive 23) · ×1
  • usageCharts.contribHeatmap (cognitive 23) src/electron/renderer/usageCharts.js:243 — usageCharts.contribHeatmap has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), ternaries 5 (6 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · performFixedPeriodHistoryLoad (cognitive 23) · ×1
  • performFixedPeriodHistoryLoad (cognitive 23) REDACTED:6367 — performFixedPeriodHistoryLoad has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderSyncPanelDevices (cognitive 23) · ×1
  • renderSyncPanelDevices (cognitive 23) REDACTED:9462 — renderSyncPanelDevices has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (5 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 6). Of this number, 17 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 · sendPush (cognitive 23) · ×1
  • sendPush (cognitive 23) src/electron/main.js:5240 — sendPush has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (8 pts), boolean chains 5 (nesting depth added 8). Of this number, 22 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createNotchPanel.paintStatus (cognitive 23) · ×1
  • createNotchPanel.paintStatus (cognitive 23) src/electron/renderer/notch/panel.js:514 — createNotchPanel.paintStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 4, loops 1 (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 · createIcloudSyncStore.writeDeviceNow (cognitive 23) · ×1
  • createIcloudSyncStore.writeDeviceNow (cognitive 23) src/electron/icloudSync.js:912 — createIcloudSyncStore.writeDeviceNow has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, ternaries 4 (6 pts), if/else 4, error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · hasMatchingHtmlClosingTag (cognitive 23) · ×1
  • hasMatchingHtmlClosingTag (cognitive 23) src/shared/appUpdater.js:193 — hasMatchingHtmlClosingTag has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseKimiMembershipStats (cognitive 23) · ×1
  • parseKimiMembershipStats (cognitive 23) src/shared/providers/kimi/limits.js:365 — parseKimiMembershipStats has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (7 pts), if/else 4 (5 pts), other 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 · normalizeClientHealth (cognitive 23) · ×1
  • normalizeClientHealth (cognitive 23) src/shared/clientHealth.js:462 — normalizeClientHealth has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLimitsHistoryController.register (cognitive 23) · ×1
  • createLimitsHistoryController.register (cognitive 23) src/electron/limits/historyController.js:317 — createLimitsHistoryController.register has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8 (nesting depth added 2). None of this is in the body itself: all 23 points belong to 8 function literals inside it that branch (lines 343, 326, 319, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · drawDistribution (cognitive 23) · ×1
  • drawDistribution (cognitive 23) src/electron/renderer/limits/history.js:98 — drawDistribution has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 3, loops 2 (3 pts), boolean chains 2, other 2 (nesting depth added 5). Of this number, 17 points are the body's own statements and 6 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 · sessionActivityProjection.indexFor (cognitive 22) · ×1
  • sessionActivityProjection.indexFor (cognitive 22) src/shared/sessionActivityProjection.js:32 — sessionActivityProjection.indexFor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · accountIdentity.sameAccount (cognitive 22) · ×1
  • accountIdentity.sameAccount (cognitive 22) src/electron/renderer/accountIdentity.js:176 — accountIdentity.sameAccount has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (10 pts), loops 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 · accountSlots.normalizeAccountSlots (cognitive 22) · ×1
  • accountSlots.normalizeAccountSlots (cognitive 22) src/shared/limits/accountSlots.js:21 — accountSlots.normalizeAccountSlots has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 7, if/else 3 (5 pts), loops 1 (nesting depth added 6). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providerHelpers.fetchJson (cognitive 22) · ×1
  • providerHelpers.fetchJson (cognitive 22) REDACTED:186 — providerHelpers.fetchJson has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 5 (7 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 · sessionMetadata.resolveSessionMetadata · ×1
  • sessionMetadata.resolveSessionMetadata::applyFile (cognitive 22) src/shared/providers/claude/sessionMetadata.js:696 — sessionMetadata.resolveSessionMetadata::applyFile has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, ternaries 9, if/else 3 (4 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (sessionMetadata.resolveSessionMetadata) 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 · sessionFiles.dshSessionFiles (cognitive 22) · ×1
  • sessionFiles.dshSessionFiles (cognitive 22) src/shared/providers/dsh/sessionFiles.js:128 — sessionFiles.dshSessionFiles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (6 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.
D2 · Cognitive Complexity · sessionFiles.foldDshSessionState (cognitive 22) · ×1
  • sessionFiles.foldDshSessionState (cognitive 22) src/shared/providers/dsh/sessionFiles.js:298 — sessionFiles.foldDshSessionState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (2 pts), boolean chains 1, loops 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 · session.readSessionEvents (cognitive 22) · ×1
  • session.readSessionEvents (cognitive 22) src/shared/providers/opencode/session.js:452 — session.readSessionEvents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (5 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.jsonEnd (cognitive 22) · ×1
  • limits.jsonEnd (cognitive 22) src/shared/providers/mistral/limits.js:35 — limits.jsonEnd has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchOpendesignLimits (cognitive 22) · ×1
  • limits.fetchOpendesignLimits (cognitive 22) src/shared/providers/opendesign/limits.js:65 — limits.fetchOpendesignLimits has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 7, boolean chains 6, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 76, 75). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · network.createPluginNetwork.request (cognitive 22) · ×1
  • network.createPluginNetwork.request (cognitive 22) src/electron/plugins/network.js:7 — network.createPluginNetwork.request has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), error handling 2, ternaries 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · panel.createNotchPanel.renderSessions (cognitive 22) · ×1
  • panel.createNotchPanel.renderSessions (cognitive 22) src/electron/renderer/notch/panel.js:1139 — panel.createNotchPanel.renderSessions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 6). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagnosticSnapshot.diagnosticStreamDetailCode (cognitive 22) · ×1
  • diagnosticSnapshot.diagnosticStreamDetailCode (cognitive 22) src/electron/diagnosticSnapshot.js:78 — diagnosticSnapshot.diagnosticStreamDetailCode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · icloudSync.createIcloudSyncStore.writeDeviceNow (cognitive 22) · ×1
  • icloudSync.createIcloudSyncStore.writeDeviceNow (cognitive 22) src/electron/icloudSync.js:912 — icloudSync.createIcloudSyncStore.writeDeviceNow has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 13, if/else 4, ternaries 3 (4 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 · main.performCodexSystemAccountSwitch (cognitive 22) · ×1
  • main.performCodexSystemAccountSwitch (cognitive 22) src/electron/main.js:2047 — main.performCodexSystemAccountSwitch has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, error handling 6 (8 pts), if/else 3, ternaries 1 (2 pts) (nesting depth added 3). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.renderToolDetailAccordion (cognitive 22) · ×1
  • app.renderToolDetailAccordion (cognitive 22) REDACTED:2606 — app.renderToolDetailAccordion has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.createTrayComposer (cognitive 22) · ×1
  • app.createTrayComposer (cognitive 22) REDACTED:16479 — app.createTrayComposer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 5 (7 pts) (nesting depth added 4). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 16512, 16490, 16497, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · app.apiKeyAccountStatusText (cognitive 22) · ×1
  • app.apiKeyAccountStatusText (cognitive 22) REDACTED:17660 — app.apiKeyAccountStatusText has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (11 pts), boolean chains 7, if/else 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · windowsView.createLimitWindowsView.renderLimitProviderGroup (cognitive 22) · ×1
  • windowsView.createLimitWindowsView.renderLimitProviderGroup (cognitive 22) src/electron/renderer/limits/windowsView.js:3036 — windowsView.createLimitWindowsView.renderLimitProviderGroup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 8). 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 · usageCharts.modelVendorFor (cognitive 22) · ×1
  • usageCharts.modelVendorFor (cognitive 22) src/electron/renderer/usageCharts.js:441 — usageCharts.modelVendorFor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · renderSessionGroupDetail (cognitive 22) · ×1
  • renderSessionGroupDetail (cognitive 22) REDACTED:5805 — renderSessionGroupDetail has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, loops 3 (7 pts), if/else 4 (5 pts), ternaries 1 (nesting depth added 5). Of this number, 19 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 · renderHomeTrendsModule (cognitive 22) · ×1
  • renderHomeTrendsModule (cognitive 22) REDACTED:7537 — renderHomeTrendsModule has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (6 pts), if/else 3 (4 pts), loops 1, other 1 (nesting depth added 3). Of this number, 21 points are the body's own statements and 1 belongs to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · spawnTokscaleJson (cognitive 22) · ×1
  • spawnTokscaleJson (cognitive 22) src/shared/collector.js:252 — spawnTokscaleJson has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, boolean chains 5, error handling 2. Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 307, (anonymous)::finish, a function literal at line 255, …). 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 · createLimitWindowsView.renderLimitProviderGroup (cognitive 22) · ×1
  • createLimitWindowsView.renderLimitProviderGroup (cognitive 22) src/electron/renderer/limits/windowsView.js:3036 — createLimitWindowsView.renderLimitProviderGroup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 20 points are the body's own statements and 2 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providerCellNode (cognitive 22) · ×1
  • providerCellNode (cognitive 22) REDACTED:792 — providerCellNode has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, ternaries 6 (7 pts), if/else 6, other 1 (nesting depth added 1). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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 · createNotchPanel.renderSessions (cognitive 22) · ×1
  • createNotchPanel.renderSessions (cognitive 22) src/electron/renderer/notch/panel.js:1139 — createNotchPanel.renderSessions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 6). Of this number, 20 points are the body's own statements and 2 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 · runCodexLoginWithCommand (cognitive 22) · ×1
  • runCodexLoginWithCommand (cognitive 22) src/shared/providers/codex/limits.js:681 — runCodexLoginWithCommand has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), ternaries 3, error handling 1, other 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 9 belong to 8 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · createNotchController.animateShell (cognitive 22) · ×1
  • createNotchController.animateShell (cognitive 22) src/electron/notch/controller.js:580 — createNotchController.animateShell has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, ternaries 7, other 4, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · sanitizeDiagnosticSnapshot (cognitive 22) · ×1
  • sanitizeDiagnosticSnapshot (cognitive 22) src/shared/diagnosticReport.js:741 — sanitizeDiagnosticSnapshot has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, ternaries 6, 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 · validSubscriptionDocument (cognitive 22) · ×1
  • validSubscriptionDocument (cognitive 22) src/electron/icloudSync.js:385 — validSubscriptionDocument has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · createIcloudSyncStore.discoverSubscriptions (cognitive 22) · ×1
  • createIcloudSyncStore.discoverSubscriptions (cognitive 22) src/electron/icloudSync.js:1154 — createIcloudSyncStore.discoverSubscriptions has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), ternaries 3 (5 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeLimitWindow (cognitive 22) · ×1
  • normalizeLimitWindow (cognitive 22) src/shared/limits/core.js:173 — normalizeLimitWindow has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9, boolean chains 6, other 5, if/else 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 · grokBotSessionIdsForMaps (cognitive 22) · ×1
  • grokBotSessionIdsForMaps (cognitive 22) src/electron/renderer/sessionRows.js:435 — grokBotSessionIdsForMaps has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 7). Of this number, 19 points are the body's own statements and 3 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 · createBusinessDataService.lazyQuery (cognitive 22) · ×1
  • createBusinessDataService.lazyQuery (cognitive 22) src/electron/plugins/businessData.js:326 — createBusinessDataService.lazyQuery has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (2 pts), other 1 (nesting depth added 9). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 6 function items inside it that branch (check, a function literal at line 342, a function literal at line 330, …). 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 · parseGrokGrpcWebBilling (cognitive 22) · ×1
  • parseGrokGrpcWebBilling (cognitive 22) src/shared/providers/grok/limits.js:407 — parseGrokGrpcWebBilling has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, ternaries 5, if/else 3, loops 1, other 1. Of this number, 16 points are the body's own statements and 6 belong to 11 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · buildLimitWindow (cognitive 22) · ×1
  • buildLimitWindow (cognitive 22) src/shared/macWidgetSnapshot.js:172 — buildLimitWindow has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12, boolean chains 7, if/else 2, other 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · summarizeOpenCodeProvider (cognitive 22) · ×1
  • summarizeOpenCodeProvider (cognitive 22) src/electron/serviceStatus.js:418 — summarizeOpenCodeProvider has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (7 pts), ternaries 2, error handling 1, loops 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 · createIcloudSyncRuntime.writeDevice (cognitive 22) · ×1
  • createIcloudSyncRuntime.writeDevice (cognitive 22) src/electron/icloudSyncRuntime.js:383 — createIcloudSyncRuntime.writeDevice has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, ternaries 2, error handling 1 (nesting depth added 2). Of this number, 21 points are the body's own statements and 1 belongs 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.
D2 · Cognitive Complexity · createLocalUsageSource.connect (cognitive 22) · ×1
  • createLocalUsageSource.connect (cognitive 22) src/shared/providers/codex/localUsageSource.js:280 — createLocalUsageSource.connect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), error handling 3, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 306, a function literal at line 289, active, …). 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 · usage.mergeSyncDeviceRecord (cognitive 21) · ×1
  • usage.mergeSyncDeviceRecord (cognitive 21) src/shared/usage.js:1709 — usage.mergeSyncDeviceRecord has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionActivityProjection.locationsFor (cognitive 21) · ×1
  • sessionActivityProjection.locationsFor (cognitive 21) src/shared/sessionActivityProjection.js:59 — sessionActivityProjection.locationsFor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · windowsProcessStarts.readWindowsProcessStarts (cognitive 21) · ×1
  • windowsProcessStarts.readWindowsProcessStarts (cognitive 21) src/shared/windowsProcessStarts.js:23 — windowsProcessStarts.readWindowsProcessStarts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · settings.validateSetting (cognitive 21) · ×1
  • settings.validateSetting (cognitive 21) src/shared/plugins/settings.js:17 — settings.validateSetting has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 6, if/else 3 (6 pts), match/switch 1 (nesting depth added 7). 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 · settings.prepareSettings (cognitive 21) · ×1
  • settings.prepareSettings (cognitive 21) src/shared/plugins/settings.js:94 — settings.prepareSettings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · screen.readMacNotchScreens (cognitive 21) · ×1
  • screen.readMacNotchScreens (cognitive 21) src/electron/notch/screen.js:6 — screen.readMacNotchScreens has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 4 (5 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 9). Of this number, 17 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 · controller.createEdgeDockController.setVisible (cognitive 21) · ×1
  • controller.createEdgeDockController.setVisible (cognitive 21) src/electron/edgeDock/controller.js:367 — controller.createEdgeDockController.setVisible has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 10, 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 · controller.createEdgeDockController.setCells (cognitive 21) · ×1
  • controller.createEdgeDockController.setCells (cognitive 21) src/electron/edgeDock/controller.js:1647 — controller.createEdgeDockController.setCells has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · config.lanIpv4Addresses (cognitive 21) · ×1
  • config.lanIpv4Addresses (cognitive 21) src/shared/config.js:123 — config.lanIpv4Addresses has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 2 (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 · probe.prepareClaudeProbeDir (cognitive 21) · ×1
  • probe.prepareClaudeProbeDir (cognitive 21) src/shared/providers/claude/probe.js:50 — probe.prepareClaudeProbeDir has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (4 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 · limits.refreshClaudeAccessToken (cognitive 21) · ×1
  • limits.refreshClaudeAccessToken (cognitive 21) src/shared/providers/claude/limits.js:591 — limits.refreshClaudeAccessToken has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 6, if/else 4 (5 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.readCodexUsageOrRpc (cognitive 21) · ×1
  • limits.readCodexUsageOrRpc (cognitive 21) src/shared/providers/codex/limits.js:1211 — limits.readCodexUsageOrRpc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, error handling 4 (5 pts), ternaries 1 (nesting depth added 6). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionActivity.activityFiles (cognitive 21) · ×1
  • sessionActivity.activityFiles (cognitive 21) src/shared/providers/claude/sessionActivity.js:164 — sessionActivity.activityFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 2 (6 pts), loops 3 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.buildEvents (cognitive 21) · ×1
  • session.buildEvents (cognitive 21) src/shared/providers/opencode/session.js:421 — session.buildEvents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, ternaries 1 (3 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionDetail.parseJsonString (cognitive 21) · ×1
  • sessionDetail.parseJsonString (cognitive 21) src/shared/providers/reasonix/sessionDetail.js:455 — sessionDetail.parseJsonString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 1 (3 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 · sessionDetail.findSessionEventFile (cognitive 21) · ×1
  • sessionDetail.findSessionEventFile (cognitive 21) src/shared/providers/reasonix/sessionDetail.js:864 — sessionDetail.findSessionEventFile has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (7 pts), loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 7). Of this number, 18 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 · probe.legacyQuotaFromCandidates (cognitive 21) · ×1
  • probe.legacyQuotaFromCandidates (cognitive 21) REDACTED:728 — probe.legacyQuotaFromCandidates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.refreshMinimaxCodeSession (cognitive 21) · ×1
  • limits.refreshMinimaxCodeSession (cognitive 21) src/shared/providers/minimax/limits.js:477 — limits.refreshMinimaxCodeSession has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 3 (4 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · limits.fetchStepfunLimits (cognitive 21) · ×1
  • limits.fetchStepfunLimits (cognitive 21) src/shared/providers/stepfun/limits.js:133 — limits.fetchStepfunLimits has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (5 pts), ternaries 2 (5 pts), error handling 3 (nesting depth added 4). Of this number, 12 points are the body's own statements and 9 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 · limits.normalizeNotionCookieHeader (cognitive 21) · ×1
  • limits.normalizeNotionCookieHeader (cognitive 21) src/shared/providers/notion/limits.js:40 — limits.normalizeNotionCookieHeader has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · networkProxy.parseNoProxyEntry (cognitive 21) · ×1
  • networkProxy.parseNoProxyEntry (cognitive 21) REDACTED:150 — networkProxy.parseNoProxyEntry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, 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 · modelAliasPresentation.collectStatsModelIds (cognitive 21) · ×1
  • modelAliasPresentation.collectStatsModelIds (cognitive 21) src/electron/modelAliasPresentation.js:100 — modelAliasPresentation.collectStatsModelIds has cognitive complexity 21 (threshold 15). Drivers by points: loops 8 (13 pts), boolean chains 5, ternaries 1 (2 pts), if/else 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · modelAliasPresentation.projectModelAliasStats (cognitive 21) · ×1
  • modelAliasPresentation.projectModelAliasStats (cognitive 21) src/electron/modelAliasPresentation.js:376 — modelAliasPresentation.projectModelAliasStats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 4, ternaries 2, boolean chains 1 (nesting depth added 3). Of this number, 13 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · credentialCommands.draftFor (cognitive 21) · ×1
  • credentialCommands.draftFor (cognitive 21) src/electron/limits/credentialCommands.js:49 — credentialCommands.draftFor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · clientUsageArchive.normalizeArchivedClientUsage (cognitive 21) · ×1
  • clientUsageArchive.normalizeArchivedClientUsage (cognitive 21) src/shared/usage/clientUsageArchive.js:99 — clientUsageArchive.normalizeArchivedClientUsage has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), loops 2 (3 pts), ternaries 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 · serviceStatus.summarizeAtomFeedProvider (cognitive 21) · ×1
  • serviceStatus.summarizeAtomFeedProvider (cognitive 21) src/electron/serviceStatus.js:291 — serviceStatus.summarizeAtomFeedProvider has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 4, if/else 1 (3 pts), loops 2 (3 pts), error handling 1 (nesting depth added 6). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.addAntigravityManagedAccount (cognitive 21) · ×1
  • main.addAntigravityManagedAccount (cognitive 21) src/electron/main.js:1417 — main.addAntigravityManagedAccount has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 3 (5 pts), error handling 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.saveSubscriptions (cognitive 21) · ×1
  • main.saveSubscriptions (cognitive 21) src/electron/main.js:4541 — main.saveSubscriptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8 (nesting depth added 5). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 4570). 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 · app.bindTrendTooltip (cognitive 21) · ×1
  • app.bindTrendTooltip (cognitive 21) REDACTED:5974 — app.bindTrendTooltip has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 8, boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 6044, position, a function literal at line 6055, …). 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 · app.setupLimitAccountPanels (cognitive 21) · ×1
  • app.setupLimitAccountPanels (cognitive 21) REDACTED:12849 — app.setupLimitAccountPanels has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 7). Of this number, 12 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 · displaySettingsPreview.create.show (cognitive 21) · ×1
  • displaySettingsPreview.create.show (cognitive 21) REDACTED:87 — displaySettingsPreview.create.show has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4 (nesting depth added 4). Of this number, 17 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: 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 · providerPresentation.workbuddyCreditTotals (cognitive 21) · ×1
  • providerPresentation.workbuddyCreditTotals (cognitive 21) src/electron/renderer/limits/providerPresentation.js:690 — providerPresentation.workbuddyCreditTotals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 697, 692). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · pluginContent.create.retain (cognitive 21) · ×1
  • pluginContent.create.retain (cognitive 21) src/electron/renderer/pluginContent.js:153 — pluginContent.create.retain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WidgetVendorIdentity.modelVendor (cognitive 21) · ×1
  • WidgetVendorIdentity.modelVendor (cognitive 21) native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:647 — WidgetVendorIdentity.modelVendor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21. 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 · renderSessionDetail (cognitive 21) · ×1
  • renderSessionDetail (cognitive 21) REDACTED:5577 — renderSessionDetail has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 4 (5 pts), 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 · setupHomeActivityHover (cognitive 21) · ×1
  • setupHomeActivityHover (cognitive 21) REDACTED:7395 — setupHomeActivityHover has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 7, ternaries 2. None of this is in the body itself: all 21 points belong to 10 function items inside it that branch (showAtPoint, a function literal at line 7413, homeActivityTooltipUpdate, …). 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 · renderWslPanel (cognitive 21) · ×1
  • renderWslPanel (cognitive 21) REDACTED:12039 — renderWslPanel has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 6, if/else 5, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · moveOpenCodeLocalFallbackSetting (cognitive 21) · ×1
  • moveOpenCodeLocalFallbackSetting (cognitive 21) REDACTED:12610 — moveOpenCodeLocalFallbackSetting has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createPluginSettingsPanel.authorSettingsSection · ×1
  • createPluginSettingsPanel.authorSettingsSection::paint (cognitive 21) src/electron/renderer/pluginSettings.js:1179 — createPluginSettingsPanel.authorSettingsSection::paint has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 6, if/else 2 (3 pts), loops 2, other 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 · createNotchPanel.renderLimits (cognitive 21) · ×1
  • createNotchPanel.renderLimits (cognitive 21) src/electron/renderer/notch/panel.js:984 — createNotchPanel.renderLimits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 3 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 8 function items inside it that branch (fitLimitPlans, a function literal at line 1033, a function literal at line 991, …). 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 · createEdgeDockController.setVisible (cognitive 21) · ×1
  • createEdgeDockController.setVisible (cognitive 21) src/electron/edgeDock/controller.js:367 — createEdgeDockController.setVisible has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 10, ternaries 1. Of this number, 12 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · normalizeCodexUsagePayload (cognitive 21) · ×1
  • normalizeCodexUsagePayload (cognitive 21) src/shared/providers/codex/limits.js:165 — normalizeCodexUsagePayload has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), other 6, ternaries 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderActivity (cognitive 21) · ×1
  • renderActivity (cognitive 21) src/electron/renderer/dashboard.js:492 — renderActivity has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, ternaries 5, if/else 2. Of this number, 13 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · parseMimoPlanDetail (cognitive 21) · ×1
  • parseMimoPlanDetail (cognitive 21) src/shared/providers/mimo/limits.js:145 — parseMimoPlanDetail has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 16, other 3, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · slotAccounts (cognitive 21) · ×1
  • slotAccounts (cognitive 21) src/shared/limits/accountSlotFetcher.js:68 — slotAccounts has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, ternaries 5 (6 pts), if/else 4 (nesting depth added 1). Of this number, 12 points are the body's own statements and 9 belong to 12 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · hubProtocol.prepareSseFanout (cognitive 20) · ×1
  • hubProtocol.prepareSseFanout (cognitive 20) src/shared/hubProtocol.js:199 — hubProtocol.prepareSseFanout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · vendorPresentation.widgetVendorPalette (cognitive 20) · ×1
  • vendorPresentation.widgetVendorPalette (cognitive 20) src/shared/vendorPresentation.js:163 — vendorPresentation.widgetVendorPalette has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, 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 · presentation.accountingSessionSources (cognitive 20) · ×1
  • presentation.accountingSessionSources (cognitive 20) src/electron/renderer/edgeDock/presentation.js:214 — presentation.accountingSessionSources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 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 · renderer.createNotchRenderer.notchNumber (cognitive 20) · ×1
  • renderer.createNotchRenderer.notchNumber (cognitive 20) src/electron/renderer/notch/renderer.js:79 — renderer.createNotchRenderer.notchNumber has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 4). Of this number, 16 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 · controller.createEdgeDockController.syncRefresh (cognitive 20) · ×1
  • controller.createEdgeDockController.syncRefresh (cognitive 20) src/electron/edgeDock/controller.js:1027 — controller.createEdgeDockController.syncRefresh has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (7 pts), boolean chains 4 (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 · wslUsage.collectWslUsage (cognitive 20) · ×1
  • wslUsage.collectWslUsage (cognitive 20) src/shared/wslUsage.js:130 — wslUsage.collectWslUsage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 2 (3 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 · auth.codexManagedAccountMatchesIdentity (cognitive 20) · ×1
  • auth.codexManagedAccountMatchesIdentity (cognitive 20) src/shared/providers/codex/auth.js:90 — auth.codexManagedAccountMatchesIdentity has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, if/else 6. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · subagents.readOmpSessionHeader (cognitive 20) · ×1
  • subagents.readOmpSessionHeader (cognitive 20) src/shared/providers/omp/subagents.js:9 — subagents.readOmpSessionHeader has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 3 (5 pts), ternaries 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionActivity.projectSessionActivity (cognitive 20) · ×1
  • sessionActivity.projectSessionActivity (cognitive 20) src/shared/providers/claude/sessionActivity.js:124 — sessionActivity.projectSessionActivity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 17 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 · localUsageStore.createLocalUsageStore.observe (cognitive 20) · ×1
  • localUsageStore.createLocalUsageStore.observe (cognitive 20) src/shared/providers/codex/localUsageStore.js:69 — localUsageStore.createLocalUsageStore.observe has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · collector.watchClientRootsForClients (cognitive 20) · ×1
  • collector.watchClientRootsForClients (cognitive 20) src/shared/collector.js:1603 — collector.watchClientRootsForClients has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 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 · limits.mapAntigravitySnapshot (cognitive 20) · ×1
  • limits.mapAntigravitySnapshot (cognitive 20) src/shared/providers/antigravity/limits.js:47 — limits.mapAntigravitySnapshot has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 7 (nesting depth added 5). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 53, 64). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · limits.parseDevinUsage (cognitive 20) · ×1
  • limits.parseDevinUsage (cognitive 20) src/shared/providers/devin/limits.js:253 — limits.parseDevinUsage has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, ternaries 5 (6 pts), if/else 3 (nesting depth added 1). Of this number, 15 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · limits.minimaxJsonFetch (cognitive 20) · ×1
  • limits.minimaxJsonFetch (cognitive 20) src/shared/providers/minimax/limits.js:337 — limits.minimaxJsonFetch has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 4 (5 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchOpenRouterAccount (cognitive 20) · ×1
  • limits.fetchOpenRouterAccount (cognitive 20) src/shared/providers/openrouter/limits.js:125 — limits.fetchOpenRouterAccount has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 5, if/else 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 · limits.fetchManusLimits (cognitive 20) · ×1
  • limits.fetchManusLimits (cognitive 20) src/shared/providers/manus/limits.js:134 — limits.fetchManusLimits has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (5 pts), if/else 4, error handling 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 · desktop.readBinaryCookies (cognitive 20) · ×1
  • desktop.readBinaryCookies (cognitive 20) src/shared/providers/hark/desktop.js:28 — desktop.readBinaryCookies has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, 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 · businessData.createBusinessDataService.dependency (cognitive 20) · ×1
  • businessData.createBusinessDataService.dependency (cognitive 20) src/electron/plugins/businessData.js:59 — businessData.createBusinessDataService.dependency has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, ternaries 4 (6 pts), boolean chains 5 (nesting depth added 2). Of this number, 11 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · catalogMedia.createCatalogMedia.load (cognitive 20) · ×1
  • catalogMedia.createCatalogMedia.load (cognitive 20) src/electron/plugins/catalogMedia.js:11 — catalogMedia.createCatalogMedia.load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 9. 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 · main.setupWidgetViewSwitchers (cognitive 20) · ×1
  • main.setupWidgetViewSwitchers (cognitive 20) site/scripts/main.js:201 — main.setupWidgetViewSwitchers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 8). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 221, 270, 240, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · syncContent.createSessionTitleSyncNegotiator.negotiate (cognitive 20) · ×1
  • syncContent.createSessionTitleSyncNegotiator.negotiate (cognitive 20) src/shared/syncContent.js:135 — syncContent.createSessionTitleSyncNegotiator.negotiate has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 4 (6 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deviceRuntime.createDeviceRuntime.usageRuntimeOptions (cognitive 20) · ×1
  • deviceRuntime.createDeviceRuntime.usageRuntimeOptions (cognitive 20) src/shared/usage/deviceRuntime.js:74 — deviceRuntime.createDeviceRuntime.usageRuntimeOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · sessionUsageArchive.pruneExpiredSessionUsagePeriods (cognitive 20) · ×1
  • sessionUsageArchive.pruneExpiredSessionUsagePeriods (cognitive 20) src/shared/usage/sessionUsageArchive.js:168 — sessionUsageArchive.pruneExpiredSessionUsagePeriods has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (9 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · sessionDetail.readTranscriptLines (cognitive 20) · ×1
  • sessionDetail.readTranscriptLines (cognitive 20) src/shared/sessionDetail.js:19 — sessionDetail.readTranscriptLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (7 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 · transcriptReader.frameRange (cognitive 20) · ×1
  • transcriptReader.frameRange (cognitive 20) src/shared/providers/dsh/transcriptReader.js:13 — transcriptReader.frameRange has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 2 (nesting depth added 5). Of this number, 16 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 · runtimeConfig.limitsConfigFromSettings (cognitive 20) · ×1
  • runtimeConfig.limitsConfigFromSettings (cognitive 20) src/electron/runtimeConfig.js:131 — runtimeConfig.limitsConfigFromSettings has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, ternaries 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 · main.edgeDockLiveRateSample (cognitive 20) · ×1
  • main.edgeDockLiveRateSample (cognitive 20) src/electron/main.js:6227 — main.edgeDockLiveRateSample has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · app.iconKindFor (cognitive 20) · ×1
  • app.iconKindFor (cognitive 20) REDACTED:69 — app.iconKindFor has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 6 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.animateRowNumber (cognitive 20) · ×1
  • app.animateRowNumber (cognitive 20) REDACTED:2105 — app.animateRowNumber has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 2 (nesting depth added 2). Of this number, 11 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · windowsView.createLimitWindowsView.codexAdditionalWindowPeriodLabel (cognitive 20) · ×1
  • windowsView.createLimitWindowsView.codexAdditionalWindowPeriodLabel (cognitive 20) src/electron/renderer/limits/windowsView.js:140 — windowsView.createLimitWindowsView.codexAdditionalWindowPeriodLabel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (6 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 · usageCharts.statCardColumnWidths (cognitive 20) · ×1
  • usageCharts.statCardColumnWidths (cognitive 20) src/electron/renderer/usageCharts.js:653 — usageCharts.statCardColumnWidths has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · watcherWorker.pump (cognitive 20) · ×1
  • watcherWorker.pump (cognitive 20) src/shared/watcherWorker.js:78 — watcherWorker.pump has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, error handling 1 (3 pts), loops 1 (nesting depth added 8). Of this number, 13 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderWorkbuddyStatus (cognitive 20) · ×1
  • renderWorkbuddyStatus (cognitive 20) REDACTED:17122 — renderWorkbuddyStatus has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8, if/else 6 (7 pts), boolean chains 4, loops 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · injectLocalDeviceStatus (cognitive 20) · ×1
  • injectLocalDeviceStatus (cognitive 20) src/electron/main.js:4954 — injectLocalDeviceStatus has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). Of this number, 18 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 · createLimitWindowsView.codexAdditionalWindowPeriodLabel (cognitive 20) · ×1
  • createLimitWindowsView.codexAdditionalWindowPeriodLabel (cognitive 20) src/electron/renderer/limits/windowsView.js:140 — createLimitWindowsView.codexAdditionalWindowPeriodLabel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (6 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 · createEdgeDockController.buildWindows (cognitive 20) · ×1
  • createEdgeDockController.buildWindows (cognitive 20) src/electron/edgeDock/controller.js:933 — createEdgeDockController.buildWindows has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8, if/else 4 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 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 · createEdgeDockController.syncRefresh (cognitive 20) · ×1
  • createEdgeDockController.syncRefresh (cognitive 20) src/electron/edgeDock/controller.js:1027 — createEdgeDockController.syncRefresh has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (6 pts), boolean chains 5 (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 · createEdgeDockController.setCells (cognitive 20) · ×1
  • createEdgeDockController.setCells (cognitive 20) src/electron/edgeDock/controller.js:1647 — createEdgeDockController.setCells has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · createNotchController · ×1
  • createNotchController::topNotch:size (cognitive 20) src/electron/notch/controller.js:903 — createNotchController::topNotch:size has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createNotchRenderer.notchNumber (cognitive 20) · ×1
  • createNotchRenderer.notchNumber (cognitive 20) src/electron/renderer/notch/renderer.js:79 — createNotchRenderer.notchNumber has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 4). Of this number, 16 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 · createBusinessDataService.dependency (cognitive 20) · ×1
  • createBusinessDataService.dependency (cognitive 20) src/electron/plugins/businessData.js:59 — createBusinessDataService.dependency has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, ternaries 4 (6 pts), boolean chains 5 (nesting depth added 2). Of this number, 11 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · activityStatsForPeriod (cognitive 20) · ×1
  • activityStatsForPeriod (cognitive 20) src/electron/renderer/homeOverview.js:396 — activityStatsForPeriod has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, ternaries 3, if/else 2. Of this number, 16 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · serializeSyncPayload (cognitive 20) · ×1
  • serializeSyncPayload (cognitive 20) src/shared/syncPayload.js:278 — serializeSyncPayload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, ternaries 2 (3 pts), loops 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 · parseWindowObj (cognitive 20) · ×1
  • parseWindowObj (cognitive 20) src/shared/providers/opencode/web.js:94 — parseWindowObj has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sampleIndices (cognitive 20) · ×1
  • sampleIndices (cognitive 20) src/electron/tokenNumberAnimation.js:49 — sampleIndices has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), ternaries 5, boolean chains 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetchCopilotAccountLimits (cognitive 20) · ×1
  • fetchCopilotAccountLimits (cognitive 20) src/shared/providers/copilot/limits.js:388 — fetchCopilotAccountLimits has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 3 (4 pts), ternaries 3, error handling 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 · readSessionUsageArchiveSnapshot (cognitive 20) · ×1
  • readSessionUsageArchiveSnapshot (cognitive 20) src/shared/usage/sessionUsageArchiveStore.js:97 — readSessionUsageArchiveSnapshot has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (7 pts), ternaries 2 (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 · limitsAccountConfig (cognitive 20) · ×1
  • limitsAccountConfig (cognitive 20) src/electron/limits/accountSettings.js:190 — limitsAccountConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts), other 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 · clientHealth.normalizeClientHealthEntry (cognitive 19) · ×1
  • clientHealth.normalizeClientHealthEntry (cognitive 19) src/shared/clientHealth.js:410 — clientHealth.normalizeClientHealthEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage.sessionFromRow (cognitive 19) · ×1
  • usage.sessionFromRow (cognitive 19) src/shared/usage.js:860 — usage.sessionFromRow has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · accountIdentity.keyedAccountGroups (cognitive 19) · ×1
  • accountIdentity.keyedAccountGroups (cognitive 19) src/electron/renderer/accountIdentity.js:228 — accountIdentity.keyedAccountGroups has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · controller.createNotchController.animateShell (cognitive 19) · ×1
  • controller.createNotchController.animateShell (cognitive 19) src/electron/notch/controller.js:580 — controller.createNotchController.animateShell has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (8 pts), if/else 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wslUsage.homeHasData (cognitive 19) · ×1
  • wslUsage.homeHasData (cognitive 19) src/shared/wslUsage.js:68 — wslUsage.homeHasData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), error handling 2 (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 · sessionMetadata.resolveSessionMetadata (cognitive 19) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 19) src/shared/providers/droid/sessionMetadata.js:56 — sessionMetadata.resolveSessionMetadata has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (6 pts), ternaries 2 (6 pts), boolean chains 4, 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 · sessionActivityWatch.activityWatchSources (cognitive 19) · ×1
  • sessionActivityWatch.activityWatchSources (cognitive 19) src/shared/sessionActivityWatch.js:25 — sessionActivityWatch.activityWatchSources has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 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 · sessions.scanEntries (cognitive 19) · ×1
  • sessions.scanEntries (cognitive 19) src/shared/providers/reasonix/sessions.js:539 — sessions.scanEntries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collector.clientActivityDaysFromHistory (cognitive 19) · ×1
  • collector.clientActivityDaysFromHistory (cognitive 19) src/shared/collector.js:2264 — collector.clientActivityDaysFromHistory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collector.mergeClientActivityDays (cognitive 19) · ×1
  • collector.mergeClientActivityDays (cognitive 19) src/shared/collector.js:2288 — collector.mergeClientActivityDays has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchJson (cognitive 19) · ×1
  • limits.fetchJson (cognitive 19) src/shared/providers/copilot/limits.js:239 — limits.fetchJson has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4 (6 pts), boolean chains 3, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchCopilotLimits (cognitive 19) · ×1
  • limits.fetchCopilotLimits (cognitive 19) src/shared/providers/copilot/limits.js:359 — limits.fetchCopilotLimits has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 6, if/else 4 (5 pts) (nesting depth added 4). Of this number, 12 points are the body's own statements and 7 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 · limits.fetchNotionLimits (cognitive 19) · ×1
  • limits.fetchNotionLimits (cognitive 19) src/shared/providers/notion/limits.js:186 — limits.fetchNotionLimits has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 2 (4 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 198, 197). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · credentialStore.writePrivateJsonAtomic (cognitive 19) · ×1
  • credentialStore.writePrivateJsonAtomic (cognitive 19) src/shared/credentialStore.js:157 — credentialStore.writePrivateJsonAtomic has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (9 pts), if/else 5 (8 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.createLimitsRuntime.dispatchIntent (cognitive 19) · ×1
  • runtime.createLimitsRuntime.dispatchIntent (cognitive 19) src/shared/limits/runtime.js:799 — runtime.createLimitsRuntime.dispatchIntent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · i18n.localeFromTag (cognitive 19) · ×1
  • i18n.localeFromTag (cognitive 19) src/electron/renderer/i18n.js:17804 — i18n.localeFromTag has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 8. 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 · managedAccounts.createClaudeManagedAccounts.resolved (cognitive 19) · ×1
  • managedAccounts.createClaudeManagedAccounts.resolved (cognitive 19) src/electron/providers/claude/managedAccounts.js:168 — managedAccounts.createClaudeManagedAccounts.resolved has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 3 (nesting depth added 1). None of this is in the body itself: all 19 points belong to 3 function literals inside it that branch (lines 169, 192, 193). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · bridge.prepareMacWidgetSnapshot (cognitive 19) · ×1
  • bridge.prepareMacWidgetSnapshot (cognitive 19) src/electron/macWidget/bridge.js:58 — bridge.prepareMacWidgetSnapshot has cognitive complexity 19 (threshold 15). Drivers by points: error handling 6 (8 pts), boolean chains 7, if/else 4 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.syncCurrencyRateControls (cognitive 19) · ×1
  • app.syncCurrencyRateControls (cognitive 19) REDACTED:1469 — app.syncCurrencyRateControls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.thirdPartyProfileErrorText (cognitive 19) · ×1
  • app.thirdPartyProfileErrorText (cognitive 19) REDACTED:18845 — app.thirdPartyProfileErrorText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 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 · dock.renderRail (cognitive 19) · ×1
  • dock.renderRail (cognitive 19) REDACTED:1300 — dock.renderRail has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 3 (6 pts) (nesting depth added 3). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1321, 1340). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · railNumberRoll.create.play (cognitive 19) · ×1
  • railNumberRoll.create.play (cognitive 19) src/electron/renderer/edgeDock/railNumberRoll.js:48 — railNumberRoll.create.play has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, ternaries 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · accountPanels.syncCredentialFields (cognitive 19) · ×1
  • accountPanels.syncCredentialFields (cognitive 19) src/electron/renderer/limits/accountPanels.js:45 — accountPanels.syncCredentialFields has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, 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 · accountPanels.refreshFieldDependents (cognitive 19) · ×1
  • accountPanels.refreshFieldDependents (cognitive 19) src/electron/renderer/limits/accountPanels.js:70 — accountPanels.refreshFieldDependents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 3, loops 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 · syncContentForm.createSyncContentForm.render (cognitive 19) · ×1
  • syncContentForm.createSyncContentForm.render (cognitive 19) src/electron/renderer/syncContentForm.js:65 — syncContentForm.createSyncContentForm.render has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 16, loops 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 · syncContentForm.createSyncContentForm.toggle (cognitive 19) · ×1
  • syncContentForm.createSyncContentForm.toggle (cognitive 19) src/electron/renderer/syncContentForm.js:185 — syncContentForm.createSyncContentForm.toggle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2 (nesting depth added 3). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 191). 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 · WidgetHeatmapLayoutCalculator.make (cognitive 19) · ×1
  • WidgetHeatmapLayoutCalculator.make (cognitive 19) native/macos/TokenMonitorWidget/WidgetViewModel.swift:129 — WidgetHeatmapLayoutCalculator.make has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · renderSessionToolFilter (cognitive 19) · ×1
  • renderSessionToolFilter (cognitive 19) REDACTED:3192 — renderSessionToolFilter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (7 pts), boolean chains 5 (nesting depth added 5). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 3209, 3196, 3225, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · renderFloatingBubbleContent (cognitive 19) · ×1
  • renderFloatingBubbleContent (cognitive 19) REDACTED:8936 — renderFloatingBubbleContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 3 (6 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 · updateSyncDeviceRow (cognitive 19) · ×1
  • updateSyncDeviceRow (cognitive 19) REDACTED:9558 — updateSyncDeviceRow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 6 (7 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, 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 · renderClaudeWebAccounts (cognitive 19) · ×1
  • renderClaudeWebAccounts (cognitive 19) REDACTED:17792 — renderClaudeWebAccounts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, ternaries 3 (4 pts), other 2, loops 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 17797, 17858, 17824, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · createNotchPanel.homeFuel (cognitive 19) · ×1
  • createNotchPanel.homeFuel (cognitive 19) src/electron/renderer/notch/panel.js:654 — createNotchPanel.homeFuel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (6 pts), boolean chains 2, loops 2 (nesting depth added 5). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (fitHomeFuel, a function literal at line 668, show, …). 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 · createNotchPanel.breakdownColumn (cognitive 19) · ×1
  • createNotchPanel.breakdownColumn (cognitive 19) src/electron/renderer/notch/panel.js:1224 — createNotchPanel.breakdownColumn has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11, boolean chains 5, if/else 2, loops 1. Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 1242, colorFor, labelFor, …). 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 · createNotchController.paint (cognitive 19) · ×1
  • createNotchController.paint (cognitive 19) src/electron/notch/controller.js:350 — createNotchController.paint has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 7, if/else 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · createIcloudSyncStore.writeSubscriptionsNow (cognitive 19) · ×1
  • createIcloudSyncStore.writeSubscriptionsNow (cognitive 19) src/electron/icloudSync.js:1212 — createIcloudSyncStore.writeSubscriptionsNow has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLimitsRuntime.dispatchIntent (cognitive 19) · ×1
  • createLimitsRuntime.dispatchIntent (cognitive 19) src/shared/limits/runtime.js:799 — createLimitsRuntime.dispatchIntent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 6 belong to 5 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 · selectSource (cognitive 19) · ×1
  • selectSource (cognitive 19) src/shared/trayLayout.js:839 — selectSource has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (7 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createHub (cognitive 19) · ×1
  • createHub (cognitive 19) REDACTED:53 — createHub has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), loops 2, error handling 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · fetchVolcengineArkLimits (cognitive 19) · ×1
  • fetchVolcengineArkLimits (cognitive 19) src/shared/providers/volcengine/limits.js:639 — fetchVolcengineArkLimits has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 4, if/else 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · summarizeInstatusProvider (cognitive 19) · ×1
  • summarizeInstatusProvider (cognitive 19) src/electron/serviceStatus.js:357 — summarizeInstatusProvider has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (4 pts), loops 2, error handling 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · parseDirectQuotaSnapshots (cognitive 19) · ×1
  • parseDirectQuotaSnapshots (cognitive 19) src/shared/providers/copilot/limits.js:150 — parseDirectQuotaSnapshots has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createPanel.render (cognitive 19) · ×1
  • createPanel.render (cognitive 19) src/electron/renderer/limits/accountSlotsPanel.js:276 — createPanel.render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 3 (4 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 279, 278, 282, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · DockBackdrop.Proc (cognitive 18) · ×1
  • DockBackdrop.Proc (cognitive 18) src/windows-dock/DockBackdrop.cs:216 — DockBackdrop.Proc has cognitive complexity 18 (threshold 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 · syncDisplayStats.composeLocalSyncStats (cognitive 18) · ×1
  • syncDisplayStats.composeLocalSyncStats (cognitive 18) src/electron/syncDisplayStats.js:114 — syncDisplayStats.composeLocalSyncStats has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (5 pts), ternaries 5, loops 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 4 belong to 5 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 · hubProtocol.applyActivityClocks (cognitive 18) · ×1
  • hubProtocol.applyActivityClocks (cognitive 18) src/shared/hubProtocol.js:80 — hubProtocol.applyActivityClocks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · appearance.normalizeAppearance (cognitive 18) · ×1
  • appearance.normalizeAppearance (cognitive 18) src/shared/plugins/appearance.js:6 — appearance.normalizeAppearance has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · catalogSources.parseIndex.plugins (cognitive 18) · ×1
  • catalogSources.parseIndex.plugins (cognitive 18) src/electron/plugins/catalogSources.js:52 — catalogSources.parseIndex.plugins has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 1. Of this number, 9 points are the body's own statements and 9 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 · macVibrancyMask.applyVibrancyMask (cognitive 18) · ×1
  • macVibrancyMask.applyVibrancyMask (cognitive 18) src/electron/edgeDock/macVibrancyMask.js:131 — macVibrancyMask.applyVibrancyMask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, 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 · auth.preserveCodexManagedHydrationCollisions (cognitive 18) · ×1
  • auth.preserveCodexManagedHydrationCollisions (cognitive 18) src/shared/providers/codex/auth.js:58 — auth.preserveCodexManagedHydrationCollisions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 8). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.upgradeCodexManagedAccountIdentity (cognitive 18) · ×1
  • auth.upgradeCodexManagedAccountIdentity (cognitive 18) src/shared/providers/codex/auth.js:123 — auth.upgradeCodexManagedAccountIdentity has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4, 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 · sessionMetadata.applyMetadataLine (cognitive 18) · ×1
  • sessionMetadata.applyMetadataLine (cognitive 18) src/shared/providers/claude/sessionMetadata.js:259 — sessionMetadata.applyMetadataLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.projectFromWorkspaceUris (cognitive 18) · ×1
  • sessionMetadata.projectFromWorkspaceUris (cognitive 18) src/shared/providers/antigravity/sessionMetadata.js:62 — sessionMetadata.projectFromWorkspaceUris has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, error handling 2 (3 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.
D2 · Cognitive Complexity · sessionMetadata.readTurnEnds (cognitive 18) · ×1
  • sessionMetadata.readTurnEnds (cognitive 18) src/shared/providers/cursor/sessionMetadata.js:48 — sessionMetadata.readTurnEnds has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, ternaries 2 (6 pts), if/else 3 (5 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dailyHistoryArchive.normalizeDailyHistoryArchive (cognitive 18) · ×1
  • dailyHistoryArchive.normalizeDailyHistoryArchive (cognitive 18) src/shared/dailyHistoryArchive.js:206 — dailyHistoryArchive.normalizeDailyHistoryArchive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 2, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · localUsage.priceLocalSessionDetail (cognitive 18) · ×1
  • localUsage.priceLocalSessionDetail (cognitive 18) src/shared/providers/codex/localUsage.js:153 — localUsage.priceLocalSessionDetail has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (5 pts), loops 3 (4 pts) (nesting depth added 3). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · deviceHardware.detectDeviceKind (cognitive 18) · ×1
  • deviceHardware.detectDeviceKind (cognitive 18) src/shared/deviceHardware.js:17 — deviceHardware.detectDeviceKind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.createJarExchange.request (cognitive 18) · ×1
  • session.createJarExchange.request (cognitive 18) src/shared/providers/mimo/session.js:159 — session.createJarExchange.request has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchMimoLimits (cognitive 18) · ×1
  • limits.fetchMimoLimits (cognitive 18) src/shared/providers/mimo/limits.js:761 — limits.fetchMimoLimits has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.keyLimitWindow (cognitive 18) · ×1
  • limits.keyLimitWindow (cognitive 18) src/shared/providers/openrouter/limits.js:64 — limits.keyLimitWindow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 4, if/else 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 · limits.resetHeaderToIso (cognitive 18) · ×1
  • limits.resetHeaderToIso (cognitive 18) src/shared/providers/volcengine/limits.js:95 — limits.resetHeaderToIso has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lazySessions.createSessionBacking.pin (cognitive 18) · ×1
  • lazySessions.createSessionBacking.pin (cognitive 18) src/electron/plugins/lazySessions.js:111 — lazySessions.createSessionBacking.pin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 2, error handling 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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 · syncContentRuntime.createSyncContentRuntime.retryCleanup (cognitive 18) · ×1
  • syncContentRuntime.createSyncContentRuntime.retryCleanup (cognitive 18) src/electron/syncContentRuntime.js:301 — syncContentRuntime.createSyncContentRuntime.retryCleanup has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 5 (7 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tokenNumberAnimation.glyphFrames (cognitive 18) · ×1
  • tokenNumberAnimation.glyphFrames (cognitive 18) src/electron/tokenNumberAnimation.js:89 — tokenNumberAnimation.glyphFrames has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 13 (17 pts), boolean chains 1 (nesting depth added 4). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 99). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · oauth.verifyIdentity (cognitive 18) · ×1
  • oauth.verifyIdentity (cognitive 18) src/shared/providers/workbuddy/oauth.js:109 — oauth.verifyIdentity has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, if/else 4 (5 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · tokscaleCustomPricing.normalizeCustomPricingSetting (cognitive 18) · ×1
  • tokscaleCustomPricing.normalizeCustomPricingSetting (cognitive 18) src/shared/tokscaleCustomPricing.js:18 — tokscaleCustomPricing.normalizeCustomPricingSetting has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · modelAliases.inferModelAliases (cognitive 18) · ×1
  • modelAliases.inferModelAliases (cognitive 18) src/electron/renderer/modelAliases.js:109 — modelAliases.inferModelAliases has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · modelAliasPresentation.projectUsage (cognitive 18) · ×1
  • modelAliasPresentation.projectUsage (cognitive 18) src/electron/modelAliasPresentation.js:168 — modelAliasPresentation.projectUsage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · modelAliasPresentation.projectHistory (cognitive 18) · ×1
  • modelAliasPresentation.projectHistory (cognitive 18) src/electron/modelAliasPresentation.js:313 — modelAliasPresentation.projectHistory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 5). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 326, set). 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 · workspaces.listCodexWorkspaces (cognitive 18) · ×1
  • workspaces.listCodexWorkspaces (cognitive 18) src/shared/providers/codex/workspaces.js:47 — workspaces.listCodexWorkspaces has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 3 (4 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 · app.captureBreakdownMotion (cognitive 18) · ×1
  • app.captureBreakdownMotion (cognitive 18) REDACTED:2077 — app.captureBreakdownMotion has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 6, if/else 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.renderDeviceAccordion (cognitive 18) · ×1
  • app.renderDeviceAccordion (cognitive 18) REDACTED:2504 — app.renderDeviceAccordion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (6 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 · app.patchRenderedNode (cognitive 18) · ×1
  • app.patchRenderedNode (cognitive 18) REDACTED:11525 — app.patchRenderedNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.limitProviderSettingsRenderSignature (cognitive 18) · ×1
  • app.limitProviderSettingsRenderSignature (cognitive 18) REDACTED:12989 — app.limitProviderSettingsRenderSignature has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 17, ternaries 1. Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (providerSignature, deviceSignature, a function literal at line 13005, …). 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 · app.els.breakdown.addEventListener("click") (cognitive 18) · ×1
  • app.els.breakdown.addEventListener("click") (cognitive 18) REDACTED:14067 — app.els.breakdown.addEventListener("click") has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · app.setThirdPartyAdapterFields (cognitive 18) · ×1
  • app.setThirdPartyAdapterFields (cognitive 18) REDACTED:16733 — app.setThirdPartyAdapterFields has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · clientHealthPresentation.mergeSourceChecks (cognitive 18) · ×1
  • clientHealthPresentation.mergeSourceChecks (cognitive 18) src/electron/renderer/clientHealthPresentation.js:104 — clientHealthPresentation.mergeSourceChecks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, ternaries 1 (3 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · composer.createEdgeDockComposer.windowChoices (cognitive 18) · ×1
  • composer.createEdgeDockComposer.windowChoices (cognitive 18) src/electron/renderer/edgeDock/composer.js:293 — composer.createEdgeDockComposer.windowChoices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dock.statCellNode (cognitive 18) · ×1
  • dock.statCellNode (cognitive 18) REDACTED:955 — dock.statCellNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · accountPanels.createCredentialPanel · ×1
  • accountPanels.createCredentialPanel::blockContent (cognitive 18) src/electron/renderer/limits/accountPanels.js:183 — accountPanels.createCredentialPanel::blockContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (5 pts), ternaries 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · windowsView.createLimitWindowsView.codexResetCreditsNode (cognitive 18) · ×1
  • windowsView.createLimitWindowsView.codexResetCreditsNode (cognitive 18) src/electron/renderer/limits/windowsView.js:263 — windowsView.createLimitWindowsView.codexResetCreditsNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · windowsView.createLimitWindowsView.limitProviderUsageItems (cognitive 18) · ×1
  • windowsView.createLimitWindowsView.limitProviderUsageItems (cognitive 18) src/electron/renderer/limits/windowsView.js:1949 — windowsView.createLimitWindowsView.limitProviderUsageItems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 2, ternaries 1 (2 pts) (nesting depth added 5). Of this number, 10 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 · rowDragController.createRowDragController.updateDragPositions (cognitive 18) · ×1
  • rowDragController.createRowDragController.updateDragPositions (cognitive 18) src/electron/renderer/rowDragController.js:177 — rowDragController.createRowDragController.updateDragPositions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4 (5 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · beginSubscriptionEdit (cognitive 18) · ×1
  • beginSubscriptionEdit (cognitive 18) REDACTED:4588 — beginSubscriptionEdit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 3, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · updateViewSwitcherOpenState (cognitive 18) · ×1
  • updateViewSwitcherOpenState (cognitive 18) REDACTED:6614 — updateViewSwitcherOpenState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · loadClientSources (cognitive 18) · ×1
  • loadClientSources (cognitive 18) REDACTED:11463 — loadClientSources has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 11473, 11481, 11474, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 18) · ×1
  • (anonymous) (cognitive 18) REDACTED:14067 — (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · startCollector.refreshClient (cognitive 18) · ×1
  • startCollector.refreshClient (cognitive 18) src/shared/collector.js:4160 — startCollector.refreshClient has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, error handling 1 (2 pts), ternaries 1 (nesting depth added 6). Of this number, 10 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLimitWindowsView.codexResetCreditsNode (cognitive 18) · ×1
  • createLimitWindowsView.codexResetCreditsNode (cognitive 18) src/electron/renderer/limits/windowsView.js:263 — createLimitWindowsView.codexResetCreditsNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createLimitWindowsView.limitWindowNode (cognitive 18) · ×1
  • createLimitWindowsView.limitWindowNode (cognitive 18) src/electron/renderer/limits/windowsView.js:909 — createLimitWindowsView.limitWindowNode has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 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 · createLimitWindowsView.limitProviderUsageItems (cognitive 18) · ×1
  • createLimitWindowsView.limitProviderUsageItems (cognitive 18) src/electron/renderer/limits/windowsView.js:1949 — createLimitWindowsView.limitProviderUsageItems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 2, ternaries 1 (2 pts) (nesting depth added 5). Of this number, 10 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createNotchPanel.placeTabs (cognitive 18) · ×1
  • createNotchPanel.placeTabs (cognitive 18) src/electron/renderer/notch/panel.js:468 — createNotchPanel.placeTabs has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 5, if/else 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codexAdditionalRateLimitWindows (cognitive 18) · ×1
  • codexAdditionalRateLimitWindows (cognitive 18) src/shared/providers/codex/limits.js:102 — codexAdditionalRateLimitWindows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), other 4, boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeResetCreditExpirations (cognitive 18) · ×1
  • normalizeResetCreditExpirations (cognitive 18) src/shared/limits/core.js:327 — normalizeResetCreditExpirations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, other 2, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeProviderUsageSummary (cognitive 18) · ×1
  • normalizeProviderUsageSummary (cognitive 18) src/shared/limits/core.js:432 — normalizeProviderUsageSummary has cognitive complexity 18 (threshold 15). Drivers by points: other 10, ternaries 4, boolean chains 3, if/else 1. Of this number, 15 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, 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 · windowOptions (cognitive 18) · ×1
  • windowOptions (cognitive 18) src/shared/trayLayout.js:707 — windowOptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, 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 · normalizeComponentSummary (cognitive 18) · ×1
  • normalizeComponentSummary (cognitive 18) src/shared/dailyHistoryArchive.js:127 — normalizeComponentSummary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 2 (nesting depth added 3). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (foldComponentMapByClient, normalizeMap, a function literal at line 167, …). 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 · snapshotEvents (cognitive 18) · ×1
  • snapshotEvents (cognitive 18) src/shared/providers/reasonix/sessionDetail.js:327 — snapshotEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 6, 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 · createTray (cognitive 18) · ×1
  • createTray (cognitive 18) src/electron/tray.js:457 — createTray has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (5 pts), boolean chains 2, other 1 (nesting depth added 4). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 14 function items inside it that branch (refreshContextMenu, a function literal at line 564, 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 · createSyncContentRuntime.retryCleanup (cognitive 18) · ×1
  • createSyncContentRuntime.retryCleanup (cognitive 18) src/electron/syncContentRuntime.js:301 — createSyncContentRuntime.retryCleanup has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 5 (7 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · projectEntry (cognitive 18) · ×1
  • projectEntry (cognitive 18) src/shared/providers/reasonix/sessions.js:451 — projectEntry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · fetchCommandcodeLimits (cognitive 18) · ×1
  • fetchCommandcodeLimits (cognitive 18) src/shared/providers/commandcode/limits.js:399 — fetchCommandcodeLimits has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 3 (4 pts), error handling 2, other 2, 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 · createRowDragController.updateDragPositions (cognitive 18) · ×1
  • createRowDragController.updateDragPositions (cognitive 18) src/electron/renderer/rowDragController.js:177 — createRowDragController.updateDragPositions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4 (5 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createPanel.openEditor · ×1
  • createPanel.openEditor::(anonymous)::submit (cognitive 18) src/electron/renderer/limits/accountSlotsPanel.js:128 — createPanel.openEditor::(anonymous)::submit has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5, boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DockBackdrop.Main (cognitive 17) · ×1
  • DockBackdrop.Main (cognitive 17) src/windows-dock/DockBackdrop.cs:243 — DockBackdrop.Main has cognitive complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 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 · ui.activate.mount.flush (cognitive 17) · ×1
  • ui.activate.mount.flush (cognitive 17) plugins/quota-alerts/ui.mjs:83 — ui.activate.mount.flush has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (7 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trayText.formatTrayText (cognitive 17) · ×1
  • trayText.formatTrayText (cognitive 17) src/shared/trayText.js:437 — trayText.formatTrayText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · syncPayload.postSyncPayload (cognitive 17) · ×1
  • syncPayload.postSyncPayload (cognitive 17) src/shared/syncPayload.js:338 — syncPayload.postSyncPayload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, error handling 1 (2 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · presentation.groupedSessionRows.rows (cognitive 17) · ×1
  • presentation.groupedSessionRows.rows (cognitive 17) src/electron/renderer/edgeDock/presentation.js:351 — presentation.groupedSessionRows.rows has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 15, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · controller.createNotchController.paint (cognitive 17) · ×1
  • controller.createNotchController.paint (cognitive 17) src/electron/notch/controller.js:350 — controller.createNotchController.paint has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, ternaries 5 (7 pts), if/else 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · mask.shapeRectsFromPolygons (cognitive 17) · ×1
  • mask.shapeRectsFromPolygons (cognitive 17) src/electron/edgeDock/mask.js:183 — mask.shapeRectsFromPolygons has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchCodexResetCredits (cognitive 17) · ×1
  • limits.fetchCodexResetCredits (cognitive 17) src/shared/providers/codex/limits.js:397 — limits.fetchCodexResetCredits has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 4, if/else 3 (4 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · goApi.fetchGoApi (cognitive 17) · ×1
  • goApi.fetchGoApi (cognitive 17) src/shared/providers/opencode/goApi.js:190 — goApi.fetchGoApi has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, error handling 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · profiles.moveCredential (cognitive 17) · ×1
  • profiles.moveCredential (cognitive 17) src/shared/providers/opencode/profiles.js:185 — profiles.moveCredential has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, 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 · web.fetchWithConsole (cognitive 17) · ×1
  • web.fetchWithConsole (cognitive 17) src/shared/providers/opencode/web.js:354 — web.fetchWithConsole has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (6 pts), boolean chains 5, if/else 3 (5 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.resolveSessionMetadata (cognitive 17) · ×1
  • sessionMetadata.resolveSessionMetadata (cognitive 17) src/shared/providers/kimi/sessionMetadata.js:179 — sessionMetadata.resolveSessionMetadata has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 3, if/else 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · subagents.findOmpSubagentSessionFiles (cognitive 17) · ×1
  • subagents.findOmpSubagentSessionFiles (cognitive 17) src/shared/providers/omp/subagents.js:43 — subagents.findOmpSubagentSessionFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · extension.collectHistoryDirs (cognitive 17) · ×1
  • extension.collectHistoryDirs (cognitive 17) src/shared/providers/codebuddy/extension.js:57 — extension.collectHistoryDirs has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · sessionMetadata.readSessionRows (cognitive 17) · ×1
  • sessionMetadata.readSessionRows (cognitive 17) src/shared/providers/zcode/sessionMetadata.js:73 — sessionMetadata.readSessionRows has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (5 pts), if/else 2 (3 pts), error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · localUsageSource.createLocalUsageSource.connect (cognitive 17) · ×1
  • localUsageSource.createLocalUsageSource.connect (cognitive 17) src/shared/providers/codex/localUsageSource.js:280 — localUsageSource.createLocalUsageSource.connect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 306, active, a function literal at line 289, …). 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 · resetBoundary.limitResetBoundaryEntries (cognitive 17) · ×1
  • resetBoundary.limitResetBoundaryEntries (cognitive 17) src/shared/limits/resetBoundary.js:7 — resetBoundary.limitResetBoundaryEntries has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 11, if/else 1 (3 pts), loops 2 (3 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, name the conditions: bind each compound test to a 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 · collector.watchAttributionRootsForClients (cognitive 17) · ×1
  • collector.watchAttributionRootsForClients (cognitive 17) src/shared/collector.js:1662 — collector.watchAttributionRootsForClients has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), loops 1 (2 pts) (nesting depth added 3). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · collector.startCollector.getDiagnostics (cognitive 17) · ×1
  • collector.startCollector.getDiagnostics (cognitive 17) src/shared/collector.js:4071 — collector.startCollector.getDiagnostics has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.billingAction (cognitive 17) · ×1
  • limits.billingAction (cognitive 17) src/shared/providers/typesafe/limits.js:175 — limits.billingAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · arkcli.runArkcli (cognitive 17) · ×1
  • arkcli.runArkcli (cognitive 17) src/shared/providers/volcengine/arkcli.js:82 — arkcli.runArkcli has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 6, error handling 2, ternaries 1 (2 pts) (nesting depth added 1). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 86, 134, 93, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · limits.parseAllowanceWindow (cognitive 17) · ×1
  • limits.parseAllowanceWindow (cognitive 17) src/shared/providers/notion/limits.js:132 — limits.parseAllowanceWindow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, ternaries 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 · credentialStore.persistSettingsAndCredentials (cognitive 17) · ×1
  • credentialStore.persistSettingsAndCredentials (cognitive 17) src/shared/credentialStore.js:213 — credentialStore.persistSettingsAndCredentials has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 3 (6 pts), boolean chains 2 (nesting depth added 7). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · manager.createPluginManager.reload (cognitive 17) · ×1
  • manager.createPluginManager.reload (cognitive 17) src/electron/plugins/manager.js:131 — manager.createPluginManager.reload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (3 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.setupObservers (cognitive 17) · ×1
  • main.setupObservers (cognitive 17) site/scripts/main.js:26 — main.setupObservers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (7 pts) (nesting depth added 7). Of this number, 10 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.setupDashboard · ×1
  • main.setupDashboard::heatmapSvg (cognitive 17) site/scripts/main.js:584 — main.setupDashboard::heatmapSvg has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (14 pts), loops 3 (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. This shape REPEATS in the file: one other method here (main.setupDashboard) 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 · hubBuildComparison.compareHubBuild (cognitive 17) · ×1
  • hubBuildComparison.compareHubBuild (cognitive 17) src/shared/hubBuildComparison.js:28 — hubBuildComparison.compareHubBuild has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 5. 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 · icloudSync.createIcloudSyncStore.writeSubscriptionsNow (cognitive 17) · ×1
  • icloudSync.createIcloudSyncStore.writeSubscriptionsNow (cognitive 17) src/electron/icloudSync.js:1212 — icloudSync.createIcloudSyncStore.writeSubscriptionsNow has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), error handling 2 (4 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · icloudSyncRuntime.createIcloudSyncRuntime.reconcile (cognitive 17) · ×1
  • icloudSyncRuntime.createIcloudSyncRuntime.reconcile (cognitive 17) src/electron/icloudSyncRuntime.js:225 — icloudSyncRuntime.createIcloudSyncRuntime.reconcile has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 15, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · retainedWindow.createRetainedWindow (cognitive 17) · ×1
  • retainedWindow.createRetainedWindow (cognitive 17) src/electron/retainedWindow.js:11 — retainedWindow.createRetainedWindow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (nesting depth added 2). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 17, a function literal at line 20, a function literal at line 56, …). 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 · managedAccounts.createWorkbuddyManagedAccounts.commitAccounts (cognitive 17) · ×1
  • managedAccounts.createWorkbuddyManagedAccounts.commitAccounts (cognitive 17) src/electron/providers/workbuddy/managedAccounts.js:39 — managedAccounts.createWorkbuddyManagedAccounts.commitAccounts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), error handling 3 (5 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 · accountSlotService.createAccountSlotService.mutate (cognitive 17) · ×1
  • accountSlotService.createAccountSlotService.mutate (cognitive 17) src/electron/limits/accountSlotService.js:136 — accountSlotService.createAccountSlotService.mutate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6 (nesting depth added 1). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 137). 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 · accountSlotsPanel.createPanel.render (cognitive 17) · ×1
  • accountSlotsPanel.createPanel.render (cognitive 17) src/electron/renderer/limits/accountSlotsPanel.js:276 — accountSlotsPanel.createPanel.render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 279). 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 · appUpdater.parseHtmlReleaseNoteGroups (cognitive 17) · ×1
  • appUpdater.parseHtmlReleaseNoteGroups (cognitive 17) src/shared/appUpdater.js:358 — appUpdater.parseHtmlReleaseNoteGroups has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionDetail.claudePromptText (cognitive 17) · ×1
  • sessionDetail.claudePromptText (cognitive 17) src/shared/sessionDetail.js:94 — sessionDetail.claudePromptText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 5). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · macProgressiveBlur.createProgressiveBlurApi.apply (cognitive 17) · ×1
  • macProgressiveBlur.createProgressiveBlurApi.apply (cognitive 17) src/electron/notch/macProgressiveBlur.js:60 — macProgressiveBlur.createProgressiveBlurApi.apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.resolveCodexWorkspaceAfterLogin (cognitive 17) · ×1
  • main.resolveCodexWorkspaceAfterLogin (cognitive 17) src/electron/main.js:1860 — main.resolveCodexWorkspaceAfterLogin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, 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 · main.limitsHistoryPayload (cognitive 17) · ×1
  • main.limitsHistoryPayload (cognitive 17) src/electron/main.js:3337 — main.limitsHistoryPayload has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 3 (4 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · main.updateTrayDisplay (cognitive 17) · ×1
  • main.updateTrayDisplay (cognitive 17) src/electron/main.js:5390 — main.updateTrayDisplay has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 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 · main.notchDataFor (cognitive 17) · ×1
  • main.notchDataFor (cognitive 17) src/electron/main.js:6037 — main.notchDataFor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · app.createDockItemsComposer (cognitive 17) · ×1
  • app.createDockItemsComposer (cognitive 17) REDACTED:14830 — app.createDockItemsComposer has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (7 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 14845, 14850, 14866, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · pluginCredentials.create.mount.run (cognitive 17) · ×1
  • pluginCredentials.create.mount.run (cognitive 17) src/electron/renderer/pluginCredentials.js:71 — pluginCredentials.create.mount.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 2, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · pluginViews.createPluginViewHost.mount (cognitive 17) · ×1
  • pluginViews.createPluginViewHost.mount (cognitive 17) src/electron/renderer/pluginViews.js:152 — pluginViews.createPluginViewHost.mount has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 160, 164). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · usageCharts.patchTodayBar (cognitive 17) · ×1
  • usageCharts.patchTodayBar (cognitive 17) src/electron/renderer/usageCharts.js:402 — usageCharts.patchTodayBar has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (4 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · maybeFetchCodexResetForecast (cognitive 17) · ×1
  • maybeFetchCodexResetForecast (cognitive 17) REDACTED:5127 — maybeFetchCodexResetForecast has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 3 (nesting depth added 3). Of this number, 11 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 17) · ×1
  • (anonymous) (cognitive 17) REDACTED:13965 — (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · writeSharedSubscriptionsNow (cognitive 17) · ×1
  • writeSharedSubscriptionsNow (cognitive 17) src/electron/main.js:4182 — writeSharedSubscriptionsNow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · refreshEdgeDockDerivedPeriods (cognitive 17) · ×1
  • refreshEdgeDockDerivedPeriods (cognitive 17) src/electron/main.js:6300 — refreshEdgeDockDerivedPeriods has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), error handling 1, loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 6318, 6337). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · spawnTokscaleHelp (cognitive 17) · ×1
  • spawnTokscaleHelp (cognitive 17) src/shared/collector.js:330 — spawnTokscaleHelp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 4, error handling 2, other 1. Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 369, (anonymous)::finish, a function literal at line 358, …). 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 · appendLiveRate (cognitive 17) · ×1
  • appendLiveRate (cognitive 17) REDACTED:1769 — appendLiveRate has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 6, if/else 3 (nesting depth added 1). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · createPluginSettingsPanel.refreshCatalog (cognitive 17) · ×1
  • createPluginSettingsPanel.refreshCatalog (cognitive 17) src/electron/renderer/pluginSettings.js:824 — createPluginSettingsPanel.refreshCatalog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 828, 835, 825, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · createNotchPanel.applyScroll (cognitive 17) · ×1
  • createNotchPanel.applyScroll (cognitive 17) src/electron/renderer/notch/panel.js:1427 — createNotchPanel.applyScroll has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createEdgeDockController.syncRailPointer (cognitive 17) · ×1
  • createEdgeDockController.syncRailPointer (cognitive 17) src/electron/edgeDock/controller.js:459 — createEdgeDockController.syncRailPointer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, loops 1 (2 pts), ternaries 2 (nesting depth added 3). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · mapCodexRateLimitsToProvider (cognitive 17) · ×1
  • mapCodexRateLimitsToProvider (cognitive 17) src/shared/providers/codex/limits.js:528 — mapCodexRateLimitsToProvider has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, other 4, if/else 1 (2 pts), ternaries 1 (2 pts), loops 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 · dailyBarsChart (cognitive 17) · ×1
  • dailyBarsChart (cognitive 17) src/electron/renderer/usageCharts.js:129 — dailyBarsChart has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, loops 3 (4 pts), ternaries 4, if/else 1 (2 pts) (nesting depth added 2). Of this number, 10 points are the body's own statements and 7 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 · createEdgeDockComposer.windowChoices (cognitive 17) · ×1
  • createEdgeDockComposer.windowChoices (cognitive 17) src/electron/renderer/edgeDock/composer.js:293 — createEdgeDockComposer.windowChoices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parsePersonalUsage (cognitive 17) · ×1
  • parsePersonalUsage (cognitive 17) src/shared/providers/workbuddy/limits.js:140 — parsePersonalUsage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, ternaries 2 (3 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.
D2 · Cognitive Complexity · cookieHeaderFromCurl (cognitive 17) · ×1
  • cookieHeaderFromCurl (cognitive 17) src/shared/providers/commandcode/limits.js:148 — cookieHeaderFromCurl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, ternaries 1 (2 pts), loops 1, other 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createWorkbuddyLocalAuth.request (cognitive 17) · ×1
  • createWorkbuddyLocalAuth.request (cognitive 17) src/electron/providers/workbuddy/localAuth.js:353 — createWorkbuddyLocalAuth.request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 7, 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 · loadApi (cognitive 17) · ×1
  • loadApi (cognitive 17) src/electron/macLiquidGlass.js:8 — loadApi has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 2, loops 2, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 18 function items inside it that branch (setPath, getBounds, loadPathApi, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · trayText.pickWorstLimitProvider (cognitive 16) · ×1
  • trayText.pickWorstLimitProvider (cognitive 16) src/shared/trayText.js:308 — trayText.pickWorstLimitProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 6). Of this number, 12 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 · sessionRows.sessionSearchHaystack (cognitive 16) · ×1
  • sessionRows.sessionSearchHaystack (cognitive 16) src/electron/renderer/sessionRows.js:53 — sessionRows.sessionSearchHaystack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · presentation.nextRunningExpiryAt (cognitive 16) · ×1
  • presentation.nextRunningExpiryAt (cognitive 16) src/electron/renderer/edgeDock/presentation.js:487 — presentation.nextRunningExpiryAt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.readWindowsCredentialSecret (cognitive 16) · ×1
  • limits.readWindowsCredentialSecret (cognitive 16) src/shared/providers/claude/limits.js:338 — limits.readWindowsCredentialSecret has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · web.parseSubscription (cognitive 16) · ×1
  • web.parseSubscription (cognitive 16) src/shared/providers/opencode/web.js:142 — web.parseSubscription has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, 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 · paths.senpiWatchSources (cognitive 16) · ×1
  • paths.senpiWatchSources (cognitive 16) src/shared/providers/senpi/paths.js:134 — paths.senpiWatchSources has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 4, if/else 2 (4 pts), error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionFiles.findTimestampedSessionFiles · ×1
  • sessionFiles.findTimestampedSessionFiles::walk (cognitive 16) src/shared/sessionFiles.js:73 — sessionFiles.findTimestampedSessionFiles::walk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 1, 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 · sessionFiles.findCodexSessionFiles · ×1
  • sessionFiles.findCodexSessionFiles::walk (cognitive 16) src/shared/sessionFiles.js:122 — sessionFiles.findCodexSessionFiles::walk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionFiles.codexSessionFile (cognitive 16) · ×1
  • sessionFiles.codexSessionFile (cognitive 16) src/shared/sessionFiles.js:147 — sessionFiles.codexSessionFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.closedUsageObject (cognitive 16) · ×1
  • sessionMetadata.closedUsageObject (cognitive 16) src/shared/providers/claude/sessionMetadata.js:136 — sessionMetadata.closedUsageObject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extension.conversationTitle (cognitive 16) · ×1
  • extension.conversationTitle (cognitive 16) src/shared/providers/codebuddy/extension.js:103 — extension.conversationTitle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionMetadata.projectPathFromJsonl (cognitive 16) · ×1
  • sessionMetadata.projectPathFromJsonl (cognitive 16) src/shared/sessionMetadata.js:151 — sessionMetadata.projectPathFromJsonl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchCursorLimits (cognitive 16) · ×1
  • limits.fetchCursorLimits (cognitive 16) src/shared/providers/cursor/limits.js:267 — limits.fetchCursorLimits has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5, ternaries 5. Of this number, 9 points are the body's own statements and 7 belong to 4 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 · limits.parseFactoryTokenRateLimits (cognitive 16) · ×1
  • limits.parseFactoryTokenRateLimits (cognitive 16) src/shared/providers/factory/limits.js:91 — limits.parseFactoryTokenRateLimits has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (6 pts), if/else 4 (5 pts), boolean chains 4, loops 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (appendPool, a function literal at line 96). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · limits.fetchKimiLimits (cognitive 16) · ×1
  • limits.fetchKimiLimits (cognitive 16) src/shared/providers/kimi/limits.js:579 — limits.fetchKimiLimits has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, error handling 2 (4 pts), if/else 3, ternaries 3 (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 · session.mintMimoServiceSession (cognitive 16) · ×1
  • session.mintMimoServiceSession (cognitive 16) src/shared/providers/mimo/session.js:245 — session.mintMimoServiceSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 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 · limits.zcodePeriodByEntitlement (cognitive 16) · ×1
  • limits.zcodePeriodByEntitlement (cognitive 16) src/shared/providers/zai/limits.js:739 — limits.zcodePeriodByEntitlement has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (6 pts), boolean chains 4, if/else 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 6). 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.
D2 · Cognitive Complexity · balanceHistory.normalizedCompactEntry (cognitive 16) · ×1
  • balanceHistory.normalizedCompactEntry (cognitive 16) src/shared/providers/deepseek/balanceHistory.js:77 — balanceHistory.normalizedCompactEntry has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (5 pts), ternaries 3, loops 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchToolSpends (cognitive 16) · ×1
  • limits.fetchToolSpends (cognitive 16) src/shared/providers/deepseek/limits.js:66 — limits.fetchToolSpends has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, error handling 1, loops 1, 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: 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 · limits.findQuotaWindow (cognitive 16) · ×1
  • limits.findQuotaWindow (cognitive 16) src/shared/providers/devin/limits.js:201 — limits.findQuotaWindow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.resolveApiIdentity (cognitive 16) · ×1
  • limits.resolveApiIdentity (cognitive 16) src/shared/providers/ollama/limits.js:470 — limits.resolveApiIdentity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.parseTraeEntUsage (cognitive 16) · ×1
  • limits.parseTraeEntUsage (cognitive 16) src/shared/providers/trae/limits.js:68 — limits.parseTraeEntUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limits.fetchTraeLimits (cognitive 16) · ×1
  • limits.fetchTraeLimits (cognitive 16) src/shared/providers/trae/limits.js:184 — limits.fetchTraeLimits has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), ternaries 2 (4 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.existingBailianCli (cognitive 16) · ×1
  • cli.existingBailianCli (cognitive 16) src/shared/providers/alibaba/cli.js:22 — cli.existingBailianCli has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, ternaries 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · accountSlotFetcher.createAccountSlotFetcher · ×1
  • accountSlotFetcher.createAccountSlotFetcher::fetchAccount (cognitive 16) src/shared/limits/accountSlotFetcher.js:136 — accountSlotFetcher.createAccountSlotFetcher::fetchAccount has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (5 pts), loops 1 (2 pts), ternaries 2, 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 · limits.createPluginLimits.reconcile (cognitive 16) · ×1
  • limits.createPluginLimits.reconcile (cognitive 16) src/electron/plugins/limits.js:41 — limits.createPluginLimits.reconcile has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, loops 2 (4 pts), if/else 3, ternaries 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 3 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · businessData.sessionSources.contexts (cognitive 16) · ×1
  • businessData.sessionSources.contexts (cognitive 16) src/shared/plugins/businessData.js:183 — businessData.sessionSources.contexts has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, ternaries 5, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · businessData.createBusinessDataService.sweep (cognitive 16) · ×1
  • businessData.createBusinessDataService.sweep (cognitive 16) src/electron/plugins/businessData.js:239 — businessData.createBusinessDataService.sweep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 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 · businessData.createBusinessDataService.lazyBytes (cognitive 16) · ×1
  • businessData.createBusinessDataService.lazyBytes (cognitive 16) src/electron/plugins/businessData.js:303 — businessData.createBusinessDataService.lazyBytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · githubDiscovery.createGitHubDiscovery.repositoryReadme (cognitive 16) · ×1
  • githubDiscovery.createGitHubDiscovery.repositoryReadme (cognitive 16) src/electron/plugins/githubDiscovery.js:70 — githubDiscovery.createGitHubDiscovery.repositoryReadme has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6, 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 · runtime.createPluginRuntime.listWithPlacements (cognitive 16) · ×1
  • runtime.createPluginRuntime.listWithPlacements (cognitive 16) src/electron/plugins/runtime.js:349 — runtime.createPluginRuntime.listWithPlacements has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 2 (4 pts), loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · archiveReconciliation.resolveOmpForkParents (cognitive 16) · ×1
  • archiveReconciliation.resolveOmpForkParents (cognitive 16) src/shared/providers/omp/archiveReconciliation.js:21 — archiveReconciliation.resolveOmpForkParents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessionUsageArchiveStore.createSessionUsageArchiveStore.mutateArchive (cognitive 16) · ×1
  • sessionUsageArchiveStore.createSessionUsageArchiveStore.mutateArchive (cognitive 16) src/shared/usage/sessionUsageArchiveStore.js:347 — sessionUsageArchiveStore.createSessionUsageArchiveStore.mutateArchive has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6, error handling 2 (3 pts) (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagnosticReport.projectClientHealth (cognitive 16) · ×1
  • diagnosticReport.projectClientHealth (cognitive 16) src/shared/diagnosticReport.js:108 — diagnosticReport.projectClientHealth has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 6, loops 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 115, 121, 161). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · historySource.parseDeviceHistories (cognitive 16) · ×1
  • historySource.parseDeviceHistories (cognitive 16) src/electron/historySource.js:13 — historySource.parseDeviceHistories has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 2, ternaries 2. Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 16). 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 · historySource.devicesWithLocalHistory (cognitive 16) · ×1
  • historySource.devicesWithLocalHistory (cognitive 16) src/electron/historySource.js:48 — historySource.devicesWithLocalHistory has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), ternaries 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · icloudSyncRuntime.createIcloudSyncRuntime.saveSubscriptions (cognitive 16) · ×1
  • icloudSyncRuntime.createIcloudSyncRuntime.saveSubscriptions (cognitive 16) src/electron/icloudSyncRuntime.js:470 — icloudSyncRuntime.createIcloudSyncRuntime.saveSubscriptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, error handling 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 · windowViewState.restoreWindowViewState · ×1
  • windowViewState.restoreWindowViewState::restore (cognitive 16) src/electron/renderer/windowViewState.js:22 — windowViewState.restoreWindowViewState::restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oauth.authRequest (cognitive 16) · ×1
  • oauth.authRequest (cognitive 16) src/shared/providers/workbuddy/oauth.js:157 — oauth.authRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, error handling 1, ternaries 1 (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 one function literal inside it that branches (line 164). 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 · oauth.refreshCredential (cognitive 16) · ×1
  • oauth.refreshCredential (cognitive 16) src/shared/providers/workbuddy/oauth.js:190 — oauth.refreshCredential has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · localAuth.createWorkbuddyLocalAuth.request (cognitive 16) · ×1
  • localAuth.createWorkbuddyLocalAuth.request (cognitive 16) src/electron/providers/workbuddy/localAuth.js:353 — localAuth.createWorkbuddyLocalAuth.request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · historyStore.writePrivateBufferAtomic (cognitive 16) · ×1
  • historyStore.writePrivateBufferAtomic (cognitive 16) src/electron/macWidget/historyStore.js:204 — historyStore.writePrivateBufferAtomic has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 4 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.normalizeMimoManagedAccounts (cognitive 16) · ×1
  • main.normalizeMimoManagedAccounts (cognitive 16) src/electron/main.js:1532 — main.normalizeMimoManagedAccounts has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · main.macWidgetConfiguration (cognitive 16) · ×1
  • main.macWidgetConfiguration (cognitive 16) src/electron/main.js:4981 — main.macWidgetConfiguration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.cursorStatusValue (cognitive 16) · ×1
  • main.cursorStatusValue (cognitive 16) src/electron/main.js:8211 — main.cursorStatusValue has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 3, error handling 1 (2 pts), if/else 2 (nesting depth added 1). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 8221, 8246). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · main.app.whenReady().then() (cognitive 16) · ×1
  • main.app.whenReady().then() (cognitive 16) src/electron/main.js:8255 — main.app.whenReady().then() has cognitive complexity 16 (threshold 15). Drivers by points: if/else 198 (225 pts), boolean chains 206, error handling 32 (37 pts), ternaries 18 (20 pts), loops 10 (14 pts) (nesting depth added 38). 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 (main.app.whenReady().then()::applySettingsPatch) 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 · backendHost.port.on("message") (cognitive 16) · ×1
  • backendHost.port.on("message") (cognitive 16) src/electron/plugins/backendHost.cjs:16 — backendHost.port.on("message") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 1 (2 pts), boolean chains 1, 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 · app.syncHubProfileControls (cognitive 16) · ×1
  • app.syncHubProfileControls (cognitive 16) REDACTED:9847 — app.syncHubProfileControls has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (6 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · app.preferenceRows (cognitive 16) · ×1
  • app.preferenceRows (cognitive 16) REDACTED:10350 — app.preferenceRows has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (15 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 · windowsView.createLimitWindowsView.claudeResetGrantRows (cognitive 16) · ×1
  • windowsView.createLimitWindowsView.claudeResetGrantRows (cognitive 16) src/electron/renderer/limits/windowsView.js:345 — windowsView.createLimitWindowsView.claudeResetGrantRows has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4, boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 347, 364). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · homeLimitRows · ×1
  • homeLimitRows::accountName (cognitive 16) REDACTED:6867 — homeLimitRows::accountName has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderMinimaxApiKeys (cognitive 16) · ×1
  • renderMinimaxApiKeys (cognitive 16) REDACTED:19087 — renderMinimaxApiKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 5). Of this number, 10 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 · addProjectInto (cognitive 16) · ×1
  • addProjectInto (cognitive 16) src/shared/usage.js:463 — addProjectInto has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), other 2, ternaries 1 (2 pts), loops 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 · createNotchController.send (cognitive 16) · ×1
  • createNotchController.send (cognitive 16) src/electron/notch/controller.js:293 — createNotchController.send has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4, ternaries 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 · createPluginRuntime.listWithPlacements (cognitive 16) · ×1
  • createPluginRuntime.listWithPlacements (cognitive 16) src/electron/plugins/runtime.js:349 — createPluginRuntime.listWithPlacements has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 2 (4 pts), loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseTeamSummary (cognitive 16) · ×1
  • parseTeamSummary (cognitive 16) src/shared/providers/alibaba/limits.js:499 — parseTeamSummary has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 4, 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 · createNotchRenderer (cognitive 16) · ×1
  • createNotchRenderer (cognitive 16) src/electron/renderer/notch/renderer.js:25 — createNotchRenderer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 2 (nesting depth added 2). None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 686, 181, 701). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · createBusinessDataService.sweep (cognitive 16) · ×1
  • createBusinessDataService.sweep (cognitive 16) src/electron/plugins/businessData.js:239 — createBusinessDataService.sweep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 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 · createBusinessDataService.lazyBytes (cognitive 16) · ×1
  • createBusinessDataService.lazyBytes (cognitive 16) src/electron/plugins/businessData.js:303 — createBusinessDataService.lazyBytes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · limitProviderFreshness (cognitive 16) · ×1
  • limitProviderFreshness (cognitive 16) src/electron/renderer/limits/providerPresentation.js:426 — limitProviderFreshness has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · animateHeatmapEntry (cognitive 16) · ×1
  • animateHeatmapEntry (cognitive 16) src/electron/renderer/dashboard.js:142 — animateHeatmapEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, error handling 1, ternaries 1. Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 8 function items inside it that branch (startWhenVisible, a function literal at line 168, a function literal at line 179, …). 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 · withGrokPathHints (cognitive 16) · ×1
  • withGrokPathHints (cognitive 16) src/shared/providers/grok/limits.js:466 — withGrokPathHints has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 4, if/else 3, loops 1, other 1. 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: 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 · buildModels (cognitive 16) · ×1
  • buildModels (cognitive 16) src/shared/macWidgetSnapshot.js:364 — buildModels has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), if/else 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 4). Of this number, 14 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 · createSyncContentRuntime.refreshWork (cognitive 16) · ×1
  • createSyncContentRuntime.refreshWork (cognitive 16) src/electron/syncContentRuntime.js:331 — createSyncContentRuntime.refreshWork has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (3 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createEdgeDockComposer.markFor (cognitive 16) · ×1
  • createEdgeDockComposer.markFor (cognitive 16) src/electron/renderer/edgeDock/composer.js:126 — createEdgeDockComposer.markFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (6 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · compactLimitSelection (cognitive 16) · ×1
  • compactLimitSelection (cognitive 16) src/shared/trayText.js:247 — compactLimitSelection has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 5, if/else 2. Of this number, 10 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · createIcloudSyncRuntime.saveSubscriptions (cognitive 16) · ×1
  • createIcloudSyncRuntime.saveSubscriptions (cognitive 16) src/electron/icloudSyncRuntime.js:470 — createIcloudSyncRuntime.saveSubscriptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, error handling 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 · createSessionUsageArchiveStore.mutateArchive (cognitive 16) · ×1
  • createSessionUsageArchiveStore.mutateArchive (cognitive 16) src/shared/usage/sessionUsageArchiveStore.js:347 — createSessionUsageArchiveStore.mutateArchive has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6, error handling 2 (3 pts) (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · MethodTooLong · ×1
  • MethodTooLong: HubDO.fetch worker/src/index.js:462 — MethodTooLong — fetch runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: REDACTED → discordRpc.js, floatingBubble.js, preload.js REDACTED — `REDACTED` changes together with 3 other files — `src/electron/discordRpc.js`, `src/electron/floatingBubble.js`, `src/electron/preload.js` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) native/macos/TokenMonitorWidget/WidgetConfigurationIntent.swift:396 — native/macos/TokenMonitorWidget/WidgetConfigurationIntent.swift:396-409 | native/macos/TokenMonitorWidget/WidgetViewModel.swift:272-284 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:499 — native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:499-524 | native/macos/TokenMonitorWidget/WidgetDashboardViews.swift:591-618 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) native/macos/TokenMonitorWidget/WidgetSnapshot.swift:555 — native/macos/TokenMonitorWidget/WidgetSnapshot.swift:555-561 | native/macos/TokenMonitorWidget/WidgetSnapshot.swift:575-580 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 10+ corresponding lines) native/macos/TokenMonitorWidget/TokenMonitorWidget.swift:16 — native/macos/TokenMonitorWidget/TokenMonitorWidget.swift:16-29 | native/macos/TokenMonitorWidget/TokenMonitorWidget.swift:33-42 | native/macos/TokenMonitorWidget/TokenMonitorWidget.swift:46-55 | native/macos/TokenMonitorWidget/TokenMonitorWidget.swift:59-68 | native/macos/TokenMonitorWidget/TokenMonitorWidget.swift:72-81 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 3+ corresponding lines) native/macos/TokenMonitorWidget/WidgetTimelineProvider.swift:83 — native/macos/TokenMonitorWidget/WidgetTimelineProvider.swift:83-85 | native/macos/TokenMonitorWidget/WidgetTimelineProvider.swift:86-88 | native/macos/TokenMonitorWidget/WidgetTimelineProvider.swift:93-95 | native/macos/TokenMonitorWidget/WidgetTimelineProvider.swift:96-98 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×1
  • Duplicated block (8 lines × 2) native/macos/TokenMonitorWidget/WidgetConfigurationIntent.swift:397 — native/macos/TokenMonitorWidget/WidgetConfigurationIntent.swift:397-404 | native/macos/TokenMonitorWidget/WidgetViewModel.swift:273-280 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: Element (LCOM4 5) tests/helpers/notchPanel.js:7 — Element's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
P12 · CI test-gate honesty · Coverage collected but not gated · ×1
  • Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging call was found in the 552 JavaScript/TypeScript, Swift production file(s) this check read across 4 module(s). Each was searched for its ecosystem's logging libraries (JavaScript/TypeScript: pino, winston, bunyan, log4js, loglevel, consola, the NestJS Logger; Swift: os.Logger/os_log/NSLog, swift-log, CocoaLumberjack, SwiftyBeaver, XCGLogger) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 38 typed · 1223 plain JS — the untyped files are plugins/openai-api-credit/backend.cjs, plugins/openai-api-credit/balance.cjs, plugins/openai-api-credit/i18n.mjs, plugins/openai-api-credit/settings.mjs, plugins/quota-alerts/backend.cjs, plugins/quota-alerts/delivery.cjs (+1217 more).
R10 · Code Duplication · Duplication concentrated across 38 sibling directories (88 clone groups) · ×1
  • Duplication concentrated across 38 sibling directories (88 clone groups) src/shared/providers/mimo/spendHistory.js:34 — 88 duplicated blocks under src/shared/providers/ have copies in at least two of the sibling directories alibaba, antigravity, claude, cline, codebuddy, codex (+32 more sibling(s) not listed) — 66 of them are reported below, and 22 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 88 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 88 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 88 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 2 sibling directories (49 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (49 clone groups) src/electron/macWidget/historyStore.js:189 — 49 duplicated blocks under src/ have copies in at least two of the sibling directories electron, shared — 41 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 49 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 49 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 49 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (12 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (12 clone groups) src/electron/edgeDock/preload.js:64 — 12 duplicated blocks under src/electron/ have copies in at least two of the sibling directories edgeDock, limits, macWidget, notch, plugins, providers (+1 more sibling(s) not listed) — 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 3 sibling directories (7 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (7 clone groups) REDACTED:150 — 7 duplicated blocks under src/shared/ have copies in at least two of the sibling directories limits, plugins, providers — 6 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 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 7 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 3 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (5 clone groups) REDACTED:1078 — 5 duplicated blocks under src/electron/renderer/ have copies in at least two of the sibling directories edgeDock, limits, notch — 3 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (134 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (134 matched lines × 2 locations) REDACTED:1078 — REDACTED:1078 · src/electron/renderer/limits/resetAnimator.js:48 — the two spans are one implementation copied and then locally edited — 1030 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 (55 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (55 matched lines × 2 locations) src/electron/renderer/homeModulePreferences.js:41 — src/electron/renderer/homeModulePreferences.js:41 · src/electron/renderer/limits/providerOrder.js:8 — the two spans are one implementation copied and then locally edited — 601 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 (50 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (50 matched lines × 2 locations) src/electron/renderer/clientDisplayPreferences.js:3 — src/electron/renderer/clientDisplayPreferences.js:3 · src/electron/renderer/viewDisplayPreferences.js:3 — the two spans are one implementation copied and then locally edited — 357 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 (46 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (46 matched lines × 2 locations) src/shared/providers/mimo/spendHistory.js:34 — src/shared/providers/mimo/spendHistory.js:34 · src/shared/providers/zai/limits.js:577 — the two spans are one implementation copied and then locally edited — 423 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 (42 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (42 matched lines × 2 locations) src/shared/providers/antigravity/sessionMetadata.js:14 — src/shared/providers/antigravity/sessionMetadata.js:14 · src/shared/providers/cursor/sessionMetadata.js:11 — the two spans are one implementation copied and then locally edited — 259 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 (40 lines × 2 locations) · ×1
  • Duplicated block (40 lines × 2 locations) src/electron/main.js:1489 — src/electron/main.js:1489 · src/electron/main.js:1667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) src/shared/providers/claude/limits.js:2160 — src/shared/providers/claude/limits.js:2160 · src/shared/providers/minimax/cliProcess.js:49 — 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 (36 lines × 2 locations) · ×1
  • Duplicated block (36 lines × 2 locations) src/electron/main.js:9811 — src/electron/main.js:9811 · src/electron/main.js:9965 — 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 (35 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (35 matched lines × 2 locations) src/shared/providers/claude/sessionMetadata.js:302 — src/shared/providers/claude/sessionMetadata.js:302 · src/shared/providers/codebuddy/sessionMetadata.js:73 — the two spans are one implementation copied and then locally edited — 261 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 (30 lines × 4 locations) · ×1
  • Duplicated block (30 lines × 4 locations) src/electron/edgeDock/preload.js:64 — src/electron/edgeDock/preload.js:64 · src/electron/notch/preload.js:30 · src/electron/plugins/pagePreload.js:13 · src/electron/preload.js:343 — the 4 copies are spread across 4 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 (30 lines × 2 locations) · ×1
  • Duplicated block (30 lines × 2 locations) REDACTED:7019 — REDACTED:7019 · REDACTED:7059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) src/shared/providers/manus/desktop.js:81 — src/shared/providers/manus/desktop.js:81 · src/shared/providers/mimo/desktop.js:52 — 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 with local edits (28 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (28 matched lines × 2 locations) src/shared/providers/notion/limits.js:194 — src/shared/providers/notion/limits.js:194 · src/shared/providers/opendesign/limits.js:72 — the two spans are one implementation copied and then locally edited — 233 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 (26 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (26 matched lines × 2 locations) src/electron/historySource.js:89 — src/electron/historySource.js:89 · src/electron/historySource.js:135 — the two spans are one implementation copied and then locally edited — 207 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 (23 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (23 matched lines × 2 locations) src/electron/macWidget/historyStore.js:189 — src/electron/macWidget/historyStore.js:189 · src/shared/credentialStore.js:139 — the two spans are one implementation copied and then locally edited — 143 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 (23 lines × 3 locations) · ×1
  • Duplicated block (23 lines × 3 locations) REDACTED:10844 — REDACTED:10844 · REDACTED:10951 · REDACTED:11286 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (22 lines × 6 locations) · ×1
  • Duplicated block (22 lines × 6 locations) REDACTED:10619 — REDACTED:10619 · REDACTED:10642 · REDACTED:10665 · REDACTED:10688 · +2 more site(s) not listed — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block with local edits (19 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (19 matched lines × 2 locations) src/electron/renderer/pluginCredentials.js:88 — src/electron/renderer/pluginCredentials.js:88 · src/electron/renderer/pluginCredentials.js:114 — the two spans are one implementation copied and then locally edited — 166 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 (17 lines × 3 locations) · ×1
  • Duplicated block (17 lines × 3 locations) src/electron/main.js:4761 — src/electron/main.js:4761 · src/electron/main.js:4843 · src/electron/main.js:4901 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function renderProviderWindows (cyclomatic 274, cognitive 476) · ×1
  • Complex function renderProviderWindows (cyclomatic 274, cognitive 476) src/electron/renderer/limits/windowsView.js:1030 — renderProviderWindows has cyclomatic complexity 274 and cognitive complexity 476; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 applySettingsPatch (cyclomatic 255, cognitive 264) · ×1
  • Complex function applySettingsPatch (cyclomatic 255, cognitive 264) src/electron/main.js:8498 — applySettingsPatch has cyclomatic complexity 255 and cognitive complexity 264; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalizeManifest (cyclomatic 133, cognitive 150) · ×1
  • Complex function normalizeManifest (cyclomatic 133, cognitive 150) src/shared/plugins/manifest.js:59 — normalizeManifest has cyclomatic complexity 133 and cognitive complexity 150; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 collectUsageOnce (cyclomatic 122, cognitive 194) · ×1
  • Complex function collectUsageOnce (cyclomatic 122, cognitive 194) src/shared/collector.js:947 — collectUsageOnce has cyclomatic complexity 122 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 performTick (cyclomatic 118, cognitive 184) · ×1
  • Complex function performTick (cyclomatic 118, cognitive 184) src/shared/collector.js:3137 — performTick has cyclomatic complexity 118 and cognitive complexity 184; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 115, cognitive 244) · ×1
  • Complex function (anonymous) (cyclomatic 115, cognitive 244) scripts/test-plugin-trusted-app.cjs:128 — (anonymous) has cyclomatic complexity 115 and cognitive complexity 244; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 updateRow (cyclomatic 104, cognitive 110) · ×1
  • Complex function updateRow (cyclomatic 104, cognitive 110) REDACTED:2787 — updateRow has cyclomatic complexity 104 and cognitive complexity 110; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 normalizePeriod (cyclomatic 97, cognitive 158) · ×1
  • Complex function normalizePeriod (cyclomatic 97, cognitive 158) src/shared/usage.js:1031 — normalizePeriod has cyclomatic complexity 97 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 recordActions (cyclomatic 91, cognitive 155) · ×1
  • Complex function recordActions (cyclomatic 91, cognitive 155) src/electron/limits/historyDatabase.js:208 — recordActions has cyclomatic complexity 91 and cognitive complexity 155; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 fetchOpenCodeLimits (cyclomatic 78, cognitive 99) · ×1
  • Complex function fetchOpenCodeLimits (cyclomatic 78, cognitive 99) src/shared/providers/opencode/limits.js:104 — fetchOpenCodeLimits has cyclomatic complexity 78 and cognitive complexity 99; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 deltaValue (cyclomatic 75, cognitive 119) · ×1
  • Complex function deltaValue (cyclomatic 75, cognitive 119) src/shared/usage.js:2292 — deltaValue has cyclomatic complexity 75 and cognitive complexity 119; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function projectResource (cyclomatic 74, cognitive 143) · ×1
  • Complex function projectResource (cyclomatic 74, cognitive 143) src/shared/plugins/businessData.js:252 — projectResource has cyclomatic complexity 74 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 commitRows (cyclomatic 72, cognitive 98) · ×1
  • Complex function commitRows (cyclomatic 72, cognitive 98) src/shared/limits/runtime.js:644 — commitRows has cyclomatic complexity 72 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 limitProviderStatusLabel (cyclomatic 72, cognitive 70) · ×1
  • Complex function limitProviderStatusLabel (cyclomatic 72, cognitive 70) src/electron/renderer/limits/providerPresentation.js:450 — limitProviderStatusLabel has cyclomatic complexity 72 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 validateStaticSvg (cyclomatic 70, cognitive 120) · ×1
  • Complex function validateStaticSvg (cyclomatic 70, cognitive 120) src/shared/plugins/staticSvg.js:14 — validateStaticSvg has cyclomatic complexity 70 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function mergeSession (cyclomatic 70, cognitive 81) · ×1
  • Complex function mergeSession (cyclomatic 70, cognitive 81) src/shared/usage.js:723 — mergeSession has cyclomatic complexity 70 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function resolveSessionMetadata (cyclomatic 69, cognitive 121) · ×1
  • Complex function resolveSessionMetadata (cyclomatic 69, cognitive 121) src/shared/providers/antigravity/sessionMetadata.js:145 — resolveSessionMetadata has cyclomatic complexity 69 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 normalizeSession (cyclomatic 69, cognitive 58) · ×1
  • Complex function normalizeSession (cyclomatic 69, cognitive 58) src/shared/usage.js:901 — normalizeSession has cyclomatic complexity 69 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalizeProviderBalance (cyclomatic 69, cognitive 49) · ×1
  • Complex function normalizeProviderBalance (cyclomatic 69, cognitive 49) src/shared/limits/core.js:234 — normalizeProviderBalance has cyclomatic complexity 69 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 renderLimitProviderCheckboxesNow (cyclomatic 68, cognitive 107) · ×1
  • Complex function renderLimitProviderCheckboxesNow (cyclomatic 68, cognitive 107) REDACTED:12404 — renderLimitProviderCheckboxesNow has cyclomatic complexity 68 and cognitive complexity 107; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 syncSettingsForm (cyclomatic 68, cognitive 77) · ×1
  • Complex function syncSettingsForm (cyclomatic 68, cognitive 77) REDACTED:10080 — syncSettingsForm has cyclomatic complexity 68 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 fetchBailianCLI (cyclomatic 67, cognitive 76) · ×1
  • Complex function fetchBailianCLI (cyclomatic 67, cognitive 76) src/shared/providers/alibaba/cli.js:101 — fetchBailianCLI has cyclomatic complexity 67 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 projectRowsForPeriod (cyclomatic 66, cognitive 107) · ×1
  • Complex function projectRowsForPeriod (cyclomatic 66, cognitive 107) src/electron/renderer/projectRows.js:61 — projectRowsForPeriod has cyclomatic complexity 66 and cognitive complexity 107; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 fetch (cyclomatic 63, cognitive 90) · ×1
  • Complex function fetch (cyclomatic 63, cognitive 90) worker/src/index.js:462 — fetch has cyclomatic complexity 63 and cognitive complexity 90; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 fetchClaudeAccountsLimits (cyclomatic 63, cognitive 85) · ×1
  • Complex function fetchClaudeAccountsLimits (cyclomatic 63, cognitive 85) src/shared/providers/claude/limits.js:1363 — fetchClaudeAccountsLimits has cyclomatic complexity 63 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 applySessionMetadata (cyclomatic 62, cognitive 121) · ×1
  • Complex function applySessionMetadata (cyclomatic 62, cognitive 121) src/shared/sessionMetadata.js:471 — applySessionMetadata has cyclomatic complexity 62 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 pluginDetail (cyclomatic 62, cognitive 95) · ×1
  • Complex function pluginDetail (cyclomatic 62, cognitive 95) src/electron/renderer/pluginSettings.js:1211 — pluginDetail has cyclomatic complexity 62 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 updateSessionUsageArchive (cyclomatic 62, cognitive 91) · ×1
  • Complex function updateSessionUsageArchive (cyclomatic 62, cognitive 91) src/shared/usage/sessionUsageArchive.js:223 — updateSessionUsageArchive has cyclomatic complexity 62 and cognitive complexity 91; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalizeItem (cyclomatic 61, cognitive 95) · ×1
  • Complex function normalizeItem (cyclomatic 61, cognitive 95) src/shared/trayLayout.js:382 — normalizeItem has cyclomatic complexity 61 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 normalizeClientName (cyclomatic 61, cognitive 56) · ×1
  • Complex function normalizeClientName (cyclomatic 61, cognitive 56) src/shared/usage.js:285 — normalizeClientName has cyclomatic complexity 61 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function renderAppContent (cyclomatic 59, cognitive 81) · ×1
  • Complex function renderAppContent (cyclomatic 59, cognitive 81) REDACTED:7803 — renderAppContent has cyclomatic complexity 59 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleRequest (cyclomatic 57, cognitive 85) · ×1
  • Complex function handleRequest (cyclomatic 57, cognitive 85) REDACTED:395 — handleRequest has cyclomatic complexity 57 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 propagateTodayProjects (cyclomatic 56, cognitive 106) · ×1
  • Complex function propagateTodayProjects (cyclomatic 56, cognitive 106) src/shared/collector.js:693 — propagateTodayProjects has cyclomatic complexity 56 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 parseUsageSummary (cyclomatic 56, cognitive 57) · ×1
  • Complex function parseUsageSummary (cyclomatic 56, cognitive 57) src/shared/providers/cursor/probe.js:158 — parseUsageSummary has cyclomatic complexity 56 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 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 renderExternalProviderStatus (cyclomatic 55, cognitive 46) · ×1
  • Complex function renderExternalProviderStatus (cyclomatic 55, cognitive 46) REDACTED:17902 — renderExternalProviderStatus has cyclomatic complexity 55 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function readT3SessionRelationResult (cyclomatic 53, cognitive 106) · ×1
  • Complex function readT3SessionRelationResult (cyclomatic 53, cognitive 106) src/shared/t3SessionMetadata.js:217 — readT3SessionRelationResult has cyclomatic complexity 53 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 queryInternal (cyclomatic 53, cognitive 64) · ×1
  • Complex function queryInternal (cyclomatic 53, cognitive 64) src/electron/plugins/businessData.js:406 — queryInternal has cyclomatic complexity 53 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 fetchMinimaxCodeLimits (cyclomatic 52, cognitive 92) · ×1
  • Complex function fetchMinimaxCodeLimits (cyclomatic 52, cognitive 92) src/shared/providers/minimax/limits.js:524 — fetchMinimaxCodeLimits has cyclomatic complexity 52 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 applyTokscaleSessionMetadata (cyclomatic 52, cognitive 64) · ×1
  • Complex function applyTokscaleSessionMetadata (cyclomatic 52, cognitive 64) src/shared/sessionMetadata.js:85 — applyTokscaleSessionMetadata has cyclomatic complexity 52 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 51, cognitive 120) · ×1
  • Complex function (anonymous) (cyclomatic 51, cognitive 120) src/electron/limits/historyDatabase.js:387 — (anonymous) has cyclomatic complexity 51 and cognitive complexity 120; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 19356 lines of code REDACTED:1 — REDACTED has 19356 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/electron/main.js · ×1
  • src/electron/main.js: 9916 lines of code src/electron/main.js:1 — src/electron/main.js has 9916 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/collector.js · ×1
  • src/shared/collector.js: 4112 lines of code src/shared/collector.js:1 — src/shared/collector.js has 4112 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/electron/renderer/limits/windowsView.js · ×1
  • src/electron/renderer/limits/windowsView.js: 3351 lines of code src/electron/renderer/limits/windowsView.js:1 — src/electron/renderer/limits/windowsView.js has 3351 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/usage.js · ×1
  • src/shared/usage.js: 2296 lines of code src/shared/usage.js:1 — src/shared/usage.js has 2296 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: 2236 lines of code REDACTED:1 — REDACTED has 2236 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/claude/limits.js · ×1
  • src/shared/providers/claude/limits.js: 2196 lines of code src/shared/providers/claude/limits.js:1 — src/shared/providers/claude/limits.js has 2196 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/electron/edgeDock/controller.js · ×1
  • src/electron/edgeDock/controller.js: 1631 lines of code src/electron/edgeDock/controller.js:1 — src/electron/edgeDock/controller.js has 1631 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/electron/renderer/pluginSettings.js · ×1
  • src/electron/renderer/pluginSettings.js: 1523 lines of code src/electron/renderer/pluginSettings.js:1 — src/electron/renderer/pluginSettings.js has 1523 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/electron/renderer/notch/panel.js · ×1
  • src/electron/renderer/notch/panel.js: 1460 lines of code src/electron/renderer/notch/panel.js:1 — src/electron/renderer/notch/panel.js has 1460 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/electron/renderer/trayComposer.js · ×1
  • src/electron/renderer/trayComposer.js: 1374 lines of code src/electron/renderer/trayComposer.js:1 — src/electron/renderer/trayComposer.js has 1374 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/codex/limits.js · ×1
  • src/shared/providers/codex/limits.js: 1363 lines of code src/shared/providers/codex/limits.js:1 — src/shared/providers/codex/limits.js has 1363 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/electron/icloudSync.js · ×1
  • src/electron/icloudSync.js: 1234 lines of code src/electron/icloudSync.js:1 — src/electron/icloudSync.js has 1234 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/trayLayout.js · ×1
  • src/shared/trayLayout.js: 1137 lines of code src/shared/trayLayout.js:1 — src/shared/trayLayout.js has 1137 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/limits/runtime.js · ×1
  • src/shared/limits/runtime.js: 1115 lines of code src/shared/limits/runtime.js:1 — src/shared/limits/runtime.js has 1115 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/diagnosticReport.js · ×1
  • src/shared/diagnosticReport.js: 1096 lines of code src/shared/diagnosticReport.js:1 — src/shared/diagnosticReport.js has 1096 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/limits/core.js · ×1
  • src/shared/limits/core.js: 1077 lines of code src/shared/limits/core.js:1 — src/shared/limits/core.js has 1077 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/alibaba/limits.js · ×1
  • src/shared/providers/alibaba/limits.js: 950 lines of code src/shared/providers/alibaba/limits.js:1 — src/shared/providers/alibaba/limits.js has 950 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/electron/notch/controller.js · ×1
  • src/electron/notch/controller.js: 948 lines of code src/electron/notch/controller.js:1 — src/electron/notch/controller.js has 948 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/electron/renderer/edgeDock/presentation.js · ×1
  • src/electron/renderer/edgeDock/presentation.js: 936 lines of code src/electron/renderer/edgeDock/presentation.js:1 — src/electron/renderer/edgeDock/presentation.js has 936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/electron/renderer/sessionRows.js · ×1
  • src/electron/renderer/sessionRows.js: 936 lines of code src/electron/renderer/sessionRows.js:1 — src/electron/renderer/sessionRows.js has 936 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 935 lines of code REDACTED:1 — REDACTED has 935 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/electron/plugins/runtime.js · ×1
  • src/electron/plugins/runtime.js: 912 lines of code src/electron/plugins/runtime.js:1 — src/electron/plugins/runtime.js has 912 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/minimax/limits.js · ×1
  • src/shared/providers/minimax/limits.js: 907 lines of code src/shared/providers/minimax/limits.js:1 — src/shared/providers/minimax/limits.js has 907 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/dailyHistoryArchive.js · ×1
  • src/shared/dailyHistoryArchive.js: 873 lines of code src/shared/dailyHistoryArchive.js:1 — src/shared/dailyHistoryArchive.js 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 · src/shared/providers/reasonix/sessionDetail.js · ×1
  • src/shared/providers/reasonix/sessionDetail.js: 854 lines of code src/shared/providers/reasonix/sessionDetail.js:1 — src/shared/providers/reasonix/sessionDetail.js has 854 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/grok/limits.js · ×1
  • src/shared/providers/grok/limits.js: 801 lines of code src/shared/providers/grok/limits.js:1 — src/shared/providers/grok/limits.js has 801 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/zai/limits.js · ×1
  • src/shared/providers/zai/limits.js: 799 lines of code src/shared/providers/zai/limits.js:1 — src/shared/providers/zai/limits.js has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/mimo/limits.js · ×1
  • src/shared/providers/mimo/limits.js: 795 lines of code src/shared/providers/mimo/limits.js:1 — src/shared/providers/mimo/limits.js has 795 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/claude/sessionMetadata.js · ×1
  • src/shared/providers/claude/sessionMetadata.js: 769 lines of code src/shared/providers/claude/sessionMetadata.js:1 — src/shared/providers/claude/sessionMetadata.js has 769 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/electron/renderer/dashboard.js · ×1
  • src/electron/renderer/dashboard.js: 765 lines of code src/electron/renderer/dashboard.js:1 — src/electron/renderer/dashboard.js has 765 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/electron/renderer/limits/providerPresentation.js · ×1
  • src/electron/renderer/limits/providerPresentation.js: 721 lines of code src/electron/renderer/limits/providerPresentation.js:1 — src/electron/renderer/limits/providerPresentation.js has 721 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/sessionDetail.js · ×1
  • src/shared/sessionDetail.js: 716 lines of code src/shared/sessionDetail.js:1 — src/shared/sessionDetail.js has 716 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/electron/renderer/notch/renderer.js · ×1
  • src/electron/renderer/notch/renderer.js: 703 lines of code src/electron/renderer/notch/renderer.js:1 — src/electron/renderer/notch/renderer.js has 703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/appUpdater.js · ×1
  • src/shared/appUpdater.js: 684 lines of code src/shared/appUpdater.js:1 — src/shared/appUpdater.js has 684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/macWidgetSnapshot.js · ×1
  • src/shared/macWidgetSnapshot.js: 678 lines of code src/shared/macWidgetSnapshot.js:1 — src/shared/macWidgetSnapshot.js has 678 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/electron/renderer/fixedPeriodRanges.js · ×1
  • src/electron/renderer/fixedPeriodRanges.js: 677 lines of code src/electron/renderer/fixedPeriodRanges.js:1 — src/electron/renderer/fixedPeriodRanges.js has 677 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/shared/providers/volcengine/limits.js · ×1
  • src/shared/providers/volcengine/limits.js: 670 lines of code src/shared/providers/volcengine/limits.js:1 — src/shared/providers/volcengine/limits.js has 670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/electron/tray.js · ×1
  • src/electron/tray.js: 669 lines of code src/electron/tray.js:1 — src/electron/tray.js has 669 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 · worker/src/index.js · ×1
  • worker/src/index.js: 666 lines of code worker/src/index.js:1 — worker/src/index.js has 666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Minor — 128 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate src/electron/edgeDock/macVibrancyMask.js:144 — `!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0` appears character-identically in 3 files — src/electron/edgeDock/macVibrancyMask.js, src/electron/floatingBubble.js, src/electron/main.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/providers/devin/limits.js:109 — `!body || typeof body !== 'object' || Array.isArray(body)` appears character-identically in 2 files — src/shared/providers/devin/limits.js, src/shared/providers/manus/limits.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/usage/clientUsageArchive.js:136 — `!deviceRecord || typeof deviceRecord !== 'object'` appears character-identically in 2 files — src/shared/usage/clientUsageArchive.js, src/shared/usage/sessionUsageArchive.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/clientHealth.js:479 — `!entry || typeof entry !== 'object' || Array.isArray(entry)` appears character-identically in 3 files — src/shared/clientHealth.js, src/shared/providers/mimo/spendHistory.js, src/shared/providers/zai/limits.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/providers/mimo/spendHistory.js:53 — `!entry.dailySpend || typeof entry.dailySpend !== 'object' || Array.isArray(entry.dailySpend)` appears character-identically in 2 files — src/shared/providers/mimo/spendHistory.js, src/shared/providers/zai/limits.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/appUpdater.js:475 — `!incoming || typeof incoming !== 'object'` appears character-identically in 2 files — src/shared/appUpdater.js, src/shared/usage.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/electron/renderer/deviceIcons.js:14 — `!input || typeof input !== 'object' || Array.isArray(input)` appears character-identically in 4 files — src/electron/renderer/deviceIcons.js, src/shared/subscriptionDisplay.js, src/shared/trayLayout.js, src/shared/usage.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/electron/renderer/projectRows.js:21 — `!models || typeof models !== 'object' || Array.isArray(models)` appears character-identically in 2 files — src/electron/renderer/projectRows.js, src/shared/usage.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/electron/macWidget/historyStore.js:166 — `!pathStat.isFile() || pathStat.isSymbolicLink()` appears character-identically in 2 files — src/electron/macWidget/historyStore.js, src/shared/credentialStore.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/electron/providers/codex/resetForecast.js:81 — `!payload || typeof payload !== 'object' || Array.isArray(payload)` appears character-identically in 2 files — src/electron/providers/codex/resetForecast.js, src/electron/serviceStatus.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/electron/limits/accountSettings.js:64 — `!profiles || typeof profiles !== 'object'` appears character-identically in 2 files — src/electron/limits/accountSettings.js, src/shared/providers/opencode/profiles.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/electron/renderer/edgeDock/presentation.js:98 — `!provider || provider.status !== 'ok' || provider.stale` appears character-identically in 2 files — src/electron/renderer/edgeDock/presentation.js, src/shared/trayText.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/usage/clientUsageArchive.js:105 — `!rawEntry || typeof rawEntry !== 'object'` appears character-identically in 2 files — src/shared/usage/clientUsageArchive.js, src/shared/usage/sessionUsageArchive.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/electron/modelAliasPresentation.js:440 — `!sessions || typeof sessions !== 'object'` appears character-identically in 4 files — src/electron/modelAliasPresentation.js, src/electron/renderer/allTimeSessions.js, src/shared/providers/reasonix/sessionGuard.js, src/shared/syncPayload.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:1159 — `!snapshot?.size || prefersReducedMotion()` appears character-identically in 2 files — REDACTED, src/electron/renderer/limits/resetAnimator.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/electron/plugins/credentials.js:22 — `!stat.isDirectory() || stat.isSymbolicLink()` appears character-identically in 3 files — src/electron/plugins/credentials.js, src/electron/plugins/managed.js, src/shared/providers/claude/probe.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/providers/mimo/spendHistory.js:36 — `!store || typeof store !== 'object' || Array.isArray(store) || !store.accounts || typeof store.accounts !== 'object' || Array.isArray(store.…` appears character-identically in 2 files — src/shared/providers/mimo/spendHistory.js, src/shared/providers/zai/limits.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/electron/icloudSync.js:400 — `!subscription || seen.has(subscription.id)` appears character-identically in 2 files — src/electron/icloudSync.js, src/shared/subscriptionDisplay.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/validate-star-history-artifact.js:43 — `!value || typeof value !== 'object' || Array.isArray(value)` appears character-identically in 11 files — scripts/validate-star-history-artifact.js, src/electron/main.js, src/electron/plugins/initialSetup.js, src/electron/renderer/modelAliases.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/merge-mac-updater-metadata.js:13 — `(first === '"' && last === '"') || (first === "'" && last === "'")` appears character-identically in 2 files — scripts/merge-mac-updater-metadata.js, scripts/verify-updater-artifact-names.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:31 — `(raw.startsWith('"') && raw.endsWith('"')) || (raw.startsWith("'") && raw.endsWith("'"))` appears character-identically in 5 files — REDACTED, src/shared/limits/registry.js, src/shared/outboundFetch.js, src/shared/providers/alibaba/limits.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/electron/edgeDock/controller.js:472 — `(yi > y) !== (yj > y) && x < (xj - xi) * (y - yi) / (yj - yi) + xi` appears character-identically in 2 files — src/electron/edgeDock/controller.js, src/electron/notch/controller.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/shared/providers/devin/paths.js:52 — `/^[A-Za-z]:[\\/]/.test(raw) || /^[\\/]{2}[^\\/]+[\\/][^\\/]+/.test(raw)` appears character-identically in 2 files — src/shared/providers/devin/paths.js, src/shared/tokscaleConfig.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/hub-build-manifest.js:183 — `Array.isArray(entries) && entries.length > 0` appears character-identically in 2 files — scripts/hub-build-manifest.js, src/shared/hubBuildIdentity.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/electron/renderer/edgeDock/presentation.js:165 — `Array.isArray(provider?.windows) && provider.windows.length > 0` appears character-identically in 2 files — src/electron/renderer/edgeDock/presentation.js, src/shared/limits/core.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×40
  • Silent fallback default in catch scripts/sign-macos-with-widget.js:288 — `fsSyncExists` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/electron/renderer/fixedPeriodRanges.js:416 — `dayKeyInTimeZone` 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/shared/wslUsage.js:53 — `listRunningWslDistros` 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/shared/providers/codex/auth.js:162 — `decodeJwtPayload` 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/shared/providers/opencode/goLimits.js:114 — `discoverDbPaths` 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/shared/providers/opencode/web.js:286 — `parseGoUsageJson` 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/shared/providers/hermes/profiles.js:40 — `discoverHermesProfileScanPaths` 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/shared/providers/kimi/sessionMetadata.js:22 — `fileExists` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/shared/providers/kimi/sessionMetadata.js:157 — `readKimiStateMetadata` 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/shared/providers/catpaw/paths.js:47 — `catpawDataSources` 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/shared/clientSourceObservations.js:10 — `dirExists` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/shared/clientSourceObservations.js:14 — `fileExists` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/shared/providers/codebuddy/subagents.js:49 — `sessionIdOfRecord` 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/shared/providers/codebuddy/subagents.js:77 — `sessionIdOfFile` 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/shared/t3SessionMetadata.js:140 — `readT3SessionMeta` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch src/shared/providers/codex/sessionIdentity.js:46 — `nativeIdForFile` 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/shared/providers/codex/sessionMetadata.js:58 — `versionedDbFiles` 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/shared/providers/codex/sessionActivity.js:25 — `fileSignature` 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/shared/providers/codex/sessionActivity.js:50 — `discoverFilesUncached` 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/shared/providers/codebuddy/extension.js:37 — `parseJsonObject` 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/shared/providers/codebuddy/extension.js:47 — `listDirectories` 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/shared/providers/codebuddy/extension.js:79 — `statKey` 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/shared/providers/codebuddy/extension.js:214 — `readdirFiles` 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/shared/providers/cursor/sessionMetadata.js:24 — `fileStamp` 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/shared/providers/droid/sessionMetadata.js:26 — `readDroidSessionIndex` 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.
  • + 15 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×24
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D12 · Dependency Hygiene · Deprecated · ×5
  • Deprecated: boolean REDACTED:2206 — boolean 3.2.0 is resolved in REDACTED and is marked deprecated by its publisher: "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.". 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:3801 — 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:4149 — 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: lodash.isequal REDACTED:4484 — lodash.isequal 4.5.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package is deprecated. Use require('node:util').isDeepStrictEqual 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:5356 — rimraf 2.6.3 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.
D16 · Bus Factor · Off-boarding risk · ×3
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 57 significant file(s) lose their only recent owner: src/shared/providers/codex/limits.js, src/electron/notch/controller.js, src/shared/providers/alibaba/limits.js, src/electron/renderer/notch/renderer.js, src/electron/renderer/selectControl.js, src/shared/providers/opencode/limits.js, src/shared/t3SessionMetadata.js, src/shared/providers/commandcode/limits.js (+49 more). 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/electron/edgeDock/mask.js, src/shared/providers/mimo/desktop.js. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: src/shared/providers/deepseek/balanceHistory.js, src/electron/renderer/viewDisplayPreferences.js, src/electron/windowState.js. Pair on, review, or document these before any departure.
D24 · Comment Value · redundant comment · ×2
  • redundant comment tests/electron/limitProviderWiring.test.js:245 — "Settings win over env." repeats the code it sits on: 3 of its 3 words (settings, win, env) are already in `const settingsWin = limitsConfigFromSettings(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment tests/shared/historyDayBoundary.test.js:33 — "2026-08-17T00:00-07" repeats the code it sits on: 5 of its 5 words (2026, 08, 17, 00, 07) are already in `const LA_MIDNIGHT = '2026-08-17T07:00:00.000Z';`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D34 · Knowledge Freshness · Orphaned file · ×2
  • Orphaned file src/electron/syncUploadScheduler.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/electron/linuxAutostart.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.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 3 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 (67 single-owned of 423 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; 423 of the 552 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/shared/providers/codebuddy/subagents.js, src/shared/providers/codebuddy/paths.js, src/shared/providers/grok/sessionMetadata.js, src/shared/providers/stepfun/refresh.js.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found package.json:8 — 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 8).
D21 · Naming Consistency · `validatePersonalCLIUsage` spells `CLI` where 25 names in the project spell it `Cli` · ×1
  • `validatePersonalCLIUsage` spells `CLI` where 25 names in the project spell it `Cli` src/shared/providers/alibaba/cli.js:89 — 25 of 27 names in project token-monitor spell the token `Cli` (25 of 27; unit: names in project token-monitor containing `Cli`). Peers: fetch-star-history-stargazers.parseCli (scripts/fetch-star-history-stargazers.js:211); validate-star-history-artifact.parseCli (scripts/validate-star-history-artifact.js:200); clientSources.clineCliSessionRoot (src/shared/clientSources.js:167); clientSources.antigravityCliDataDir (src/shared/clientSources.js:556); cli.existingBailianCli (src/shared/providers/alibaba/cli.js:22). Rename to `validatePersonalCliUsage`. [rule N6]
D21 · Naming Consistency · `fetchBailianCLI` spells `CLI` where 25 names in the project spell it `Cli` · ×1
  • `fetchBailianCLI` spells `CLI` where 25 names in the project spell it `Cli` src/shared/providers/alibaba/cli.js:101 — 25 of 27 names in project token-monitor spell the token `Cli` (25 of 27; unit: names in project token-monitor containing `Cli`). Peers: fetch-star-history-stargazers.parseCli (scripts/fetch-star-history-stargazers.js:211); validate-star-history-artifact.parseCli (scripts/validate-star-history-artifact.js:200); clientSources.clineCliSessionRoot (src/shared/clientSources.js:167); clientSources.antigravityCliDataDir (src/shared/clientSources.js:556); cli.existingBailianCli (src/shared/providers/alibaba/cli.js:22). Rename to `fetchBailianCli`. [rule N6]
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 2 of 423 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 423 of the 552 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: src/electron/syncUploadScheduler.js, src/electron/linuxAutostart.js. 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
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.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation package.json:164 — `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`.
X5 · Nullable reference types · Nullable reference types not enabled everywhere · ×1
  • Nullable reference types not enabled everywhere — 0/2 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
Minor — 19 finding(s)
D10 · Test Quality · Skipped (documented) · ×13
  • Skipped (documented): Desktop links follow discovery, explicit scan-root and file boundaries tests/shared/claudeDesktopWatch.test.js:53 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): Desktop watches permitted links and their removals (${usePolling ? 'polling' : 'native'}) tests/shared/claudeDesktopWatch.test.js:132 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): Antigravity ${source} summary WAL events refresh titles with an exact today delta tests/shared/collectorLoadGuards.test.js:511 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): Kiro native discovery rejects directory symlinks while retaining transcript links tests/shared/kiroWatch.test.js:72 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): the pinned electron-builder runs the install hook after the app files are written tests/shared/nsisInstallerAcl.test.js:58 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): the pinned electron-builder loads and honors the current-user install hook tests/shared/nsisInstallerMode.test.js:57 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): the pinned electron-updater is the one these assumptions were read from tests/electron/updateInstallQuitUpstream.test.js:49 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): BaseUpdater announces a successful install on Electron own autoUpdater tests/electron/updateInstallQuitUpstream.test.js:59 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): BaseUpdater resets itself when an install fails, so a retry is clean tests/electron/updateInstallQuitUpstream.test.js:71 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): MacUpdater attaches an update-downloaded listener it never detaches tests/electron/updateInstallQuitUpstream.test.js:80 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): MacUpdater leaves Squirrel untouched until the install is requested tests/electron/updateInstallQuitUpstream.test.js:103 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): the hand-off event is part of Electron public API, not something we inferred tests/electron/updateInstallQuitUpstream.test.js:127 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): the Linux install path in electron-updater needs that emitter to exist tests/electron/updateInstallQuitUpstream.test.js:143 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
D12 · Dependency Hygiene · Outdated (npm) · ×6
  • Outdated (npm): chokidar — chokidar is pinned at 4.0.3; 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): dotenv — dotenv is pinned at 17.4.2; 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): image-size — image-size is pinned at 2.0.4; registry.npmjs.org publishes 2.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): koffi — koffi is pinned at 3.3.5; registry.npmjs.org publishes 3.3.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): semver — semver is pinned at 7.8.5; registry.npmjs.org publishes 7.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): undici — undici is pinned at 7.30.2; registry.npmjs.org publishes 8.12.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.

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 --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-51411eef701f4ca2ad10c3b0d4ca9eec/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-51411eef701f4ca2ad10c3b0d4ca9eec/history-1.json --exit-code 0 --source .1artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=278" --report-format json --report-path /tmp/watchdog-gitleaks-51411eef701f4ca2ad10c3b0d4ca9eec/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.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-51411eef701f4ca2ad10c3b0d4ca9eec/tree.json --exit-code 0 --source .1artifacts/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 --exclude worker/src/shared/limits --exclude worker/src/shared/providers .91artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .3artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 4 file(s) — `native/macos/TokenMonitorWidget/WidgetDashboardViews.swift`, `native/macos/TokenMonitorWidget/WidgetViewModel.swift`, `REDACTED`, `src/shared/providers/ollama/limits.js` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious 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 01a1e889-c841-7405-9058-e8481c55467b · 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