Public report of cnjack/jcode, 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, 00:09 UTC · Survey ID cd_0ed8797c03714c2a9587088c25e90d91

cnjack/jcode

Measured 17 November 2026, 00:09 UTC, at code version 24aba5d

First survey, so nothing to compare with yet Code coverage: not measured

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

CAI score 52.9out of 100 At risk

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: 169,404 lines of product code in 8 projects, tests not counted · Estimated rebuild effort: about 1.6 person-years · Weakest lens: Accessibility, 44.9

Findings by how serious they are

127 critical 1643 serious 115 minor

23 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, 00:09 UTC

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

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

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

68of 68 dimensions measured by tools.
1868of 1885 findings point to an exact file and line, so you can open each one in the code. The other 17 concern the repository as a whole, such as missing documentation.
68dimensions across 7 lenses, read from 169,404 lines of product code in 8 projects.
Chapters

Executive summary

cnjack/jcode is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because it has controls that only work with a mouse. It scores 52.9 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Accessibility, at 44.9, is the weakest lens and counts most in the score. The best first step is making the controls keyboard-usable, worth about 4.9 points. Adding text alternatives comes next, worth about 3.1 points. Raising Accessibility to 65 would lift the score to about 58.6.

Twenty-eight pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Sixteen known security holes in the packages the code depends on can be used by attackers, and twelve controls can't be used without a mouse. Making the controls work with a keyboard, pinning each tool to an exact version and updating the vulnerable packages would close these risks. Fixing the weaknesses the scanner points to would fix the ten security weaknesses in the code, and the four pipeline steps that install packages without pinning their versions need the packages they install pinned to exact versions. The 22 buttons or links with no name need a name, even when they only show an icon.

The product code is 169,404 lines, about €230,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 44.9 · counts for 46%Security and Compliance 53.9 · counts for 25%Code Health 57.8 · counts for 14%Production Readiness 58.9 · counts for 8%Maturity 76.6 · counts for 4%Architecture 84.7 · counts for 2%Performance 100.0 · counts for 1%

If Accessibility rose from 44.9 to 65, the lowest score rated Strong, the score would rise from 52.9 to about 58.6.

Code composition: what the lines of code are
Product code 71%Tests 29%
Rebuild cost: about €230,000 · Estimate
Cost to rebuild€77,000 to €390,000, for 1,289 to 4,090 hours of work, about 1.6 person-years for 1 to 4 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 53. 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: 169,404 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 4.9 points · Medium effort · Keyboard semantics
2
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.
Raises the score by about 3.1 points · Medium effort · Text alternatives
3
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED.
Raises the score by about 0.8 points · Low effort · Static Analysis (SAST)

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 €230,000 to build again, about 1.6 person-years of work. Its weakest lens is Accessibility, at 44.9 (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
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. Of all the actions in this report, it raises the score most for the work it takes: about 4.9 points for medium effort. 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.5 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 119,775 lines over the last 90 days, which is about 485,754 lines a year. At that pace, the extra work comes to an estimated 77.3 to 463.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch github.com/cnjack/jcode jcode jcode-acp-harness jcode-acp-harness jcode-computerd-onboarding jcode-computerd-onboarding jcode-desktop jcode-desktop jcode-site jcode-site jcode-ui jcode-ui jcode-ui-core jcode-ui-core jcode-ui->jcode-ui-core web web web->jcode-ui web->jcode-ui-core

Architecture: which parts of the code depend on which

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

272 modules, with 282 dependencies between them. 2 loops run through 15 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 agent-eval.suite2 github.com/cnjack/jcode/internal/artifact3 github.com/cnjack/jcode/internal/automation4 github.com/cnjack/jcode/internal/channel5 github.com/cnjack/jcode/internal/config6 github.com/cnjack/jcode/internal/mode7 github.com/cnjack/jcode/internal/toolpolicy8 jcode_desktop.desktop_apps9 packages.jcode-ui-core.src.types10 packages.jcode-ui.src.canvas11 packages.jcode-ui.src.product.strings12 packages.jcode-ui.src.voice13 github.com/cnjack/jcode/internal/browser14 github.com/cnjack/jcode/internal/computer15 github.com/cnjack/jcode/internal/model16 github.com/cnjack/jcode/internal/providertools17 packages.jcode-ui-core.src.adapters18 packages.jcode-ui-core.src.primitives19 packages.jcode-ui-core.src.runtime20 packages.jcode-ui-core.src.timeline21 packages.jcode-ui.src.product.types22 github.com/cnjack/jcode/internal/review23 github.com/cnjack/jcode/internal/telemetry24 packages.jcode-ui.src.components25 packages.jcode-ui.src.product.host26 web.src.lib.types27 github.com/cnjack/jcode/internal/team28 packages.jcode-ui.src.product29 web.src.app30 web.src.components31 web.src.lib32 github.com/cnjack/jcode/internal/tools33 github.com/cnjack/jcode/internal/handler34 github.com/cnjack/jcode/internal/session35 github.com/cnjack/jcode/internal/agent36 github.com/cnjack/jcode/internal/runner37 github.com/cnjack/jcode/internal/tui38 github.com/cnjack/jcode/internal/web39 github.com/cnjack/jcode/internal/cloud40 github.com/cnjack/jcode/internal/command
1 agent-eval.suite
2 github.com/cnjack/jcode/internal/artifact
3 github.com/cnjack/jcode/internal/automation
4 github.com/cnjack/jcode/internal/channel
5 github.com/cnjack/jcode/internal/config
6 github.com/cnjack/jcode/internal/mode
7 github.com/cnjack/jcode/internal/toolpolicy
8 jcode_desktop.desktop_apps
9 packages.jcode-ui-core.src.types
10 packages.jcode-ui.src.canvas
11 packages.jcode-ui.src.product.strings
12 packages.jcode-ui.src.voice
13 github.com/cnjack/jcode/internal/browser1
14 github.com/cnjack/jcode/internal/computer1
15 github.com/cnjack/jcode/internal/model5
16 github.com/cnjack/jcode/internal/providertools4
17 packages.jcode-ui-core.src.adapters5
18 packages.jcode-ui-core.src.primitives2
19 packages.jcode-ui-core.src.runtime6
20 packages.jcode-ui-core.src.timeline9
21 packages.jcode-ui.src.product.types1
22 github.com/cnjack/jcode/internal/review32
23 github.com/cnjack/jcode/internal/telemetry11
24 packages.jcode-ui.src.components51
25 packages.jcode-ui.src.product.host11
26 web.src.lib.types413
27 github.com/cnjack/jcode/internal/team2211
28 packages.jcode-ui.src.product1411
29 web.src.app41114
30 web.src.components116
31 web.src.lib112
32 github.com/cnjack/jcode/internal/tools72683433614
33 github.com/cnjack/jcode/internal/handler214
34 github.com/cnjack/jcode/internal/session22
35 github.com/cnjack/jcode/internal/agent12771
36 github.com/cnjack/jcode/internal/runner1222113101
37 github.com/cnjack/jcode/internal/tui231572
38 github.com/cnjack/jcode/internal/web48218125911211915314
39 github.com/cnjack/jcode/internal/cloud7222
40 github.com/cnjack/jcode/internal/command32742135223185633712
Uses a module listed above itPart of a loopThe module itself
1 agent-eval.suite2 github.com/cnjack/jcode/internal/artifact3 github.com/cnjack/jcode/internal/automation4 github.com/cnjack/jcode/internal/channel5 github.com/cnjack/jcode/internal/config6 github.com/cnjack/jcode/internal/mode7 github.com/cnjack/jcode/internal/toolpolicy8 jcode_desktop.desktop_apps9 packages.jcode-ui-core.src.types10 packages.jcode-ui.src.canvas11 packages.jcode-ui.src.product.strings12 packages.jcode-ui.src.voice13 github.com/cnjack/jcode/internal/browser14 github.com/cnjack/jcode/internal/computer15 github.com/cnjack/jcode/internal/model16 github.com/cnjack/jcode/internal/providertools17 packages.jcode-ui-core.src.adapters18 packages.jcode-ui-core.src.primitives19 packages.jcode-ui-core.src.runtime20 packages.jcode-ui-core.src.timeline21 packages.jcode-ui.src.product.types22 github.com/cnjack/jcode/internal/review23 github.com/cnjack/jcode/internal/telemetry24 packages.jcode-ui.src.components25 packages.jcode-ui.src.product.host26 web.src.lib.types27 github.com/cnjack/jcode/internal/team28 packages.jcode-ui.src.product29 web.src.app30 web.src.components31 web.src.lib32 github.com/cnjack/jcode/internal/tools33 github.com/cnjack/jcode/internal/handler34 github.com/cnjack/jcode/internal/session35 github.com/cnjack/jcode/internal/agent36 github.com/cnjack/jcode/internal/runner37 github.com/cnjack/jcode/internal/tui38 github.com/cnjack/jcode/internal/web39 github.com/cnjack/jcode/internal/cloud40 github.com/cnjack/jcode/internal/commandagent-eval.suite1github.com/cnjack/jcode/internal/artifact2github.com/cnjack/jcode/internal/automation3github.com/cnjack/jcode/internal/channel4github.com/cnjack/jcode/internal/config5github.com/cnjack/jcode/internal/mode6github.com/cnjack/jcode/internal/toolpolicy7jcode_desktop.desktop_apps8packages.jcode-ui-core.src.types9packages.jcode-ui.src.canvas10packages.jcode-ui.src.product.strings11packages.jcode-ui.src.voice12github.com/cnjack/jcode/internal/browser13github.com/cnjack/jcode/internal/computer14github.com/cnjack/jcode/internal/model15github.com/cnjack/jcode/internal/providertools16packages.jcode-ui-core.src.adapters17packages.jcode-ui-core.src.primitives18packages.jcode-ui-core.src.runtime19packages.jcode-ui-core.src.timeline20packages.jcode-ui.src.product.types21github.com/cnjack/jcode/internal/review22github.com/cnjack/jcode/internal/telemetry23packages.jcode-ui.src.components24packages.jcode-ui.src.product.host25web.src.lib.types26github.com/cnjack/jcode/internal/team27packages.jcode-ui.src.product28web.src.app29web.src.components30web.src.lib31github.com/cnjack/jcode/internal/tools32github.com/cnjack/jcode/internal/handler33github.com/cnjack/jcode/internal/session34github.com/cnjack/jcode/internal/agent35github.com/cnjack/jcode/internal/runner36github.com/cnjack/jcode/internal/tui37github.com/cnjack/jcode/internal/web38github.com/cnjack/jcode/internal/cloud39github.com/cnjack/jcode/internal/command40115452691321151114132211141141114116112726834336142142212771122211310123157248218125911211915314722232742135223185633712+232 more modules (most-connected shown)

At a glance — Code Health · 57.8 · Adequate · gated by D1, D2 ·

At a glance — Architecture · 84.7 · Adequate · gated by D26 ·

At a glance — Maturity · 76.6 · Strong ·

At a glance — Readiness · 58.9 · Adequate · gated by P7 ·

At a glance — Security · 53.9 · Checked 4 of 10 · gated by D29, D36 ·

At a glance — Accessibility · 44.9 · Adequate · gated by AC4 ·

At a glance — Performance · 100.0 · Exemplary ·

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 — Injection71High / Critical
A03:2025 — Software Supply Chain Failures61High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; 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; Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.

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

Do thisHelpsEffortDimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+4.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.+3.1 ptsMediumText alternatives
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED.+0.8 ptsLowStatic Analysis (SAST)
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+2.1 ptsMediumForms & labels
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.+2.0 ptsMediumVisual & motion safety
Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED.+0.8 ptsLowSecrets (history)
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2).+0.8 ptsLowStatic Analysis (SAST)
Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED.+0.8 ptsLowDependency Vulnerabilities

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.9SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0MixedDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
internal/config/config.go5.6MixedCyclomatic Complexity: config.loadConfig (cyclomatic 16)

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

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

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

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

Could not be resolved — 23

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

Methodology & how to trust this report

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

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

What we checked — 68 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D17D19D20D21D23D24D26D27D28D29D30D34D35D36D43D44AC1AC2AC3AC4AC5AC6AX10AX2AX3AX4AX6AX9M1M2M3M4P1P10P2P3P4P6P7PF3R1R10R2R3R4R6R7R8R9X14X15X2X26X27X28X3X5

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, 1868 of 1885 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1e6d5-e60d-738f-943c-4a0d177c0f3a.

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.

  • 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 408 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 297 test source file(s) (.go) 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.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for packages/jcode-ui/ could not reach cdn.sheetjs.com, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403  GET https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz: Forbidden - 403), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in packages/jcode-ui/ was NOT MEASURED: the dependency install for packages/jcode-ui/ could not reach cdn.sheetjs.com, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403  GET https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz: Forbidden - 403), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in web/ was NOT MEASURED: the dependency install for web/ could not reach cdn.sheetjs.com, which the analyzer sandbox's egress allowlist does not carry (ERR_PNPM_FETCH_403  GET https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz: Forbidden - 403), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D14 License Compliance — 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 repository declares a Go module (REDACTED/go.sum), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Go dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — 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 repository declares REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — 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. Single-maintainer repository — bus factor is not applicable (2 contributor(s) across 831 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 1 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • 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. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • 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.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • 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.
  • D27 Navigability — 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. Tracing effort is measured over resolved call sites, and all 591 sampled here came from .go files. This repository's .tsx source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
  • 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. `cmd/jcode-computerd/main.swift`, `packages/jcode-ui-core/src/hooks/index.ts`, `packages/jcode-ui-core/src/primitives/Thread.tsx`, `web/src/app/store.ts`, `web/src/lib/types.ts`, … (+1 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 91 further occurrence(s) are not listed individually; the score already reflects all 131.
  • 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. 60 further occurrence(s) are not listed individually; the score already reflects all 100.
  • AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in packages/jcode-ui-core/src/adapters/index.ts, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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. `npm run` found no REDACTED in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. (rule: no-root-manifest). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): `npm run` found no REDACTED in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read REDACTED: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" 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 (our sandbox): `npm run` found no REDACTED in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read REDACTED: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
  • C1 Data Protection — 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — 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. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — 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. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — 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. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — 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. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Go, Python, Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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 reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Go, Python, Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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 no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • R10 Code Duplication — measured, with a gap in what it reached — 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. 94 further occurrence(s) are not listed individually; the score already reflects all 134.
  • 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. 118 further occurrence(s) are not listed individually; the score already reflects all 158.
  • S1 Web-Security Posture — 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — 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.
  • 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. 33 further occurrence(s) are not listed individually; the score already reflects all 73.
  • 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.
  • X13 Undrained process stream — 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.
  • X21 Side-effecting pattern guard — 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.
  • X24 Document value interpolated into markup unescaped — 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.
  • X25 Inert configuration knob — 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.
  • X26 Unsynchronised callback handoff — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X27 Collection changed while being enumerated — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • 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 — 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. 296 further occurrence(s) are not listed individually; the score already reflects all 336.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • 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 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • 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.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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 (REDACTED, 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.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • 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

318 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Model.Update at 503. A further 6 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being fileTree.extCategory at 29 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: packages/jcode-ui/src/toolRenderers/fileTree.tsx (fileTree.extCategory at 29), web/src/lib/ws.ts (WSClient.connect at 27). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

jcode_desktop::sidecar::start (cyclomatic 21) · ×3desktop/src-tauri/src/sidecar.rs:96
Model.Update (cyclomatic 503)internal/tui/update.go:21
Sidebar.Sidebar (cyclomatic 179)web/src/components/Sidebar.tsx:107
RemoteConnectWizard.RemoteConnectWizard (cyclomatic 156)web/src/components/RemoteConnectWizard.tsx:36
ProviderAuthSection.ProviderAuthSection (cyclomatic 146)web/src/components/settings/ProviderAuthSection.tsx:250

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with Model.Update (cyclomatic 503), Sidebar.Sidebar (cyclomatic 179), RemoteConnectWizard.RemoteConnectWizard (cyclomatic 156). — 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 4 together lifts Cyclomatic Complexity from 2.0 to about 3.1/10, projected with the scoring formula itself and assuming each lands exactly at 120; 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

449 method(s) exceeded the cognitive complexity threshold of 15; the worst was Model.Update at 1067.

jcode_desktop::desktop_apps::linux::resolve_icon (cognitive 29) · ×6desktop/src-tauri/src/desktop_apps/linux.rs:622
index.html.step (cognitive 21) · ×3agent-eval/showcase/projects/fe_canvas_particles/index.html:124
Model.Update (cognitive 1067)internal/tui/update.go:21
runner.runInner (cognitive 284)internal/runner/runner.go:305
Sidebar.Sidebar (cognitive 198)web/src/components/Sidebar.tsx:107

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

What to do

  1. Bring the 36 bodies over 60 down to 60 or less in Cognitive Complexity — start with Model.Update (cognitive 1067), runner.runInner (cognitive 284), Sidebar.Sidebar (cognitive 198). — 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 36 together lifts Cognitive Complexity from 2.0 to about 3.4/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 Classes6.8 / 10Adequate✓ Tool-verified

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

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

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

180 god class(es) detected.

FunctionTooLong: ChatInput.ChatInput · ×81packages/jcode-ui/src/product/ChatInput.tsx:306
FileTooLong: components/SettingsView.tsx · ×50web/src/components/SettingsView.tsx
MethodTooLong: Model.Update · ×18internal/tui/update.go:21
ClassTooLong: ChatInput · ×14packages/jcode-ui/src/product/ChatInput.tsx:1
TooManyMethods: Server · ×10REDACTED:41

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

What to do

  1. Resolve the 81 FunctionTooLong finding(s) in God Classes — start with SettingsView.tsx (12), web.go (3), RightPanel.tsx (3). — One of this dimension's main actionable groups (81 warning-level).
  2. Resolve the 50 FileTooLong finding(s) in God Classes — start with session.go (2), web.go (2), acp.go (2). — One of this dimension's main actionable groups (50 warning-level).
  3. Resolve the 18 MethodTooLong finding(s) in God Classes — start with providers.go (3), acp.go (2), setup.go (2). — One of this dimension's main actionable groups (18 warning-level).

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

D4 · Code Duplication8.2 / 10Strong✓ 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 8.2 / 10 · rule-coverage 100% · ceiling Verified

179 duplicated block group(s) detected. 4.6 % of the production lines (7,716 of 169,404) are in a reported copy. A further 133 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: .tsx (22% 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.

Duplicated block (8 lines × 2) · ×24internal/cloud/pairing_inbox.go:139
Duplicated block (7 lines × 2) · ×17internal/cloud/artifact_share.go:241
Duplicated block (10 lines × 2) · ×15REDACTED:231
Duplicated block (9 lines × 2) · ×13internal/agent/hook_middleware.go:68
Edited copy of a member (13 corresponding lines) · ×9internal/tools/docker_exec.go:222

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

What to do

  1. Resolve the 24 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with filelock_windows.go (2), codex.go (2), pairing_inbox.go. — One of this dimension's main actionable groups (24 warning-level).
  2. Resolve the 17 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with artifact_share.go, acp.go, parse.go. — One of this dimension's main actionable groups (17 warning-level).
  3. Resolve the 15 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED, acp.go, client.go. — One of this dimension's main actionable groups (15 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

8 production modules (Cargo+npm+Go), 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.

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.6 / 10Stronggated by 5 serious findings✓ 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 9.6 / 10 · rule-coverage 100% · ceiling Verified

5 of 166 classes have LCOM4 above 3.

Low cohesion: Env (LCOM4 22) · ×5internal/tools/env.go:30

What to do

  1. Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with env.go, REDACTED, config.go. — One of this dimension's main actionable groups (5 warning-level).

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

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

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

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

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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 408 tests. Measured on the JavaScript/TypeScript suite only — at least 297 test source file(s) (.go) went unread, so its test quality is unmeasured and is not in these counts.

Mock-dominated test: focuses a newly bound workspace explicitly · ×2web/src/components/RemoteConnectWizard.contract.test.tsx:14

✓ On the Gold path — maintain.

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

D12 · Dependency Hygiene9.7 9.0 / 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.0 / 10 · rule-coverage 93% · ceiling Verified

7 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 30 of 30 direct requirement(s) were graded against proxy.golang.org (0 not served there, 2 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org 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, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

Outdated: charm.land/bubbletea/v2 · ×7

✓ On the Gold path — maintain.

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

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.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 537 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares a Go module (REDACTED/go.sum) and REDACTED, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots8.0 / 10Strong✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: packages/jcode-ui/src/product/ChatInput.tsx (18×304=5472); internal/command/web.go (18×116=2088); internal/tui/update.go (4×503=2012)

Hotspot: packages/jcode-ui/src/product/ChatInput.tsx · ×56packages/jcode-ui/src/product/ChatInput.tsx:306

What to do

  1. Resolve the 56 Hotspot finding(s) in Churn × Complexity Hotspots — start with web.go (2), acp.go (2), client.go (2). — One of this dimension's main actionable groups (56 warning-level).

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

D17 · Explicit Debt10.0 / 10Stronggated by 4 serious findings✓ Tool-verified

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

4 deducted task-comment markers across 169404 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.

TodoComment · ×4internal/tui/messages.go:122

What to do

  1. Resolve the 4 TodoComment finding(s) in Explicit Debt — start with messages.go, session_helper.go, acp.go. — One of this dimension's main actionable groups (4 warning-level).

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

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

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

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

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

2 of 2 documentation facets pass in full. 90 document(s) read across 6 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 foundinternal/theme/gen/main.go:11

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.go. — 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.3 / 10Critical✓ 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.3 / 10 · rule-coverage 100% · ceiling Verified

1 naming inconsistencies among 13 declarations measured against a convention their peers follow.

`recreateMDRenderer` spells `MD` where 12 names in the project spell it `Md`internal/tui/content_render.go:294

What to do

  1. Resolve the 1 `recreateMDRenderer` spells `MD` where 12 names in the project spell it… finding(s) in Naming Consistency — start with content_render.go. — 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.

D23 · Boundary Type-Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.

Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.

Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.

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

No domain types leak across context boundaries (3 contexts). Contexts: handler, team, web.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value9.9 9.3 / 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.3 / 10 · rule-coverage 94% · ceiling Documented

1 of 1013 judged comments only repeat the code they sit on (0.1 %). 105 comment(s) in another language or script were not judged.

redundant commentsite/public/showcase-projects/game/js/utils.js:32
doc comments repeat the namespackages/jcode-ui-core/src/primitives/attachmentAdapter.ts:65

✓ On the Gold path — maintain.

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

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

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

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

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

4 of 8 build units (Cargo, Go, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×4REDACTED:1

What to do

  1. Resolve the 4 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 recommendation-level).

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

D27 · Navigability9.3 / 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 9.3 / 10 · rule-coverage 100% · ceiling Documented

18 % of calls cross a namespace and 10 % go through an interface, but 79 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated. Measured over the .go source only — this repository's .tsx was not sampled for call sites, so this score covers part of the tree, not all of it.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

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

REDACTED

What to do

  1. Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

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

72 finding(s): 0 critical, 54 high, 16 medium, 2 low. 28 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 9 file(s) — `agent-eval/suite/budget_guard.sh` (line 17), `agent-eval/suite/run_when_quota.sh` (line 66), `packages/jcode-ui-core/src/hooks/index.ts` (lines 81–82), `packages/jcode-ui-core/src/primitives/Thread.tsx` (lines 145–146), `script/build_computerd_bundle.sh` (line 23, line 24), … (+4 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

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

What to do

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

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

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

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

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

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

55 finding(s): 4 critical, 12 high, 35 medium, 4 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 464 of the 585 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Adequategated by 1 critical finding✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: format.go↔tui.go 77%; main.go↔tui.go 59%

Boundary-crossing change coupling: main.go ↔ tui.gocmd/jcode/main.go:1
Change coupling: format.go ↔ tui.gointernal/tui/format.go:1

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with main.go. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Change coupling finding(s) in Change Coupling — start with format.go. — 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

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

What to do

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

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

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

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

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

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

No 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 2 platform declaration(s) and 0 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 alternatives4.3 / 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) — agent-eval/showcase/projects/fe_canvas_particles/index.html:61, packages/jcode-ui/src/voice/VoiceVisualizer.tsx:194, site/public/showcase-projects/city3d/js/textures.js:10, …

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 & labels5.2 / 10Adequate✓ 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 control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×9) — agent-eval/showcase/projects/fe_analytics_dashboard/index.html:336, agent-eval/showcase/projects/fe_todo_app/index.html:245, design/provider-redesign.html:662, …
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×22) — design/goal-banner-composer.html:357, design/goal-banner-composer.html:358, design/goal-banner-composer.html:359, …
  • 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. (×8) — design/provider-redesign.html:660, design/provider-redesign.html:667, design/provider-redesign.html:713, …
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — design/provider-redesign.html:714

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure6.4 / 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>. (×11) — agent-eval/report/report.html:1, agent-eval/showcase/projects/fe_analytics_dashboard/index.html:2, agent-eval/showcase/projects/fe_canvas_particles/index.html:2, …
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×6) — design/workflow-progress.html:627, site/src/pages/HomePage.tsx:220, site/src/pages/HomePage.tsx:242, …
  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — extension/popup/popup.html:2
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. — extension/popup/popup.html:2
  • A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). (×3) — packages/jcode-ui/src/toolRenderers/diff.tsx:27, packages/jcode-ui/src/toolRenderers/fileViewer.tsx:27, web/src/components/ArtifactsPanel.tsx:560

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.5 / 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".

  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. (×7) — agent-eval/showcase/projects/fe_analytics_dashboard/index.html:275, agent-eval/showcase/projects/fe_analytics_dashboard/index.html:279, agent-eval/showcase/projects/fe_analytics_dashboard/index.html:283, …
  • The repo's own CSS styles .btn 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. — agent-eval/showcase/projects/fe_analytics_dashboard/index.html:321
  • A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — agent-eval/showcase/projects/fe_analytics_dashboard/index.html:329
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×4) — design/workflow-progress.html:488, design/workflow-progress.html:521, design/workflow-progress.html:580, …
  • A script attaches a click listener to this <section>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — internal-doc/artifacts-ui/index.html:847
  • This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×5) — packages/jcode-ui/src/components/Attachment.tsx:123, packages/jcode-ui/src/product/ChatInput.tsx:2022, web/src/components/ArtifactsPanel.tsx:305, …
  • 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:437
  • This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×3) — packages/jcode-ui/src/product/GoalBanner.tsx:316, web/src/components/DesktopTitlebar.tsx:244, web/src/components/Sidebar.tsx:795
  • This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus. — site/public/showcase-projects/ui-kit/js/jui.js:631
  • The repo's own CSS styles .jui-pagination__item 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. — site/public/showcase-projects/ui-kit/js/jui.js:770
  • The repo's own CSS styles .btn 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. — site/src/pages/ShowcasePage.tsx:20
  • This <form role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — web/src/components/AutomationsView.tsx:516
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. — web/src/components/RemoteConnectWizard.tsx:448

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness7.9 / 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.

  • aria-activedescendant is present but empty, so it references no element and the relationship is lost. Point it at the id(s) of the target element, or remove it. — site/public/showcase-projects/ui-kit/js/jui.js:898

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 safety5.3 / 10Adequate✓ 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.

  • `.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. — agent-eval/showcase/projects/fe_analytics_dashboard/index.html:108
  • `input[type="range"]::-webkit-slider-thumb` moves (`transition: transform 0.12s 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. — agent-eval/showcase/projects/fe_pricing_calculator/index.html:95
  • `.slider-toggle::before` moves (`transition: transform 0.2s 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. — agent-eval/showcase/projects/fe_pricing_calculator/index.html:169
  • `input[type="range"]` 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. — agent-eval/showcase/projects/fe_pricing_calculator/index.html:81
  • `.badge` sets color: #fff on background-color: #10b981 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — agent-eval/showcase/projects/fe_pricing_calculator/index.html:176
  • `#add-btn` moves (`transition: background 0.2s, transform 0.1s`) 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. — agent-eval/showcase/projects/fe_todo_app/index.html:78
  • `#add-btn` sets color: #fff on background-color: #667eea — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — agent-eval/showcase/projects/fe_todo_app/index.html:69
  • `.filter-btn.active` sets color: #667eea on background-color: #fff — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — agent-eval/showcase/projects/fe_todo_app/index.html:123
  • `.task .delete:hover` sets color: #e53e3e on background-color: #fed7d7 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — agent-eval/showcase/projects/fe_todo_app/index.html:205
  • `.sec-head .sec-no` sets color: #FFFFFF on background-color: #FFFFFF — 1.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — design/goal-banner-composer.html:100
  • `.mark::after` sets color: #FFFFFF on background-color: #FF5C33 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — design/goal-banner-composer.html:270
  • `.legend-item .n` sets color: #FFFFFF on background-color: #FF5C33 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — design/goal-banner-composer.html:286
  • `.spin` moves (`animation: rot .7s 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. — design/provider-redesign.html:324
  • `.btn-danger` sets color: #FFFFFF on background-color: #FF5C33 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — design/provider-redesign.html:109
  • `.tool-row` 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. — design/running-thinking-indicator.html:62
  • `.wf-foot .elapsed .live-dot` moves (`animation: pulse-dot 1.2s var(--ease-out) 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. — design/workflow-progress.html:308
  • `.tab-btn .badge` sets color: #FFFFFF on background-color: #FF8400 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — design/workflow-progress.html:159
  • `.mark` moves (`animation: float 3.2s ease-in-out 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. — desktop/splash/index.html:72
  • `.spinner` moves (`animation: spin 0.8s 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. — desktop/splash/index.html:98
  • `.logo` sets color: #fff on background-color: #e8631a — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — extension/popup/popup.html:16
  • `.pill.on` sets color: #1f9d55 on background-color: #e6f6ec — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — extension/popup/popup.html:20
  • `button.primary` sets color: #fff on background-color: #e8631a — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — extension/popup/popup.html:36
  • `.badge` sets color: #e8631a on background-color: #fdeee3 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — extension/popup/popup.html:41
  • `.msg.ok` sets color: #1f9d55 on background-color: #e6f6ec — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — extension/popup/popup.html:44
  • `.preview-toolbar` sets color: #7f817d on background-color: #1a1a1a — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — internal-doc/artifacts-ui/index.html:533
  • `.image-card[data-state="saving"] .pixel` moves (`animation-name: pixel-save`) 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. — internal-doc/prototypes/image-generation-motion/01-pixel-shutter.html:215
  • `.generated-card[data-state="saving"] .slice` moves (`animation-name: film-save`) 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. — internal-doc/prototypes/image-generation-motion/02-film-slices.html:258
  • `.media-card` moves (`transition: width 320ms var(--ease-lock), aspect-ratio 320ms var(--ease-lock), border-radius 320ms var(--ease-lock)`) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:272
  • `.signal-dot` moves (`animation: signal-echo 3.6s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:311
  • `.media-card[data-state="saving"] .signal-dot` moves (`animation: signal-settle 2.4s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:316
  • `.focus-rig` moves (`animation: focus-hunt 4.8s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:324
  • `.media-card[data-state="saving"] .focus-rig` moves (`animation: focus-lock 2.4s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:339
  • `.media-card[data-state="saving"] .corner::after` moves (`animation: lock-point 2.4s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:411
  • `.axis.horizontal` moves (`animation: axis-x 3.1s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:426
  • `.axis.vertical` moves (`animation: axis-y 3.1s var(--ease-lock) infinite 160ms`) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:433
  • `.media-card[data-state="saving"] .axis` moves (`animation: axis-lock 2.4s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:438
  • `.aperture-blade::before` moves (`animation: blade-breathe 2.8s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:469
  • `.media-card[data-state="saving"] .aperture-blade::before` moves (`animation: blade-close 2.4s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:474
  • `.aperture-core` moves (`animation: core-read 2.8s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:487
  • `.media-card[data-state="saving"] .aperture-core` moves (`animation: core-capture 2.4s var(--ease-lock) 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. — internal-doc/prototypes/image-generation-motion/03-focus-iris.html:492

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 composition7.1 / 10Strong✓ 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.

AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

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.

  • `CloudSupervisor` declares 17 methods: `Status`, `SetAutoConnect`, `SetConfigSync`, `SyncCredentials`, `PairingRecords`, `ApprovePairing`, `DenyPairing`, `RevokePairing`, `SyncAccountSettings`, `SyncProviderConfigs`, `AccountSyncKeyStatus`, `PendingAccountSyncDevices`, `ApprovedAccountSyncDevices`, `ApproveAccountSyncDevice`, `DenyAccountSyncDevice`, `RevokeAccountSyncDevice`, `LastPaired`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — REDACTED:254

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

M1 · Documentation (README)7.9 / 10Strong✓ Tool-verified

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

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

What to do

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

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
  • `internal-doc/artifacts-design.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `jcode-site`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — internal-doc/artifacts-design.md:80
  • `internal-doc/image-generation-architecture.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `jcode-site`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — internal-doc/image-generation-architecture.md:44

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.
  • Update internal-doc/artifacts-design.md so it draws the parts the code has today: add jcode-site.
  • Update internal-doc/image-generation-architecture.md so it draws the parts the code has today: add jcode-site.
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 · Observability7.9 / 10Strong✓ Tool-verified

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

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

  • Only 2/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `agent-eval/harness`, `cmd/jcode-computerd/onboarding`, `desktop/src-tauri`, `packages/jcode-ui`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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.

  • `desktop/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`. — desktop/package.json:13

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 & Rollback5.0 / 10Adequate✓ 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.

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

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download 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.

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

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

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

  • `http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — internal/command/update.go:76, internal/pkg/weixin/api.go:136, script/generate_models.go:123

What to do

  • Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ 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.

R1 · Type Safety9.5 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

R10 · Code Duplication7.7 / 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.

  • 21 duplicated blocks under the repository root have copies in at least two of the sibling directories packages, web — 13 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 21 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 21 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 21 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. — packages/jcode-ui/src/product/types.ts:19
  • 7 duplicated blocks under packages/ have copies in at least two of the sibling directories jcode-ui, jcode-ui-core — 4 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 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. — packages/jcode-ui-core/src/primitives/Composer.tsx:534
  • packages/jcode-ui-core/src/timeline/groupActivity.ts:23 · packages/jcode-ui-core/src/timeline/groupExploring.ts:41 — the two spans are one implementation copied and then locally edited — 242 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. — packages/jcode-ui-core/src/timeline/groupActivity.ts:23
  • packages/jcode-ui/src/product/types.ts:19 · web/src/lib/types.ts:200 — 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. — packages/jcode-ui/src/product/types.ts:19
  • REDACTED:181 · REDACTED:44 — the two spans are one implementation copied and then locally edited — 189 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:181
  • packages/jcode-ui/src/toolRenderers/team.tsx:90 · packages/jcode-ui/src/toolRenderers/team.tsx:149 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/jcode-ui/src/toolRenderers/team.tsx:90
  • packages/jcode-ui/src/canvas/WorkflowEdge.tsx:17 · packages/jcode-ui/src/canvas/WorkflowEdge.tsx:45 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/jcode-ui/src/canvas/WorkflowEdge.tsx:17
  • packages/jcode-ui/src/toolRenderers/diff.tsx:51 · packages/jcode-ui/src/toolRenderers/fileViewer.tsx:37 — 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. — packages/jcode-ui/src/toolRenderers/diff.tsx:51
  • packages/jcode-ui-core/src/primitives/Composer.tsx:534 · packages/jcode-ui/src/product/ChatInput.tsx:969 — the two spans are one implementation copied and then locally edited — 89 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. — packages/jcode-ui-core/src/primitives/Composer.tsx:534
  • REDACTED:17 · REDACTED:11 — 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:17
  • web/src/components/SettingsView.tsx:840 · web/src/components/SettingsView.tsx:3237 — 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. — web/src/components/SettingsView.tsx:840
  • web/src/components/SettingsView.tsx:3568 · web/src/components/SettingsView.tsx:3592 — 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. — web/src/components/SettingsView.tsx:3568
  • packages/jcode-ui/src/product/remote.ts:7 · web/src/lib/remote.ts:27 — 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. — packages/jcode-ui/src/product/remote.ts:7
  • packages/jcode-ui/src/toolRenderers/browserShot.tsx:11 · packages/jcode-ui/src/toolRenderers/computerShot.tsx:14 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/jcode-ui/src/toolRenderers/browserShot.tsx:11
  • packages/jcode-ui/src/toolRenderers/team.tsx:141 · packages/jcode-ui/src/toolRenderers/team.tsx:216 — 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. — packages/jcode-ui/src/toolRenderers/team.tsx:141
  • web/src/components/SettingsView.tsx:760 · web/src/components/SettingsView.tsx:2302 — 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. — web/src/components/SettingsView.tsx:760
  • web/src/components/RemoteConnectionNotice.tsx:54 · web/src/components/RemoteConnectionNotice.tsx:80 — 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. — web/src/components/RemoteConnectionNotice.tsx:54
  • packages/jcode-ui/src/components/Thread.tsx:261 · web/src/components/ChatView.tsx:49 — 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. — packages/jcode-ui/src/components/Thread.tsx:261
  • packages/jcode-ui/src/components/TurnChangesCard.tsx:49 · packages/jcode-ui/src/components/TurnChangesCard.tsx:112 — the two spans are one implementation copied and then locally edited — 89 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. — packages/jcode-ui/src/components/TurnChangesCard.tsx:49
  • packages/jcode-ui/src/product/BranchPicker.tsx:90 · packages/jcode-ui/src/product/WorkspacePicker.tsx:135 — 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. — packages/jcode-ui/src/product/BranchPicker.tsx:90
  • packages/jcode-ui/src/product/remote.ts:35 · web/src/components/Sidebar.tsx:1135 — 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. — packages/jcode-ui/src/product/remote.ts:35
  • web/src/components/CloudBadge.tsx:124 · web/src/components/ThemeToggle.tsx:19 — 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. — web/src/components/CloudBadge.tsx:124
  • packages/jcode-ui/src/components/Thread.tsx:152 · packages/jcode-ui/src/components/Thread.tsx:172 — 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. — packages/jcode-ui/src/components/Thread.tsx:152
  • web/src/components/AuthGate.tsx:25 · web/src/components/SetupView.tsx:201 — 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. — web/src/components/AuthGate.tsx:25
  • web/src/components/CloudBadge.tsx:35 · web/src/components/settings/CloudTab.tsx:40 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/src/components/CloudBadge.tsx:35
  • web/src/components/SettingsView.tsx:4253 · web/src/components/SettingsView.tsx:4985 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/components/SettingsView.tsx:4253
  • web/src/App.tsx:442 · web/src/components/RightPanel.tsx:119 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/src/App.tsx:442
  • web/src/components/SettingsView.tsx:2640 · web/src/components/SettingsView.tsx:2655 — 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. — web/src/components/SettingsView.tsx:2640
  • packages/jcode-ui-core/src/primitives/Composer.tsx:204 · packages/jcode-ui/src/voice/SpeechInput.tsx:53 — 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. — packages/jcode-ui-core/src/primitives/Composer.tsx:204
  • packages/jcode-ui/src/components/ThreadList.tsx:96 · packages/jcode-ui/src/components/ThreadList.tsx:130 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/jcode-ui/src/components/ThreadList.tsx:96
  • web/src/app/store.ts:668 · web/src/app/store.ts:708 — the two spans are one implementation copied and then locally edited — 162 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. — web/src/app/store.ts:668
  • web/src/components/SettingsView.tsx:455 · web/src/components/SettingsView.tsx:474 — 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. — web/src/components/SettingsView.tsx:455
  • web/src/components/SettingsView.tsx:2067 · web/src/components/SettingsView.tsx:2398 — 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. — web/src/components/SettingsView.tsx:2067
  • web/src/components/SettingsView.tsx:2448 · web/src/components/SettingsView.tsx:2477 — 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. — web/src/components/SettingsView.tsx:2448
  • web/src/components/SettingsView.tsx:4195 · web/src/components/SettingsView.tsx:4209 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/src/components/SettingsView.tsx:4195
  • packages/jcode-ui-core/src/primitives/Thread.tsx:284 · packages/jcode-ui-core/src/primitives/Thread.tsx:318 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/jcode-ui-core/src/primitives/Thread.tsx:284
  • packages/jcode-ui-core/src/timeline/turnGroups.ts:125 · packages/jcode-ui-core/src/timeline/turnGroups.ts:138 — 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. — packages/jcode-ui-core/src/timeline/turnGroups.ts:125
  • packages/jcode-ui/src/lib/markdown.ts:64 · packages/jcode-ui/src/plugins/mermaid.ts: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. — packages/jcode-ui/src/lib/markdown.ts:64
  • packages/jcode-ui/src/product/ChatInput.tsx:2016 · packages/jcode-ui/src/product/GoalBanner.tsx:310 — 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. — packages/jcode-ui/src/product/ChatInput.tsx:2016
  • packages/jcode-ui/src/toolRenderers/generic.tsx:35 · packages/jcode-ui/src/toolRenderers/generic.tsx:48 — 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. — packages/jcode-ui/src/toolRenderers/generic.tsx:35

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.
R2 · Cyclomatic Complexity5.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.

  • ChatInput has cyclomatic complexity 96 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — packages/jcode-ui/src/product/ChatInput.tsx:306
  • MemoryTab has cyclomatic complexity 80 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/SettingsView.tsx:3451
  • addToolCall has cyclomatic complexity 68 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/store.ts:606
  • ComputerTab has cyclomatic complexity 66 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/SettingsView.tsx:4420
  • resolveToolCall has cyclomatic complexity 53 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/store.ts:764
  • extractSymbols has cyclomatic complexity 51 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — script/generate_jcode_ui_api_docs.mjs:52
  • CloudTab has cyclomatic complexity 47 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/settings/CloudTab.tsx:89
  • RemoteConnectWizard has cyclomatic complexity 46 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/RemoteConnectWizard.tsx:36
  • ProviderAuthSection has cyclomatic complexity 46 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/settings/ProviderAuthSection.tsx:250
  • ToolCallView has cyclomatic complexity 46 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui-core/src/primitives/ToolCallView.tsx:63
  • ProviderForm has cyclomatic complexity 45 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/SettingsView.tsx:1235
  • ToolRowHeader has cyclomatic complexity 45 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:43
  • Message has cyclomatic complexity 45 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:59
  • GeneratedImageCard has cyclomatic complexity 44 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui/src/components/GeneratedImageCard.tsx:100
  • ProviderCard has cyclomatic complexity 43 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/SettingsView.tsx:893
  • Composer has cyclomatic complexity 42 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui-core/src/primitives/Composer.tsx:219
  • ConversationLoadingView has cyclomatic complexity 41 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/ConversationLoadingView.tsx:23
  • ToolHeader has cyclomatic complexity 41 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:169
  • save has cyclomatic complexity 38 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/SettingsView.tsx:1329
  • replayOperationsByOccurrence has cyclomatic complexity 38 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/store.ts:212
  • parseTestOutput has cyclomatic complexity 37 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui/src/toolRenderers/testResults.tsx:131
  • WorkspacePicker has cyclomatic complexity 36 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui/src/product/WorkspacePicker.tsx:51
  • provisionNewChat has cyclomatic complexity 35 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/store.ts:2830
  • replayTimeline has cyclomatic complexity 34 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/store.ts:72
  • poll has cyclomatic complexity 34 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/settings/ProviderAuthSection.tsx:403
  • resumeConversationEnvironment has cyclomatic complexity 32 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/store.ts:2468
  • TerminalRenderer has cyclomatic complexity 31 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui/src/toolRenderers/terminal.tsx:12
  • boot has cyclomatic complexity 29 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/App.tsx:111
  • AutomationEditor has cyclomatic complexity 29 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/AutomationsView.tsx:371
  • revealSessionInSidebar has cyclomatic complexity 29 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/store.ts:1829
  • RemoteConnectionNotice has cyclomatic complexity 28 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/RemoteConnectionNotice.tsx:25
  • mergeToolLifecycle has cyclomatic complexity 28 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/toolLifecycle.ts:38
  • (anonymous) has cyclomatic complexity 28 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/Sidebar.tsx:635
  • (anonymous) has cyclomatic complexity 27 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui/src/product/ChatInput.tsx:564
  • handleEvent has cyclomatic complexity 27 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui-core/src/runtime/aguiRuntime.ts:307
  • SubagentHeader has cyclomatic complexity 26 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:291
  • applyForegroundAgentDone has cyclomatic complexity 26 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/app/wsBridge.ts:39
  • UpdateBanner has cyclomatic complexity 26 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/UpdateBanner.tsx:14
  • SetupView has cyclomatic complexity 25 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/SetupView.tsx:27
  • CompactToolRow has cyclomatic complexity 25 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — packages/jcode-ui/src/components/CompactToolRow.tsx:14
R3 · Large Files4.1 / 10Weak✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • web/src/components/SettingsView.tsx has 5094 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/SettingsView.tsx:1
  • web/src/app/store.ts has 2841 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/app/store.ts:1
  • packages/jcode-ui/src/product/ChatInput.tsx has 2000 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/jcode-ui/src/product/ChatInput.tsx:1
  • web/src/i18n/locales/en.ts has 1618 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/i18n/locales/en.ts:1
  • web/src/i18n/locales/zh-Hans.ts has 1592 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/i18n/locales/zh-Hans.ts:1
  • web/src/i18n/locales/ja.ts has 1484 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/i18n/locales/ja.ts:1
  • web/src/i18n/locales/ko.ts has 1483 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/i18n/locales/ko.ts:1
  • web/src/i18n/locales/zh-Hant.ts has 1478 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/i18n/locales/zh-Hant.ts:1
  • web/src/components/AutomationsView.tsx has 1176 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/AutomationsView.tsx:1
  • web/src/components/Sidebar.tsx has 1168 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/Sidebar.tsx:1
  • web/src/components/RemoteConnectWizard.tsx has 1152 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/RemoteConnectWizard.tsx:1
  • web/src/lib/api.ts has 982 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/api.ts:1
  • web/src/lib/types.ts has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/types.ts:1
  • web/src/components/settings/ProviderAuthSection.tsx has 880 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/settings/ProviderAuthSection.tsx:1
  • web/src/components/settings/CloudTab.tsx has 748 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/settings/CloudTab.tsx:1
  • packages/jcode-ui-core/src/primitives/Composer.tsx has 683 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/jcode-ui-core/src/primitives/Composer.tsx:1
  • web/src/App.tsx has 656 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/App.tsx:1
  • web/src/components/RightPanel.tsx has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/RightPanel.tsx:1
  • packages/jcode-ui/src/product/WorkspacePicker.tsx has 624 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/jcode-ui/src/product/WorkspacePicker.tsx:1
  • web/src/components/ArtifactsPanel.tsx has 596 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/ArtifactsPanel.tsx:1
  • web/src/components/DesktopTitlebar.tsx has 559 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/DesktopTitlebar.tsx:1
  • packages/jcode-ui-core/src/types/index.ts has 489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/jcode-ui-core/src/types/index.ts:1
  • web/fixture-tool-ux/main.tsx has 454 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/fixture-tool-ux/main.tsx:1
  • packages/jcode-ui-core/src/runtime/aguiRuntime.ts has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/jcode-ui-core/src/runtime/aguiRuntime.ts:1
  • REDACTED has 448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.2 / 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. (×13) — web/src/App.tsx:1, extension/background.js:1, web/src/components/ChatView.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED 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: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code9.7 / 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.

  • Unreachable from the 27 application, 11 tooling and 77 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (27 application, 11 tooling, 77 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×5) — internal/flow/prelude.js, internal/flow/builtin/pr-review.js, internal/flow/builtin/roundtable.js, …
  • Nothing imports this binding — it is safe to review for removal. (×3) — web/src/components/AuthGate.tsx:82, web/src/lib/useDesktop.ts:12, web/src/lib/useDesktop.ts:151

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene8.5 / 10Exemplary✓ Tool-verified

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

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

  • Declared in packages/jcode-ui/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. — packages/jcode-ui/package.json:112
  • Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×2) — REDACTED:27, REDACTED:32

What to do

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

  • packages/jcode-ui-core/src/runtime/externalStore.ts → packages/jcode-ui-core/src/runtime/index.ts → packages/jcode-ui-core/src/runtime/externalStore.ts (one verified cycle inside a mutually-dependent group of 3 files) — packages/jcode-ui-core/src/runtime/externalStore.ts:16

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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

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

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation8.2 / 10Strong✓ Tool-verified

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

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

  • Only 25/36 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial) accept a context.Context or an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Go: `ctx context.Context`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `requestBlob` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api.ts:53
  • `requestForm` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api.ts:66
  • `requestVoid` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api.ts:83
  • `artifactDownloadAvailable` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api.ts:229
  • `workspaceFileDownloadAvailable` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/api.ts:242
  • `waitForHealth` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/src/lib/apiBase.ts:58
  • `agentSocketSigners` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — internal/tools/ssh_auth.go:60
  • `sign` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — internal/tools/ssh_auth.go:99
  • `FetchQRCode` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — internal/pkg/weixin/api.go:131
  • `SendText` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — internal/pkg/weixin/api.go:244
  • `runUpdate` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — internal/command/update.go:26

What to do

  • Thread a context.Context or an AbortSignal through functions that make requests, so the work stops when its caller gives up.
X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated7.9 / 10Strong✓ Tool-verified

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for … range` leaves the slice or map it is walking alone — Go raises nothing, but the walk and the collection part: a range evaluates its slice once, so an element appended in the body is never visited and a removal by reslicing (`s = append(s[:i], s[i+1:]...)`, `slices.Delete`) shifts the next element under the index, which is then skipped while the last is read twice; a reslice, a reassignment or a sort leaves every later `s[i]` naming another element; and a map's order is unspecified, so deleting another key (or clearing the map) changes from run to run which entries the loop still sees.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

  • `msgs` is walked by the `for … range` at line 187, and line 192 reassigns `msgs`. The loop keeps walking the collection it started with, while the body from here on reads and writes another one. — internal/agent/turn_budget.go:187

What to do

  • Each finding names the two spans that cannot both stand — the borrow in the `for` header, and the `borrow_mut()` of the same cell inside the body. Confirm from those two, then pick one: take what the loop needs before it so the guard is dropped (`let n = cell.borrow().len();`, or iterate `cell.borrow().clone()` bound to a `let` first); collect the changes and apply them after the loop; or re-borrow per pass by index. A `break` straight after the `borrow_mut()` does NOT help here: the call itself panics, not the next element. In Python: Each finding names the two lines that cannot both stand — the `for` over the collection (or its `keys()`/`values()`/`items()` view), and the call inside the body that changes its size. Confirm from those two, then pick one: walk a snapshot (`for k in list(d):`, `for x in s.copy():`); build the result instead of editing in place (`d = {k: v for k, v in d.items() if keep(v)}`); collect what needs removing and remove it after the loop; or — where only the first match was ever meant — `break` straight after the change, which is the one shape that is already safe. In Go: Each finding names the two lines that cannot both stand — the `for … range` over the collection, and the change to it in the body. Confirm from those two, then pick one: build the result instead of editing the walked collection (`var kept []T` … `kept = append(kept, v)`, or `kept := s[:0]` and assign `s = kept` after the loop; `slices.DeleteFunc(s, drop)` in one call); for a worklist that must visit what it adds, loop `for len(queue) > 0` or by index (`for i := 0; i < len(s); i++`); walk a copy (`range slices.Clone(s)`, `range slices.Collect(maps.Keys(m))`) and change the original; delete only the CURRENT key (`delete(m, k)`), which the specification allows; or — where only the first match was ever meant — `break` straight after the change.
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

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

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

X3 · Exception handling5.5 / 10Adequate✓ Tool-verified

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

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

  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×17) — web/src/App.tsx:575, web/src/lib/useTheme.ts:176, web/src/components/AutomationsView.tsx:838, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×22) — web/src/lib/apiBase.ts:50, web/src/lib/apiBase.ts:66, web/src/lib/authToken.ts:26, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — web/src/lib/useDesktop.ts:130

What to do

  • Swallowed exception (empty catch)
X5 · Nullable reference types9.7 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

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

  • ~0.7 `!` null assertions per 1k TypeScript source lines — 41 assertion(s) across the 59142 source line(s) of the 203 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: web/src/components/settings/ProviderAuthSection.tsx (21), web/src/components/SettingsView.tsx (4), packages/jcode-ui/src/components/ModelSelector.tsx (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

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 Health57.8Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture84.7Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity76.6StrongSolid.
Readiness58.9Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security53.9Checked 4 of 10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility44.9Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100.0ExemplaryStrongest 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.

  • SC1 Supply-chain hygiene — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 37 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 55 check(s) not relevant to this codebase

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

  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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
  • 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 (our sandbox): `npm run` found no REDACTED in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read REDACTED: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" 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 — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • 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.
  • D25 ADR Conformance — no ADRs to check
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 6 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/jcode-ui/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 3 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 21 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • 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
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 aggregate(s) with Apply/When folds; 5 Go aggregate(s) recording domain events (own events-slice append / raise-record)
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a `func BenchmarkXxx(b *testing.B)` in any `_test.go` file, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — X1 reached only 46% of this repository's production lines — go (97,015 lines), swift (2,028 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X12 Unreachable branch — X12 reached only 46% of this repository's production lines — go (97,015 lines), swift (2,028 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 — X13 reached only 46% of this repository's production lines — go (97,015 lines), swift (2,028 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X16 Unfloored truncation loop — X16 reached only 41% of this repository's production lines — go (97,015 lines), python (9,179 lines), swift (2,028 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 41% of this repository's production lines — go (97,015 lines), python (9,179 lines), swift (2,028 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
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — X21 reached only 46% of this repository's production lines — go (97,015 lines), swift (2,028 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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
  • X24 Document value interpolated into markup unescaped — X24 reached only 44% of this repository's production lines — go (97,015 lines), rust (3,903 lines), swift (2,028 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X25 Inert configuration knob — X25 reached only 46% of this repository's production lines — go (97,015 lines), swift (2,028 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X29 Per-element action decided by a fixed element — X29 reached only 41% of this repository's production lines — go (97,015 lines), python (9,179 lines), swift (2,028 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 — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Go was read, and it logs through none: the standard library's `log` takes one finished line, or it makes no log call outside its tests at all, so an assembled message there loses nothing the API could have kept (as with log4net in C#). Calls through log/slog, zap, logrus, zerolog, hclog, go-kit's log or logr would be judged.
  • 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 — 127 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 3 more in this group — see findings.md.
AC2 · Forms & labels · <button> with no accessible text · ×22
  • <button> with no accessible text design/goal-banner-composer.html:357 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:358 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:359 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:367 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:426 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:449 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:489 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:490 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:491 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:514 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:538 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:539 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:540 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:547 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:565 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:566 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:573 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:588 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:622 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:623 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:624 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text design/goal-banner-composer.html:633 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
D30 · Dependency Vulnerabilities · High CVE · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×10
  • <input> without a programmatic label agent-eval/showcase/projects/fe_analytics_dashboard/index.html:336 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label agent-eval/showcase/projects/fe_todo_app/index.html:245 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label design/provider-redesign.html:662 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label design/provider-redesign.html:713 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label design/provider-redesign.html:714 — 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 design/provider-redesign.html:715 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label design/provider-redesign.html:718 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label design/provider-redesign.html:748 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label design/provider-redesign.html:797 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label design/provider-redesign.html:798 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC2 · Forms & labels · <label> that labels no control · ×8
  • <label> that labels no control design/provider-redesign.html:660 — 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 design/provider-redesign.html:667 — 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 design/provider-redesign.html:713 — 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 design/provider-redesign.html:714 — 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 design/provider-redesign.html:715 — 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 design/provider-redesign.html:717 — 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 design/provider-redesign.html:797 — 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 design/provider-redesign.html:798 — 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.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×7
  • Click handler on a non-interactive <div> agent-eval/showcase/projects/fe_analytics_dashboard/index.html:329 — A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> design/workflow-progress.html:488 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> design/workflow-progress.html:521 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> design/workflow-progress.html:580 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> design/workflow-progress.html:600 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:437 — 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}.
  • Click handler on a non-interactive <div> web/src/components/RemoteConnectWizard.tsx:448 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×3
  • Clickable element isn't keyboard-operable agent-eval/showcase/projects/fe_analytics_dashboard/index.html:321 — The repo's own CSS styles .btn 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 site/public/showcase-projects/ui-kit/js/jui.js:770 — The repo's own CSS styles .jui-pagination__item 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 site/src/pages/ShowcasePage.tsx:20 — The repo's own CSS styles .btn 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang extension/popup/popup.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure · Document without a <title> · ×1
  • Document without a <title> extension/popup/popup.html:2 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
AC4 · Keyboard semantics · Click handler on a non-interactive <section> · ×1
  • Click handler on a non-interactive <section> internal-doc/artifacts-ui/index.html:847 — A script attaches a click listener to this <section>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics · Hover-only interaction on <div> · ×1
  • Hover-only interaction on <div> site/public/showcase-projects/ui-kit/js/jui.js:631 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabindex="0", so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabindex="0"="0" so the element can receive that focus.
AC5 · ARIA correctness · Empty aria-activedescendant reference · ×1
  • Empty aria-activedescendant reference site/public/showcase-projects/ui-kit/js/jui.js:898 — aria-activedescendant is present but empty, so it references no element and the relationship is lost. Point it at the id(s) of the target element, or remove it.
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: main.go ↔ tui.go cmd/jcode/main.go:1 — `cmd/jcode/main.go` (context cmd) and `internal/tui/tui.go` (context internal) sit in DIFFERENT parts of the tree yet change together 59% of the time (16 of the 27 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 `96c1f8c6` feat: redesign TUI with two-column layout, sidebar, and orange theme; `355ca52f` feat: enhance approval state management with auto-approve option and …; `a7b1133c` refactor: update bubbletea and lipgloss imports to new charm.land paths — run `git show` on any of them.
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) packages/jcode-ui-core/src/runtime/externalStore.ts:16 — packages/jcode-ui-core/src/runtime/externalStore.ts → packages/jcode-ui-core/src/runtime/index.ts → packages/jcode-ui-core/src/runtime/externalStore.ts (one verified cycle inside a mutually-dependent group of 3 files)
Serious — 1643 finding(s)
D3 · God Classes · FunctionTooLong · ×81
  • FunctionTooLong: ChatInput.ChatInput packages/jcode-ui/src/product/ChatInput.tsx:306 — FunctionTooLong — ChatInput runs 1285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1185 over it, 12.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: Sidebar.Sidebar web/src/components/Sidebar.tsx:107 — FunctionTooLong — Sidebar runs 696 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 596 over it, 6.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: command.runWebServer internal/command/web.go:253 — FunctionTooLong — runWebServer runs 607 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 507 over it, 6.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: RemoteConnectWizard.RemoteConnectWizard web/src/components/RemoteConnectWizard.tsx:36 — FunctionTooLong — RemoteConnectWizard runs 600 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 500 over it, 6.00× 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: CloudTab.CloudTab web/src/components/settings/CloudTab.tsx:89 — FunctionTooLong — CloudTab runs 588 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 488 over it, 5.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ProviderAuthSection.ProviderAuthSection web/src/components/settings/ProviderAuthSection.tsx:250 — FunctionTooLong — ProviderAuthSection runs 580 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 480 over it, 5.80× 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: SettingsView.ComputerTab web/src/components/SettingsView.tsx:4420 — FunctionTooLong — ComputerTab runs 556 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 456 over it, 5.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: command.RunInteractive internal/command/interactive.go:1391 — FunctionTooLong — RunInteractive 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: SettingsView.ProvidersTab web/src/components/SettingsView.tsx:331 — FunctionTooLong — ProvidersTab runs 431 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 331 over it, 4.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SettingsView.ProviderForm web/src/components/SettingsView.tsx:1235 — FunctionTooLong — ProviderForm runs 407 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 307 over it, 4.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SettingsView.MCPTab web/src/components/SettingsView.tsx:2863 — FunctionTooLong — MCPTab runs 399 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 299 over it, 3.99× 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: AutomationsView.AutomationsView web/src/components/AutomationsView.tsx:789 — FunctionTooLong — AutomationsView runs 392 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 292 over it, 3.92× 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: city.buildCity site/public/showcase-projects/city3d/js/city.js:308 — FunctionTooLong — buildCity runs 391 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 291 over it, 3.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: Composer.Composer packages/jcode-ui-core/src/primitives/Composer.tsx:219 — FunctionTooLong — Composer runs 384 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 284 over it, 3.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: SettingsView.MemoryTab web/src/components/SettingsView.tsx:3451 — FunctionTooLong — MemoryTab runs 377 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 277 over it, 3.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AutomationsView.AutomationEditor web/src/components/AutomationsView.tsx:371 — FunctionTooLong — AutomationEditor runs 348 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 248 over it, 3.48× 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: runner.runInner internal/runner/runner.go:305 — FunctionTooLong — runInner 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: SetupView.SetupView web/src/components/SetupView.tsx:27 — FunctionTooLong — SetupView runs 295 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 195 over it, 2.95× 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: WorkspacePicker.WorkspacePicker packages/jcode-ui/src/product/WorkspacePicker.tsx:51 — FunctionTooLong — WorkspacePicker runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SettingsView.ProviderCard web/src/components/SettingsView.tsx:893 — FunctionTooLong — ProviderCard runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: aguiRuntime.createAGUIRuntime packages/jcode-ui-core/src/runtime/aguiRuntime.ts:127 — FunctionTooLong — createAGUIRuntime runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: Message.Message REDACTED:59 — FunctionTooLong — Message runs 255 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× 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: just-the-docs.searchLoaded agent-eval/site/docs/assets/js/just-the-docs.js:119 — FunctionTooLong — searchLoaded runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SettingsView.BrowserTab web/src/components/SettingsView.tsx:4005 — FunctionTooLong — BrowserTab runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wsBridge.createWSHandlers web/src/app/wsBridge.ts:35 — FunctionTooLong — createWSHandlers runs 236 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 136 over it, 2.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.
  • + 56 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×56
  • Hotspot: packages/jcode-ui/src/product/ChatInput.tsx packages/jcode-ui/src/product/ChatInput.tsx:306 — packages/jcode-ui/src/product/ChatInput.tsx changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 304 in ChatInput.ChatInput at line 306. 6 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- packages/jcode-ui/src/product/ChatInput.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/command/web.go internal/command/web.go:253 — internal/command/web.go changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in command.runWebServer at line 253. 4 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/command/web.go`: 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: internal/tui/update.go internal/tui/update.go:21 — internal/tui/update.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 503 in Model.Update at line 21. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/tui/update.go`: 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: web/src/components/SettingsView.tsx web/src/components/SettingsView.tsx:331 — web/src/components/SettingsView.tsx changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in SettingsView.ProvidersTab at line 331. 3 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/components/SettingsView.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/command/interactive.go internal/command/interactive.go:1391 — internal/command/interactive.go changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in command.RunInteractive at line 1391. 3 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/command/interactive.go`: 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: web/src/components/Sidebar.tsx web/src/components/Sidebar.tsx:107 — web/src/components/Sidebar.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 179 in Sidebar.Sidebar at line 107. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/components/Sidebar.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/src/App.tsx web/src/App.tsx:83 — web/src/App.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in App.App at line 83. 2 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/App.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/runner/runner.go internal/runner/runner.go:305 — internal/runner/runner.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in runner.runInner at line 305. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/runner/runner.go`: 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: web/src/components/settings/CloudTab.tsx web/src/components/settings/CloudTab.tsx:89 — web/src/components/settings/CloudTab.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 110 in CloudTab.CloudTab at line 89. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/components/settings/CloudTab.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/web/providers.go internal/web/providers.go:1008 — internal/web/providers.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in Server.handleUpdateProvider at line 1008. 4 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/web/providers.go`: 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: packages/jcode-ui/src/product/WorkspacePicker.tsx packages/jcode-ui/src/product/WorkspacePicker.tsx:51 — packages/jcode-ui/src/product/WorkspacePicker.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in WorkspacePicker.WorkspacePicker at line 51. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- packages/jcode-ui/src/product/WorkspacePicker.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/src/app/wsBridge.ts web/src/app/wsBridge.ts:35 — web/src/app/wsBridge.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in wsBridge.createWSHandlers at line 35. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/app/wsBridge.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/web/models.go internal/web/models.go:104 — internal/web/models.go changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in Server.handleListModels at line 104. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/web/models.go`: 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: web/src/app/store.ts web/src/app/store.ts:2830 — web/src/app/store.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in store.provisionNewChat at line 2830. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/app/store.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/src/components/RemoteConnectWizard.tsx web/src/components/RemoteConnectWizard.tsx:36 — web/src/components/RemoteConnectWizard.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 156 in RemoteConnectWizard.RemoteConnectWizard at line 36. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/components/RemoteConnectWizard.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/command/acp.go internal/command/acp.go:478 — internal/command/acp.go changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in acpAgent.buildAgentSession at line 478. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/command/acp.go`: 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: internal/web/chat.go internal/web/chat.go:198 — internal/web/chat.go changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Server.submitMessageWithOptions at line 198. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/web/chat.go`: 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: internal/web/sessions.go internal/web/sessions.go:289 — internal/web/sessions.go changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in Server.handleDeleteSession at line 289. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/web/sessions.go`: 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: internal/cloud/connector.go internal/cloud/connector.go:824 — internal/cloud/connector.go changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Connector.execChatSendCompose at line 824. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/cloud/connector.go`: 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: web/src/components/AutomationsView.tsx web/src/components/AutomationsView.tsx:371 — web/src/components/AutomationsView.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in AutomationsView.AutomationEditor at line 371. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/components/AutomationsView.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/src/components/SetupView.tsx web/src/components/SetupView.tsx:27 — web/src/components/SetupView.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in SetupView.SetupView at line 27. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/components/SetupView.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/handler/web.go internal/handler/web.go:71 — internal/handler/web.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in handler.extractToolDisplayInfo at line 71. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/handler/web.go`: 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: internal/team/manager.go internal/team/manager.go:607 — internal/team/manager.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in Manager.runAgentTurn at line 607. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- internal/team/manager.go`: 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: web/src/components/ChatView.tsx web/src/components/ChatView.tsx:66 — web/src/components/ChatView.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in ChatView.ChatView at line 66. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/components/ChatView.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/src/components/CloudBadge.tsx web/src/components/CloudBadge.tsx:52 — web/src/components/CloudBadge.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in CloudBadge.CloudBadge at line 52. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 22:37:53 +08:00' --until='2026-10-18 22:37:53 +08:00' --full-history --no-merges -- web/src/components/CloudBadge.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 31 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×50
  • FileTooLong: components/SettingsView.tsx web/src/components/SettingsView.tsx — FileTooLong — 4408 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3908 over it, 8.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: app/store.ts web/src/app/store.ts — FileTooLong — 2167 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1667 over it, 4.33× 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: tui/update.go internal/tui/update.go — FileTooLong — 1717 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: Model (21-2330). The bar is 500 significant lines; this is 1217 over it, 3.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: product/ChatInput.tsx packages/jcode-ui/src/product/ChatInput.tsx — FileTooLong — 1681 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: ChatInput (306-1890). The bar is 500 significant lines; this is 1181 over it, 3.36× 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: command/interactive.go internal/command/interactive.go — FileTooLong — 1413 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 913 over it, 2.83× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: session/session.go internal/session/session.go — FileTooLong — 1288 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 788 over it, 2.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: analysis/toolsearch_report.py agent-eval/analysis/toolsearch_report.py — FileTooLong — 1252 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 752 over it, 2.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: jcode-computerd/main.swift cmd/jcode-computerd/main.swift — FileTooLong — 1248 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 748 over it, 2.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: suite/toolsearch_campaign.py agent-eval/suite/toolsearch_campaign.py — FileTooLong — 1086 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 586 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: components/RemoteConnectWizard.tsx web/src/components/RemoteConnectWizard.tsx — FileTooLong — 1012 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 512 over it, 2.02× 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 — 1011 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 511 over it, 2.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: components/AutomationsView.tsx web/src/components/AutomationsView.tsx — FileTooLong — 1007 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 507 over it, 2.01× 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: web/providers.go internal/web/providers.go — FileTooLong — 941 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: Server (8 blocks, 250-1449). The bar is 500 significant lines; this is 441 over it, 1.88× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: components/Sidebar.tsx web/src/components/Sidebar.tsx — FileTooLong — 924 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: Sidebar (107-1025). The bar is 500 significant lines; this is 424 over it, 1.85× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: command/web.go internal/command/web.go — FileTooLong — 910 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: runWebServer (253-1179). The bar is 500 significant lines; this is 410 over it, 1.82× 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: handler/web.go internal/handler/web.go — FileTooLong — 898 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 398 over it, 1.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: command/acp.go internal/command/acp.go — FileTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: acpAgent (18 blocks, 195-1416). The bar is 500 significant lines; this is 389 over it, 1.78× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: suite/orchestrate.py agent-eval/suite/orchestrate.py — FileTooLong — 882 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 382 over it, 1.76× 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: suite/web_toolsearch_orchestrate.py agent-eval/suite/web_toolsearch_orchestrate.py — FileTooLong — 862 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 362 over it, 1.72× 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: js/jui.js site/public/showcase-projects/ui-kit/js/jui.js — FileTooLong — 800 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 300 over it, 1.60× 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: settings/ProviderAuthSection.tsx web/src/components/settings/ProviderAuthSection.tsx — FileTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: ProviderAuthSection (250-936). The bar is 500 significant lines; this is 283 over it, 1.57× 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: handler/acp.go internal/handler/acp.go — FileTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 280 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: lib/api.ts web/src/lib/api.ts — FileTooLong — 778 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: api (96-707). The bar is 500 significant lines; this is 278 over it, 1.56× 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: model/chatmodel.go internal/model/chatmodel.go — FileTooLong — 769 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 269 over it, 1.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: lib/types.ts web/src/lib/types.ts — FileTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 247 over it, 1.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 25 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×39
  • Swallowed exception (empty catch) web/src/App.tsx:575 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/apiBase.ts:50 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/apiBase.ts:66 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/authToken.ts:26 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/providerCatalogCache.ts:53 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/providerCatalogCache.ts:66 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/toolInfo.ts:34 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/useTheme.ts:130 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/useTheme.ts:176 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/ws.ts:235 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/ws.ts:305 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/components/AutomationsView.tsx:838 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/components/AutomationsView.tsx:877 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/components/AutomationsView.tsx:881 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/components/AutomationsView.tsx:885 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/components/CloudBadge.tsx:115 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/components/CloudSyncToggle.tsx:65 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/components/RemoteConnectWizard.tsx:210 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/components/RemoteConnectWizard.tsx:380 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/components/RemoteConnectWizard.tsx:383 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/components/SettingsView.tsx:372 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/components/SettingsView.tsx:395 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/components/SettingsView.tsx:427 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) web/src/components/SettingsView.tsx:544 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/components/SettingsView.tsx:1995 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×24
  • Duplicated block (8 lines × 2) internal/cloud/pairing_inbox.go:139 — internal/cloud/pairing_inbox.go:139-146 | internal/cloud/pairing_inbox.go:152-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) internal/command/acp.go:735 — internal/command/acp.go:735-742 | internal/command/interactive.go:1567-1574 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/interactive.go:1567` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/command/provider_runtime_verifier.go:19 — internal/command/provider_runtime_verifier.go:19-26 | internal/command/provider_runtime_verifier.go:33-40 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/provider_runtime_verifier.go:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/memory/filelock_windows.go:15 — internal/memory/filelock_windows.go:15-22 | internal/tools/ssh_known_hosts_lock_windows.go:15-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/providerauth/codex.go:186 — internal/providerauth/codex.go:186-193 | internal/providerauth/xai.go:229-236 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/providerauth/codex.go:186` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/providerauth/copilot.go:49 — internal/providerauth/copilot.go:49-56 | internal/providerauth/xai.go:53-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/providerauth/copilot.go:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/providerauth/manager.go:532 — internal/providerauth/manager.go:532-539 | internal/providerauth/manager.go:549-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/runner/runner.go:639 — internal/runner/runner.go:639-646 | internal/tools/subagent.go:522-529 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runner/runner.go:639` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/session/provider_tool_operation.go:261 — internal/session/provider_tool_operation.go:261-268 | internal/session/session.go:2122-2129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/session/provider_tool_operation.go:261` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/tools/read.go:77 — internal/tools/read.go:77-84 | internal/tools/write.go:54-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) internal/web/artifacts.go:169 — internal/web/artifacts.go:169-176 | internal/web/artifacts_desktop.go:27-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/artifacts.go:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/web/browser.go:86 — internal/web/browser.go:86-93 | internal/web/computer.go:164-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) internal/web/remote.go:298 — internal/web/remote.go:298-305 | internal/web/remote.go:341-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) internal/web/sessions.go:343 — internal/web/sessions.go:343-350 | internal/web/sessions.go:362-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/web/usage.go:56 — internal/web/usage.go:56-63 | internal/web/usage.go:149-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/usage.go:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/web/activation.go:153 — internal/web/activation.go:153-160 | internal/web/sessions.go:570-577 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/agent/turn_budget.go:269 — internal/agent/turn_budget.go:269-276 | internal/model/chatmodel.go:1030-1037 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) internal/automation/filelock_windows.go:54 — internal/automation/filelock_windows.go:54-61 | internal/computer/screenshot_filelock_windows.go:31-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) internal/providerauth/filelock_unix.go:39 — internal/providerauth/filelock_unix.go:39-46 | internal/session/sync_dir_unix.go:7-14 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) internal/tools/edit.go:187 — internal/tools/edit.go:187-195 | internal/tools/edit.go:493-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/tui/pickers.go:294 — internal/tui/pickers.go:294-301 | internal/tui/pickers.go:383-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) internal/providerauth/codex.go:195 — internal/providerauth/codex.go:195-202 | internal/providerauth/xai.go:238-245 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/providerauth/codex.go:195` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) internal/web/memory.go:318 — internal/web/memory.go:318-325 | internal/web/memory.go:395-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/memory.go:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) cmd/jcode-computerd/WindowCaptureHelper.swift:84 — cmd/jcode-computerd/WindowCaptureHelper.swift:84-91 | cmd/jcode-computerd/WindowCaptureHelper.swift:149-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/jcode-computerd/WindowCaptureHelper.swift:84` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×22
  • Animation without a prefers-reduced-motion guard agent-eval/showcase/projects/fe_pricing_calculator/index.html:95 — `input[type="range"]::-webkit-slider-thumb` moves (`transition: transform 0.12s 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 agent-eval/showcase/projects/fe_pricing_calculator/index.html:169 — `.slider-toggle::before` moves (`transition: transform 0.2s 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 agent-eval/showcase/projects/fe_todo_app/index.html:78 — `#add-btn` moves (`transition: background 0.2s, transform 0.1s`) 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 design/provider-redesign.html:324 — `.spin` moves (`animation: rot .7s 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 design/workflow-progress.html:308 — `.wf-foot .elapsed .live-dot` moves (`animation: pulse-dot 1.2s var(--ease-out) 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 desktop/splash/index.html:72 — `.mark` moves (`animation: float 3.2s ease-in-out 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 desktop/splash/index.html:98 — `.spinner` moves (`animation: spin 0.8s 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 internal-doc/prototypes/image-generation-motion/01-pixel-shutter.html:215 — `.image-card[data-state="saving"] .pixel` moves (`animation-name: pixel-save`) 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 internal-doc/prototypes/image-generation-motion/02-film-slices.html:258 — `.generated-card[data-state="saving"] .slice` moves (`animation-name: film-save`) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:272 — `.media-card` moves (`transition: width 320ms var(--ease-lock), aspect-ratio 320ms var(--ease-lock), border-radius 320ms var(--ease-lock)`) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:311 — `.signal-dot` moves (`animation: signal-echo 3.6s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:316 — `.media-card[data-state="saving"] .signal-dot` moves (`animation: signal-settle 2.4s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:324 — `.focus-rig` moves (`animation: focus-hunt 4.8s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:339 — `.media-card[data-state="saving"] .focus-rig` moves (`animation: focus-lock 2.4s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:411 — `.media-card[data-state="saving"] .corner::after` moves (`animation: lock-point 2.4s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:426 — `.axis.horizontal` moves (`animation: axis-x 3.1s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:433 — `.axis.vertical` moves (`animation: axis-y 3.1s var(--ease-lock) infinite 160ms`) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:438 — `.media-card[data-state="saving"] .axis` moves (`animation: axis-lock 2.4s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:469 — `.aperture-blade::before` moves (`animation: blade-breathe 2.8s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:474 — `.media-card[data-state="saving"] .aperture-blade::before` moves (`animation: blade-close 2.4s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:487 — `.aperture-core` moves (`animation: core-read 2.8s var(--ease-lock) 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 internal-doc/prototypes/image-generation-motion/03-focus-iris.html:492 — `.media-card[data-state="saving"] .aperture-core` moves (`animation: core-capture 2.4s var(--ease-lock) 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.
D3 · God Classes · MethodTooLong · ×18
  • MethodTooLong: Model.Update internal/tui/update.go:21 — MethodTooLong — Update runs 1702 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1602 over it, 17.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: acpAgent.buildAgentSession internal/command/acp.go:478 — MethodTooLong — buildAgentSession runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.handleUpdateProvider internal/web/providers.go:1008 — MethodTooLong — handleUpdateProvider runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.Start REDACTED:456 — MethodTooLong — Start runs 190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.handleListModels internal/web/models.go:104 — MethodTooLong — handleListModels runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DayNightSystem.constructor site/public/showcase-projects/city3d/js/daynight.js:111 — MethodTooLong — constructor runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.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.
  • MethodTooLong: Manager.runAgentTurn internal/team/manager.go:607 — MethodTooLong — runAgentTurn runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.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.
  • MethodTooLong: Server.handleProviderCatalog internal/web/providers.go:250 — MethodTooLong — handleProviderCatalog runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.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.
  • MethodTooLong: Server.submitMessageWithOptions internal/web/chat.go:198 — MethodTooLong — submitMessageWithOptions runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.handleSetupComplete internal/web/setup.go:261 — MethodTooLong — handleSetupComplete runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Connector.reconcileProviderConfigs internal/cloud/provider_sync.go:372 — MethodTooLong — reconcileProviderConfigs runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.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.
  • MethodTooLong: Model.handleModelInput internal/tui/pickers.go:15 — MethodTooLong — handleModelInput runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: acpAgent.Prompt internal/command/acp.go:936 — MethodTooLong — Prompt runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SetupModel.Update internal/tui/setup.go:168 — MethodTooLong — Update runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.handleDeleteSession internal/web/sessions.go:289 — MethodTooLong — handleDeleteSession runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: generateImageTool.InvokableRun internal/tools/generate_image.go:138 — MethodTooLong — InvokableRun runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.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.
  • MethodTooLong: interactiveState.createAgentWithModeCatalog internal/command/interactive.go:329 — MethodTooLong — createAgentWithModeCatalog runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.handleListProviders internal/web/providers.go:676 — MethodTooLong — handleListProviders runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D30 · Dependency Vulnerabilities · Medium CVE · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×17
  • Duplicated block (7 lines × 2) internal/cloud/artifact_share.go:241 — internal/cloud/artifact_share.go:241-247 | internal/cloud/artifact_share.go:264-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/artifact_share.go:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/cloud/artifact_share.go:240` calls `Set` and `internal/cloud/artifact_share.go:263` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) internal/command/acp.go:685 — internal/command/acp.go:685-691 | internal/command/web.go:740-746 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/acp.go:685` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/review/parse.go:38 — internal/review/parse.go:38-44 | REDACTED:236-242 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) internal/tui/update.go:191 — internal/tui/update.go:191-197 | internal/tui/update.go:219-225 — 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 (7 lines × 2) internal/web/agents.go:20 — internal/web/agents.go:20-26 | internal/web/git.go:18-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/agents.go:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/web/approval.go:125 — internal/web/approval.go:125-131 | internal/web/approval.go:136-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/approval.go:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/web/artifacts.go:84 — internal/web/artifacts.go:84-90 | internal/web/artifacts.go:406-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/artifacts.go:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/web/remote.go:512 — internal/web/remote.go:512-518 | internal/web/remote.go:560-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/remote.go:512` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/command/interactive.go:1022 — internal/command/interactive.go:1022-1028 | internal/command/interactive.go:2007-2013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/interactive.go:1022` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/tui/content_render.go:84 — internal/tui/content_render.go:84-90 | internal/tui/content_render.go:94-100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/content_render.go:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/imagegen/client.go:261 — internal/imagegen/client.go:261-267 | internal/imagegen/token_plan_multimodal.go:140-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/imagegen/token_plan_multimodal.go:148` calls `Set` and `internal/imagegen/client.go:268` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) internal/automation/filelock_unix.go:46 — internal/automation/filelock_unix.go:46-52 | internal/computer/screenshot_filelock_unix.go:28-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) internal/cloud/credentials.go:67 — internal/cloud/credentials.go:67-73 | internal/cloud/sync_store.go:43-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) internal/web/cloud_sync.go:80 — internal/web/cloud_sync.go:80-86 | internal/web/cloud_sync.go:126-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) agent-eval/analysis/analyze.py:140 — agent-eval/analysis/analyze.py:140-146 | agent-eval/analysis/analyze.py:195-201 — 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 (7 lines × 2) cmd/jcode-computerd/main.swift:1467 — cmd/jcode-computerd/main.swift:1467-1473 | cmd/jcode-computerd/main.swift:1563-1569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/jcode-computerd/main.swift:1467` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) cmd/jcode-computerd/WindowCaptureHelper.swift:26 — cmd/jcode-computerd/WindowCaptureHelper.swift:26-32 | cmd/jcode-computerd/main.swift:2010-2016 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×15
  • Duplicated block (10 lines × 2) REDACTED:231 — REDACTED:231-240 | internal/browser/cdp.go:109-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) internal/command/acp.go:433 — internal/command/acp.go:433-442 | internal/command/acp.go:1362-1371 — 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 (10 lines × 2) internal/imagegen/client.go:303 — internal/imagegen/client.go:303-312 | internal/imagegen/token_plan_multimodal.go:164-173 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/imagegen/client.go:303` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) REDACTED:604 — REDACTED:604-613 | REDACTED:617-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:604` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/team/manager.go:723 — internal/team/manager.go:723-732 | internal/team/manager.go:756-765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/team/manager.go:723` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/tools/docker_exec.go:421 — internal/tools/docker_exec.go:421-430 | internal/tools/env.go:609-618 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/docker_exec.go:421` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/web/cloud.go:101 — internal/web/cloud.go:101-110 | internal/web/cloud_sync.go:102-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/cloud.go:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) internal/web/models.go:813 — internal/web/models.go:813-822 | internal/web/models.go:959-969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/models.go:813` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/web/setup.go:174 — internal/web/setup.go:174-183 | internal/web/setup.go:306-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/setup.go:174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/model/chatmodel.go:423 — internal/model/chatmodel.go:423-432 | internal/model/responses.go:104-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) internal/model/responses.go:138 — internal/model/responses.go:138-147 | internal/providertools/manifest.go:517-526 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) internal/tools/todo.go:73 — internal/tools/todo.go:73-82 | internal/tools/todo_enhanced.go:266-275 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/providerauth/copilot.go:33 — internal/providerauth/copilot.go:33-42 | internal/providerauth/xai.go:37-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/providerauth/copilot.go:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/tui/browser_command.go:17 — internal/tui/browser_command.go:17-26 | internal/tui/computer_command.go:21-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/browser_command.go:17` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/tui/input_views.go:455 — internal/tui/input_views.go:455-464 | internal/tui/input_views.go:500-509 — 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.
D3 · God Classes · ClassTooLong · ×14
  • ClassTooLong: ChatInput packages/jcode-ui/src/product/ChatInput.tsx:1 — ClassTooLong — 1285 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 885 over it, 3.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: interactiveState internal/command/interactive.go:51 — ClassTooLong — 829 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods, 33 blocks, lines 51-1387. The bar is 400 significant lines; this is 429 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: acpAgent internal/command/acp.go:195 — ClassTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods, 18 blocks, lines 195-1416. The bar is 400 significant lines; this is 312 over it, 1.78× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Sidebar web/src/components/Sidebar.tsx:1 — ClassTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 296 over it, 1.74× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RemoteConnectWizard web/src/components/RemoteConnectWizard.tsx:1 — ClassTooLong — 600 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 200 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CloudTab web/src/components/settings/CloudTab.tsx:1 — ClassTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 188 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ProviderAuthSection web/src/components/settings/ProviderAuthSection.tsx:1 — ClassTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 180 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Connector internal/cloud/connector.go:100 — ClassTooLong — 559 significant lines (blank, comment-only and punctuation-only lines excluded), 79 methods, 41 blocks, lines 100-1173. The bar is 400 significant lines; this is 159 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Manager internal/team/manager.go:97 — ClassTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods, 28 blocks, lines 97-977. The bar is 400 significant lines; this is 152 over it, 1.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: api web/src/lib/api.ts:1 — ClassTooLong — 483 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 83 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Recorder internal/session/session.go:630 — ClassTooLong — 457 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods, 40 blocks, lines 630-1614. The bar is 400 significant lines; this is 57 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ACPHandler internal/handler/acp.go:25 — ClassTooLong — 444 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods, 27 blocks, lines 25-1162. The bar is 400 significant lines; this is 44 over it, 1.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WebHandler internal/handler/web.go:545 — ClassTooLong — 435 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods, 30 blocks, lines 545-1317. The bar is 400 significant lines; this is 35 over it, 1.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Session internal/computer/session.go:21 — ClassTooLong — 406 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods, 23 blocks, lines 21-872. The bar is 400 significant lines; this is 6 over it, 1.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×13
  • Duplicated block (9 lines × 2) internal/agent/hook_middleware.go:68 — internal/agent/hook_middleware.go:68-76 | internal/agent/hook_middleware.go:129-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agent/hook_middleware.go:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/agent/middleware.go:47 — internal/agent/middleware.go:47-55 | internal/tools/subagent.go:157-165 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agent/middleware.go:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) internal/automation/filelock_unix.go:19 — internal/automation/filelock_unix.go:19-27 | internal/memory/filelock_unix.go:17-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/automation/filelock_unix.go:19` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/cloud/connector.go:1035 — internal/cloud/connector.go:1035-1043 | internal/cloud/connector.go:1095-1103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/connector.go:1035` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/cloud/history_sync.go:236 — internal/cloud/history_sync.go:236-244 | internal/session/session.go:1928-1936 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/history_sync.go:236` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/session/security_dispatch.go:47 — internal/session/security_dispatch.go:47-55 | internal/session/security_dispatch.go:86-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/session/security_dispatch.go:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) REDACTED:44 — REDACTED:44-52 | internal/web/project.go:32-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/tui/update.go:1515 — internal/tui/update.go:1515-1523 | internal/tui/update.go:1557-1565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) REDACTED:306 — REDACTED:306-314 | internal/browser/cdp.go:205-213 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `c *bridgeConn) setHandler(tabID` in one and `c *wsCDP) setHandler(sessionID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) internal/web/remote.go:483 — internal/web/remote.go:483-494 | internal/web/remote.go:534-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/remote.go:483` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/tui/tui.go:311 — internal/tui/tui.go:311-319 | internal/tui/tui.go:325-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/tui/tui.go:308` calls `SetFilteringEnabled` and `internal/tui/tui.go:322` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) internal/tui/browser_command.go:34 — internal/tui/browser_command.go:34-42 | internal/tui/computer_command.go:38-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/browser_command.go:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) internal/command/interactive.go:981 — internal/command/interactive.go:981-989 | internal/command/interactive.go:2036-2044 — 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.
R4 · Test Coverage · No test reaches this file · ×13
  • No test reaches this file web/src/App.tsx: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 extension/background.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/components/ChatView.tsx: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 packages/jcode-ui-core/src/runtime/agui.selftest.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/components/TerminalPanel.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/components/CommandPalette.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/components/ComputerShotPiP.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/components/UpdateBanner.tsx: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 packages/jcode-ui/scripts/smoke-markdown.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 web/src/components/AuthGate.tsx: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 packages/jcode-ui/scripts/generate-compat-css.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 web/src/main.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/components/ProjectHeader.tsx: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.
AC3 · Page structure · Page without a main landmark · ×11
  • Page without a main landmark agent-eval/report/report.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark agent-eval/showcase/projects/fe_analytics_dashboard/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark agent-eval/showcase/projects/fe_canvas_particles/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark agent-eval/showcase/projects/fe_svg_dataviz/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark agent-eval/showcase/projects/fe_todo_app/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark design/goal-banner-composer.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark design/provider-redesign.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark design/running-thinking-indicator.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark design/workflow-progress.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark extension/popup/popup.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark web/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D3 · God Classes · TooManyMethods · ×10
  • TooManyMethods: Server REDACTED:41 — TooManyMethods — 260 methods, declared across 42 files: web/engine.go (27), web/models.go (13), web/artifacts.go (12), web/mcp.go (12), +38 more file(s). The bar is 30 methods; this is 230 over it, 8.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Model internal/tui/tui.go:34 — TooManyMethods — 120 methods, declared across 20 files: tui/input_views.go (20), tui/content_render.go (15), tui/pickers.go (14), tui/subagent_state.go (8), +16 more file(s). The bar is 30 methods; this is 90 over it, 4.00× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Connector internal/cloud/connector.go:100 — TooManyMethods — 79 methods, declared across 8 files: cloud/connector.go (40), cloud/provider_sync.go (11), cloud/pairing_inbox.go (10), cloud/account_settings.go (7), +4 more file(s). The bar is 30 methods; this is 49 over it, 2.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Manager internal/providerauth/manager.go:64 — TooManyMethods — 51 methods, declared across 7 files: providerauth/manager.go (28), providerauth/copilot.go (7), providerauth/codex.go (4), providerauth/http.go (4), +3 more file(s). The bar is 30 methods; this is 21 over it, 1.70× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Recorder internal/session/session.go:630 — TooManyMethods — 47 methods, declared across 4 files: session/session.go (40), session/security_dispatch.go (3), session/tool_overrides.go (3), session/provider_tool_operation.go (1). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Env internal/tools/env.go:30 — TooManyMethods — 41 methods, declared across 18 files: tools/env.go (15), tools/automation_tool.go (4), tools/goal.go (3), tools/browser.go (2), +14 more file(s). The bar is 30 methods; this is 11 over it, 1.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: interactiveState internal/command/interactive.go:51 — TooManyMethods — 34 methods, declared across 2 files: command/interactive.go (32), command/channel.go (2). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Session internal/browser/session.go:21 — TooManyMethods — 33 methods, declared across 2 files: browser/session.go (21), browser/actions.go (12). The bar is 30 methods; this is 3 over it, 1.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ApprovalState internal/runner/approval.go:28 — TooManyMethods — 33 methods, declared across 2 files: runner/approval.go (28), runner/review.go (5). The bar is 30 methods; this is 3 over it, 1.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Client internal/cloud/client.go:86 — TooManyMethods — 31 methods, declared across 5 files: cloud/client.go (10), cloud/desktop_config_client.go (9), cloud/relay.go (6), cloud/pairings.go (4), +1 more file(s). The bar is 30 methods; this is 1 over it, 1.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×9
  • Modal dialog does not manage focus packages/jcode-ui/src/components/Attachment.tsx:123 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus packages/jcode-ui/src/product/ChatInput.tsx:2022 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus packages/jcode-ui/src/product/GoalBanner.tsx:316 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/ArtifactsPanel.tsx:305 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/ArtifactsPanel.tsx:375 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/AutomationsView.tsx:516 — This <form role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/DesktopTitlebar.tsx:244 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/RemoteConnectWizard.tsx:447 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/src/components/Sidebar.tsx:795 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×9
  • Edited copy of a member (13 corresponding lines) internal/tools/docker_exec.go:222 — internal/tools/docker_exec.go:222-234 | internal/tools/env.go:727-741 — These two members are one piece of code written twice and then edited apart: 13 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 (13 corresponding lines) internal/web/cloud_login.go:345 — internal/web/cloud_login.go:345-357 | internal/web/cloud_login.go:361-373 — These two members are one piece of code written twice and then edited apart: 13 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 (13 corresponding lines) internal/web/approval.go:15 — internal/web/approval.go:15-27 | internal/web/approval.go:30-42 — These two members are one piece of code written twice and then edited apart: 13 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 (13 corresponding lines) internal/providerauth/http.go:23 — internal/providerauth/http.go:23-37 | internal/providerauth/http.go:44-56 — These two members are one piece of code written twice and then edited apart: 13 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 (13 corresponding lines) internal/command/provider_runtime_verifier.go:18 — internal/command/provider_runtime_verifier.go:18-30 | internal/command/provider_runtime_verifier.go:32-44 — These two members are one piece of code written twice and then edited apart: 13 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 (13 corresponding lines) internal/tui/input_layout.go:110 — internal/tui/input_layout.go:110-123 | internal/tui/input_layout.go:126-138 — These two members are one piece of code written twice and then edited apart: 13 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 (13 corresponding lines) internal/web/memory.go:53 — internal/web/memory.go:53-65 | internal/web/memory.go:82-95 — These two members are one piece of code written twice and then edited apart: 13 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 (13 corresponding lines) internal/cloud/desktop_config_client.go:87 — internal/cloud/desktop_config_client.go:87-99 | internal/cloud/pairings.go:32-44 — These two members are one piece of code written twice and then edited apart: 13 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 (13 corresponding lines) REDACTED:278 — REDACTED:278-291 | REDACTED:158-170 — These two members are one piece of code written twice and then edited apart: 13 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 · Duplicated block (6 lines × 2) · ×9
  • Duplicated block (6 lines × 2) internal/model/chatmodel.go:204 — internal/model/chatmodel.go:204-209 | internal/model/chatmodel.go:228-233 — 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 (6 lines × 2) internal/tools/edit.go:234 — internal/tools/edit.go:234-239 | internal/tools/edit.go:548-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) internal/automation/filelock_unix.go:32 — internal/automation/filelock_unix.go:32-37 | internal/memory/filelock_unix.go:37-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/automation/filelock_unix.go:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/command/mcp.go:158 — internal/command/mcp.go:158-163 | internal/command/mcp.go:217-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (6 lines × 2) internal/web/approval.go:16 — internal/web/approval.go:16-21 | internal/web/approval.go:31-36 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) internal/flow/run.go:204 — internal/flow/run.go:204-209 | internal/flow/run.go:218-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/flow/run.go:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/web/providers.go:847 — internal/web/providers.go:847-852 | internal/web/setup.go:273-278 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/providers.go:847` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/web/providers.go:853` calls `TrimSpace` and `internal/web/setup.go:279` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) internal/command/interactive.go:568 — internal/command/interactive.go:568-573 | internal/command/interactive.go:599-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/interactive.go:568` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/tui/activity_group.go:430 — internal/tui/activity_group.go:430-435 | internal/tui/activity_group.go:445-450 — 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.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×8
  • Edited copy of a member (11 corresponding lines) internal/cloud/pairing_inbox.go:138 — internal/cloud/pairing_inbox.go:138-148 | internal/cloud/pairing_inbox.go:151-164 — These two members are one piece of code written twice and then edited apart: 11 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 (11 corresponding lines) cmd/jcode-computerd/WindowCaptureHelper.swift:65 — cmd/jcode-computerd/WindowCaptureHelper.swift:65-75 | cmd/jcode-computerd/main.swift:971-982 — These two members are one piece of code written twice and then edited apart: 11 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 (11 corresponding lines) internal/agent/toolsearch_disclosure.go:82 — internal/agent/toolsearch_disclosure.go:82-97 | internal/agent/toolsearch_disclosure.go:145-155 — These two members are one piece of code written twice and then edited apart: 11 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 (11 corresponding lines) internal/cloud/config_sync_crypto.go:56 — internal/cloud/config_sync_crypto.go:56-66 | internal/cloud/crypto.go:82-92 — These two members are one piece of code written twice and then edited apart: 11 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 (11 corresponding lines) desktop/src-tauri/src/desktop_apps/linux.rs:198 — desktop/src-tauri/src/desktop_apps/linux.rs:198-212 | desktop/src-tauri/src/desktop_apps/windows.rs:148-158 — These two members are one piece of code written twice and then edited apart: 11 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 (11 corresponding lines) desktop/src-tauri/src/main.rs:36 — desktop/src-tauri/src/main.rs:36-46 | desktop/src-tauri/src/main.rs:52-62 — These two members are one piece of code written twice and then edited apart: 11 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 (11 corresponding lines) internal/cloud/backoff.go:49 — internal/cloud/backoff.go:49-59 | REDACTED:389-401 — These two members are one piece of code written twice and then edited apart: 11 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 (11 corresponding lines) internal/memory/pipeline/phase1.go:403 — internal/memory/pipeline/phase1.go:403-414 | internal/memory/memory.go:77-87 — These two members are one piece of code written twice and then edited apart: 11 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.
AC1 · Text alternatives · <canvas> without a text alternative · ×7
  • <canvas> without a text alternative agent-eval/showcase/projects/fe_canvas_particles/index.html:61 — 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 packages/jcode-ui/src/voice/VoiceVisualizer.tsx:194 — 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 site/public/showcase-projects/city3d/js/textures.js:10 — 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 site/public/showcase-projects/game/js/render.js:16 — 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 site/public/showcase-projects/webgpu-cnn/js/lab.js:327 — 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 site/public/showcase-projects/webgpu-cnn/js/lab.js:352 — 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 site/public/showcase-projects/webgpu-cnn/js/lab.js:360 — 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.
AC4 · Keyboard semantics · Anchor without href · ×7
  • Anchor without href agent-eval/showcase/projects/fe_analytics_dashboard/index.html:275 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href agent-eval/showcase/projects/fe_analytics_dashboard/index.html:279 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href agent-eval/showcase/projects/fe_analytics_dashboard/index.html:283 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href agent-eval/showcase/projects/fe_analytics_dashboard/index.html:289 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href agent-eval/showcase/projects/fe_analytics_dashboard/index.html:294 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href agent-eval/showcase/projects/fe_analytics_dashboard/index.html:298 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href agent-eval/showcase/projects/fe_analytics_dashboard/index.html:304 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
D3 · God Classes · TooManyFields · ×7
  • TooManyFields: Model internal/tui/tui.go:34 — TooManyFields — 130 stored fields beside 120 methods. The bar is 30 stored fields; this is 100 over it, 4.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Entry internal/session/session.go:263 — TooManyFields — 79 stored fields. The bar is 30 stored fields; this is 49 over it, 2.63× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Server REDACTED:41 — TooManyFields — 59 stored fields beside 260 methods. The bar is 30 stored fields; this is 29 over it, 1.97× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ServerConfig REDACTED:278 — TooManyFields — 51 stored fields. The bar is 30 stored fields; this is 21 over it, 1.70× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: interactiveState internal/command/interactive.go:51 — TooManyFields — 46 stored fields beside 34 methods. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Engine internal/web/engine.go:40 — TooManyFields — 37 stored fields beside 14 methods. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Config internal/config/config.go:425 — TooManyFields — 36 stored fields beside 21 methods. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×7
  • Edited copy of a member (12 corresponding lines) internal/cloud/config_sync_crypto.go:43 — internal/cloud/config_sync_crypto.go:43-54 | internal/cloud/crypto.go:406-417 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) internal/flow/run.go:201 — internal/flow/run.go:201-212 | internal/flow/run.go:215-226 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) internal/web/approval.go:86 — internal/web/approval.go:86-97 | internal/web/project.go:180-192 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) internal/web/cloud_config_sync.go:39 — internal/web/cloud_config_sync.go:39-51 | internal/web/remote.go:273-284 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) internal/browser/nativehost.go:79 — internal/browser/nativehost.go:79-90 | internal/computer/proto.go:255-270 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) internal/web/session_changes.go:63 — internal/web/session_changes.go:63-74 | internal/web/session_draft_pr.go:58-71 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) internal/command/login.go:58 — internal/command/login.go:58-72 | internal/util/util.go:12-23 — These two members are one piece of code written twice and then edited apart: 12 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 (7 corresponding lines) · ×7
  • Edited copy of a member (7 corresponding lines) agent-eval/analysis/analyze.py:20 — agent-eval/analysis/analyze.py:20-26 | agent-eval/analysis/computer_report.py:28-36 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/cloud/config_sync_crypto.go:35 — internal/cloud/config_sync_crypto.go:35-41 | internal/cloud/crypto.go:193-199 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/agent/tool_plan.go:288 — internal/agent/tool_plan.go:288-294 | internal/agent/toolsearch_agent.go:124-133 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/cloud/account_settings.go:40 — internal/cloud/account_settings.go:40-46 | internal/cloud/desktop_config_client.go:65-71 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/session/security_dispatch.go:131 — internal/session/security_dispatch.go:131-137 | internal/web/mcp.go:232-238 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/team/manager.go:507 — internal/team/manager.go:507-513 | internal/tools/subagent_manager.go:271-277 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/tools/mcp_oauth.go:127 — internal/tools/mcp_oauth.go:127-133 | REDACTED:675-681 — These two members are one piece of code written twice and then edited apart: 7 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 · Duplicated block (11 lines × 2) · ×7
  • Duplicated block (11 lines × 2) internal/tui/update.go:244 — internal/tui/update.go:244-254 | internal/tui/update.go:318-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/update.go:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/web/artifacts.go:424 — internal/web/artifacts.go:424-434 | internal/web/artifacts.go:444-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/artifacts.go:424` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/web/artifacts.go:435` calls `Logger`, `Printf` and `internal/web/artifacts.go:455` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) internal/web/cloud_config_sync.go:91 — internal/web/cloud_config_sync.go:91-101 | internal/web/cloud_config_sync.go:116-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) internal/web/cloud_login.go:347 — internal/web/cloud_login.go:347-357 | internal/web/cloud_login.go:363-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/cloud_login.go:347` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/command/interactive.go:1530 — internal/command/interactive.go:1530-1540 | internal/command/web.go:506-516 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/interactive.go:1530` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) agent-eval/analysis/analyze.py:47 — agent-eval/analysis/analyze.py:47-57 | agent-eval/analysis/report.py:64-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) cmd/jcode-computerd/main.swift:1474 — cmd/jcode-computerd/main.swift:1474-1484 | cmd/jcode-computerd/main.swift:1510-1520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/jcode-computerd/main.swift:1474` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×7
  • Duplicated block (5 lines × 2) internal/command/interactive.go:2079 — internal/command/interactive.go:2079-2084 | internal/command/web.go:1356-1360 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) internal/handler/acp.go:751 — internal/handler/acp.go:751-755 | internal/handler/acp.go:838-842 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/handler/acp.go:751` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/tui/update.go:1651 — internal/tui/update.go:1651-1655 | internal/tui/update.go:1975-1979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/update.go:1651` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/tui/update.go:1980` calls `textLine`, `Focus` and `internal/tui/update.go:1656` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) internal/web/models.go:408 — internal/web/models.go:408-412 | internal/web/models.go:446-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) internal/artifact/service.go:333 — internal/artifact/service.go:333-337 | internal/session/session.go:2041-2045 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/artifact/service.go:333` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) agent-eval/suite/toolsearch_campaign.py:191 — agent-eval/suite/toolsearch_campaign.py:191-195 | agent-eval/suite/web_toolsearch_orchestrate.py:147-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) agent-eval/suite/session_extract.py:203 — agent-eval/suite/session_extract.py:203-207 | agent-eval/suite/web_toolsearch_orchestrate.py:131-135 — 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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.1 · ×6
  • Low contrast colour pair in CSS (3.1:1) agent-eval/showcase/projects/fe_todo_app/index.html:205 — `.task .delete:hover` sets color: #e53e3e on background-color: #fed7d7 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.1:1) design/goal-banner-composer.html:270 — `.mark::after` sets color: #FFFFFF on background-color: #FF5C33 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.1:1) design/goal-banner-composer.html:286 — `.legend-item .n` sets color: #FFFFFF on background-color: #FF5C33 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.1:1) design/provider-redesign.html:109 — `.btn-danger` sets color: #FFFFFF on background-color: #FF5C33 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.1:1) extension/popup/popup.html:20 — `.pill.on` sets color: #1f9d55 on background-color: #e6f6ec — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.1:1) extension/popup/popup.html:44 — `.msg.ok` sets color: #1f9d55 on background-color: #e6f6ec — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D2 · Cognitive Complexity · jcode_desktop · ×6
  • jcode_desktop::desktop_apps::linux::resolve_icon (cognitive 29) desktop/src-tauri/src/desktop_apps/linux.rs:622 — jcode_desktop::desktop_apps::linux::resolve_icon has cognitive complexity 29 (threshold 15). Drivers by points: loops 6 (17 pts), if/else 3 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 18). 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.
  • jcode_desktop::sidecar::start (cognitive 29) desktop/src-tauri/src/sidecar.rs:96 — jcode_desktop::sidecar::start has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 2 (3 pts), 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.
  • jcode_desktop::desktop_apps::linux::desktop_command (cognitive 20) desktop/src-tauri/src/desktop_apps/linux.rs:377 — jcode_desktop::desktop_apps::linux::desktop_command has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • jcode_desktop::desktop_apps::linux::read_desktop_entries (cognitive 17) desktop/src-tauri/src/desktop_apps/linux.rs:435 — jcode_desktop::desktop_apps::linux::read_desktop_entries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • jcode_desktop::desktop_apps::windows::installed_registry_applications (cognitive 17) desktop/src-tauri/src/desktop_apps/windows.rs:268 — jcode_desktop::desktop_apps::windows::installed_registry_applications has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), 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.
  • jcode_desktop::desktop_apps::windows::known_application_paths (cognitive 17) desktop/src-tauri/src/desktop_apps/windows.rs:319 — jcode_desktop::desktop_apps::windows::known_application_paths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 8). 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.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×6
  • Edited copy of a member (14 corresponding lines) internal/channel/ble/ble_cgo.go:33 — internal/channel/ble/ble_cgo.go:33-74 | script/poc/ble.go:13-29 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) internal/tools/mcp.go:340 — internal/tools/mcp.go:340-353 | internal/tools/mcp.go:355-370 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) internal/config/project.go:22 — internal/config/project.go:22-40 | internal/util/envinfo.go:73-86 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) internal/config/mcp_file.go:22 — internal/config/mcp_file.go:22-35 | internal/team/mailbox.go:138-154 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) internal/artifact/service.go:278 — internal/artifact/service.go:278-291 | internal/artifact/service.go:296-309 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) internal/cloud/account_settings.go:312 — internal/cloud/account_settings.go:312-325 | internal/cloud/provider_sync.go:569-584 — These two members are one piece of code written twice and then edited apart: 14 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 (17 corresponding lines) · ×6
  • Edited copy of a member (17 corresponding lines) cmd/jcode-computerd/main.swift:417 — cmd/jcode-computerd/main.swift:417-442 | cmd/jcode-computerd/main.swift:1322-1338 — These two members are one piece of code written twice and then edited apart: 17 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 (17 corresponding lines) agent-eval/analysis/toolsearch_report.py:385 — agent-eval/analysis/toolsearch_report.py:385-401 | agent-eval/suite/toolsearch_campaign.py:598-620 — These two members are one piece of code written twice and then edited apart: 17 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 (17 corresponding lines) internal/modelcatalog/modelcatalog.go:88 — internal/modelcatalog/modelcatalog.go:88-104 | internal/providerauth/models.go:115-132 — These two members are one piece of code written twice and then edited apart: 17 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 (17 corresponding lines) internal/tools/docker_exec.go:243 — internal/tools/docker_exec.go:243-259 | internal/tools/env.go:762-780 — These two members are one piece of code written twice and then edited apart: 17 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 (17 corresponding lines) internal/model/responses.go:399 — internal/model/responses.go:399-415 | internal/model/responses_parse.go:173-189 — These two members are one piece of code written twice and then edited apart: 17 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 (17 corresponding lines) internal/command/acp.go:1132 — internal/command/acp.go:1132-1148 | internal/command/acp.go:1240-1261 — These two members are one piece of code written twice and then edited apart: 17 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 (10 corresponding lines) · ×6
  • Edited copy of a member (10 corresponding lines) internal/cloud/history_sync.go:220 — internal/cloud/history_sync.go:220-229 | internal/review/session_cache.go:173-185 — 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.
  • Edited copy of a member (10 corresponding lines) cmd/jcode-computerd/main.swift:236 — cmd/jcode-computerd/main.swift:236-247 | cmd/jcode-computerd/main.swift:249-258 — 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.
  • Edited copy of a member (10 corresponding lines) internal/command/cloud.go:106 — internal/command/cloud.go:106-115 | internal/command/cloud.go:117-126 — 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.
  • Edited copy of a member (10 corresponding lines) internal/cloud/desktop_config_client.go:123 — internal/cloud/desktop_config_client.go:123-132 | internal/cloud/account_settings.go:48-58 — 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.
  • Edited copy of a member (10 corresponding lines) internal/memory/memory.go:186 — internal/memory/memory.go:186-195 | internal/tools/read.go:204-213 — 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.
  • Edited copy of a member (10 corresponding lines) internal/command/acp.go:213 — internal/command/acp.go:213-223 | internal/command/mcp.go:84-93 — 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 · Duplicated block (9 lines × 3) · ×6
  • Duplicated block (9 lines × 3) internal/web/channel.go:129 — internal/web/channel.go:129-137 | internal/web/mcp.go:531-539 | internal/web/skills.go:57-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/channel.go:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) internal/web/mcp.go:434 — internal/web/mcp.go:434-442 | internal/web/mcp.go:476-484 | internal/web/mcp.go:556-564 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/mcp.go:434` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/web/mcp.go:553` calls `cloneMCPServer` and `internal/web/mcp.go:474` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) internal/web/models.go:814 — internal/web/models.go:814-822 | internal/web/models.go:961-969 | internal/web/providers.go:1086-1095 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/models.go:814` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/web/models.go:810` calls `legacyEnabledCustomModels`, `discoverCustomModelMetadata` and `internal/web/providers.go:1083` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) internal/command/channel.go:75 — internal/command/channel.go:75-83 | internal/command/channel.go:103-111 | internal/command/channel.go:135-143 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/channel.go:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) internal/cloud/connector.go:1040 — internal/cloud/connector.go:1040-1048 | internal/cloud/connector.go:1100-1108 | internal/cloud/connector.go:1127-1135 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/connector.go:1040` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) internal/cloud/history_sync.go:87 — internal/cloud/history_sync.go:87-95 | internal/cloud/provider_sync.go:102-110 | internal/providerauth/store.go:211-219 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/history_sync.go:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×6
  • Duplicated block (13 lines × 2 locations) packages/jcode-ui-core/src/primitives/Composer.tsx:204 — packages/jcode-ui-core/src/primitives/Composer.tsx:204 · packages/jcode-ui/src/voice/SpeechInput.tsx:53 — 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 (13 lines × 2 locations) packages/jcode-ui/src/components/ThreadList.tsx:96 — packages/jcode-ui/src/components/ThreadList.tsx:96 · packages/jcode-ui/src/components/ThreadList.tsx:130 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
  • Duplicated block (13 lines × 2 locations) web/src/components/SettingsView.tsx:455 — web/src/components/SettingsView.tsx:455 · web/src/components/SettingsView.tsx:474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2 locations) web/src/components/SettingsView.tsx:2067 — web/src/components/SettingsView.tsx:2067 · web/src/components/SettingsView.tsx:2398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2 locations) web/src/components/SettingsView.tsx:2448 — web/src/components/SettingsView.tsx:2448 · web/src/components/SettingsView.tsx:2477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2 locations) web/src/components/SettingsView.tsx:4195 — web/src/components/SettingsView.tsx:4195 · web/src/components/SettingsView.tsx:4209 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
X2 · Cancellation propagation · Async function without AbortSignal · ×6
  • Async function without AbortSignal: requestBlob web/src/lib/api.ts:53 — `requestBlob` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: requestForm web/src/lib/api.ts:66 — `requestForm` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: requestVoid web/src/lib/api.ts:83 — `requestVoid` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: artifactDownloadAvailable web/src/lib/api.ts:229 — `artifactDownloadAvailable` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: workspaceFileDownloadAvailable web/src/lib/api.ts:242 — `workspaceFileDownloadAvailable` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: waitForHealth web/src/lib/apiBase.ts:58 — `waitForHealth` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/automation/filelock_unix.go:17 — internal/automation/filelock_unix.go:17-27 | internal/computer/screenshot_filelock_unix.go:16-26 | internal/config/config_filelock_unix.go:13-23 | internal/memory/filelock_unix.go:15-25 | internal/session/security_filelock_unix.go:13-23 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/session/provider_tool_operation.go:135 — internal/session/provider_tool_operation.go:135-155 | internal/session/security_dispatch.go:109-127 | internal/session/session.go:1027-1047 | internal/session/session.go:1222-1240 | internal/session/session.go:1275-1374 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/tui/channel_panel.go:99 — internal/tui/channel_panel.go:99-138 | internal/tui/manage_models.go:199-249 | internal/tui/pickers.go:270-320 | internal/tui/pickers.go:359-409 | internal/tui/theme_picker.go:136-176 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/web/cloud.go:43 — internal/web/cloud.go:43-112 | internal/web/computer.go:217-253 | internal/web/dev_options.go:64-147 | internal/web/memory.go:263-307 | internal/web/tool_search.go:42-82 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/web/models.go:546 — internal/web/models.go:546-602 | internal/web/models.go:609-662 | internal/web/models.go:702-730 | internal/web/models.go:733-789 | internal/web/models.go:1003-1036 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×5
  • Edited copy of a member (27 corresponding lines) internal/providerauth/http.go:73 — internal/providerauth/http.go:73-103 | internal/providerauth/models.go:87-113 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) internal/agent/hook_middleware.go:66 — internal/agent/hook_middleware.go:66-92 | internal/agent/hook_middleware.go:123-154 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) cmd/jcode-computerd/main.swift:1457 — cmd/jcode-computerd/main.swift:1457-1484 | cmd/jcode-computerd/main.swift:1494-1520 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) internal/session/provider_tool_operation.go:96 — internal/session/provider_tool_operation.go:96-122 | internal/session/session.go:168-196 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) internal/browser/session.go:332 — internal/browser/session.go:332-358 | internal/browser/session.go:362-390 — These two members are one piece of code written twice and then edited apart: 27 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 (15 corresponding lines) · ×5
  • Edited copy of a member (15 corresponding lines) internal/providerauth/filelock_unix.go:13 — internal/providerauth/filelock_unix.go:13-27 | internal/tools/ssh_known_hosts_lock_unix.go:13-27 — These two members are one piece of code written twice and then edited apart: 15 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 (15 corresponding lines) internal/session/provider_tool_operation.go:254 — internal/session/provider_tool_operation.go:254-268 | internal/session/session.go:2115-2129 — These two members are one piece of code written twice and then edited apart: 15 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 (15 corresponding lines) internal/browser/nativehost.go:63 — internal/browser/nativehost.go:63-77 | internal/computer/proto.go:274-288 — These two members are one piece of code written twice and then edited apart: 15 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 (15 corresponding lines) internal/tui/input_views.go:430 — internal/tui/input_views.go:430-445 | internal/tui/input_views.go:479-493 — These two members are one piece of code written twice and then edited apart: 15 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 (15 corresponding lines) internal/model/chatmodel.go:1156 — internal/model/chatmodel.go:1156-1170 | internal/model/chatmodel.go:1172-1186 — These two members are one piece of code written twice and then edited apart: 15 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 · Duplicated block (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) internal/artifact/managed.go:560 — internal/artifact/managed.go:560-573 | internal/imagegen/client.go:761-774 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/artifact/managed.go:560` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) internal/channel/ble/ble_cgo.go:33 — internal/channel/ble/ble_cgo.go:33-46 | script/poc/ble.go:16-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Check import visibility before settling on that home: `internal/channel/ble/ble_cgo.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (14 lines × 2) internal/cloud/provider_sync.go:109 — internal/cloud/provider_sync.go:109-122 | internal/tools/ssh_known_hosts.go:260-273 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/provider_sync.go:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) REDACTED:278 — REDACTED:278-291 | REDACTED:457-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:278` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (14 lines × 2) internal/web/mcp.go:454 — internal/web/mcp.go:454-467 | internal/web/mcp.go:538-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/mcp.go:454` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×5
  • Duplicated block (8 lines × 3) internal/cloud/credentials.go:153 — internal/cloud/credentials.go:153-163 | internal/cloud/sync_store.go:205-212 | internal/config/config.go:1287-1297 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/credentials.go:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 3) internal/web/agents.go:59 — internal/web/agents.go:59-66 | internal/web/models.go:370-377 | internal/web/project.go:202-209 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/agents.go:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) internal/web/models.go:547 — internal/web/models.go:547-554 | internal/web/models.go:610-617 | internal/web/models.go:703-710 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) internal/web/models.go:707 — internal/web/models.go:707-714 | internal/web/models.go:739-746 | internal/web/models.go:1009-1016 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) internal/tui/tui.go:297 — internal/tui/tui.go:297-304 | internal/tui/tui.go:312-319 | internal/tui/tui.go:326-333 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/tui/tui.go:308` calls `SetFilteringEnabled` and `internal/tui/tui.go:322` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: Env (LCOM4 22) internal/tools/env.go:30 — Env's methods fall into 22 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 22 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Server (LCOM4 10) REDACTED:41 — Server's methods fall into 10 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 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Config (LCOM4 8) internal/config/config.go:425 — Config's methods fall into 8 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 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FuncSink (LCOM4 6) internal/flow/types.go:121 — FuncSink's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: acpAgent (LCOM4 5) internal/command/acp.go:195 — acpAgent'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.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×5
  • Duplicated block (12 lines × 2 locations) packages/jcode-ui-core/src/primitives/Thread.tsx:284 — packages/jcode-ui-core/src/primitives/Thread.tsx:284 · packages/jcode-ui-core/src/primitives/Thread.tsx:318 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (12 lines × 2 locations) packages/jcode-ui-core/src/timeline/turnGroups.ts:125 — packages/jcode-ui-core/src/timeline/turnGroups.ts:125 · packages/jcode-ui-core/src/timeline/turnGroups.ts:138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2 locations) packages/jcode-ui/src/lib/markdown.ts:64 — packages/jcode-ui/src/lib/markdown.ts:64 · packages/jcode-ui/src/plugins/mermaid.ts: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 (12 lines × 2 locations) packages/jcode-ui/src/product/ChatInput.tsx:2016 — packages/jcode-ui/src/product/ChatInput.tsx:2016 · packages/jcode-ui/src/product/GoalBanner.tsx:310 — 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 (12 lines × 2 locations) packages/jcode-ui/src/toolRenderers/generic.tsx:35 — packages/jcode-ui/src/toolRenderers/generic.tsx:35 · packages/jcode-ui/src/toolRenderers/generic.tsx:48 — 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.
X2 · Cancellation propagation · Function without context.Context · ×5
  • Function without context.Context: agentSocketSigners internal/tools/ssh_auth.go:60 — `agentSocketSigners` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: sign internal/tools/ssh_auth.go:99 — `sign` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: FetchQRCode internal/pkg/weixin/api.go:131 — `FetchQRCode` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: SendText internal/pkg/weixin/api.go:244 — `SendText` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: runUpdate internal/command/update.go:26 — `runUpdate` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
D17 · Explicit Debt · TodoComment · ×4
  • TodoComment internal/tui/messages.go:122 — // Todo fields — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/tui/session_helper.go:52 — // Todo fields — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/command/acp.go:682 — // todo tools they only mutate session metadata, and the continuation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/cloud/events.go:42 — // todo list changed — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×4
  • Edited copy of a member (26 corresponding lines) internal/imagegen/client.go:445 — internal/imagegen/client.go:445-471 | internal/imagegen/token_plan_multimodal.go:206-231 — 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.
  • Edited copy of a member (26 corresponding lines) internal/tools/generate_image.go:111 — internal/tools/generate_image.go:111-136 | internal/tools/provider_managed_billable.go:120-147 — 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.
  • Edited copy of a member (26 corresponding lines) internal/agent/hook_middleware.go:95 — internal/agent/hook_middleware.go:95-120 | internal/agent/hook_middleware.go:160-189 — 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.
  • Edited copy of a member (26 corresponding lines) internal/computer/configmap.go:59 — internal/computer/configmap.go:59-90 | internal/computer/manager.go:242-267 — 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 (20 corresponding lines) · ×4
  • Edited copy of a member (20 corresponding lines) internal/command/automation.go:38 — internal/command/automation.go:38-66 | REDACTED:77-96 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) internal/command/cloud.go:274 — internal/command/cloud.go:274-293 | internal/command/cloud.go:327-346 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) internal/providerauth/manager.go:417 — internal/providerauth/manager.go:417-436 | internal/providerauth/manager.go:547-568 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) internal/tools/todo.go:85 — internal/tools/todo.go:85-104 | internal/tools/todo_enhanced.go:278-297 — These two members are one piece of code written twice and then edited apart: 20 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 (8 corresponding lines) · ×4
  • Edited copy of a member (8 corresponding lines) internal/web/approval.go:197 — internal/web/approval.go:197-206 | internal/web/approval.go:255-262 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) internal/util/envinfo.go:26 — internal/util/envinfo.go:26-34 | internal/util/envinfo.go:40-47 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) internal/tools/todo.go:279 — internal/tools/todo.go:279-286 | internal/tools/todo_enhanced.go:764-771 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) internal/tools/docker_exec.go:261 — internal/tools/docker_exec.go:261-268 | internal/tools/env.go:802-810 — These two members are one piece of code written twice and then edited apart: 8 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 · Duplicated block (19 lines × 2) · ×4
  • Duplicated block (19 lines × 2) internal/cloud/capabilities.go:214 — internal/cloud/capabilities.go:214-232 | internal/cloud/capabilities.go:288-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/capabilities.go:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) internal/imagegen/client.go:446 — internal/imagegen/client.go:446-464 | internal/imagegen/token_plan_multimodal.go:207-225 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (19 lines × 2) internal/review/parse.go:49 — internal/review/parse.go:49-67 | REDACTED:256-274 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/review/parse.go:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) internal/web/artifacts.go:170 — internal/web/artifacts.go:170-188 | internal/web/artifacts.go:347-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/artifacts.go:170` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) internal/runner/approval.go:584 — internal/runner/approval.go:584-596 | internal/runner/approval.go:840-852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/runner/approval.go:584` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) internal/web/session_draft_pr.go:123 — internal/web/session_draft_pr.go:123-135 | internal/web/session_draft_pr.go:317-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/session_draft_pr.go:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (13 lines × 2) internal/command/acp.go:609 — internal/command/acp.go:609-621 | internal/command/web.go:663-675 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/acp.go:609` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/tools/grep.go:422 — internal/tools/grep.go:422-436 | internal/tools/grep.go:463-475 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×4
  • Duplicated block (12 lines × 2) internal/cloud/provider_sync.go:466 — internal/cloud/provider_sync.go:466-477 | internal/cloud/provider_sync.go:505-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/provider_sync.go:466` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/cloud/provider_sync.go:465` calls `cloneProviderConfig` and `internal/cloud/provider_sync.go:504` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) internal/command/login.go:167 — internal/command/login.go:167-178 | internal/web/cloud_login.go:223-234 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/login.go:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/providerauth/filelock_unix.go:14 — internal/providerauth/filelock_unix.go:14-25 | internal/tools/ssh_known_hosts_lock_unix.go:14-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/web/providers.go:920 — internal/web/providers.go:920-931 | internal/web/setup.go:392-403 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/providers.go:920` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×4
  • Duplicated block (20 lines × 2 locations) packages/jcode-ui/src/product/remote.ts:7 — packages/jcode-ui/src/product/remote.ts:7 · web/src/lib/remote.ts:27 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (20 lines × 2 locations) packages/jcode-ui/src/toolRenderers/browserShot.tsx:11 — packages/jcode-ui/src/toolRenderers/browserShot.tsx:11 · packages/jcode-ui/src/toolRenderers/computerShot.tsx:14 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (20 lines × 2 locations) packages/jcode-ui/src/toolRenderers/team.tsx:141 — packages/jcode-ui/src/toolRenderers/team.tsx:141 · packages/jcode-ui/src/toolRenderers/team.tsx:216 — 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 (20 lines × 2 locations) web/src/components/SettingsView.tsx:760 — web/src/components/SettingsView.tsx:760 · web/src/components/SettingsView.tsx:2302 — 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 (16 lines × 2 locations) · ×4
  • Duplicated block (16 lines × 2 locations) packages/jcode-ui/src/components/Thread.tsx:261 — packages/jcode-ui/src/components/Thread.tsx:261 · web/src/components/ChatView.tsx:49 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (16 lines × 2 locations) packages/jcode-ui/src/product/BranchPicker.tsx:90 — packages/jcode-ui/src/product/BranchPicker.tsx:90 · packages/jcode-ui/src/product/WorkspacePicker.tsx:135 — 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 (16 lines × 2 locations) packages/jcode-ui/src/product/remote.ts:35 — packages/jcode-ui/src/product/remote.ts:35 · web/src/components/Sidebar.tsx:1135 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (16 lines × 2 locations) web/src/components/CloudBadge.tsx:124 — web/src/components/CloudBadge.tsx:124 · web/src/components/ThemeToggle.tsx:19 — 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 (15 lines × 2 locations) · ×4
  • Duplicated block (15 lines × 2 locations) packages/jcode-ui/src/components/Thread.tsx:152 — packages/jcode-ui/src/components/Thread.tsx:152 · packages/jcode-ui/src/components/Thread.tsx:172 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (15 lines × 2 locations) web/src/components/AuthGate.tsx:25 — web/src/components/AuthGate.tsx:25 · web/src/components/SetupView.tsx:201 — 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 (15 lines × 2 locations) web/src/components/CloudBadge.tsx:35 — web/src/components/CloudBadge.tsx:35 · web/src/components/settings/CloudTab.tsx:40 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (15 lines × 2 locations) web/src/components/SettingsView.tsx:4253 — web/src/components/SettingsView.tsx:4253 · web/src/components/SettingsView.tsx:4985 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
AC3 · Page structure · Heading level jumps from h1 to h3 · ×3
  • Heading level jumps from h1 to h3 design/workflow-progress.html:627 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 site/src/pages/ShowcaseProjectPage.tsx:67 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 site/src/pages/docs/DocPage.tsx:92 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure · Data table has no header cells · ×3
  • Data table has no header cells packages/jcode-ui/src/toolRenderers/diff.tsx:27 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells packages/jcode-ui/src/toolRenderers/fileViewer.tsx:27 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells web/src/components/ArtifactsPanel.tsx:560 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
AC3 · Page structure · Heading level jumps from h2 to h4 · ×3
  • Heading level jumps from h2 to h4 site/src/pages/HomePage.tsx:220 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 site/src/pages/HomePage.tsx:242 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 site/src/pages/ShowcasePage.tsx:137 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×3
  • Focus outline removed in CSS without a :focus replacement agent-eval/showcase/projects/fe_analytics_dashboard/index.html:108 — `.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 agent-eval/showcase/projects/fe_pricing_calculator/index.html:81 — `input[type="range"]` 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 design/running-thinking-indicator.html:62 — `.tool-row` 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.
D1 · Cyclomatic Complexity · jcode_desktop · ×3
  • jcode_desktop::sidecar::start (cyclomatic 21) desktop/src-tauri/src/sidecar.rs:96 — jcode_desktop::sidecar::start 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.
  • jcode_desktop::desktop_apps::linux::parse_desktop_entry (cyclomatic 16) desktop/src-tauri/src/desktop_apps/linux.rs:465 — jcode_desktop::desktop_apps::linux::parse_desktop_entry 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.
  • jcode_desktop::desktop_apps::windows::known_application_paths (cyclomatic 16) desktop/src-tauri/src/desktop_apps/windows.rs:319 — jcode_desktop::desktop_apps::windows::known_application_paths 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.
D2 · Cognitive Complexity · index.html.step (cognitive 21) · ×3
  • index.html.step (cognitive 21) agent-eval/showcase/projects/fe_canvas_particles/index.html:124 — index.html.step has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (5 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.
  • index.html.step (cognitive 21) agent-eval/site/projects/fe_canvas_particles/index.html:124 — index.html.step has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (5 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.
  • index.html.step (cognitive 21) site/public/showcase-projects/fe_canvas_particles/index.html:124 — index.html.step has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (5 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.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/tui/input_views.go:258 — internal/tui/input_views.go:258-275 | internal/tui/input_views.go:449-475 | internal/tui/input_views.go:497-520 | internal/tui/update.go:21-2330 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/web/channel.go:126 — internal/web/channel.go:126-170 | internal/web/mcp.go:449-489 | internal/web/mcp.go:527-568 | internal/web/skills.go:53-112 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/web/mcp.go:403 — internal/web/mcp.go:403-447 | internal/web/mcp.go:449-489 | internal/web/mcp.go:491-525 | internal/web/mcp.go:527-568 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×3
  • Edited copy of a member (18 corresponding lines) internal/web/cloud_config_sync.go:90 — internal/web/cloud_config_sync.go:90-113 | internal/web/cloud_config_sync.go:115-132 — These two members are one piece of code written twice and then edited apart: 18 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 (18 corresponding lines) internal/flow/loader.go:46 — internal/flow/loader.go:46-65 | internal/flow/loader.go:67-84 — These two members are one piece of code written twice and then edited apart: 18 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 (18 corresponding lines) REDACTED:277 — REDACTED:277-295 | REDACTED:456-473 — These two members are one piece of code written twice and then edited apart: 18 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 (16 corresponding lines) · ×3
  • Edited copy of a member (16 corresponding lines) internal/command/update.go:145 — internal/command/update.go:145-160 | internal/computer/helper_install.go:200-220 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) internal/tools/provider_managed_billable.go:153 — internal/tools/provider_managed_billable.go:153-170 | internal/tools/provider_managed_billable.go:176-191 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) internal/model/registry.go:96 — internal/model/registry.go:96-111 | internal/model/registry.go:441-458 — These two members are one piece of code written twice and then edited apart: 16 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 (3 members, 7+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 7+ corresponding lines) internal/command/web.go:193 — internal/command/web.go:193-199 | internal/computer/helper_dial.go:40-46 | internal/runner/approval.go:743-749 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) REDACTED:354 — REDACTED:354-360 | internal/tools/automation_tool.go:298-305 | internal/tui/format.go:89-96 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) internal/config/config.go:1352 — internal/config/config.go:1352-1358 | internal/session/lastsession.go:20-26 | internal/session/session.go:512-518 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×3
  • Duplicated block (15 lines × 2) internal/config/project.go:46 — internal/config/project.go:46-60 | internal/util/envinfo.go:57-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) internal/session/provider_tool_operation.go:136 — internal/session/provider_tool_operation.go:136-150 | internal/session/session.go:1028-1042 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (15 lines × 2) internal/web/cloud_pairings.go:79 — internal/web/cloud_pairings.go:79-93 | internal/web/cloud_pairings.go:112-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/cloud_pairings.go:79` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) internal/tools/edit.go:238 — internal/tools/edit.go:238-242 | internal/tools/edit.go:321-325 | internal/tools/edit.go:552-556 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/edit.go:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) internal/web/git.go:95 — internal/web/git.go:95-102 | internal/web/models.go:370-374 | internal/web/project.go:202-206 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/git.go:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) internal/command/interactive.go:569 — internal/command/interactive.go:569-573 | internal/command/interactive.go:600-604 | internal/command/interactive.go:1040-1044 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/interactive.go:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×3
  • Outbound HTTP without resilience internal/command/update.go:76 — `http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience internal/pkg/weixin/api.go:136 — `http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience script/generate_models.go:123 — `http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×3
  • Duplicated block (21 lines × 2 locations) REDACTED:17 — REDACTED:17 · REDACTED:11 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (21 lines × 2 locations) web/src/components/SettingsView.tsx:840 — web/src/components/SettingsView.tsx:840 · web/src/components/SettingsView.tsx:3237 — 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 (21 lines × 2 locations) web/src/components/SettingsView.tsx:3568 — web/src/components/SettingsView.tsx:3568 · web/src/components/SettingsView.tsx:3592 — 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.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×3
  • JavaScript dependencies are not locked examples/jcode-ui-minimal/package.json:11 — examples/jcode-ui-minimal/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked examples/jcode-ui-zustand/package.json:11 — examples/jcode-ui-zustand/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked REDACTED:13 — REDACTED declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / REDACTED / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.5 · ×2
  • Low contrast colour pair in CSS (2.5:1) agent-eval/showcase/projects/fe_pricing_calculator/index.html:176 — `.badge` sets color: #fff on background-color: #10b981 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (2.5:1) design/workflow-progress.html:159 — `.tab-btn .badge` sets color: #FFFFFF on background-color: #FF8400 — 2.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.7 · ×2
  • Low contrast colour pair in CSS (3.7:1) agent-eval/showcase/projects/fe_todo_app/index.html:69 — `#add-btn` sets color: #fff on background-color: #667eea — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.7:1) agent-eval/showcase/projects/fe_todo_app/index.html:123 — `.filter-btn.active` sets color: #667eea on background-color: #fff — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.4 · ×2
  • Low contrast colour pair in CSS (3.4:1) extension/popup/popup.html:16 — `.logo` sets color: #fff on background-color: #e8631a — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.4:1) extension/popup/popup.html:36 — `button.primary` sets color: #fff on background-color: #e8631a — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×2
  • Edited copy of a member (19 corresponding lines) internal/handler/acp.go:827 — internal/handler/acp.go:827-849 | internal/handler/acp.go:855-873 — These two members are one piece of code written twice and then edited apart: 19 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 (19 corresponding lines) internal/tools/todo.go:107 — internal/tools/todo.go:107-125 | internal/tools/todo_enhanced.go:300-318 — These two members are one piece of code written twice and then edited apart: 19 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 (4 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 14+ corresponding lines) internal/automation/filelock_unix.go:31 — internal/automation/filelock_unix.go:31-44 | internal/automation/filelock_windows.go:39-52 | internal/memory/filelock_unix.go:36-49 | internal/memory/filelock_windows.go:36-52 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 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.
  • Edited copies of one member (4 members, 14+ corresponding lines) internal/session/session.go:522 — internal/session/session.go:522-539 | internal/session/session.go:1788-1805 | internal/session/session.go:1868-1885 | REDACTED:659-672 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 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 · Edited copy of a member (4 corresponding lines) · ×2
  • Edited copy of a member (4 corresponding lines) agent-eval/suite/toolsearch_campaign.py:1233 — agent-eval/suite/toolsearch_campaign.py:1233-1236 | agent-eval/suite/web_toolsearch_orchestrate.py:957-960 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) internal/artifact/managed.go:183 — internal/artifact/managed.go:183-186 | internal/artifact/service.go:450-453 — These two members are one piece of code written twice and then edited apart: 4 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) · ×2
  • Edited copy of a member (6 corresponding lines) agent-eval/suite/routing_verify.py:107 — agent-eval/suite/routing_verify.py:107-114 | agent-eval/suite/toolsearch_expect.py:266-271 — 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.
  • Edited copy of a member (6 corresponding lines) internal/flow/loader.go:104 — internal/flow/loader.go:104-109 | internal/tui/paste_store.go:57-63 — 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 · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) internal/providerauth/copilot.go:81 — internal/providerauth/copilot.go:81-98 | internal/providerauth/xai.go:140-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/providerauth/copilot.go:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) internal/tui/update.go:682 — internal/tui/update.go:682-699 | internal/tui/update.go:1128-1145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/update.go:682` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) internal/review/review.go:300 — internal/review/review.go:300-316 | internal/review/session_cache.go:89-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (17 lines × 2) internal/web/models.go:549 — internal/web/models.go:549-565 | internal/web/models.go:612-628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/models.go:549` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) internal/tui/update.go:758 — internal/tui/update.go:758-773 | internal/tui/update.go:796-811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) REDACTED:199 — REDACTED:199-214 | REDACTED:342-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:199` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×2
  • Duplicated block (10–14 lines × 2) internal/runner/runner.go:538 — internal/runner/runner.go:538-547 | internal/runner/runner.go:585-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10–14 lines × 2) internal/tools/edit.go:194 — internal/tools/edit.go:194-207 | internal/tools/edit.go:503-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/edit.go:194` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) internal/tui/pickers.go:51 — internal/tui/pickers.go:51-63 | internal/tui/pickers.go:104-116 | internal/tui/pickers.go:168-180 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) internal/tools/grep.go:381 — internal/tools/grep.go:381-393 | internal/tools/grep.go:422-436 | internal/tools/grep.go:463-475 — 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×2
  • Duplicated block (10–12 lines × 2) internal/command/interactive.go:1073 — internal/command/interactive.go:1073-1084 | internal/command/interactive.go:1160-1169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/interactive.go:1073` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–12 lines × 2) internal/model/chatmodel.go:665 — internal/model/chatmodel.go:665-676 | internal/model/responses.go:388-397 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/model/chatmodel.go:665` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) internal/automation/filelock_unix.go:18 — internal/automation/filelock_unix.go:18-25 | internal/computer/screenshot_filelock_unix.go:17-24 | internal/config/config_filelock_unix.go:14-21 | internal/memory/filelock_unix.go:16-23 | internal/session/security_filelock_unix.go:14-21 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 5) internal/tui/input_views.go:266 — internal/tui/input_views.go:266-273 | internal/tui/input_views.go:466-473 | internal/tui/input_views.go:511-518 | internal/tui/update.go:959-966 | internal/tui/update.go:1341-1348 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/input_views.go:266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) internal/web/mcp.go:434 — internal/web/mcp.go:434-440 | internal/web/mcp.go:476-482 | internal/web/mcp.go:506-512 | internal/web/mcp.go:556-562 — all 4 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/web/mcp.go:553` calls `cloneMCPServer` and `internal/web/mcp.go:474` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) internal/config/config_filelock_unix.go:25 — internal/config/config_filelock_unix.go:25-31 | internal/providerauth/filelock_unix.go:29-35 | internal/session/security_filelock_unix.go:25-31 | internal/tools/ssh_known_hosts_lock_unix.go:29-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) internal/cloud/credentials.go:131 — internal/cloud/credentials.go:131-137 | internal/config/config.go:1270-1276 | internal/config/config_mutation.go:70-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) internal/web/session_changes.go:80 — internal/web/session_changes.go:80-86 | internal/web/session_draft_pr.go:123-129 | internal/web/session_draft_pr.go:317-323 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/session_changes.go:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) internal/cloud/connector.go:752 — internal/cloud/connector.go:752-758 | internal/cloud/connector.go:1002-1007 | internal/cloud/connector.go:1075-1081 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/connector.go:752` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 3) internal/cloud/connector.go:1088 — internal/cloud/connector.go:1088-1093 | internal/cloud/connector.go:1112-1117 | internal/cloud/connector.go:1139-1144 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×2
  • Duplicated block (14 lines × 2 locations) web/src/App.tsx:442 — web/src/App.tsx:442 · web/src/components/RightPanel.tsx:119 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (14 lines × 2 locations) web/src/components/SettingsView.tsx:2640 — web/src/components/SettingsView.tsx:2640 · web/src/components/SettingsView.tsx:2655 — 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.
R8 · Dependency Hygiene · Unused dependency 'marked-highlight' · ×2
  • Unused dependency 'marked-highlight' packages/jcode-ui/package.json:112 — Declared in packages/jcode-ui/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
  • Unused dependency 'marked-highlight' REDACTED:32 — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (1.0 · ×1
  • Low contrast colour pair in CSS (1.0:1) design/goal-banner-composer.html:100 — `.sec-head .sec-no` sets color: #FFFFFF on background-color: #FFFFFF — 1.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.0 · ×1
  • Low contrast colour pair in CSS (3.0:1) extension/popup/popup.html:41 — `.badge` sets color: #e8631a on background-color: #fdeee3 — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (4.4 · ×1
  • Low contrast colour pair in CSS (4.4:1) internal-doc/artifacts-ui/index.html:533 — `.preview-toolbar` sets color: #7f817d on background-color: #1a1a1a — 4.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · Model.Update (cyclomatic 503) · ×1
  • Model.Update (cyclomatic 503) internal/tui/update.go:21 — Model.Update has cyclomatic complexity 503 (threshold 15). Of this number, 500 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 · Sidebar.Sidebar (cyclomatic 179) · ×1
  • Sidebar.Sidebar (cyclomatic 179) web/src/components/Sidebar.tsx:107 — Sidebar.Sidebar has cyclomatic complexity 179 (threshold 15). Most of this is not in the body itself: 12 of the 179 points are its own statements and the rest belongs to 37 function items inside it that branch (a function literal at line 635, a function literal at line 252, a function literal at line 300, …). 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 · RemoteConnectWizard.RemoteConnectWizard (cyclomatic 156) · ×1
  • RemoteConnectWizard.RemoteConnectWizard (cyclomatic 156) web/src/components/RemoteConnectWizard.tsx:36 — RemoteConnectWizard.RemoteConnectWizard has cyclomatic complexity 156 (threshold 15). Of this number, 50 points are the body's own statements and 106 belong to 27 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 · ProviderAuthSection.ProviderAuthSection (cyclomatic 146) · ×1
  • ProviderAuthSection.ProviderAuthSection (cyclomatic 146) web/src/components/settings/ProviderAuthSection.tsx:250 — ProviderAuthSection.ProviderAuthSection has cyclomatic complexity 146 (threshold 15). Of this number, 55 points are the body's own statements and 91 belong to 24 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 · ChatInput.ChatInput (cyclomatic 118) · ×1
  • ChatInput.ChatInput (cyclomatic 118) packages/jcode-ui/src/product/ChatInput.tsx:306 — ChatInput.ChatInput has cyclomatic complexity 118 (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 (ChatInput.ChatInput::handleKeyDown) 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 · command.runWebServer (cyclomatic 116) · ×1
  • command.runWebServer (cyclomatic 116) internal/command/web.go:253 — command.runWebServer has cyclomatic complexity 116 (threshold 15). Most of this is not in the body itself: 11 of the 116 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 434, 345, 293). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · SettingsView.ComputerTab (cyclomatic 114) · ×1
  • SettingsView.ComputerTab (cyclomatic 114) web/src/components/SettingsView.tsx:4420 — SettingsView.ComputerTab has cyclomatic complexity 114 (threshold 15). Of this number, 69 points are the body's own statements and 45 belong to 16 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CloudTab.CloudTab (cyclomatic 110) · ×1
  • CloudTab.CloudTab (cyclomatic 110) web/src/components/settings/CloudTab.tsx:89 — CloudTab.CloudTab has cyclomatic complexity 110 (threshold 15). Of this number, 49 points are the body's own statements and 61 belong to 18 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 · runner.runInner (cyclomatic 107) · ×1
  • runner.runInner (cyclomatic 107) internal/runner/runner.go:305 — runner.runInner has cyclomatic complexity 107 (threshold 15). Of this number, 85 points are the body's own statements and 22 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 · Composer.Composer (cyclomatic 107) · ×1
  • Composer.Composer (cyclomatic 107) packages/jcode-ui-core/src/primitives/Composer.tsx:219 — Composer.Composer has cyclomatic complexity 107 (threshold 15). Of this number, 41 points are the body's own statements and 66 belong to 27 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 · command.RunInteractive (cyclomatic 101) · ×1
  • command.RunInteractive (cyclomatic 101) internal/command/interactive.go:1391 — command.RunInteractive has cyclomatic complexity 101 (threshold 15). Of this number, 69 points are the body's own statements and 32 belong to 16 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 · SettingsView.MemoryTab (cyclomatic 97) · ×1
  • SettingsView.MemoryTab (cyclomatic 97) web/src/components/SettingsView.tsx:3451 — SettingsView.MemoryTab has cyclomatic complexity 97 (threshold 15). Of this number, 62 points are the body's own statements and 35 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 · WorkspacePicker.WorkspacePicker (cyclomatic 91) · ×1
  • WorkspacePicker.WorkspacePicker (cyclomatic 91) packages/jcode-ui/src/product/WorkspacePicker.tsx:51 — WorkspacePicker.WorkspacePicker has cyclomatic complexity 91 (threshold 15). Of this number, 37 points are the body's own statements and 54 belong to 17 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 · verify.check_oracle (cyclomatic 85) · ×1
  • verify.check_oracle (cyclomatic 85) agent-eval/suite/verify.py:150 — verify.check_oracle has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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_browser_driver.run_web_browser_case (cyclomatic 81) · ×1
  • web_browser_driver.run_web_browser_case (cyclomatic 81) REDACTED:908 — web_browser_driver.run_web_browser_case has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SetupView.SetupView (cyclomatic 81) · ×1
  • SetupView.SetupView (cyclomatic 81) web/src/components/SetupView.tsx:27 — SetupView.SetupView has cyclomatic complexity 81 (threshold 15). Of this number, 25 points are the body's own statements and 56 belong to 10 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 · SettingsView.ProvidersTab (cyclomatic 78) · ×1
  • SettingsView.ProvidersTab (cyclomatic 78) web/src/components/SettingsView.tsx:331 — SettingsView.ProvidersTab has cyclomatic complexity 78 (threshold 15). Of this number, 20 points are the body's own statements and 58 belong to 26 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 · Server.handleUpdateProvider (cyclomatic 73) · ×1
  • Server.handleUpdateProvider (cyclomatic 73) internal/web/providers.go:1008 — Server.handleUpdateProvider has cyclomatic complexity 73 (threshold 15). Of this number, 16 points are the body's own statements and 57 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.App (cyclomatic 67) · ×1
  • App.App (cyclomatic 67) web/src/App.tsx:83 — App.App has cyclomatic complexity 67 (threshold 15). Most of this is not in the body itself: 5 of the 67 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 111, 271, 212, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · SettingsView.MCPTab (cyclomatic 61) · ×1
  • SettingsView.MCPTab (cyclomatic 61) web/src/components/SettingsView.tsx:2863 — SettingsView.MCPTab has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 15 of the 61 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 3258, save, a function literal at line 2988, …). 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 · Game.update (cyclomatic 56) · ×1
  • Game.update (cyclomatic 56) site/public/showcase-projects/game/js/game.js:252 — Game.update has cyclomatic complexity 56 (threshold 15). Of this number, 47 points are the body's own statements and 9 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 · Manager.runAgentTurn (cyclomatic 54) · ×1
  • Manager.runAgentTurn (cyclomatic 54) internal/team/manager.go:607 — Manager.runAgentTurn has cyclomatic complexity 54 (threshold 15). Of this number, 53 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 · Message.Message (cyclomatic 52) · ×1
  • Message.Message (cyclomatic 52) REDACTED:59 — Message.Message has cyclomatic complexity 52 (threshold 15). Of this number, 45 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsView.ProviderCard (cyclomatic 52) · ×1
  • SettingsView.ProviderCard (cyclomatic 52) web/src/components/SettingsView.tsx:893 — SettingsView.ProviderCard has cyclomatic complexity 52 (threshold 15). Of this number, 43 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Server.handleProviderCatalog (cyclomatic 51) · ×1
  • Server.handleProviderCatalog (cyclomatic 51) internal/web/providers.go:250 — Server.handleProviderCatalog has cyclomatic complexity 51 (threshold 15). Of this number, 45 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 · extractSymbols (cyclomatic 51) · ×1
  • extractSymbols (cyclomatic 51) script/generate_jcode_ui_api_docs.mjs:52 — extractSymbols 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 · SelectMenu.SelectMenu (cyclomatic 50) · ×1
  • SelectMenu.SelectMenu (cyclomatic 50) web/src/components/SelectMenu.tsx:33 — SelectMenu.SelectMenu has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 12 of the 50 points are its own statements and the rest belongs to 13 function items inside it that branch (onListKeyDown, openMenu, onTriggerKeyDown, …). 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 · ArtifactsPanel.ArtifactViewer (cyclomatic 49) · ×1
  • ArtifactsPanel.ArtifactViewer (cyclomatic 49) web/src/components/ArtifactsPanel.tsx:430 — ArtifactsPanel.ArtifactViewer has cyclomatic complexity 49 (threshold 15). Of this number, 22 points are the body's own statements and 27 belong to 15 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · orchestrate._run_one (cyclomatic 48) · ×1
  • orchestrate._run_one (cyclomatic 48) agent-eval/suite/orchestrate.py:514 — orchestrate._run_one 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 · Game.handleClick (cyclomatic 47) · ×1
  • Game.handleClick (cyclomatic 47) site/public/showcase-projects/game/js/game.js:481 — Game.handleClick 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 · AutomationsView.AutomationsView (cyclomatic 47) · ×1
  • AutomationsView.AutomationsView (cyclomatic 47) web/src/components/AutomationsView.tsx:789 — AutomationsView.AutomationsView has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 11 of the 47 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 970, 1124, 849, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · acpAgent.buildAgentSession (cyclomatic 46) · ×1
  • acpAgent.buildAgentSession (cyclomatic 46) internal/command/acp.go:478 — acpAgent.buildAgentSession has cyclomatic complexity 46 (threshold 15). Of this number, 27 points are the body's own statements and 19 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 · SetupModel.Update (cyclomatic 46) · ×1
  • SetupModel.Update (cyclomatic 46) internal/tui/setup.go:168 — SetupModel.Update 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 · toolsearch_cases._validate_expectation (cyclomatic 46) · ×1
  • toolsearch_cases._validate_expectation (cyclomatic 46) agent-eval/suite/toolsearch_cases.py:355 — toolsearch_cases._validate_expectation 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 · GeneratedImageCard.GeneratedImageCard (cyclomatic 46) · ×1
  • GeneratedImageCard.GeneratedImageCard (cyclomatic 46) packages/jcode-ui/src/components/GeneratedImageCard.tsx:100 — GeneratedImageCard.GeneratedImageCard has cyclomatic complexity 46 (threshold 15). Of this number, 44 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 · handler.extractToolDisplayInfo (cyclomatic 45) · ×1
  • handler.extractToolDisplayInfo (cyclomatic 45) internal/handler/web.go:71 — handler.extractToolDisplayInfo has cyclomatic complexity 45 (threshold 15). Of this number, 43 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · main.run (cyclomatic 45) · ×1
  • main.run (cyclomatic 45) script/generate_models.go:120 — main.run 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 · analyze.main (cyclomatic 45) · ×1
  • analyze.main (cyclomatic 45) agent-eval/analysis/analyze.py:102 — analyze.main 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 · toolsearch_cases._validate_case (cyclomatic 45) · ×1
  • toolsearch_cases._validate_case (cyclomatic 45) agent-eval/suite/toolsearch_cases.py:551 — toolsearch_cases._validate_case has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · jui.initSelect (cyclomatic 45) · ×1
  • jui.initSelect (cyclomatic 45) site/public/showcase-projects/ui-kit/js/jui.js:168 — jui.initSelect has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 5 of the 45 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 224, syncValue, setActive, …). 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 · Connector.reconcileProviderConfigs (cyclomatic 44) · ×1
  • Connector.reconcileProviderConfigs (cyclomatic 44) internal/cloud/provider_sync.go:372 — Connector.reconcileProviderConfigs 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 · Server.ensureConversationLocked (cyclomatic 44) · ×1
  • Server.ensureConversationLocked (cyclomatic 44) internal/web/activation.go:237 — Server.ensureConversationLocked has cyclomatic complexity 44 (threshold 15). Of this number, 43 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 · ToolCallView.ToolCallView (cyclomatic 44) · ×1
  • ToolCallView.ToolCallView (cyclomatic 44) packages/jcode-ui-core/src/primitives/ToolCallView.tsx:63 — ToolCallView.ToolCallView has cyclomatic complexity 44 (threshold 15). Of this number, 43 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 · ConversationLoadingView.ConversationLoadingView (cyclomatic 44) · ×1
  • ConversationLoadingView.ConversationLoadingView (cyclomatic 44) web/src/components/ConversationLoadingView.tsx:23 — ConversationLoadingView.ConversationLoadingView has cyclomatic complexity 44 (threshold 15). Of this number, 41 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 · Server.handleListModels (cyclomatic 43) · ×1
  • Server.handleListModels (cyclomatic 43) internal/web/models.go:104 — Server.handleListModels 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 · ToolRow.ToolRowHeader (cyclomatic 42) · ×1
  • ToolRow.ToolRowHeader (cyclomatic 42) REDACTED:43 — ToolRow.ToolRowHeader 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 · App.Shell (cyclomatic 42) · ×1
  • App.Shell (cyclomatic 42) web/src/App.tsx:330 — App.Shell has cyclomatic complexity 42 (threshold 15). Of this number, 19 points are the body's own statements and 23 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 · SpeechInput.SpeechInput (cyclomatic 40) · ×1
  • SpeechInput.SpeechInput (cyclomatic 40) packages/jcode-ui/src/voice/SpeechInput.tsx:93 — SpeechInput.SpeechInput has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 13 of the 40 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 201, 131, 220, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Server.handleDeleteSession (cyclomatic 39) · ×1
  • Server.handleDeleteSession (cyclomatic 39) internal/web/sessions.go:289 — Server.handleDeleteSession 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 · ToolCallCard.ToolHeader (cyclomatic 39) · ×1
  • ToolCallCard.ToolHeader (cyclomatic 39) REDACTED:169 — ToolCallCard.ToolHeader has cyclomatic complexity 39 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ArtifactsPanel.ArtifactsPanel (cyclomatic 39) · ×1
  • ArtifactsPanel.ArtifactsPanel (cyclomatic 39) web/src/components/ArtifactsPanel.tsx:158 — ArtifactsPanel.ArtifactsPanel has cyclomatic complexity 39 (threshold 15). Of this number, 22 points are the body's own statements and 17 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 · acpAgent.Prompt (cyclomatic 38) · ×1
  • acpAgent.Prompt (cyclomatic 38) internal/command/acp.go:936 — acpAgent.Prompt 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 · session.ReconstructState (cyclomatic 38) · ×1
  • session.ReconstructState (cyclomatic 38) internal/session/history.go:149 — session.ReconstructState 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 · Server.handleSetupComplete (cyclomatic 38) · ×1
  • Server.handleSetupComplete (cyclomatic 38) internal/web/setup.go:261 — Server.handleSetupComplete 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 · Model.handleModelInput (cyclomatic 37) · ×1
  • Model.handleModelInput (cyclomatic 37) internal/tui/pickers.go:15 — Model.handleModelInput 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 · store.replayOperationsByOccurrence (cyclomatic 37) · ×1
  • store.replayOperationsByOccurrence (cyclomatic 37) web/src/app/store.ts:212 — store.replayOperationsByOccurrence 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 · ACPHandler.presentationForTool (cyclomatic 36) · ×1
  • ACPHandler.presentationForTool (cyclomatic 36) internal/handler/acp.go:241 — ACPHandler.presentationForTool has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · subagentTool.runSubagent (cyclomatic 36) · ×1
  • subagentTool.runSubagent (cyclomatic 36) internal/tools/subagent.go:398 — subagentTool.runSubagent has cyclomatic complexity 36 (threshold 15). Of this number, 32 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 · web_browser_driver.analyze_browser_session (cyclomatic 36) · ×1
  • web_browser_driver.analyze_browser_session (cyclomatic 36) REDACTED:600 — web_browser_driver.analyze_browser_session 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 · BranchPicker.BranchPicker (cyclomatic 36) · ×1
  • BranchPicker.BranchPicker (cyclomatic 36) packages/jcode-ui/src/product/BranchPicker.tsx:31 — BranchPicker.BranchPicker 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 9 function items inside it that branch (checkout, a function literal at line 46, a function literal at line 94, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Connector.backfillSessionHistory (cyclomatic 35) · ×1
  • Connector.backfillSessionHistory (cyclomatic 35) internal/cloud/history_sync.go:278 — Connector.backfillSessionHistory 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 · web.inspectSessionChangesFromBase (cyclomatic 35) · ×1
  • web.inspectSessionChangesFromBase (cyclomatic 35) internal/web/session_changes.go:112 — web.inspectSessionChangesFromBase 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 · web.publishSessionDraft (cyclomatic 35) · ×1
  • web.publishSessionDraft (cyclomatic 35) internal/web/session_draft_pr.go:144 — web.publishSessionDraft has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RemoteConnectionNotice.RemoteConnectionNotice (cyclomatic 35) · ×1
  • RemoteConnectionNotice.RemoteConnectionNotice (cyclomatic 35) web/src/components/RemoteConnectionNotice.tsx:25 — RemoteConnectionNotice.RemoteConnectionNotice has cyclomatic complexity 35 (threshold 15). Of this number, 28 points are the body's own statements and 7 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 · SettingsView.ProviderForm · ×1
  • SettingsView.ProviderForm::save (cyclomatic 35) web/src/components/SettingsView.tsx:1329 — SettingsView.ProviderForm::save 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. This shape REPEATS in the file: one other method here (SettingsView.ProviderForm) 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 · Server.submitMessageWithOptions (cyclomatic 34) · ×1
  • Server.submitMessageWithOptions (cyclomatic 34) internal/web/chat.go:198 — Server.submitMessageWithOptions has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its 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_browser_driver._validate_case (cyclomatic 34) · ×1
  • web_browser_driver._validate_case (cyclomatic 34) REDACTED:461 — web_browser_driver._validate_case has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · city.buildCity (cyclomatic 34) · ×1
  • city.buildCity (cyclomatic 34) site/public/showcase-projects/city3d/js/city.js:308 — city.buildCity has cyclomatic complexity 34 (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 · jui.initDropdown (cyclomatic 34) · ×1
  • jui.initDropdown (cyclomatic 34) site/public/showcase-projects/ui-kit/js/jui.js:377 — jui.initDropdown has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 5 of the 34 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 422, a function literal at line 419, activate, …). 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 · lab.initLab (cyclomatic 34) · ×1
  • lab.initLab (cyclomatic 34) site/public/showcase-projects/webgpu-cnn/js/lab.js:264 — lab.initLab has cyclomatic complexity 34 (threshold 15). Of this number, 16 points are the body's own statements and 18 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 · store.replayTimeline (cyclomatic 34) · ×1
  • store.replayTimeline (cyclomatic 34) web/src/app/store.ts:72 — store.replayTimeline 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 · store.provisionNewChat (cyclomatic 34) · ×1
  • store.provisionNewChat (cyclomatic 34) web/src/app/store.ts:2830 — store.provisionNewChat 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 · SettingsView.ProviderForm (cyclomatic 34) · ×1
  • SettingsView.ProviderForm (cyclomatic 34) web/src/components/SettingsView.tsx:1235 — SettingsView.ProviderForm 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. This shape REPEATS in the file: one other method here (SettingsView.ProviderForm::save) 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 · TokenPlanMultimodalClient.Generate (cyclomatic 33) · ×1
  • TokenPlanMultimodalClient.Generate (cyclomatic 33) internal/imagegen/token_plan_multimodal.go:112 — TokenPlanMultimodalClient.Generate has cyclomatic complexity 33 (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 · Server.handleRemoteBind (cyclomatic 33) · ×1
  • Server.handleRemoteBind (cyclomatic 33) internal/web/remote.go:318 — Server.handleRemoteBind 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 · background.connect (cyclomatic 33) · ×1
  • background.connect (cyclomatic 33) extension/background.js:93 — background.connect has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 13 of the 33 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 139, 176, 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 · VoiceVisualizer.VoiceVisualizer (cyclomatic 33) · ×1
  • VoiceVisualizer.VoiceVisualizer (cyclomatic 33) packages/jcode-ui/src/voice/VoiceVisualizer.tsx:34 — VoiceVisualizer.VoiceVisualizer 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 8 function literals inside it that branch (lines 131, 56, 55, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · config.mergeProjectFields (cyclomatic 32) · ×1
  • config.mergeProjectFields (cyclomatic 32) internal/config/project.go:163 — config.mergeProjectFields 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 · subagentTool.InvokableRun (cyclomatic 32) · ×1
  • subagentTool.InvokableRun (cyclomatic 32) internal/tools/subagent.go:237 — subagentTool.InvokableRun has cyclomatic complexity 32 (threshold 15). Of this number, 26 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 · store.resumeConversationEnvironment (cyclomatic 32) · ×1
  • store.resumeConversationEnvironment (cyclomatic 32) web/src/app/store.ts:2468 — store.resumeConversationEnvironment 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 · terminal.TerminalRenderer (cyclomatic 31) · ×1
  • terminal.TerminalRenderer (cyclomatic 31) packages/jcode-ui/src/toolRenderers/terminal.tsx:12 — terminal.TerminalRenderer has cyclomatic complexity 31 (threshold 15). Of this number, 28 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 · CloudBadge.CloudBadge (cyclomatic 31) · ×1
  • CloudBadge.CloudBadge (cyclomatic 31) web/src/components/CloudBadge.tsx:52 — CloudBadge.CloudBadge has cyclomatic complexity 31 (threshold 15). Of this number, 18 points are the body's own statements and 13 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 · imagegen.inspectGeneratedWebP (cyclomatic 30) · ×1
  • imagegen.inspectGeneratedWebP (cyclomatic 30) internal/imagegen/client.go:714 — imagegen.inspectGeneratedWebP 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 · uitree.Build (cyclomatic 30) · ×1
  • uitree.Build (cyclomatic 30) internal/uitree/uitree.go:138 — uitree.Build has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 181). 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 · toolsearch_report.render_html (cyclomatic 30) · ×1
  • toolsearch_report.render_html (cyclomatic 30) agent-eval/analysis/toolsearch_report.py:1246 — toolsearch_report.render_html 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 · AutomationsView.AutomationEditor (cyclomatic 30) · ×1
  • AutomationsView.AutomationEditor (cyclomatic 30) web/src/components/AutomationsView.tsx:371 — AutomationsView.AutomationEditor 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. This shape REPEATS in the file: one other method here (AutomationsView.AutomationEditor::save) 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 · DesktopTitlebar.TaskDetails (cyclomatic 30) · ×1
  • DesktopTitlebar.TaskDetails (cyclomatic 30) web/src/components/DesktopTitlebar.tsx:153 — DesktopTitlebar.TaskDetails has cyclomatic complexity 30 (threshold 15). Of this number, 24 points are the body's own statements and 6 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 · artifact.inspectWebP (cyclomatic 29) · ×1
  • artifact.inspectWebP (cyclomatic 29) internal/artifact/managed.go:514 — artifact.inspectWebP 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 · Connector.ensureAccountSyncCipher (cyclomatic 29) · ×1
  • Connector.ensureAccountSyncCipher (cyclomatic 29) internal/cloud/provider_sync.go:256 — Connector.ensureAccountSyncCipher 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 · toolsearch_report._validate_campaign (cyclomatic 29) · ×1
  • toolsearch_report._validate_campaign (cyclomatic 29) agent-eval/analysis/toolsearch_report.py:624 — toolsearch_report._validate_campaign 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 · toolsearch_expect._check_activation (cyclomatic 29) · ×1
  • toolsearch_expect._check_activation (cyclomatic 29) agent-eval/suite/toolsearch_expect.py:648 — toolsearch_expect._check_activation 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 · AskUserBlock.AskUserBlock (cyclomatic 29) · ×1
  • AskUserBlock.AskUserBlock (cyclomatic 29) packages/jcode-ui-core/src/primitives/AskUserBlock.tsx:67 — AskUserBlock.AskUserBlock has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 174, 92, 129, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · TopBar.TopBar (cyclomatic 29) · ×1
  • TopBar.TopBar (cyclomatic 29) web/src/components/TopBar.tsx:58 — TopBar.TopBar has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 196, a function literal at line 73, a function literal at line 93, …). 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 · DesktopTitlebar.WorkspaceOpenMenu (cyclomatic 29) · ×1
  • DesktopTitlebar.WorkspaceOpenMenu (cyclomatic 29) web/src/components/DesktopTitlebar.tsx:388 — DesktopTitlebar.WorkspaceOpenMenu has cyclomatic complexity 29 (threshold 15). Of this number, 15 points are the body's own statements and 14 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 · Service.CreateManagedImage (cyclomatic 28) · ×1
  • Service.CreateManagedImage (cyclomatic 28) internal/artifact/managed.go:59 — Service.CreateManagedImage 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · command.runLogin (cyclomatic 28) · ×1
  • command.runLogin (cyclomatic 28) internal/command/login.go:74 — command.runLogin 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 · interactiveState.runEventLoop (cyclomatic 28) · ×1
  • interactiveState.runEventLoop (cyclomatic 28) internal/command/interactive.go:1211 — interactiveState.runEventLoop has cyclomatic complexity 28 (threshold 15). Of this number, 24 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 · Client.Generate (cyclomatic 28) · ×1
  • Client.Generate (cyclomatic 28) internal/imagegen/client.go:249 — Client.Generate 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 · ApprovalState.decide (cyclomatic 28) · ×1
  • ApprovalState.decide (cyclomatic 28) internal/runner/approval.go:283 — ApprovalState.decide 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 · web.validateImageEndpoint (cyclomatic 28) · ×1
  • web.validateImageEndpoint (cyclomatic 28) internal/web/providers.go:52 — web.validateImageEndpoint 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 · Server.ensureManagedModelConfigured (cyclomatic 28) · ×1
  • Server.ensureManagedModelConfigured (cyclomatic 28) internal/web/models.go:903 — Server.ensureManagedModelConfigured has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · orchestrate.main (cyclomatic 28) · ×1
  • orchestrate.main (cyclomatic 28) agent-eval/suite/orchestrate.py:943 — orchestrate.main 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 · routing_verify.verify_routing (cyclomatic 28) · ×1
  • routing_verify.verify_routing (cyclomatic 28) agent-eval/suite/routing_verify.py:374 — routing_verify.verify_routing 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 · toolsearch_campaign.validate_run_artifacts (cyclomatic 28) · ×1
  • toolsearch_campaign.validate_run_artifacts (cyclomatic 28) agent-eval/suite/toolsearch_campaign.py:638 — toolsearch_campaign.validate_run_artifacts 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 · SettingsView.LangfuseConfigCard (cyclomatic 28) · ×1
  • SettingsView.LangfuseConfigCard (cyclomatic 28) web/src/components/SettingsView.tsx:2535 — SettingsView.LangfuseConfigCard has cyclomatic complexity 28 (threshold 15). Of this number, 14 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 · Service.openManaged (cyclomatic 26) · ×1
  • Service.openManaged (cyclomatic 26) internal/artifact/managed.go:290 — Service.openManaged 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 · computer.pruneScreenshotStoreRoot (cyclomatic 26) · ×1
  • computer.pruneScreenshotStoreRoot (cyclomatic 26) internal/computer/shot_store.go:180 — computer.pruneScreenshotStoreRoot 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · model.responsesConversationItems (cyclomatic 26) · ×1
  • model.responsesConversationItems (cyclomatic 26) internal/model/responses_convert.go:141 — model.responsesConversationItems 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 · providertools.ResolveImageRuntime (cyclomatic 26) · ×1
  • providertools.ResolveImageRuntime (cyclomatic 26) internal/providertools/manifest.go:291 — providertools.ResolveImageRuntime 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 · runner.Run (cyclomatic 26) · ×1
  • runner.Run (cyclomatic 26) internal/runner/runner.go:46 — runner.Run 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 · tools.buildHunks (cyclomatic 26) · ×1
  • tools.buildHunks (cyclomatic 26) internal/tools/diff.go:124 — tools.buildHunks 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 · generateImageTool.InvokableRun (cyclomatic 26) · ×1
  • generateImageTool.InvokableRun (cyclomatic 26) internal/tools/generate_image.go:138 — generateImageTool.InvokableRun 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 · writeTool.InvokableRun (cyclomatic 26) · ×1
  • writeTool.InvokableRun (cyclomatic 26) internal/tools/write.go:52 — writeTool.InvokableRun 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 · Server.handleUpdateAutomation (cyclomatic 26) · ×1
  • Server.handleUpdateAutomation (cyclomatic 26) internal/web/automation_api.go:154 — Server.handleUpdateAutomation has cyclomatic complexity 26 (threshold 15). Of this number, 17 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 · toolsearch_report._validate_plan (cyclomatic 26) · ×1
  • toolsearch_report._validate_plan (cyclomatic 26) agent-eval/analysis/toolsearch_report.py:268 — toolsearch_report._validate_plan 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 · main.swift.handleCapture (cyclomatic 26) · ×1
  • main.swift.handleCapture (cyclomatic 26) cmd/jcode-computerd/main.swift:1522 — main.swift.handleCapture 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 · aguiRuntime.createAGUIRuntime.handleEvent (cyclomatic 26) · ×1
  • aguiRuntime.createAGUIRuntime.handleEvent (cyclomatic 26) packages/jcode-ui-core/src/runtime/aguiRuntime.ts:307 — aguiRuntime.createAGUIRuntime.handleEvent has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ToolCallCard.SubagentHeader (cyclomatic 26) · ×1
  • ToolCallCard.SubagentHeader (cyclomatic 26) REDACTED:291 — ToolCallCard.SubagentHeader has cyclomatic complexity 26 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · toolLifecycle.mergeToolLifecycle (cyclomatic 26) · ×1
  • toolLifecycle.mergeToolLifecycle (cyclomatic 26) web/src/app/toolLifecycle.ts:38 — toolLifecycle.mergeToolLifecycle 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 · toolInfo.extractToolDisplayInfo (cyclomatic 26) · ×1
  • toolInfo.extractToolDisplayInfo (cyclomatic 26) web/src/lib/toolInfo.ts:30 — toolInfo.extractToolDisplayInfo has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · wsBridge.createWSHandlers · ×1
  • wsBridge.createWSHandlers::applyForegroundAgentDone (cyclomatic 26) web/src/app/wsBridge.ts:39 — wsBridge.createWSHandlers::applyForegroundAgentDone 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 · RightPanel.RightPanel (cyclomatic 26) · ×1
  • RightPanel.RightPanel (cyclomatic 26) web/src/components/RightPanel.tsx:51 — RightPanel.RightPanel 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 6 function literals inside it that branch (lines 81, 75, 156, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · UpdateBanner.UpdateBanner (cyclomatic 26) · ×1
  • UpdateBanner.UpdateBanner (cyclomatic 26) web/src/components/UpdateBanner.tsx:14 — UpdateBanner.UpdateBanner 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 · Connector.execChatSendCompose (cyclomatic 25) · ×1
  • Connector.execChatSendCompose (cyclomatic 25) internal/cloud/connector.go:824 — Connector.execChatSendCompose 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 · hooks.parseOutcome (cyclomatic 25) · ×1
  • hooks.parseOutcome (cyclomatic 25) internal/hooks/exec.go:127 — hooks.parseOutcome 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 · responsesSSEState.emitItem (cyclomatic 25) · ×1
  • responsesSSEState.emitItem (cyclomatic 25) internal/model/responses_parse.go:489 — responsesSSEState.emitItem 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 · readTool.InvokableRun (cyclomatic 25) · ×1
  • readTool.InvokableRun (cyclomatic 25) internal/tools/read.go:75 — readTool.InvokableRun 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 · toolsearch_report._validate_supplementary (cyclomatic 25) · ×1
  • toolsearch_report._validate_supplementary (cyclomatic 25) agent-eval/analysis/toolsearch_report.py:522 — toolsearch_report._validate_supplementary 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 · Message.MarkdownBody (cyclomatic 25) · ×1
  • Message.MarkdownBody (cyclomatic 25) REDACTED:360 — Message.MarkdownBody 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 5 function literals inside it that branch (lines 417, 384, 405, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · GoalBanner.GoalBanner (cyclomatic 25) · ×1
  • GoalBanner.GoalBanner (cyclomatic 25) packages/jcode-ui/src/product/GoalBanner.tsx:56 — GoalBanner.GoalBanner has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AudioPlayer.AudioPlayer (cyclomatic 25) · ×1
  • AudioPlayer.AudioPlayer (cyclomatic 25) packages/jcode-ui/src/voice/AudioPlayer.tsx:37 — AudioPlayer.AudioPlayer 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 literals inside it that branch (lines 186, 97, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Transcription.Transcription (cyclomatic 25) · ×1
  • Transcription.Transcription (cyclomatic 25) packages/jcode-ui/src/voice/Transcription.tsx:52 — Transcription.Transcription 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 5 function literals inside it that branch (lines 113, 83, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · main.onMessage (cyclomatic 25) · ×1
  • main.onMessage (cyclomatic 25) site/public/showcase-projects/webgpu-cnn/js/main.js:203 — main.onMessage 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 · ComponentDemo.DemoChrome (cyclomatic 25) · ×1
  • ComponentDemo.DemoChrome (cyclomatic 25) site/src/playground/ComponentDemo.tsx:468 — ComponentDemo.DemoChrome has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 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 · SettingsView.ToolSearchSection (cyclomatic 25) · ×1
  • SettingsView.ToolSearchSection (cyclomatic 25) web/src/components/SettingsView.tsx:2063 — SettingsView.ToolSearchSection has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · model.toOpenAIMessages (cyclomatic 24) · ×1
  • model.toOpenAIMessages (cyclomatic 24) internal/model/chatmodel.go:843 — model.toOpenAIMessages 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 · tools.NewFlowSpawn (cyclomatic 24) · ×1
  • tools.NewFlowSpawn (cyclomatic 24) REDACTED:45 — tools.NewFlowSpawn has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 46). 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 · SidebarComponent.View (cyclomatic 24) · ×1
  • SidebarComponent.View (cyclomatic 24) internal/tui/sidebar_component.go:42 — SidebarComponent.View 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · toolsearch_campaign.run_campaign (cyclomatic 24) · ×1
  • toolsearch_campaign.run_campaign (cyclomatic 24) agent-eval/suite/toolsearch_campaign.py:1057 — toolsearch_campaign.run_campaign 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 · main.swift.handlePerform (cyclomatic 24) · ×1
  • main.swift.handlePerform (cyclomatic 24) cmd/jcode-computerd/main.swift:880 — main.swift.handlePerform has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: main.swift.normalizeRole (cyclomatic 25) 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 · Thread.VirtualizedThread (cyclomatic 24) · ×1
  • Thread.VirtualizedThread (cyclomatic 24) packages/jcode-ui-core/src/primitives/Thread.tsx:149 — Thread.VirtualizedThread has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 239, 279, 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 · turnGroups.bindApprovalsToTools (cyclomatic 24) · ×1
  • turnGroups.bindApprovalsToTools (cyclomatic 24) packages/jcode-ui-core/src/timeline/turnGroups.ts:25 — turnGroups.bindApprovalsToTools 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 · AskUserCard.PendingCard (cyclomatic 24) · ×1
  • AskUserCard.PendingCard (cyclomatic 24) REDACTED:82 — AskUserCard.PendingCard has cyclomatic complexity 24 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ApprovalBanner.BillablePendingCard (cyclomatic 24) · ×1
  • ApprovalBanner.BillablePendingCard (cyclomatic 24) packages/jcode-ui/src/components/ApprovalBanner.tsx:183 — ApprovalBanner.BillablePendingCard 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 · ModelSelector.ModelSelector (cyclomatic 24) · ×1
  • ModelSelector.ModelSelector (cyclomatic 24) packages/jcode-ui/src/components/ModelSelector.tsx:44 — ModelSelector.ModelSelector has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 8 function items inside it that branch (onSearchKeyDown, a function literal at line 64, a function literal at line 72, …). 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 · worker.onmessage (cyclomatic 24) · ×1
  • worker.onmessage (cyclomatic 24) site/public/showcase-projects/webgpu-cnn/js/worker.js:578 — worker.onmessage 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 · store.revealSessionInSidebar (cyclomatic 24) · ×1
  • store.revealSessionInSidebar (cyclomatic 24) web/src/app/store.ts:1829 — store.revealSessionInSidebar 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 · ArtifactSharePublisher.Publish (cyclomatic 23) · ×1
  • ArtifactSharePublisher.Publish (cyclomatic 23) internal/cloud/artifact_share.go:97 — ArtifactSharePublisher.Publish has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · generateImageTool.parseInput (cyclomatic 23) · ×1
  • generateImageTool.parseInput (cyclomatic 23) internal/tools/generate_image.go:287 — generateImageTool.parseInput 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 · Server.handleListProviders (cyclomatic 23) · ×1
  • Server.handleListProviders (cyclomatic 23) internal/web/providers.go:676 — Server.handleListProviders 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 · groupExploring.summarizeExploringCounts (cyclomatic 23) · ×1
  • groupExploring.summarizeExploringCounts (cyclomatic 23) packages/jcode-ui-core/src/timeline/groupExploring.ts:188 — groupExploring.summarizeExploringCounts 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 · groupActivity.summarizeActivityCounts (cyclomatic 23) · ×1
  • groupActivity.summarizeActivityCounts (cyclomatic 23) packages/jcode-ui-core/src/timeline/groupActivity.ts:177 — groupActivity.summarizeActivityCounts has cyclomatic complexity 23 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · turnGroups.findApprovalTool (cyclomatic 23) · ×1
  • turnGroups.findApprovalTool (cyclomatic 23) packages/jcode-ui-core/src/timeline/turnGroups.ts:97 — turnGroups.findApprovalTool 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 · CompactToolRow.CompactToolRow (cyclomatic 23) · ×1
  • CompactToolRow.CompactToolRow (cyclomatic 23) packages/jcode-ui/src/components/CompactToolRow.tsx:14 — CompactToolRow.CompactToolRow 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 · store.sendMessage (cyclomatic 23) · ×1
  • store.sendMessage (cyclomatic 23) web/src/app/store.ts:1736 — store.sendMessage has cyclomatic complexity 23 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatView.ChatView (cyclomatic 23) · ×1
  • ChatView.ChatView (cyclomatic 23) web/src/components/ChatView.tsx:66 — ChatView.ChatView has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 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 · RightPanel.FileTreePanel (cyclomatic 23) · ×1
  • RightPanel.FileTreePanel (cyclomatic 23) web/src/components/RightPanel.tsx:321 — RightPanel.FileTreePanel has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (openItem, a function literal at line 330, goBack, …). 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 · Connector.reconcileAccountSettings (cyclomatic 22) · ×1
  • Connector.reconcileAccountSettings (cyclomatic 22) internal/cloud/account_settings.go:227 — Connector.reconcileAccountSettings 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 · command.handleMCPAdd (cyclomatic 22) · ×1
  • command.handleMCPAdd (cyclomatic 22) internal/command/mcp.go:95 — command.handleMCPAdd 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 · ACPHandler.OnToolResult (cyclomatic 22) · ×1
  • ACPHandler.OnToolResult (cyclomatic 22) internal/handler/acp.go:502 — ACPHandler.OnToolResult 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 · model.responsesInput (cyclomatic 22) · ×1
  • model.responsesInput (cyclomatic 22) internal/model/responses_convert.go:69 — model.responsesInput 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 · Client.pollLoop (cyclomatic 22) · ×1
  • Client.pollLoop (cyclomatic 22) internal/pkg/weixin/client.go:200 — Client.pollLoop 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 · tui.summarizeActivityCounts (cyclomatic 22) · ×1
  • tui.summarizeActivityCounts (cyclomatic 22) internal/tui/activity_group.go:392 — tui.summarizeActivityCounts 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 · Server.runAutomation (cyclomatic 22) · ×1
  • Server.runAutomation (cyclomatic 22) internal/web/automation_run.go:66 — Server.runAutomation 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 · Server.handleAddProvider (cyclomatic 22) · ×1
  • Server.handleAddProvider (cyclomatic 22) internal/web/providers.go:832 — Server.handleAddProvider 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · web_toolsearch_orchestrate.run_job (cyclomatic 22) · ×1
  • web_toolsearch_orchestrate.run_job (cyclomatic 22) agent-eval/suite/web_toolsearch_orchestrate.py:661 — web_toolsearch_orchestrate.run_job 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 · WindowCaptureHelper.swift.runCapture (cyclomatic 22) · ×1
  • WindowCaptureHelper.swift.runCapture (cyclomatic 22) cmd/jcode-computerd/WindowCaptureHelper.swift:77 — WindowCaptureHelper.swift.runCapture 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 · just-the-docs.searchLoaded · ×1
  • just-the-docs.searchLoaded::update::addResult (cyclomatic 22) agent-eval/site/docs/assets/js/just-the-docs.js:209 — just-the-docs.searchLoaded::update::addResult 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 · SettingsView.DeveloperTab (cyclomatic 22) · ×1
  • SettingsView.DeveloperTab (cyclomatic 22) web/src/components/SettingsView.tsx:2394 — SettingsView.DeveloperTab has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · GeneratedImageToolRenderer.GeneratedImageToolRenderer (cyclomatic 22) · ×1
  • GeneratedImageToolRenderer.GeneratedImageToolRenderer (cyclomatic 22) web/src/components/GeneratedImageToolRenderer.tsx:11 — GeneratedImageToolRenderer.GeneratedImageToolRenderer has cyclomatic complexity 22 (threshold 15). Of this number, 12 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 · Connector.RevokePairing (cyclomatic 21) · ×1
  • Connector.RevokePairing (cyclomatic 21) internal/cloud/pairing_inbox.go:209 — Connector.RevokePairing 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 · interactiveState.createAgentWithModeCatalog (cyclomatic 21) · ×1
  • interactiveState.createAgentWithModeCatalog (cyclomatic 21) internal/command/interactive.go:329 — interactiveState.createAgentWithModeCatalog 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 · grepTool.runLocalRg (cyclomatic 21) · ×1
  • grepTool.runLocalRg (cyclomatic 21) internal/tools/grep.go:257 — grepTool.runLocalRg 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 · Server.runMCPLogin (cyclomatic 21) · ×1
  • Server.runMCPLogin (cyclomatic 21) internal/web/mcp.go:615 — Server.runMCPLogin 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · report.build (cyclomatic 21) · ×1
  • report.build (cyclomatic 21) agent-eval/analysis/report.py:127 — report.build 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 · routing_verify._verify_fixture (cyclomatic 21) · ×1
  • routing_verify._verify_fixture (cyclomatic 21) agent-eval/suite/routing_verify.py:301 — routing_verify._verify_fixture 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 · web_toolsearch_orchestrate.build_jobs (cyclomatic 21) · ×1
  • web_toolsearch_orchestrate.build_jobs (cyclomatic 21) agent-eval/suite/web_toolsearch_orchestrate.py:319 — web_toolsearch_orchestrate.build_jobs 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 · Game.render (cyclomatic 21) · ×1
  • Game.render (cyclomatic 21) site/public/showcase-projects/game/js/game.js:405 — Game.render 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 · Replica.Replica (cyclomatic 21) · ×1
  • Replica.Replica (cyclomatic 21) site/src/components/desktop/Replica.tsx:106 — Replica.Replica has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (play, a function literal at line 226, onSend, …). 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 · SettingsView.buildMCPRequest (cyclomatic 21) · ×1
  • SettingsView.buildMCPRequest (cyclomatic 21) web/src/components/SettingsView.tsx:2822 — SettingsView.buildMCPRequest 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into 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.main (cyclomatic 20) · ×1
  • main.main (cyclomatic 20) agent-eval/harness/main.go:201 — main.main 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 · approvalMiddleware.WrapInvokableToolCall (cyclomatic 20) · ×1
  • approvalMiddleware.WrapInvokableToolCall (cyclomatic 20) internal/agent/middleware.go:42 — approvalMiddleware.WrapInvokableToolCall 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 one function literal inside it that branches (line 47). 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 · approvalMiddleware.WrapEnhancedInvokableToolCall (cyclomatic 20) · ×1
  • approvalMiddleware.WrapEnhancedInvokableToolCall (cyclomatic 20) internal/agent/middleware.go:158 — approvalMiddleware.WrapEnhancedInvokableToolCall 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 one function literal inside it that branches (line 163). 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 · toolObservationMiddleware.recordSearch (cyclomatic 20) · ×1
  • toolObservationMiddleware.recordSearch (cyclomatic 20) internal/agent/tool_observation.go:252 — toolObservationMiddleware.recordSearch 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 · automation.parseCronField (cyclomatic 20) · ×1
  • automation.parseCronField (cyclomatic 20) internal/automation/cronexpr.go:172 — automation.parseCronField 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 · cloud.projectSessionHistory (cyclomatic 20) · ×1
  • cloud.projectSessionHistory (cyclomatic 20) internal/cloud/history_sync.go:118 — cloud.projectSessionHistory has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Connector.collectCapabilities (cyclomatic 20) · ×1
  • Connector.collectCapabilities (cyclomatic 20) internal/cloud/capabilities.go:77 — Connector.collectCapabilities 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 · Session.Act (cyclomatic 20) · ×1
  • Session.Act (cyclomatic 20) internal/computer/session.go:563 — Session.Act has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · responsesSSEState.handleEvent (cyclomatic 20) · ×1
  • responsesSSEState.handleEvent (cyclomatic 20) internal/model/responses_parse.go:384 — responsesSSEState.handleEvent 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 · cloudLoginFlow.pollAndFinish (cyclomatic 20) · ×1
  • cloudLoginFlow.pollAndFinish (cyclomatic 20) internal/web/cloud_login.go:170 — cloudLoginFlow.pollAndFinish 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 · Server.publishEngineCandidate (cyclomatic 20) · ×1
  • Server.publishEngineCandidate (cyclomatic 20) internal/web/engine.go:577 — Server.publishEngineCandidate 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 · report.render_trajectory (cyclomatic 20) · ×1
  • report.render_trajectory (cyclomatic 20) agent-eval/analysis/report.py:57 — report.render_trajectory 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 · toolsearch_report._trajectory_lines (cyclomatic 20) · ×1
  • toolsearch_report._trajectory_lines (cyclomatic 20) agent-eval/analysis/toolsearch_report.py:1200 — toolsearch_report._trajectory_lines 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 · session_extract.extract_trajectory (cyclomatic 20) · ×1
  • session_extract.extract_trajectory (cyclomatic 20) agent-eval/suite/session_extract.py:98 — session_extract.extract_trajectory 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 · groupExploring.summarizeExploringSteps (cyclomatic 20) · ×1
  • groupExploring.summarizeExploringSteps (cyclomatic 20) packages/jcode-ui-core/src/timeline/groupExploring.ts:144 — groupExploring.summarizeExploringSteps has cyclomatic complexity 20 (threshold 15). Of this number, 19 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 · jui.init (cyclomatic 20) · ×1
  • jui.init (cyclomatic 20) site/public/showcase-projects/ui-kit/js/jui.js:991 — jui.init 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 · LineChart.draw (cyclomatic 20) · ×1
  • LineChart.draw (cyclomatic 20) site/public/showcase-projects/webgpu-cnn/js/charts.js:60 — LineChart.draw 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 · ChatDemo.ChatDemo (cyclomatic 20) · ×1
  • ChatDemo.ChatDemo (cyclomatic 20) site/src/playground/ChatDemo.tsx:86 — ChatDemo.ChatDemo has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 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 · TypingTerminal.TypingTerminal (cyclomatic 20) · ×1
  • TypingTerminal.TypingTerminal (cyclomatic 20) site/src/components/TypingTerminal.tsx:12 — TypingTerminal.TypingTerminal has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 33, 92, 47, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · store.retryRemoteConnection (cyclomatic 20) · ×1
  • store.retryRemoteConnection (cyclomatic 20) web/src/app/store.ts:2607 — store.retryRemoteConnection 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 · CommandPalette.CommandPalette (cyclomatic 20) · ×1
  • CommandPalette.CommandPalette (cyclomatic 20) web/src/components/CommandPalette.tsx:32 — CommandPalette.CommandPalette has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (onKey, openTask, a function literal at line 90, …). 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 · ServerVersionRow.ServerVersionRow (cyclomatic 20) · ×1
  • ServerVersionRow.ServerVersionRow (cyclomatic 20) web/src/components/settings/ServerVersionRow.tsx:28 — ServerVersionRow.ServerVersionRow has cyclomatic complexity 20 (threshold 15). Of this number, 14 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 · SettingsView.ApprovalReviewSection (cyclomatic 20) · ×1
  • SettingsView.ApprovalReviewSection (cyclomatic 20) web/src/components/SettingsView.tsx:2180 — SettingsView.ApprovalReviewSection has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 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 · SettingsView.SkillsTab (cyclomatic 20) · ×1
  • SettingsView.SkillsTab (cyclomatic 20) web/src/components/SettingsView.tsx:3337 — SettingsView.SkillsTab has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 3367, a function literal at line 3406, load, …). 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 · SettingsView.BrowserTab (cyclomatic 20) · ×1
  • SettingsView.BrowserTab (cyclomatic 20) web/src/components/SettingsView.tsx:4005 — SettingsView.BrowserTab has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 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 · App.AutomationRunReplay (cyclomatic 20) · ×1
  • App.AutomationRunReplay (cyclomatic 20) web/src/App.tsx:561 — App.AutomationRunReplay has cyclomatic complexity 20 (threshold 15). Of this number, 19 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 · artifact.validateWorkspaceFile (cyclomatic 19) · ×1
  • artifact.validateWorkspaceFile (cyclomatic 19) internal/artifact/service.go:461 — artifact.validateWorkspaceFile 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 · automation.validateTrigger (cyclomatic 19) · ×1
  • automation.validateTrigger (cyclomatic 19) internal/automation/validate.go:79 — automation.validateTrigger 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 · config.loadAgentRoleDir (cyclomatic 19) · ×1
  • config.loadAgentRoleDir (cyclomatic 19) internal/config/agent_roles.go:91 — config.loadAgentRoleDir 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 · ACPHandler.RequestApproval (cyclomatic 19) · ×1
  • ACPHandler.RequestApproval (cyclomatic 19) internal/handler/acp.go:912 — ACPHandler.RequestApproval 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 · pipeline.runPhase1 (cyclomatic 19) · ×1
  • pipeline.runPhase1 (cyclomatic 19) internal/memory/pipeline/phase1.go:155 — pipeline.runPhase1 has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 209, 191). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Recorder.TruncateAtUserMessage (cyclomatic 19) · ×1
  • Recorder.TruncateAtUserMessage (cyclomatic 19) internal/session/session.go:1275 — Recorder.TruncateAtUserMessage 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 · tools.PerformMCPOAuthLogin (cyclomatic 19) · ×1
  • tools.PerformMCPOAuthLogin (cyclomatic 19) internal/tools/mcp_oauth.go:233 — tools.PerformMCPOAuthLogin 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 · switchEnvTool.InvokableRun (cyclomatic 19) · ×1
  • switchEnvTool.InvokableRun (cyclomatic 19) internal/tools/switch_env.go:46 — switchEnvTool.InvokableRun 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 · Model.handleComputerInput (cyclomatic 19) · ×1
  • Model.handleComputerInput (cyclomatic 19) internal/tui/computer_command.go:16 — Model.handleComputerInput 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 · Server.runConversationAutomation (cyclomatic 19) · ×1
  • Server.runConversationAutomation (cyclomatic 19) internal/web/automation_run.go:187 — Server.runConversationAutomation 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 · Server.handleDevOptionsConfig (cyclomatic 19) · ×1
  • Server.handleDevOptionsConfig (cyclomatic 19) internal/web/dev_options.go:64 — Server.handleDevOptionsConfig 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 · toolsearch_cases.validate_suite (cyclomatic 19) · ×1
  • toolsearch_cases.validate_suite (cyclomatic 19) agent-eval/suite/toolsearch_cases.py:673 — toolsearch_cases.validate_suite 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 · MessageView.MessageView (cyclomatic 19) · ×1
  • MessageView.MessageView (cyclomatic 19) packages/jcode-ui-core/src/primitives/MessageView.tsx:55 — MessageView.MessageView has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · lab.initLab.renderConfusion (cyclomatic 19) · ×1
  • lab.initLab.renderConfusion (cyclomatic 19) site/public/showcase-projects/webgpu-cnn/js/lab.js:459 — lab.initLab.renderConfusion 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsView.SettingsView (cyclomatic 19) · ×1
  • SettingsView.SettingsView (cyclomatic 19) web/src/components/SettingsView.tsx:233 — SettingsView.SettingsView has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SettingsView.GeneralTab (cyclomatic 19) · ×1
  • SettingsView.GeneralTab (cyclomatic 19) web/src/components/SettingsView.tsx:1820 — SettingsView.GeneralTab has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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 · ArtifactsPanel.parseCSV (cyclomatic 19) · ×1
  • ArtifactsPanel.parseCSV (cyclomatic 19) web/src/components/ArtifactsPanel.tsx:129 — ArtifactsPanel.parseCSV 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 · agent.validateDescriptors (cyclomatic 18) · ×1
  • agent.validateDescriptors (cyclomatic 18) internal/agent/tool_plan.go:163 — agent.validateDescriptors 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 · turnBudgetMiddleware.BeforeModelRewriteState (cyclomatic 18) · ×1
  • turnBudgetMiddleware.BeforeModelRewriteState (cyclomatic 18) internal/agent/turn_budget.go:68 — turnBudgetMiddleware.BeforeModelRewriteState 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 · artifact.inspectManagedImage (cyclomatic 18) · ×1
  • artifact.inspectManagedImage (cyclomatic 18) internal/artifact/managed.go:437 — artifact.inspectManagedImage 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 · Scheduler.tick (cyclomatic 18) · ×1
  • Scheduler.tick (cyclomatic 18) internal/automation/scheduler.go:143 — Scheduler.tick has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Session.Act (cyclomatic 18) · ×1
  • Session.Act (cyclomatic 18) internal/browser/actions.go:23 — Session.Act 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 · cloud.UnwrapAccountSyncKey (cyclomatic 18) · ×1
  • cloud.UnwrapAccountSyncKey (cyclomatic 18) internal/cloud/config_sync_crypto.go:113 — cloud.UnwrapAccountSyncKey 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 · Connector.handleWSEvent (cyclomatic 18) · ×1
  • Connector.handleWSEvent (cyclomatic 18) internal/cloud/events.go:374 — Connector.handleWSEvent 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 · Connector.sessionSyncLoop (cyclomatic 18) · ×1
  • Connector.sessionSyncLoop (cyclomatic 18) internal/cloud/sessions.go:157 — Connector.sessionSyncLoop 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 · run.jsAgent (cyclomatic 18) · ×1
  • run.jsAgent (cyclomatic 18) internal/flow/run.go:101 — run.jsAgent has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · memory.WriteNote (cyclomatic 18) · ×1
  • memory.WriteNote (cyclomatic 18) internal/memory/note.go:35 — memory.WriteNote 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 · pipeline.selectSessions (cyclomatic 18) · ×1
  • pipeline.selectSessions (cyclomatic 18) internal/memory/pipeline/phase1.go:47 — pipeline.selectSessions 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 · model.classifyByStatus (cyclomatic 18) · ×1
  • model.classifyByStatus (cyclomatic 18) REDACTED:201 — model.classifyByStatus has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ModelFactory.GetModel (cyclomatic 18) · ×1
  • ModelFactory.GetModel (cyclomatic 18) internal/model/factory.go:91 — ModelFactory.GetModel 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 · responsesSSEState.emitEnvelopeFallback (cyclomatic 18) · ×1
  • responsesSSEState.emitEnvelopeFallback (cyclomatic 18) internal/model/responses_parse.go:449 — responsesSSEState.emitEnvelopeFallback has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · session.validateSecurityJournal (cyclomatic 18) · ×1
  • session.validateSecurityJournal (cyclomatic 18) internal/session/security_journal_strict.go:48 — session.validateSecurityJournal 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 · editTool.applyMultiEdits (cyclomatic 18) · ×1
  • editTool.applyMultiEdits (cyclomatic 18) internal/tools/edit.go:491 — editTool.applyMultiEdits 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 · web.mergeMCPServerReq (cyclomatic 18) · ×1
  • web.mergeMCPServerReq (cyclomatic 18) internal/web/mcp.go:120 — web.mergeMCPServerReq 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 · Server.authorizeCloudRemoteWorkspace (cyclomatic 18) · ×1
  • Server.authorizeCloudRemoteWorkspace (cyclomatic 18) internal/web/activation.go:485 — Server.authorizeCloudRemoteWorkspace 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 · Server.handleGitCheckout (cyclomatic 18) · ×1
  • Server.handleGitCheckout (cyclomatic 18) internal/web/git.go:87 — Server.handleGitCheckout 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 · Server.handleMemorySync (cyclomatic 18) · ×1
  • Server.handleMemorySync (cyclomatic 18) internal/web/memory.go:309 — Server.handleMemorySync 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into 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.handleNewSession (cyclomatic 18) · ×1
  • Server.handleNewSession (cyclomatic 18) internal/web/sessions.go:556 — Server.handleNewSession 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 · toolsearch_campaign.normalize_options (cyclomatic 18) · ×1
  • toolsearch_campaign.normalize_options (cyclomatic 18) agent-eval/suite/toolsearch_campaign.py:460 — toolsearch_campaign.normalize_options 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 · toolsearch_expect._check_searches (cyclomatic 18) · ×1
  • toolsearch_expect._check_searches (cyclomatic 18) agent-eval/suite/toolsearch_expect.py:594 — toolsearch_expect._check_searches 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 · web_toolsearch_orchestrate._load_selected_provider (cyclomatic 18) · ×1
  • web_toolsearch_orchestrate._load_selected_provider (cyclomatic 18) agent-eval/suite/web_toolsearch_orchestrate.py:158 — web_toolsearch_orchestrate._load_selected_provider 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 · groupActivity.bucketOf (cyclomatic 18) · ×1
  • groupActivity.bucketOf (cyclomatic 18) packages/jcode-ui-core/src/timeline/groupActivity.ts:147 — groupActivity.bucketOf 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 · ThreadList.RowActions (cyclomatic 18) · ×1
  • ThreadList.RowActions (cyclomatic 18) packages/jcode-ui/src/components/ThreadList.tsx:240 — ThreadList.RowActions has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 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 · city.fillBlock (cyclomatic 18) · ×1
  • city.fillBlock (cyclomatic 18) site/public/showcase-projects/city3d/js/city.js:181 — city.fillBlock 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 · jui.initTableSort (cyclomatic 18) · ×1
  • jui.initTableSort (cyclomatic 18) site/public/showcase-projects/ui-kit/js/jui.js:682 — jui.initTableSort 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 7 function items inside it that branch (a function literal at line 710, applySort, a function literal at line 686, …). 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 · DocPage.DocPage (cyclomatic 18) · ×1
  • DocPage.DocPage (cyclomatic 18) site/src/pages/docs/DocPage.tsx:110 — DocPage.DocPage has cyclomatic complexity 18 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · store.replayArtifacts (cyclomatic 18) · ×1
  • store.replayArtifacts (cyclomatic 18) web/src/app/store.ts:160 — store.replayArtifacts 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 · store.lifecycleHostIndex (cyclomatic 18) · ×1
  • store.lifecycleHostIndex (cyclomatic 18) web/src/app/store.ts:392 — store.lifecycleHostIndex 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 · SidebarFilterMenu.SidebarFilterMenu (cyclomatic 18) · ×1
  • SidebarFilterMenu.SidebarFilterMenu (cyclomatic 18) web/src/components/SidebarFilterMenu.tsx:60 — SidebarFilterMenu.SidebarFilterMenu has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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 · Sidebar.compareProjectGroups (cyclomatic 18) · ×1
  • Sidebar.compareProjectGroups (cyclomatic 18) web/src/components/Sidebar.tsx:1158 — Sidebar.compareProjectGroups 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 · useAppUpdate.AppUpdateProvider (cyclomatic 18) · ×1
  • useAppUpdate.AppUpdateProvider (cyclomatic 18) web/src/lib/useAppUpdate.tsx:70 — useAppUpdate.AppUpdateProvider has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 82, 122, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TerminalPanel.TerminalPanel (cyclomatic 18) · ×1
  • TerminalPanel.TerminalPanel (cyclomatic 18) web/src/components/TerminalPanel.tsx:31 — TerminalPanel.TerminalPanel has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 93, 175, 99, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · agent.parseToolSearchExactListEnvelope (cyclomatic 17) · ×1
  • agent.parseToolSearchExactListEnvelope (cyclomatic 17) internal/agent/toolsearch_disclosure.go:224 — agent.parseToolSearchExactListEnvelope 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 · Notifier.connect (cyclomatic 17) · ×1
  • Notifier.connect (cyclomatic 17) internal/channel/ble/ble_cgo.go:138 — Notifier.connect 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 · interactiveState.handleResume (cyclomatic 17) · ×1
  • interactiveState.handleResume (cyclomatic 17) internal/command/interactive.go:962 — interactiveState.handleResume 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 · handler.pendingApprovalIndex (cyclomatic 17) · ×1
  • handler.pendingApprovalIndex (cyclomatic 17) internal/handler/acp.go:93 — handler.pendingApprovalIndex 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 · pipeline.buildTranscript (cyclomatic 17) · ×1
  • pipeline.buildTranscript (cyclomatic 17) internal/memory/pipeline/phase1.go:93 — pipeline.buildTranscript 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 · providertools.ImageModels (cyclomatic 17) · ×1
  • providertools.ImageModels (cyclomatic 17) internal/providertools/manifest.go:197 — providertools.ImageModels 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 · review.runReviewerAgent (cyclomatic 17) · ×1
  • review.runReviewerAgent (cyclomatic 17) internal/review/investigate.go:120 — review.runReviewerAgent 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 · session.ValidateProviderToolTransition (cyclomatic 17) · ×1
  • session.ValidateProviderToolTransition (cyclomatic 17) internal/session/provider_tool_operation.go:96 — session.ValidateProviderToolTransition 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 · session.ValidateGenerationTransition (cyclomatic 17) · ×1
  • session.ValidateGenerationTransition (cyclomatic 17) internal/session/session.go:168 — session.ValidateGenerationTransition 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 · skills.parseFrontmatter (cyclomatic 17) · ×1
  • skills.parseFrontmatter (cyclomatic 17) internal/skills/skills.go:310 — skills.parseFrontmatter 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 · tools.ExtractTodosFromPlan (cyclomatic 17) · ×1
  • tools.ExtractTodosFromPlan (cyclomatic 17) internal/tools/plan_parse.go:17 — tools.ExtractTodosFromPlan 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 · tools.WrapProviderManagedBillableTool (cyclomatic 17) · ×1
  • tools.WrapProviderManagedBillableTool (cyclomatic 17) internal/tools/provider_managed_billable.go:66 — tools.WrapProviderManagedBillableTool 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 · SSHExecutor.runOnce (cyclomatic 17) · ×1
  • SSHExecutor.runOnce (cyclomatic 17) internal/tools/env.go:918 — SSHExecutor.runOnce 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 · workflowRunTool.InvokableRun (cyclomatic 17) · ×1
  • workflowRunTool.InvokableRun (cyclomatic 17) REDACTED:88 — workflowRunTool.InvokableRun 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 · Server.assembleConversationEngine (cyclomatic 17) · ×1
  • Server.assembleConversationEngine (cyclomatic 17) internal/web/activation.go:382 — Server.assembleConversationEngine 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 · Server.engineForChatContext (cyclomatic 17) · ×1
  • Server.engineForChatContext (cyclomatic 17) internal/web/chat.go:82 — Server.engineForChatContext 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 · computer_report.main (cyclomatic 17) · ×1
  • computer_report.main (cyclomatic 17) agent-eval/analysis/computer_report.py:39 — computer_report.main 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 · toolsearch_report._evaluate_gates (cyclomatic 17) · ×1
  • toolsearch_report._evaluate_gates (cyclomatic 17) agent-eval/analysis/toolsearch_report.py:828 — toolsearch_report._evaluate_gates 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 · routing_verify._batch_facts (cyclomatic 17) · ×1
  • routing_verify._batch_facts (cyclomatic 17) agent-eval/suite/routing_verify.py:177 — routing_verify._batch_facts 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 · toolsearch_cases._validate_call (cyclomatic 17) · ×1
  • toolsearch_cases._validate_call (cyclomatic 17) agent-eval/suite/toolsearch_cases.py:321 — toolsearch_cases._validate_call has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · toolsearch_expect._search_facts (cyclomatic 17) · ×1
  • toolsearch_expect._search_facts (cyclomatic 17) agent-eval/suite/toolsearch_expect.py:388 — toolsearch_expect._search_facts 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 · computerAct.ComputerActRenderer (cyclomatic 17) · ×1
  • computerAct.ComputerActRenderer (cyclomatic 17) packages/jcode-ui/src/toolRenderers/computerAct.tsx:63 — computerAct.ComputerActRenderer has cyclomatic 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ThreadList.ThreadList (cyclomatic 17) · ×1
  • ThreadList.ThreadList (cyclomatic 17) packages/jcode-ui/src/components/ThreadList.tsx:40 — ThreadList.ThreadList has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ChatInput.ChatInput · ×1
  • ChatInput.ChatInput::handleKeyDown (cyclomatic 17) packages/jcode-ui/src/product/ChatInput.tsx:940 — ChatInput.ChatInput::handleKeyDown has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ChatInput.ChatInput) 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 · lab.preprocess (cyclomatic 17) · ×1
  • lab.preprocess (cyclomatic 17) site/public/showcase-projects/webgpu-cnn/js/lab.js:123 — lab.preprocess has cyclomatic complexity 17 (threshold 15). Of this number, 13 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 · renderMarkdown (cyclomatic 17) · ×1
  • renderMarkdown (cyclomatic 17) script/generate_jcode_ui_api_docs.mjs:195 — renderMarkdown has cyclomatic complexity 17 (threshold 15). Of this number, 11 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 · reminderMiddleware.BeforeModelRewriteState (cyclomatic 16) · ×1
  • reminderMiddleware.BeforeModelRewriteState (cyclomatic 16) REDACTED:104 — reminderMiddleware.BeforeModelRewriteState 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 · Store.ResolveOwnerSession (cyclomatic 16) · ×1
  • Store.ResolveOwnerSession (cyclomatic 16) internal/automation/store.go:382 — Store.ResolveOwnerSession 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 one function literal inside it that branches (line 387). 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 · cloud.LoadCredentials (cyclomatic 16) · ×1
  • cloud.LoadCredentials (cyclomatic 16) internal/cloud/credentials.go:77 — cloud.LoadCredentials 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 · Client.writeJSON (cyclomatic 16) · ×1
  • Client.writeJSON (cyclomatic 16) internal/cloud/client.go:158 — Client.writeJSON 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 · command.startWebServer (cyclomatic 16) · ×1
  • command.startWebServer (cyclomatic 16) internal/command/web.go:1238 — command.startWebServer has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 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 · interactiveState.handlePlanCompletion (cyclomatic 16) · ×1
  • interactiveState.handlePlanCompletion (cyclomatic 16) internal/command/interactive.go:848 — interactiveState.handlePlanCompletion 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 · config.loadConfig (cyclomatic 16) · ×1
  • config.loadConfig (cyclomatic 16) internal/config/config.go:1102 — config.loadConfig 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 · release.comparePre (cyclomatic 16) · ×1
  • release.comparePre (cyclomatic 16) internal/release/release.go:147 — release.comparePre 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 · tools.extractFlowJSON (cyclomatic 16) · ×1
  • tools.extractFlowJSON (cyclomatic 16) REDACTED:235 — tools.extractFlowJSON 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 · editTool.editFile (cyclomatic 16) · ×1
  • editTool.editFile (cyclomatic 16) internal/tools/edit.go:181 — editTool.editFile 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 · grepTool.buildRemoteCmd (cyclomatic 16) · ×1
  • grepTool.buildRemoteCmd (cyclomatic 16) internal/tools/grep.go:581 — grepTool.buildRemoteCmd 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 · enhancedTodoWriteTool.InvokableRun (cyclomatic 16) · ×1
  • enhancedTodoWriteTool.InvokableRun (cyclomatic 16) internal/tools/todo_enhanced.go:677 — enhancedTodoWriteTool.InvokableRun 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 · tui.sanitize (cyclomatic 16) · ×1
  • tui.sanitize (cyclomatic 16) internal/tui/format.go:46 — tui.sanitize 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 · Model.handleManageModelsKey (cyclomatic 16) · ×1
  • Model.handleManageModelsKey (cyclomatic 16) internal/tui/manage_models.go:120 — Model.handleManageModelsKey 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 · Server.handleMemoryStatus (cyclomatic 16) · ×1
  • Server.handleMemoryStatus (cyclomatic 16) internal/web/memory.go:179 — Server.handleMemoryStatus 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 · Server.ensureCustomModelConfigured (cyclomatic 16) · ×1
  • Server.ensureCustomModelConfigured (cyclomatic 16) internal/web/models.go:795 — Server.ensureCustomModelConfigured has cyclomatic complexity 16 (threshold 15). Of this number, 9 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 · workspace.ValidateScratchPath (cyclomatic 16) · ×1
  • workspace.ValidateScratchPath (cyclomatic 16) internal/workspace/scratch.go:69 — workspace.ValidateScratchPath 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 · toolsearch_cases._validate_browser_fixture (cyclomatic 16) · ×1
  • toolsearch_cases._validate_browser_fixture (cyclomatic 16) agent-eval/suite/toolsearch_cases.py:480 — toolsearch_cases._validate_browser_fixture 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 · toolsearch_expect._pair_entries (cyclomatic 16) · ×1
  • toolsearch_expect._pair_entries (cyclomatic 16) agent-eval/suite/toolsearch_expect.py:274 — toolsearch_expect._pair_entries 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 · toolsearch_expect._batch_facts (cyclomatic 16) · ×1
  • toolsearch_expect._batch_facts (cyclomatic 16) agent-eval/suite/toolsearch_expect.py:333 — toolsearch_expect._batch_facts 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 · Attachment.Attachment (cyclomatic 16) · ×1
  • Attachment.Attachment (cyclomatic 16) packages/jcode-ui/src/components/Attachment.tsx:36 — Attachment.Attachment 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 · Attachment.PendingTile (cyclomatic 16) · ×1
  • Attachment.PendingTile (cyclomatic 16) packages/jcode-ui/src/components/Attachment.tsx:208 — Attachment.PendingTile 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 · ActivityGroupCard.ActivityGroupCard (cyclomatic 16) · ×1
  • ActivityGroupCard.ActivityGroupCard (cyclomatic 16) packages/jcode-ui/src/components/ActivityGroupCard.tsx:32 — ActivityGroupCard.ActivityGroupCard 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 · stackTrace.StackView (cyclomatic 16) · ×1
  • stackTrace.StackView (cyclomatic 16) packages/jcode-ui/src/toolRenderers/stackTrace.tsx:59 — stackTrace.StackView 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 2 function items inside it that branch (a function literal at line 76, openFile). 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 · jui.initPopover (cyclomatic 16) · ×1
  • jui.initPopover (cyclomatic 16) site/public/showcase-projects/ui-kit/js/jui.js:493 — jui.initPopover has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 518, a function literal at line 508, close, …). 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 · useDesktop.initExternalLinks (cyclomatic 16) · ×1
  • useDesktop.initExternalLinks (cyclomatic 16) web/src/lib/useDesktop.ts:117 — useDesktop.initExternalLinks 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 (onClick). 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 · remote.parseRemoteLabel (cyclomatic 16) · ×1
  • remote.parseRemoteLabel (cyclomatic 16) web/src/lib/remote.ts:32 — remote.parseRemoteLabel 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 · AutomationsView.AutomationEditor · ×1
  • AutomationsView.AutomationEditor::save (cyclomatic 16) web/src/components/AutomationsView.tsx:451 — AutomationsView.AutomationEditor::save has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (AutomationsView.AutomationEditor) 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 · ComputerShotPiP.ComputerShotPiP (cyclomatic 16) · ×1
  • ComputerShotPiP.ComputerShotPiP (cyclomatic 16) web/src/components/ComputerShotPiP.tsx:31 — ComputerShotPiP.ComputerShotPiP 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, separate the cases: extract each independent 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 · Model.Update (cognitive 1067) · ×1
  • Model.Update (cognitive 1067) internal/tui/update.go:21 — Model.Update has cognitive complexity 1067 (threshold 15). Drivers by points: if/else 256 (862 pts), match/switch 40 (131 pts), boolean chains 50, loops 7 (24 pts) (nesting depth added 714). Of this number, 1057 points are the body's own statements and 10 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 · runner.runInner (cognitive 284) · ×1
  • runner.runInner (cognitive 284) internal/runner/runner.go:305 — runner.runInner has cognitive complexity 284 (threshold 15). Drivers by points: if/else 71 (234 pts), loops 15 (34 pts), boolean chains 14, match/switch 1 (2 pts) (nesting depth added 183). Of this number, 253 points are the body's own statements and 31 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Sidebar.Sidebar (cognitive 198) · ×1
  • Sidebar.Sidebar (cognitive 198) web/src/components/Sidebar.tsx:107 — Sidebar.Sidebar has cognitive complexity 198 (threshold 15). Drivers by points: if/else 58 (72 pts), ternaries 37 (64 pts), boolean chains 47, loops 8 (9 pts), error handling 5 (6 pts) (nesting depth added 43). Most of this is not in the body itself: 11 of the 198 points are its own statements and the rest belongs to 37 function items inside it that branch (a function literal at line 635, a function literal at line 300, a function literal at line 252, …). 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 · command.RunInteractive (cognitive 152) · ×1
  • command.RunInteractive (cognitive 152) internal/command/interactive.go:1391 — command.RunInteractive has cognitive complexity 152 (threshold 15). Drivers by points: if/else 88 (132 pts), boolean chains 9, loops 4 (8 pts), match/switch 1 (3 pts) (nesting depth added 50). Of this number, 107 points are the body's own statements and 45 belong to 16 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.run (cognitive 150) · ×1
  • main.run (cognitive 150) script/generate_models.go:120 — main.run has cognitive complexity 150 (threshold 15). Drivers by points: if/else 35 (124 pts), loops 10 (26 pts) (nesting depth added 105). 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 · CloudTab.CloudTab (cognitive 146) · ×1
  • CloudTab.CloudTab (cognitive 146) web/src/components/settings/CloudTab.tsx:89 — CloudTab.CloudTab has cognitive complexity 146 (threshold 15). Drivers by points: ternaries 26 (65 pts), boolean chains 40, if/else 27, error handling 13 (14 pts) (nesting depth added 40). Of this number, 72 points are the body's own statements and 74 belong to 18 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 · Manager.runAgentTurn (cognitive 145) · ×1
  • Manager.runAgentTurn (cognitive 145) internal/team/manager.go:607 — Manager.runAgentTurn has cognitive complexity 145 (threshold 15). Drivers by points: if/else 41 (115 pts), loops 5 (22 pts), boolean chains 8 (nesting depth added 91). Of this number, 144 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · command.runWebServer (cognitive 143) · ×1
  • command.runWebServer (cognitive 143) internal/command/web.go:253 — command.runWebServer has cognitive complexity 143 (threshold 15). Drivers by points: if/else 94 (115 pts), boolean chains 22, loops 4 (6 pts) (nesting depth added 23). Most of this is not in the body itself: 11 of the 143 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 434, 345, 293). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · RemoteConnectWizard.RemoteConnectWizard (cognitive 138) · ×1
  • RemoteConnectWizard.RemoteConnectWizard (cognitive 138) web/src/components/RemoteConnectWizard.tsx:36 — RemoteConnectWizard.RemoteConnectWizard has cognitive complexity 138 (threshold 15). Drivers by points: boolean chains 53, if/else 41 (46 pts), ternaries 23 (30 pts), error handling 9 (nesting depth added 12). Of this number, 28 points are the body's own statements and 110 belong to 27 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 · Game.update (cognitive 134) · ×1
  • Game.update (cognitive 134) site/public/showcase-projects/game/js/game.js:252 — Game.update has cognitive complexity 134 (threshold 15). Drivers by points: if/else 37 (93 pts), loops 8 (20 pts), ternaries 2 (11 pts), boolean chains 10 (nesting depth added 77). Of this number, 124 points are the body's own statements and 10 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 · verify.check_oracle (cognitive 131) · ×1
  • verify.check_oracle (cognitive 131) agent-eval/suite/verify.py:150 — verify.check_oracle has cognitive complexity 131 (threshold 15). Drivers by points: if/else 57 (91 pts), boolean chains 19, error handling 3 (10 pts), loops 4 (9 pts), ternaries 1 (2 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.handleProviderCatalog (cognitive 126) · ×1
  • Server.handleProviderCatalog (cognitive 126) internal/web/providers.go:250 — Server.handleProviderCatalog has cognitive complexity 126 (threshold 15). Drivers by points: if/else 31 (92 pts), loops 10 (26 pts), boolean chains 8 (nesting depth added 77). Of this number, 118 points are the body's own statements and 8 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 · Server.handleUpdateProvider (cognitive 126) · ×1
  • Server.handleUpdateProvider (cognitive 126) internal/web/providers.go:1008 — Server.handleUpdateProvider has cognitive complexity 126 (threshold 15). Drivers by points: if/else 56 (104 pts), loops 5 (13 pts), boolean chains 9 (nesting depth added 56). Of this number, 17 points are the body's own statements and 109 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 · SettingsView.ComputerTab (cognitive 125) · ×1
  • SettingsView.ComputerTab (cognitive 125) web/src/components/SettingsView.tsx:4420 — SettingsView.ComputerTab has cognitive complexity 125 (threshold 15). Drivers by points: ternaries 35 (68 pts), boolean chains 30, if/else 22 (24 pts), error handling 2, loops 1 (nesting depth added 35). Of this number, 89 points are the body's own statements and 36 belong to 16 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · web_browser_driver.run_web_browser_case (cognitive 120) · ×1
  • web_browser_driver.run_web_browser_case (cognitive 120) REDACTED:908 — web_browser_driver.run_web_browser_case has cognitive complexity 120 (threshold 15). Drivers by points: if/else 43 (74 pts), boolean chains 25, error handling 9 (16 pts), loops 3 (5 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch 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.Composer (cognitive 120) · ×1
  • Composer.Composer (cognitive 120) packages/jcode-ui-core/src/primitives/Composer.tsx:219 — Composer.Composer has cognitive complexity 120 (threshold 15). Drivers by points: if/else 41 (51 pts), ternaries 33 (46 pts), boolean chains 20, loops 3 (nesting depth added 23). Of this number, 45 points are the body's own statements and 75 belong to 27 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 · subagentTool.runSubagent (cognitive 97) · ×1
  • subagentTool.runSubagent (cognitive 97) internal/tools/subagent.go:398 — subagentTool.runSubagent has cognitive complexity 97 (threshold 15). Drivers by points: if/else 26 (76 pts), loops 6 (18 pts), boolean chains 3 (nesting depth added 62). Of this number, 92 points are the body's own statements and 5 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 · SettingsView.ProvidersTab (cognitive 95) · ×1
  • SettingsView.ProvidersTab (cognitive 95) web/src/components/SettingsView.tsx:331 — SettingsView.ProvidersTab has cognitive complexity 95 (threshold 15). Drivers by points: ternaries 19 (32 pts), boolean chains 29, if/else 21 (24 pts), error handling 10 (nesting depth added 16). Of this number, 20 points are the body's own statements and 75 belong to 26 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 · AutomationsView.AutomationsView (cognitive 92) · ×1
  • AutomationsView.AutomationsView (cognitive 92) web/src/components/AutomationsView.tsx:789 — AutomationsView.AutomationsView has cognitive complexity 92 (threshold 15). Drivers by points: ternaries 16 (65 pts), boolean chains 17, if/else 6 (10 pts) (nesting depth added 53). Most of this is not in the body itself: 14 of the 92 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 970, 1124, 849, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · ChatInput.ChatInput (cognitive 88) · ×1
  • ChatInput.ChatInput (cognitive 88) packages/jcode-ui/src/product/ChatInput.tsx:306 — ChatInput.ChatInput has cognitive complexity 88 (threshold 15). Drivers by points: boolean chains 124, if/else 94 (124 pts), ternaries 24 (30 pts), loops 6 (10 pts), error handling 2 (5 pts) (nesting depth added 43). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 (ChatInput.ChatInput::handleKeyDown) 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 · extractSymbols (cognitive 88) · ×1
  • extractSymbols (cognitive 88) script/generate_jcode_ui_api_docs.mjs:52 — extractSymbols has cognitive complexity 88 (threshold 15). Drivers by points: if/else 27 (61 pts), loops 4 (10 pts), boolean chains 9, ternaries 3 (7 pts), other 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.handleModelInput (cognitive 87) · ×1
  • Model.handleModelInput (cognitive 87) internal/tui/pickers.go:15 — Model.handleModelInput has cognitive complexity 87 (threshold 15). Drivers by points: if/else 26 (72 pts), loops 6 (10 pts), boolean chains 5 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspacePicker.WorkspacePicker (cognitive 85) · ×1
  • WorkspacePicker.WorkspacePicker (cognitive 85) packages/jcode-ui/src/product/WorkspacePicker.tsx:51 — WorkspacePicker.WorkspacePicker has cognitive complexity 85 (threshold 15). Drivers by points: boolean chains 34, if/else 21 (26 pts), ternaries 13 (18 pts), error handling 5 (6 pts), loops 1 (nesting depth added 11). Of this number, 26 points are the body's own statements and 59 belong to 17 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 · Connector.reconcileProviderConfigs (cognitive 83) · ×1
  • Connector.reconcileProviderConfigs (cognitive 83) internal/cloud/provider_sync.go:372 — Connector.reconcileProviderConfigs has cognitive complexity 83 (threshold 15). Drivers by points: if/else 30 (67 pts), loops 8 (9 pts), boolean chains 7 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · App.App (cognitive 83) · ×1
  • App.App (cognitive 83) web/src/App.tsx:83 — App.App has cognitive complexity 83 (threshold 15). Drivers by points: if/else 32 (41 pts), boolean chains 20, ternaries 6 (16 pts), error handling 4 (6 pts) (nesting depth added 21). Most of this is not in the body itself: 4 of the 83 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 111, 212, 271, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · SetupModel.Update (cognitive 77) · ×1
  • SetupModel.Update (cognitive 77) internal/tui/setup.go:168 — SetupModel.Update has cognitive complexity 77 (threshold 15). Drivers by points: if/else 23 (59 pts), match/switch 5 (12 pts), boolean chains 6 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsView.MemoryTab (cognitive 77) · ×1
  • SettingsView.MemoryTab (cognitive 77) web/src/components/SettingsView.tsx:3451 — SettingsView.MemoryTab has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 38, ternaries 13 (18 pts), if/else 16, error handling 5 (nesting depth added 5). Of this number, 36 points are the body's own statements and 41 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.
D2 · Cognitive Complexity · acpAgent.Prompt (cognitive 75) · ×1
  • acpAgent.Prompt (cognitive 75) internal/command/acp.go:936 — acpAgent.Prompt has cognitive complexity 75 (threshold 15). Drivers by points: if/else 29 (64 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProviderAuthSection.ProviderAuthSection (cognitive 75) · ×1
  • ProviderAuthSection.ProviderAuthSection (cognitive 75) web/src/components/settings/ProviderAuthSection.tsx:250 — ProviderAuthSection.ProviderAuthSection has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 26 (78 pts), boolean chains 51, if/else 41 (50 pts), error handling 8 (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. This shape REPEATS in the file: one other method here (ProviderAuthSection.ProviderAuthSection::runStatusAction) 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 · SettingsView.ProviderCard (cognitive 71) · ×1
  • SettingsView.ProviderCard (cognitive 71) web/src/components/SettingsView.tsx:893 — SettingsView.ProviderCard has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 21 (47 pts), boolean chains 23, if/else 1 (nesting depth added 26). Of this number, 51 points are the body's own statements and 20 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 · orchestrate._run_one (cognitive 70) · ×1
  • orchestrate._run_one (cognitive 70) agent-eval/suite/orchestrate.py:514 — orchestrate._run_one has cognitive complexity 70 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 12, ternaries 8 (11 pts), loops 6 (10 pts), error handling 3 (7 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze.main (cognitive 69) · ×1
  • analyze.main (cognitive 69) agent-eval/analysis/analyze.py:102 — analyze.main has cognitive complexity 69 (threshold 15). Drivers by points: if/else 24 (40 pts), loops 11 (15 pts), ternaries 6 (11 pts), boolean chains 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Game.handleClick (cognitive 68) · ×1
  • Game.handleClick (cognitive 68) site/public/showcase-projects/game/js/game.js:481 — Game.handleClick has cognitive complexity 68 (threshold 15). Drivers by points: if/else 36 (59 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsView.MCPTab (cognitive 68) · ×1
  • SettingsView.MCPTab (cognitive 68) web/src/components/SettingsView.tsx:2863 — SettingsView.MCPTab has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 16 (35 pts), boolean chains 21, if/else 7, error handling 5 (nesting depth added 19). Of this number, 17 points are the body's own statements and 51 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.ReconstructState (cognitive 67) · ×1
  • session.ReconstructState (cognitive 67) internal/session/history.go:149 — session.ReconstructState has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (55 pts), boolean chains 4, loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.handleListModels (cognitive 67) · ×1
  • Server.handleListModels (cognitive 67) internal/web/models.go:104 — Server.handleListModels has cognitive complexity 67 (threshold 15). Drivers by points: if/else 21 (47 pts), loops 9 (16 pts), boolean chains 4 (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 · Server.handleDeleteSession (cognitive 59) · ×1
  • Server.handleDeleteSession (cognitive 59) internal/web/sessions.go:289 — Server.handleDeleteSession has cognitive complexity 59 (threshold 15). Drivers by points: if/else 30 (53 pts), boolean chains 6 (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 · just-the-docs.searchLoaded · ×1
  • just-the-docs.searchLoaded::update::addResult (cognitive 58) agent-eval/site/docs/assets/js/just-the-docs.js:209 — just-the-docs.searchLoaded::update::addResult has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 7 (19 pts), boolean chains 2 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · web.inspectSessionChangesFromBase (cognitive 57) · ×1
  • web.inspectSessionChangesFromBase (cognitive 57) internal/web/session_changes.go:112 — web.inspectSessionChangesFromBase has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (40 pts), boolean chains 10, loops 4 (7 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 · store.replayTimeline (cognitive 55) · ×1
  • store.replayTimeline (cognitive 55) web/src/app/store.ts:72 — store.replayTimeline has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 13, ternaries 3 (9 pts), loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · acpAgent.buildAgentSession (cognitive 54) · ×1
  • acpAgent.buildAgentSession (cognitive 54) internal/command/acp.go:478 — acpAgent.buildAgentSession has cognitive complexity 54 (threshold 15). Drivers by points: if/else 41 (48 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 8). Of this number, 31 points are the body's own statements and 23 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, 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 · Client.pollLoop (cognitive 54) · ×1
  • Client.pollLoop (cognitive 54) internal/pkg/weixin/client.go:200 — Client.pollLoop has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 3 (7 pts), match/switch 2 (5 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.ensureConversationLocked (cognitive 54) · ×1
  • Server.ensureConversationLocked (cognitive 54) internal/web/activation.go:237 — Server.ensureConversationLocked has cognitive complexity 54 (threshold 15). Drivers by points: if/else 31 (45 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 15). Of this number, 53 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 · Server.submitMessageWithOptions (cognitive 54) · ×1
  • Server.submitMessageWithOptions (cognitive 54) internal/web/chat.go:198 — Server.submitMessageWithOptions has cognitive complexity 54 (threshold 15). Drivers by points: if/else 30 (48 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 20). Of this number, 51 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 · city.buildCity (cognitive 54) · ×1
  • city.buildCity (cognitive 54) site/public/showcase-projects/city3d/js/city.js:308 — city.buildCity has cognitive complexity 54 (threshold 15). Drivers by points: loops 20 (30 pts), if/else 10 (19 pts), ternaries 3 (5 pts) (nesting depth added 21). 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 · Server.handleSetupComplete (cognitive 53) · ×1
  • Server.handleSetupComplete (cognitive 53) internal/web/setup.go:261 — Server.handleSetupComplete has cognitive complexity 53 (threshold 15). Drivers by points: if/else 27 (40 pts), boolean chains 8, loops 2 (5 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 · toolsearch_cases._validate_expectation (cognitive 52) · ×1
  • toolsearch_cases._validate_expectation (cognitive 52) agent-eval/suite/toolsearch_cases.py:355 — toolsearch_cases._validate_expectation has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 19, loops 3, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.handleListProviders (cognitive 51) · ×1
  • Server.handleListProviders (cognitive 51) internal/web/providers.go:676 — Server.handleListProviders has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 5 (11 pts), boolean chains 2 (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 · Conv2D.backward (cognitive 50) · ×1
  • Conv2D.backward (cognitive 50) site/public/showcase-projects/webgpu-cnn/js/nn/cpu.js:127 — Conv2D.backward has cognitive complexity 50 (threshold 15). Drivers by points: loops 7 (28 pts), if/else 3 (20 pts), boolean chains 2 (nesting depth added 38). 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 · toolsearch_cases._validate_case (cognitive 49) · ×1
  • toolsearch_cases._validate_case (cognitive 49) agent-eval/suite/toolsearch_cases.py:551 — toolsearch_cases._validate_case has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 15, loops 3 (4 pts), ternaries 2 (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 · ToolRow.ToolRowHeader (cognitive 49) · ×1
  • ToolRow.ToolRowHeader (cognitive 49) REDACTED:43 — ToolRow.ToolRowHeader has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 20 (34 pts), boolean chains 13, if/else 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.mergeProjectFields (cognitive 48) · ×1
  • config.mergeProjectFields (cognitive 48) internal/config/project.go:163 — config.mergeProjectFields has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (36 pts), loops 6 (12 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 · web_browser_driver.analyze_browser_session (cognitive 48) · ×1
  • web_browser_driver.analyze_browser_session (cognitive 48) REDACTED:600 — web_browser_driver.analyze_browser_session has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 9, ternaries 2 (6 pts), error handling 3 (4 pts), loops 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 · GeneratedImageCard.GeneratedImageCard (cognitive 47) · ×1
  • GeneratedImageCard.GeneratedImageCard (cognitive 47) packages/jcode-ui/src/components/GeneratedImageCard.tsx:100 — GeneratedImageCard.GeneratedImageCard has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 18 (26 pts), boolean chains 20, if/else 1 (nesting depth added 8). Of this number, 44 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 · SelectMenu.SelectMenu (cognitive 47) · ×1
  • SelectMenu.SelectMenu (cognitive 47) web/src/components/SelectMenu.tsx:33 — SelectMenu.SelectMenu has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (22 pts), ternaries 11 (14 pts), boolean chains 11 (nesting depth added 4). Most of this is not in the body itself: 10 of the 47 points are its own statements and the rest belongs to 13 function items inside it that branch (onListKeyDown, onTriggerKeyDown, openMenu, …). 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 · Server.handleRemoteBind (cognitive 46) · ×1
  • Server.handleRemoteBind (cognitive 46) internal/web/remote.go:318 — Server.handleRemoteBind has cognitive complexity 46 (threshold 15). Drivers by points: if/else 25 (40 pts), boolean chains 6 (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.swift.handleCapture (cognitive 46) · ×1
  • main.swift.handleCapture (cognitive 46) cmd/jcode-computerd/main.swift:1522 — main.swift.handleCapture has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 6, ternaries 2 (6 pts), error handling 3 (4 pts), loops 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · jui.initSelect (cognitive 46) · ×1
  • jui.initSelect (cognitive 46) site/public/showcase-projects/ui-kit/js/jui.js:168 — jui.initSelect has cognitive complexity 46 (threshold 15). Drivers by points: if/else 26 (31 pts), boolean chains 12, loops 1 (2 pts), ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 46 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 224, setActive, syncValue, …). 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 · model.responsesInput (cognitive 45) · ×1
  • model.responsesInput (cognitive 45) internal/model/responses_convert.go:69 — model.responsesInput has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 4 (8 pts), boolean chains 5 (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 · Conv2D.forward (cognitive 45) · ×1
  • Conv2D.forward (cognitive 45) site/public/showcase-projects/webgpu-cnn/js/nn/cpu.js:70 — Conv2D.forward has cognitive complexity 45 (threshold 15). Drivers by points: loops 7 (28 pts), if/else 2 (15 pts), boolean chains 2 (nesting depth added 34). 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 · gradcheck.convF64 (cognitive 45) · ×1
  • gradcheck.convF64 (cognitive 45) site/public/showcase-projects/webgpu-cnn/js/nn/gradcheck.js:22 — gradcheck.convF64 has cognitive complexity 45 (threshold 15). Drivers by points: loops 7 (28 pts), if/else 2 (15 pts), boolean chains 2 (nesting depth added 34). 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 · SettingsView.ProviderForm · ×1
  • SettingsView.ProviderForm::save (cognitive 45) web/src/components/SettingsView.tsx:1329 — SettingsView.ProviderForm::save has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 11 (23 pts), boolean chains 12, if/else 8 (9 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. This shape REPEATS in the file: one other method here (SettingsView.ProviderForm) 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 · model.responsesConversationItems (cognitive 44) · ×1
  • model.responsesConversationItems (cognitive 44) internal/model/responses_convert.go:141 — model.responsesConversationItems has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 4, match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Message.Message (cognitive 44) · ×1
  • Message.Message (cognitive 44) REDACTED:59 — Message.Message has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 13 (23 pts), boolean chains 15, if/else 4 (5 pts), error handling 1 (nesting depth added 11). Of this number, 36 points are the body's own statements and 8 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 · toolsearch_report._trajectory_lines (cognitive 43) · ×1
  • toolsearch_report._trajectory_lines (cognitive 43) agent-eval/analysis/toolsearch_report.py:1200 — toolsearch_report._trajectory_lines has cognitive complexity 43 (threshold 15). Drivers by points: if/else 5 (20 pts), ternaries 3 (15 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_report.render_html (cognitive 43) · ×1
  • toolsearch_report.render_html (cognitive 43) agent-eval/analysis/toolsearch_report.py:1246 — toolsearch_report.render_html has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 16 (28 pts), if/else 4 (6 pts), boolean chains 5, loops 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session_extract.extract_trajectory (cognitive 43) · ×1
  • session_extract.extract_trajectory (cognitive 43) agent-eval/suite/session_extract.py:98 — session_extract.extract_trajectory has cognitive complexity 43 (threshold 15). Drivers by points: if/else 7 (26 pts), ternaries 6 (12 pts), loops 2 (3 pts), boolean chains 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.
D2 · Cognitive Complexity · store.replayOperationsByOccurrence (cognitive 43) · ×1
  • store.replayOperationsByOccurrence (cognitive 43) web/src/app/store.ts:212 — store.replayOperationsByOccurrence has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 13, ternaries 1 (3 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 · Connector.backfillSessionHistory (cognitive 42) · ×1
  • Connector.backfillSessionHistory (cognitive 42) internal/cloud/history_sync.go:278 — Connector.backfillSessionHistory has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 6, 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 · tools.buildHunks (cognitive 42) · ×1
  • tools.buildHunks (cognitive 42) internal/tools/diff.go:124 — tools.buildHunks has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 10 (14 pts), match/switch 2 (7 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_report._validate_supplementary (cognitive 42) · ×1
  • toolsearch_report._validate_supplementary (cognitive 42) agent-eval/analysis/toolsearch_report.py:522 — toolsearch_report._validate_supplementary has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 4 (6 pts), boolean chains 3 (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 · routing_verify.verify_routing (cognitive 42) · ×1
  • routing_verify.verify_routing (cognitive 42) agent-eval/suite/routing_verify.py:374 — routing_verify.verify_routing has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 6, loops 3 (6 pts), ternaries 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolObservationMiddleware.recordSearch (cognitive 41) · ×1
  • toolObservationMiddleware.recordSearch (cognitive 41) internal/agent/tool_observation.go:252 — toolObservationMiddleware.recordSearch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 4 (9 pts), boolean chains 4 (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 · ConversationLoadingView.ConversationLoadingView (cognitive 41) · ×1
  • ConversationLoadingView.ConversationLoadingView (cognitive 41) web/src/components/ConversationLoadingView.tsx:23 — ConversationLoadingView.ConversationLoadingView has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 17 (29 pts), boolean chains 11, if/else 1 (nesting depth added 12). Of this number, 38 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 · ArtifactsPanel.ArtifactViewer (cognitive 41) · ×1
  • ArtifactsPanel.ArtifactViewer (cognitive 41) web/src/components/ArtifactsPanel.tsx:430 — ArtifactsPanel.ArtifactViewer has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24, boolean chains 14, ternaries 3. Of this number, 18 points are the body's own statements and 23 belong to 15 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 · model.toOpenAIMessages (cognitive 40) · ×1
  • model.toOpenAIMessages (cognitive 40) internal/model/chatmodel.go:843 — model.toOpenAIMessages has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 6, loops 3 (5 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 · review.runReviewerAgent (cognitive 40) · ×1
  • review.runReviewerAgent (cognitive 40) internal/review/investigate.go:120 — review.runReviewerAgent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 2 (4 pts), boolean chains 1, jumps 1 (nesting depth added 23). 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 · ApprovalState.decide (cognitive 40) · ×1
  • ApprovalState.decide (cognitive 40) internal/runner/approval.go:283 — ApprovalState.decide has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (35 pts), match/switch 2 (3 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 · subagentTool.InvokableRun (cognitive 40) · ×1
  • subagentTool.InvokableRun (cognitive 40) internal/tools/subagent.go:237 — subagentTool.InvokableRun has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27 (36 pts), boolean chains 4 (nesting depth added 9). Of this number, 32 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · web_browser_driver._validate_case (cognitive 40) · ×1
  • web_browser_driver._validate_case (cognitive 40) REDACTED:461 — web_browser_driver._validate_case has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 9, ternaries 2, error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · approvalMiddleware.WrapInvokableToolCall (cognitive 39) · ×1
  • approvalMiddleware.WrapInvokableToolCall (cognitive 39) internal/agent/middleware.go:42 — approvalMiddleware.WrapInvokableToolCall has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (39 pts) (nesting depth added 19). None of this is in the body itself: all 39 points belong to one function literal inside it that branches (line 47). 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 · tools.runFlowAgent (cognitive 39) · ×1
  • tools.runFlowAgent (cognitive 39) REDACTED:176 — tools.runFlowAgent has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 2 (4 pts), boolean chains 1, jumps 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Connector.ensureAccountSyncCipher (cognitive 38) · ×1
  • Connector.ensureAccountSyncCipher (cognitive 38) internal/cloud/provider_sync.go:256 — Connector.ensureAccountSyncCipher has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 5, match/switch 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 · hooks.parseOutcome (cognitive 38) · ×1
  • hooks.parseOutcome (cognitive 38) internal/hooks/exec.go:127 — hooks.parseOutcome has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 4, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.validateSecurityJournal (cognitive 38) · ×1
  • session.validateSecurityJournal (cognitive 38) internal/session/security_journal_strict.go:48 — session.validateSecurityJournal has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (34 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoteConnectionNotice.RemoteConnectionNotice (cognitive 38) · ×1
  • RemoteConnectionNotice.RemoteConnectionNotice (cognitive 38) web/src/components/RemoteConnectionNotice.tsx:25 — RemoteConnectionNotice.RemoteConnectionNotice has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 7 (17 pts), boolean chains 15, if/else 6 (nesting depth added 10). Of this number, 32 points are the body's own statements and 6 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 · approvalMiddleware.WrapEnhancedInvokableToolCall (cognitive 37) · ×1
  • approvalMiddleware.WrapEnhancedInvokableToolCall (cognitive 37) internal/agent/middleware.go:158 — approvalMiddleware.WrapEnhancedInvokableToolCall has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (37 pts) (nesting depth added 18). None of this is in the body itself: all 37 points belong to one function literal inside it that branches (line 163). 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 · automation.parseCronField (cognitive 37) · ×1
  • automation.parseCronField (cognitive 37) internal/automation/cronexpr.go:172 — automation.parseCronField has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Connector.collectCapabilities (cognitive 37) · ×1
  • Connector.collectCapabilities (cognitive 37) internal/cloud/capabilities.go:77 — Connector.collectCapabilities has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (28 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · routing_verify._verify_fixture (cognitive 37) · ×1
  • routing_verify._verify_fixture (cognitive 37) agent-eval/suite/routing_verify.py:301 — routing_verify._verify_fixture has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_expect._check_activation (cognitive 37) · ×1
  • toolsearch_expect._check_activation (cognitive 37) agent-eval/suite/toolsearch_expect.py:648 — toolsearch_expect._check_activation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 9, loops 5 (6 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 · connect (cognitive 37) · ×1
  • connect (cognitive 37) extension/background.js:93 — connect has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 6, error handling 4 (5 pts), ternaries 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 5 function items inside it that branch (onmessage, onclose, a function literal at line 122, …). 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 · Connector.execChatSendCompose (cognitive 36) · ×1
  • Connector.execChatSendCompose (cognitive 36) internal/cloud/connector.go:824 — Connector.execChatSendCompose has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (33 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 · Connector.sessionSyncLoop (cognitive 36) · ×1
  • Connector.sessionSyncLoop (cognitive 36) internal/cloud/sessions.go:157 — Connector.sessionSyncLoop has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uitree.Build (cognitive 36) · ×1
  • uitree.Build (cognitive 36) internal/uitree/uitree.go:138 — uitree.Build has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 6 (8 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 10). Most of this is not in the body itself: 13 of the 36 points are its own statements and the rest belongs to one function literal inside it that branches (line 181). 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 · report.render_trajectory (cognitive 36) · ×1
  • report.render_trajectory (cognitive 36) agent-eval/analysis/report.py:57 — report.render_trajectory has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 4 (8 pts), error handling 1 (2 pts), loops 2, boolean chains 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 · report.build (cognitive 36) · ×1
  • report.build (cognitive 36) agent-eval/analysis/report.py:127 — report.build has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 6 (10 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpeechInput.SpeechInput (cognitive 36) · ×1
  • SpeechInput.SpeechInput (cognitive 36) packages/jcode-ui/src/voice/SpeechInput.tsx:93 — SpeechInput.SpeechInput has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 12, ternaries 7 (12 pts), if/else 7, error handling 4 (5 pts) (nesting depth added 6). Of this number, 16 points are the body's own statements and 20 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lab.initLab (cognitive 36) · ×1
  • lab.initLab (cognitive 36) site/public/showcase-projects/webgpu-cnn/js/lab.js:264 — lab.initLab has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (21 pts), loops 4 (8 pts), boolean chains 7 (nesting depth added 8). Of this number, 19 points are the body's own statements and 17 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, 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 · Scheduler.tick (cognitive 35) · ×1
  • Scheduler.tick (cognitive 35) internal/automation/scheduler.go:143 — Scheduler.tick has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 5, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · computer.pruneScreenshotStoreRoot (cognitive 35) · ×1
  • computer.pruneScreenshotStoreRoot (cognitive 35) internal/computer/shot_store.go:180 — computer.pruneScreenshotStoreRoot has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 10, loops 2 (nesting depth added 11). Of this number, 34 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 · ACPHandler.RequestApproval (cognitive 35) · ×1
  • ACPHandler.RequestApproval (cognitive 35) internal/handler/acp.go:912 — ACPHandler.RequestApproval has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Client.Generate (cognitive 35) · ×1
  • Client.Generate (cognitive 35) internal/imagegen/client.go:249 — Client.Generate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 5, 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 · TokenPlanMultimodalClient.Generate (cognitive 35) · ×1
  • TokenPlanMultimodalClient.Generate (cognitive 35) internal/imagegen/token_plan_multimodal.go:112 — TokenPlanMultimodalClient.Generate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Server.ensureManagedModelConfigured (cognitive 35) · ×1
  • Server.ensureManagedModelConfigured (cognitive 35) internal/web/models.go:903 — Server.ensureManagedModelConfigured has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 5, loops 3 (nesting depth added 10). Of this number, 23 points are the body's own statements and 12 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · turnGroups.findApprovalTool (cognitive 35) · ×1
  • turnGroups.findApprovalTool (cognitive 35) packages/jcode-ui-core/src/timeline/turnGroups.ts:97 — turnGroups.findApprovalTool has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 4, loops 3, ternaries 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArtifactsPanel.ArtifactsPanel (cognitive 35) · ×1
  • ArtifactsPanel.ArtifactsPanel (cognitive 35) web/src/components/ArtifactsPanel.tsx:158 — ArtifactsPanel.ArtifactsPanel has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 15, if/else 9, ternaries 6 (8 pts), error handling 3 (nesting depth added 2). Of this number, 17 points are the body's own statements and 18 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, 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 · responsesSSEState.emitItem (cognitive 34) · ×1
  • responsesSSEState.emitItem (cognitive 34) internal/model/responses_parse.go:489 — responsesSSEState.emitItem has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 5, match/switch 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 · writeTool.InvokableRun (cognitive 34) · ×1
  • writeTool.InvokableRun (cognitive 34) internal/tools/write.go:52 — writeTool.InvokableRun has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 4, match/switch 1 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.handleComputerInput (cognitive 34) · ×1
  • Model.handleComputerInput (cognitive 34) internal/tui/computer_command.go:16 — Model.handleComputerInput has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (31 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.authorizeCloudRemoteWorkspace (cognitive 34) · ×1
  • Server.authorizeCloudRemoteWorkspace (cognitive 34) internal/web/activation.go:485 — Server.authorizeCloudRemoteWorkspace has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (7 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_report._validate_plan (cognitive 34) · ×1
  • toolsearch_report._validate_plan (cognitive 34) agent-eval/analysis/toolsearch_report.py:268 — toolsearch_report._validate_plan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 5, 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 · jui.initDropdown (cognitive 34) · ×1
  • jui.initDropdown (cognitive 34) site/public/showcase-projects/ui-kit/js/jui.js:377 — jui.initDropdown has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 11, ternaries 2 (4 pts) (nesting depth added 3). Most of this is not in the body itself: 4 of the 34 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 422, activate, a function literal at line 419, …). 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 · SettingsView.ProviderForm (cognitive 34) · ×1
  • SettingsView.ProviderForm (cognitive 34) web/src/components/SettingsView.tsx:1235 — SettingsView.ProviderForm has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 30 (45 pts), boolean chains 27, if/else 9 (10 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. This shape REPEATS in the file: one other method here (SettingsView.ProviderForm::save) 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 · agent.validateDescriptors (cognitive 33) · ×1
  • agent.validateDescriptors (cognitive 33) internal/agent/tool_plan.go:163 — agent.validateDescriptors has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · imagegen.inspectGeneratedWebP (cognitive 33) · ×1
  • imagegen.inspectGeneratedWebP (cognitive 33) internal/imagegen/client.go:714 — imagegen.inspectGeneratedWebP has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VoiceVisualizer.VoiceVisualizer (cognitive 33) · ×1
  • VoiceVisualizer.VoiceVisualizer (cognitive 33) packages/jcode-ui/src/voice/VoiceVisualizer.tsx:34 — VoiceVisualizer.VoiceVisualizer has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 11, error handling 2, loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 131, 56, 55, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Flythrough._buildValidated (cognitive 33) · ×1
  • Flythrough._buildValidated (cognitive 33) site/public/showcase-projects/city3d/js/flythrough.js:79 — Flythrough._buildValidated has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (12 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 · store.resumeConversationEnvironment (cognitive 33) · ×1
  • store.resumeConversationEnvironment (cognitive 33) web/src/app/store.ts:2468 — store.resumeConversationEnvironment has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 11, error handling 3, ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RightPanel.FileTreePanel (cognitive 33) · ×1
  • RightPanel.FileTreePanel (cognitive 33) web/src/components/RightPanel.tsx:321 — RightPanel.FileTreePanel has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 8, boolean chains 7, error handling 2 (3 pts) (nesting depth added 9). Most of this is not in the body itself: 12 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (openItem, a function literal at line 330, navigateTo, …). 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 · pipeline.selectSessions (cognitive 32) · ×1
  • pipeline.selectSessions (cognitive 32) internal/memory/pipeline/phase1.go:47 — pipeline.selectSessions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 6, 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 · tools.NewFlowSpawn (cognitive 32) · ×1
  • tools.NewFlowSpawn (cognitive 32) REDACTED:45 — tools.NewFlowSpawn has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 3, loops 1 (nesting depth added 10). None of this is in the body itself: all 32 points belong to one function literal inside it that branches (line 46). 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 · tools.ExtractTodosFromPlan (cognitive 32) · ×1
  • tools.ExtractTodosFromPlan (cognitive 32) internal/tools/plan_parse.go:17 — tools.ExtractTodosFromPlan has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · web.publishSessionDraft (cognitive 32) · ×1
  • web.publishSessionDraft (cognitive 32) internal/web/session_draft_pr.go:144 — web.publishSessionDraft has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 6, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · toolsearch_report._validate_campaign (cognitive 32) · ×1
  • toolsearch_report._validate_campaign (cognitive 32) agent-eval/analysis/toolsearch_report.py:624 — toolsearch_report._validate_campaign has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 7, loops 4, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · orchestrate.main (cognitive 32) · ×1
  • orchestrate.main (cognitive 32) agent-eval/suite/orchestrate.py:943 — orchestrate.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 5 (7 pts), error handling 5 (6 pts), boolean chains 4, ternaries 2 (nesting depth added 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 · toolsearch_expect._search_facts (cognitive 32) · ×1
  • toolsearch_expect._search_facts (cognitive 32) agent-eval/suite/toolsearch_expect.py:388 — toolsearch_expect._search_facts has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 2 (5 pts), boolean chains 4, error handling 1 (3 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 · ToolCallCard.ToolHeader (cognitive 32) · ×1
  • ToolCallCard.ToolHeader (cognitive 32) REDACTED:169 — ToolCallCard.ToolHeader has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 21, ternaries 9 (11 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ToolCallCard.SubagentHeader (cognitive 32) · ×1
  • ToolCallCard.SubagentHeader (cognitive 32) REDACTED:291 — ToolCallCard.SubagentHeader has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 12 (18 pts), if/else 4 (6 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 9). Of this number, 30 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lab.preprocess (cognitive 32) · ×1
  • lab.preprocess (cognitive 32) site/public/showcase-projects/webgpu-cnn/js/lab.js:123 — lab.preprocess has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 18). Of this number, 30 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · App.Shell (cognitive 32) · ×1
  • App.Shell (cognitive 32) web/src/App.tsx:330 — App.Shell has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 23, if/else 7, ternaries 1 (2 pts) (nesting depth added 1). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 388, 375, 370, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Connector.RevokePairing (cognitive 31) · ×1
  • Connector.RevokePairing (cognitive 31) internal/cloud/pairing_inbox.go:209 — Connector.RevokePairing has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 3, loops 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 · Session.Act (cognitive 31) · ×1
  • Session.Act (cognitive 31) internal/computer/session.go:563 — Session.Act has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). 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 · pipeline.runPhase1 (cognitive 31) · ×1
  • pipeline.runPhase1 (cognitive 31) internal/memory/pipeline/phase1.go:155 — pipeline.runPhase1 has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 1, loops 1 (nesting depth added 13). Most of this is not in the body itself: 4 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 209, 191). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · pipeline.driveAgent (cognitive 31) · ×1
  • pipeline.driveAgent (cognitive 31) internal/memory/pipeline/phase2.go:251 — pipeline.driveAgent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providertools.ImageModels (cognitive 31) · ×1
  • providertools.ImageModels (cognitive 31) internal/providertools/manifest.go:197 — providertools.ImageModels has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runner.Run (cognitive 31) · ×1
  • runner.Run (cognitive 31) internal/runner/runner.go:46 — runner.Run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, match/switch 2 (4 pts), jumps 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 · generateImageTool.parseInput (cognitive 31) · ×1
  • generateImageTool.parseInput (cognitive 31) internal/tools/generate_image.go:287 — generateImageTool.parseInput has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 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 · toolsearch_expect._pair_entries (cognitive 31) · ×1
  • toolsearch_expect._pair_entries (cognitive 31) agent-eval/suite/toolsearch_expect.py:274 — toolsearch_expect._pair_entries has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 2 (8 pts), boolean chains 4, 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 · ApprovalBanner.BillablePendingCard (cognitive 31) · ×1
  • ApprovalBanner.BillablePendingCard (cognitive 31) packages/jcode-ui/src/components/ApprovalBanner.tsx:183 — ApprovalBanner.BillablePendingCard has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 5 (nesting depth added 9). 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 · BranchPicker.BranchPicker (cognitive 31) · ×1
  • BranchPicker.BranchPicker (cognitive 31) packages/jcode-ui/src/product/BranchPicker.tsx:31 — BranchPicker.BranchPicker has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 13, if/else 11 (13 pts), ternaries 2 (3 pts), error handling 2 (nesting depth added 3). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 9 function items inside it that branch (checkout, a function literal at line 46, a function literal at line 94, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · city.fillBlock (cognitive 31) · ×1
  • city.fillBlock (cognitive 31) site/public/showcase-projects/city3d/js/city.js:181 — city.fillBlock has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (12 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · store.sendMessage (cognitive 31) · ×1
  • store.sendMessage (cognitive 31) web/src/app/store.ts:1736 — store.sendMessage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 7, ternaries 1 (3 pts) (nesting depth added 11). 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 · store.provisionNewChat (cognitive 31) · ×1
  • store.provisionNewChat (cognitive 31) web/src/app/store.ts:2830 — store.provisionNewChat has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (14 pts), ternaries 2, 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 · CloudBadge.CloudBadge (cognitive 31) · ×1
  • CloudBadge.CloudBadge (cognitive 31) web/src/components/CloudBadge.tsx:52 — CloudBadge.CloudBadge has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 10, ternaries 3, error handling 2, loops 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 77, 71, 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 · artifact.inspectWebP (cognitive 30) · ×1
  • artifact.inspectWebP (cognitive 30) internal/artifact/managed.go:514 — artifact.inspectWebP has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, match/switch 1 (2 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 · command.runLogin (cognitive 30) · ×1
  • command.runLogin (cognitive 30) internal/command/login.go:74 — command.runLogin has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 5, match/switch 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 · command.handleMCPAdd (cognitive 30) · ×1
  • command.handleMCPAdd (cognitive 30) internal/command/mcp.go:95 — command.handleMCPAdd has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 4, match/switch 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelRegistry.MergeConfigProviders (cognitive 30) · ×1
  • ModelRegistry.MergeConfigProviders (cognitive 30) internal/model/registry.go:216 — ModelRegistry.MergeConfigProviders has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (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 · SSHExecutor.runOnce (cognitive 30) · ×1
  • SSHExecutor.runOnce (cognitive 30) internal/tools/env.go:918 — SSHExecutor.runOnce has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 3 (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 · grepTool.runLocalRg (cognitive 30) · ×1
  • grepTool.runLocalRg (cognitive 30) internal/tools/grep.go:257 — grepTool.runLocalRg has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 5, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_campaign.validate_run_artifacts (cognitive 30) · ×1
  • toolsearch_campaign.validate_run_artifacts (cognitive 30) agent-eval/suite/toolsearch_campaign.py:638 — toolsearch_campaign.validate_run_artifacts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 10, loops 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 · aguiRuntime.createAGUIRuntime.rebuildFromMessages (cognitive 30) · ×1
  • aguiRuntime.createAGUIRuntime.rebuildFromMessages (cognitive 30) packages/jcode-ui-core/src/runtime/aguiRuntime.ts:243 — aguiRuntime.createAGUIRuntime.rebuildFromMessages has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (8 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LineChart.draw (cognitive 30) · ×1
  • LineChart.draw (cognitive 30) site/public/showcase-projects/webgpu-cnn/js/charts.js:60 — LineChart.draw has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 7 (9 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 · MaxPool2D.forward (cognitive 30) · ×1
  • MaxPool2D.forward (cognitive 30) site/public/showcase-projects/webgpu-cnn/js/nn/cpu.js:228 — MaxPool2D.forward has cognitive complexity 30 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 1 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 21). 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 · ArtifactsPanel.parseCSV (cognitive 30) · ×1
  • ArtifactsPanel.parseCSV (cognitive 30) web/src/components/ArtifactsPanel.tsx:129 — ArtifactsPanel.parseCSV has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 8, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cloud.collectModelCapabilities (cognitive 29) · ×1
  • cloud.collectModelCapabilities (cognitive 29) internal/cloud/capabilities.go:259 — cloud.collectModelCapabilities has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (10 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 · Connector.collectModelCapabilities (cognitive 29) · ×1
  • Connector.collectModelCapabilities (cognitive 29) internal/cloud/capabilities.go:164 — Connector.collectModelCapabilities has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (10 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 · responsesSSEState.emitEnvelopeFallback (cognitive 29) · ×1
  • responsesSSEState.emitEnvelopeFallback (cognitive 29) internal/model/responses_parse.go:449 — responsesSSEState.emitEnvelopeFallback has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 3, match/switch 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 · Server.handleUpdateAutomation (cognitive 29) · ×1
  • Server.handleUpdateAutomation (cognitive 29) internal/web/automation_api.go:154 — Server.handleUpdateAutomation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 3 (nesting depth added 5). Of this number, 20 points are the body's own statements and 9 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 · toolsearch_campaign.run_campaign (cognitive 29) · ×1
  • toolsearch_campaign.run_campaign (cognitive 29) agent-eval/suite/toolsearch_campaign.py:1057 — toolsearch_campaign.run_campaign has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 7 (9 pts), boolean chains 6, error handling 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_expect._check_call_specs (cognitive 29) · ×1
  • toolsearch_expect._check_call_specs (cognitive 29) agent-eval/suite/toolsearch_expect.py:518 — toolsearch_expect._check_call_specs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · groupActivity.summarizeActivityCounts (cognitive 29) · ×1
  • groupActivity.summarizeActivityCounts (cognitive 29) packages/jcode-ui-core/src/timeline/groupActivity.ts:177 — groupActivity.summarizeActivityCounts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 7). Of this number, 28 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Message.MarkdownBody (cognitive 29) · ×1
  • Message.MarkdownBody (cognitive 29) REDACTED:360 — Message.MarkdownBody has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 4 (7 pts), boolean chains 5, loops 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 417, 384, 405, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · cloud.projectSessionHistory (cognitive 28) · ×1
  • cloud.projectSessionHistory (cognitive 28) internal/cloud/history_sync.go:118 — cloud.projectSessionHistory has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 16). 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 · interactiveState.createAgentWithModeCatalog (cognitive 28) · ×1
  • interactiveState.createAgentWithModeCatalog (cognitive 28) internal/command/interactive.go:329 — interactiveState.createAgentWithModeCatalog has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 1, loops 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 10 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 · interactiveState.runEventLoop (cognitive 28) · ×1
  • interactiveState.runEventLoop (cognitive 28) internal/command/interactive.go:1211 — interactiveState.runEventLoop has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 10). Of this number, 23 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · readTool.InvokableRun (cognitive 28) · ×1
  • readTool.InvokableRun (cognitive 28) internal/tools/read.go:75 — readTool.InvokableRun has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Model.handleManageModelsKey (cognitive 28) · ×1
  • Model.handleManageModelsKey (cognitive 28) internal/tui/manage_models.go:120 — Model.handleManageModelsKey has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 3, match/switch 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · gradcheck.maxpoolF64 (cognitive 28) · ×1
  • gradcheck.maxpoolF64 (cognitive 28) site/public/showcase-projects/webgpu-cnn/js/nn/gradcheck.js:69 — gradcheck.maxpoolF64 has cognitive complexity 28 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 1 (7 pts) (nesting depth added 21). 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 · ServerVersionRow.ServerVersionRow (cognitive 28) · ×1
  • ServerVersionRow.ServerVersionRow (cognitive 28) web/src/components/settings/ServerVersionRow.tsx:28 — ServerVersionRow.ServerVersionRow has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (19 pts), boolean chains 4, if/else 3 (4 pts), error handling 1 (nesting depth added 9). Of this number, 20 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 · SettingsView.VersionUpdateRow (cognitive 28) · ×1
  • SettingsView.VersionUpdateRow (cognitive 28) web/src/components/SettingsView.tsx:1980 — SettingsView.VersionUpdateRow has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 9 (25 pts), if/else 2, boolean chains 1 (nesting depth added 16). Of this number, 26 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, 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 · config.loadMCPFilesWithRoot (cognitive 27) · ×1
  • config.loadMCPFilesWithRoot (cognitive 27) internal/config/mcp_file.go:59 — config.loadMCPFilesWithRoot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 12). Of this number, 18 points are the body's own statements and 9 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 · session.UpdateSessionMeta (cognitive 27) · ×1
  • session.UpdateSessionMeta (cognitive 27) internal/session/session.go:1811 — session.UpdateSessionMeta has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (24 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 · Recorder.TruncateAtUserMessage (cognitive 27) · ×1
  • Recorder.TruncateAtUserMessage (cognitive 27) internal/session/session.go:1275 — Recorder.TruncateAtUserMessage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (26 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 · switchEnvTool.InvokableRun (cognitive 27) · ×1
  • switchEnvTool.InvokableRun (cognitive 27) internal/tools/switch_env.go:46 — switchEnvTool.InvokableRun has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 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 · SidebarComponent.View (cognitive 27) · ×1
  • SidebarComponent.View (cognitive 27) internal/tui/sidebar_component.go:42 — SidebarComponent.View has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, loops 3 (nesting depth added 4). Of this number, 24 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 · web.validateImageEndpoint (cognitive 27) · ×1
  • web.validateImageEndpoint (cognitive 27) internal/web/providers.go:52 — web.validateImageEndpoint has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.assembleConversationEngine (cognitive 27) · ×1
  • Server.assembleConversationEngine (cognitive 27) internal/web/activation.go:382 — Server.assembleConversationEngine has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 2, match/switch 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 · Server.runAutomation (cognitive 27) · ×1
  • Server.runAutomation (cognitive 27) internal/web/automation_run.go:66 — Server.runAutomation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (22 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 6). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Server.publishEngineCandidate (cognitive 27) · ×1
  • Server.publishEngineCandidate (cognitive 27) internal/web/engine.go:577 — Server.publishEngineCandidate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 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 · web_toolsearch_orchestrate.build_jobs (cognitive 27) · ×1
  • web_toolsearch_orchestrate.build_jobs (cognitive 27) agent-eval/suite/web_toolsearch_orchestrate.py:319 — web_toolsearch_orchestrate.build_jobs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 4 (10 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 · ToolCallView.ToolCallView (cognitive 27) · ×1
  • ToolCallView.ToolCallView (cognitive 27) packages/jcode-ui-core/src/primitives/ToolCallView.tsx:63 — ToolCallView.ToolCallView has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 12, if/else 1 (nesting depth added 3). Of this number, 24 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 · AskUserBlock.AskUserBlock (cognitive 27) · ×1
  • AskUserBlock.AskUserBlock (cognitive 27) packages/jcode-ui-core/src/primitives/AskUserBlock.tsx:67 — AskUserBlock.AskUserBlock has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 8, ternaries 4, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 174, 92, 129, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · RightPanel.RightPanel (cognitive 27) · ×1
  • RightPanel.RightPanel (cognitive 27) web/src/components/RightPanel.tsx:51 — RightPanel.RightPanel has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (12 pts), if/else 11, boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 81, 75, 156, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · renderMarkdown (cognitive 27) · ×1
  • renderMarkdown (cognitive 27) script/generate_jcode_ui_api_docs.mjs:195 — renderMarkdown has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (8 pts), ternaries 4 (8 pts), if/else 2 (6 pts), other 4, boolean chains 1 (nesting depth added 11). Of this number, 17 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 · config.loadAgentRoleDir (cognitive 26) · ×1
  • config.loadAgentRoleDir (cognitive 26) internal/config/agent_roles.go:91 — config.loadAgentRoleDir has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · editTool.applyMultiEdits (cognitive 26) · ×1
  • editTool.applyMultiEdits (cognitive 26) internal/tools/edit.go:491 — editTool.applyMultiEdits has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WriteQueue.drain (cognitive 26) · ×1
  • WriteQueue.drain (cognitive 26) REDACTED:184 — WriteQueue.drain has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (6 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 · tui.summarizeActivityCounts (cognitive 26) · ×1
  • tui.summarizeActivityCounts (cognitive 26) internal/tui/activity_group.go:392 — tui.summarizeActivityCounts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (21 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Server.engineForChatContext (cognitive 26) · ×1
  • Server.engineForChatContext (cognitive 26) internal/web/chat.go:82 — Server.engineForChatContext has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (26 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 · Server.handleGitCheckout (cognitive 26) · ×1
  • Server.handleGitCheckout (cognitive 26) internal/web/git.go:87 — Server.handleGitCheckout has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · routing_verify._pair_session_entries (cognitive 26) · ×1
  • routing_verify._pair_session_entries (cognitive 26) agent-eval/suite/routing_verify.py:117 — routing_verify._pair_session_entries has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 2, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · groupExploring.summarizeExploringCounts (cognitive 26) · ×1
  • groupExploring.summarizeExploringCounts (cognitive 26) packages/jcode-ui-core/src/timeline/groupExploring.ts:188 — groupExploring.summarizeExploringCounts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, ternaries 3 (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 · turnGroups.bindApprovalsToTools (cognitive 26) · ×1
  • turnGroups.bindApprovalsToTools (cognitive 26) packages/jcode-ui-core/src/timeline/turnGroups.ts:25 — turnGroups.bindApprovalsToTools has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, ternaries 3 (6 pts), loops 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 · ChatInput.ChatInput · ×1
  • ChatInput.ChatInput::handleKeyDown (cognitive 26) packages/jcode-ui/src/product/ChatInput.tsx:940 — ChatInput.ChatInput::handleKeyDown has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ChatInput.ChatInput) 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 · GoalBanner.GoalBanner (cognitive 26) · ×1
  • GoalBanner.GoalBanner (cognitive 26) packages/jcode-ui/src/product/GoalBanner.tsx:56 — GoalBanner.GoalBanner has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 12 (14 pts), boolean chains 9, if/else 3 (nesting depth added 2). Of this number, 21 points are the body's own statements and 5 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 · AutomationsView.AutomationEditor (cognitive 26) · ×1
  • AutomationsView.AutomationEditor (cognitive 26) web/src/components/AutomationsView.tsx:371 — AutomationsView.AutomationEditor has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 26, if/else 12 (14 pts), ternaries 8 (11 pts), error handling 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (AutomationsView.AutomationEditor::save) 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 · Store.loadLocked (cognitive 25) · ×1
  • Store.loadLocked (cognitive 25) internal/automation/store.go:96 — Store.loadLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Connector.reconcileAccountSettings (cognitive 25) · ×1
  • Connector.reconcileAccountSettings (cognitive 25) internal/cloud/account_settings.go:227 — Connector.reconcileAccountSettings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 4 (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 · interactiveState.reloadMCP (cognitive 25) · ×1
  • interactiveState.reloadMCP (cognitive 25) internal/command/interactive.go:551 — interactiveState.reloadMCP has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (25 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 · handler.pendingApprovalIndex (cognitive 25) · ×1
  • handler.pendingApprovalIndex (cognitive 25) internal/handler/acp.go:93 — handler.pendingApprovalIndex has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 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 · handler.extractToolDisplayInfo (cognitive 25) · ×1
  • handler.extractToolDisplayInfo (cognitive 25) internal/handler/web.go:71 — handler.extractToolDisplayInfo has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 1, match/switch 1 (nesting depth added 10). 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 · hooks.matchesTool (cognitive 25) · ×1
  • hooks.matchesTool (cognitive 25) internal/hooks/match.go:68 — hooks.matchesTool has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.toOpenAIMessage (cognitive 25) · ×1
  • model.toOpenAIMessage (cognitive 25) internal/model/chatmodel.go:1088 — model.toOpenAIMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · artifact_safety.sanitize_artifacts (cognitive 25) · ×1
  • artifact_safety.sanitize_artifacts (cognitive 25) agent-eval/suite/artifact_safety.py:60 — artifact_safety.sanitize_artifacts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (7 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 · wsBridge.createWSHandlers · ×1
  • wsBridge.createWSHandlers::applyForegroundAgentDone (cognitive 25) web/src/app/wsBridge.ts:39 — wsBridge.createWSHandlers::applyForegroundAgentDone has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, ternaries 6 (11 pts), if/else 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 · SettingsView.LangfuseConfigCard (cognitive 25) · ×1
  • SettingsView.LangfuseConfigCard (cognitive 25) web/src/components/SettingsView.tsx:2535 — SettingsView.LangfuseConfigCard has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, ternaries 5 (7 pts), if/else 4, error handling 2 (nesting depth added 2). 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 items inside it that branch (save, clear, a function literal at line 2559). 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 · turnBudgetMiddleware.BeforeModelRewriteState (cognitive 24) · ×1
  • turnBudgetMiddleware.BeforeModelRewriteState (cognitive 24) internal/agent/turn_budget.go:68 — turnBudgetMiddleware.BeforeModelRewriteState has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Connector.handleWSEvent (cognitive 24) · ×1
  • Connector.handleWSEvent (cognitive 24) internal/cloud/events.go:374 — Connector.handleWSEvent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, match/switch 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 · ACPHandler.OnToolResult (cognitive 24) · ×1
  • ACPHandler.OnToolResult (cognitive 24) internal/handler/acp.go:502 — ACPHandler.OnToolResult has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manager.runTeammate (cognitive 24) · ×1
  • Manager.runTeammate (cognitive 24) internal/team/manager.go:523 — Manager.runTeammate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Model.renderSubagentBox (cognitive 24) · ×1
  • Model.renderSubagentBox (cognitive 24) internal/tui/subagent_state.go:154 — Model.renderSubagentBox has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 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 · ptyManager.serveWS (cognitive 24) · ×1
  • ptyManager.serveWS (cognitive 24) internal/web/pty.go:234 — ptyManager.serveWS has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2, boolean chains 1 (nesting depth added 11). Of this number, 13 points are the body's own statements and 11 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 · WindowCaptureHelper.swift.runCapture (cognitive 24) · ×1
  • WindowCaptureHelper.swift.runCapture (cognitive 24) cmd/jcode-computerd/WindowCaptureHelper.swift:77 — WindowCaptureHelper.swift.runCapture has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 9, error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · main.swift.handlePerform (cognitive 24) · ×1
  • main.swift.handlePerform (cognitive 24) cmd/jcode-computerd/main.swift:880 — main.swift.handlePerform has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.onMessage (cognitive 24) · ×1
  • main.onMessage (cognitive 24) site/public/showcase-projects/webgpu-cnn/js/main.js:203 — main.onMessage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, match/switch 1 (nesting depth added 10). 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 · TopBar.TopBar (cognitive 24) · ×1
  • TopBar.TopBar (cognitive 24) web/src/components/TopBar.tsx:58 — TopBar.TopBar has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 8, if/else 6, error handling 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 10 belong to 8 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 · agent.expandToolSearchResult (cognitive 23) · ×1
  • agent.expandToolSearchResult (cognitive 23) internal/agent/toolsearch_disclosure.go:283 — agent.expandToolSearchResult has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · automation.ComputeNextRun (cognitive 23) · ×1
  • automation.ComputeNextRun (cognitive 23) internal/automation/schedule.go:20 — automation.ComputeNextRun has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (9 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 13). 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 · flow.matchBrace (cognitive 23) · ×1
  • flow.matchBrace (cognitive 23) internal/flow/parse.go:89 — flow.matchBrace has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ACPHandler.presentationForTool (cognitive 23) · ×1
  • ACPHandler.presentationForTool (cognitive 23) internal/handler/acp.go:241 — ACPHandler.presentationForTool has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 3 (5 pts) (nesting depth added 9). Of this number, 17 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.decodeResponsesSSE (cognitive 23) · ×1
  • model.decodeResponsesSSE (cognitive 23) internal/model/responses_parse.go:319 — model.decodeResponsesSSE has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 1 (nesting depth added 10). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelFactory.GetModel (cognitive 23) · ×1
  • ModelFactory.GetModel (cognitive 23) internal/model/factory.go:91 — ModelFactory.GetModel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 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 · responsesSSEState.handleEvent (cognitive 23) · ×1
  • responsesSSEState.handleEvent (cognitive 23) internal/model/responses_parse.go:384 — responsesSSEState.handleEvent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.ReplayProviderToolOperations (cognitive 23) · ×1
  • session.ReplayProviderToolOperations (cognitive 23) internal/session/provider_tool_operation.go:176 — session.ReplayProviderToolOperations has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, 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 · SSHExecutor.runWithRetry (cognitive 23) · ×1
  • SSHExecutor.runWithRetry (cognitive 23) internal/tools/env.go:852 — SSHExecutor.runWithRetry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.handleSetupProviderModels (cognitive 23) · ×1
  • Server.handleSetupProviderModels (cognitive 23) internal/web/setup.go:145 — Server.handleSetupProviderModels has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · routing_verify._search_facts (cognitive 23) · ×1
  • routing_verify._search_facts (cognitive 23) agent-eval/suite/routing_verify.py:223 — routing_verify._search_facts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_cases._validate_call (cognitive 23) · ×1
  • toolsearch_cases._validate_call (cognitive 23) agent-eval/suite/toolsearch_cases.py:321 — toolsearch_cases._validate_call has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, ternaries 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 · groupActivity.groupActivityTimeline (cognitive 23) · ×1
  • groupActivity.groupActivityTimeline (cognitive 23) packages/jcode-ui-core/src/timeline/groupActivity.ts:48 — groupActivity.groupActivityTimeline has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (nesting depth added 12). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.TerminalRenderer (cognitive 23) · ×1
  • terminal.TerminalRenderer (cognitive 23) packages/jcode-ui/src/toolRenderers/terminal.tsx:12 — terminal.TerminalRenderer has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 18, ternaries 4, error handling 1. 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, name the conditions: bind each compound test to a 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 · AskUserCard.PendingCard (cognitive 23) · ×1
  • AskUserCard.PendingCard (cognitive 23) REDACTED:82 — AskUserCard.PendingCard has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 14, if/else 5, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 17 points are the body's own statements and 6 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 · AudioPlayer.AudioPlayer (cognitive 23) · ×1
  • AudioPlayer.AudioPlayer (cognitive 23) packages/jcode-ui/src/voice/AudioPlayer.tsx:37 — AudioPlayer.AudioPlayer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, boolean chains 4, ternaries 4, error handling 1. 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 literals inside it that branch (lines 186, 90, 97, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Transcription.Transcription (cognitive 23) · ×1
  • Transcription.Transcription (cognitive 23) packages/jcode-ui/src/voice/Transcription.tsx:52 — Transcription.Transcription has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 14, if/else 7, ternaries 2. 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 113, 83, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Replica.Replica (cognitive 23) · ×1
  • Replica.Replica (cognitive 23) site/src/components/desktop/Replica.tsx:106 — Replica.Replica has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 6 (7 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (play, onSend, a function literal at line 145, …). 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 · DesktopTitlebar.WorkspaceOpenMenu (cognitive 23) · ×1
  • DesktopTitlebar.WorkspaceOpenMenu (cognitive 23) web/src/components/DesktopTitlebar.tsx:388 — DesktopTitlebar.WorkspaceOpenMenu has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, boolean chains 8, ternaries 3, error handling 1. Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (onMenuKeyDown, openIn, a function literal at line 406, …). 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 · WebHandler.takeActiveToolCallForResult (cognitive 22) · ×1
  • WebHandler.takeActiveToolCallForResult (cognitive 22) internal/handler/web.go:854 — WebHandler.takeActiveToolCallForResult has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 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 · providertools.ResolveImageRuntime (cognitive 22) · ×1
  • providertools.ResolveImageRuntime (cognitive 22) internal/providertools/manifest.go:291 — providertools.ResolveImageRuntime has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9, match/switch 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 · tools.PerformMCPOAuthLogin (cognitive 22) · ×1
  • tools.PerformMCPOAuthLogin (cognitive 22) internal/tools/mcp_oauth.go:233 — tools.PerformMCPOAuthLogin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (21 pts), match/switch 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 · globTool.InvokableRun (cognitive 22) · ×1
  • globTool.InvokableRun (cognitive 22) internal/tools/glob.go:74 — globTool.InvokableRun has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (21 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 · Model.handleBrowserInput (cognitive 22) · ×1
  • Model.handleBrowserInput (cognitive 22) internal/tui/browser_command.go:12 — Model.handleBrowserInput has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). 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 · web.mergeMCPServerReq (cognitive 22) · ×1
  • web.mergeMCPServerReq (cognitive 22) internal/web/mcp.go:120 — web.mergeMCPServerReq has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cloudLoginFlow.pollAndFinish (cognitive 22) · ×1
  • cloudLoginFlow.pollAndFinish (cognitive 22) internal/web/cloud_login.go:170 — cloudLoginFlow.pollAndFinish has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Server.runConversationAutomation (cognitive 22) · ×1
  • Server.runConversationAutomation (cognitive 22) internal/web/automation_run.go:187 — Server.runConversationAutomation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 3 (5 pts), loops 1 (nesting depth added 7). 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 · Server.handleCloudConfig (cognitive 22) · ×1
  • Server.handleCloudConfig (cognitive 22) internal/web/cloud.go:43 — Server.handleCloudConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 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 · Server.handleNewSession (cognitive 22) · ×1
  • Server.handleNewSession (cognitive 22) internal/web/sessions.go:556 — Server.handleNewSession has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4 (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 · main.emitReasoningOptions (cognitive 22) · ×1
  • main.emitReasoningOptions (cognitive 22) script/generate_models.go:347 — main.emitReasoningOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 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 · routing_verify._batch_facts (cognitive 22) · ×1
  • routing_verify._batch_facts (cognitive 22) agent-eval/suite/routing_verify.py:177 — routing_verify._batch_facts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 8, 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 · web_toolsearch_orchestrate.run_job (cognitive 22) · ×1
  • web_toolsearch_orchestrate.run_job (cognitive 22) agent-eval/suite/web_toolsearch_orchestrate.py:661 — web_toolsearch_orchestrate.run_job has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 8, if/else 4, 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 · CompactToolRow.CompactToolRow (cognitive 22) · ×1
  • CompactToolRow.CompactToolRow (cognitive 22) packages/jcode-ui/src/components/CompactToolRow.tsx:14 — CompactToolRow.CompactToolRow has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (16 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelSelector.ModelSelector (cognitive 22) · ×1
  • ModelSelector.ModelSelector (cognitive 22) packages/jcode-ui/src/components/ModelSelector.tsx:44 — ModelSelector.ModelSelector has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 2). 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 items inside it that branch (onSearchKeyDown, a function literal at line 72, a function literal at line 102, …). 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 · map.loadMap (cognitive 22) · ×1
  • map.loadMap (cognitive 22) site/public/showcase-projects/game/js/map.js:41 — map.loadMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 6 (8 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 · ChatView.ChatView (cognitive 22) · ×1
  • ChatView.ChatView (cognitive 22) web/src/components/ChatView.tsx:66 — ChatView.ChatView has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 6 (7 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 3). Of this number, 12 points are the body's own statements and 10 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · CommandPalette.CommandPalette (cognitive 22) · ×1
  • CommandPalette.CommandPalette (cognitive 22) web/src/components/CommandPalette.tsx:32 — CommandPalette.CommandPalette has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, ternaries 3 (4 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 7 function items inside it that branch (onKey, openTask, a function literal at line 90, …). 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 · agent.parseToolSearchExactListEnvelope (cognitive 21) · ×1
  • agent.parseToolSearchExactListEnvelope (cognitive 21) internal/agent/toolsearch_disclosure.go:224 — agent.parseToolSearchExactListEnvelope has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, match/switch 1 (2 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 · artifact.copyManagedImage (cognitive 21) · ×1
  • artifact.copyManagedImage (cognitive 21) internal/artifact/managed.go:398 — artifact.copyManagedImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 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 · Service.CreateManagedImage (cognitive 21) · ×1
  • Service.CreateManagedImage (cognitive 21) internal/artifact/managed.go:59 — Service.CreateManagedImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 2. Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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 · Service.openManagedImagesRoot (cognitive 21) · ×1
  • Service.openManagedImagesRoot (cognitive 21) internal/artifact/managed.go:209 — Service.openManagedImagesRoot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (21 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 · Store.ResolveOwnerSession (cognitive 21) · ×1
  • Store.ResolveOwnerSession (cognitive 21) internal/automation/store.go:382 — Store.ResolveOwnerSession has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 2, match/switch 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 387). 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 · Notifier.connect (cognitive 21) · ×1
  • Notifier.connect (cognitive 21) internal/channel/ble/ble_cgo.go:138 — Notifier.connect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memory.WriteNote (cognitive 21) · ×1
  • memory.WriteNote (cognitive 21) internal/memory/note.go:35 — memory.WriteNote has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (20 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · tools.extractFlowJSON (cognitive 21) · ×1
  • tools.extractFlowJSON (cognitive 21) REDACTED:235 — tools.extractFlowJSON has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sshTransport.ensureConnected (cognitive 21) · ×1
  • sshTransport.ensureConnected (cognitive 21) REDACTED:155 — sshTransport.ensureConnected has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sshTransport.reconnectAttempts (cognitive 21) · ×1
  • sshTransport.reconnectAttempts (cognitive 21) REDACTED:262 — sshTransport.reconnectAttempts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 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 · grepTool.buildRemoteCmd (cognitive 21) · ×1
  • grepTool.buildRemoteCmd (cognitive 21) internal/tools/grep.go:581 — grepTool.buildRemoteCmd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, loops 1, match/switch 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 · EnhancedTodoStore.Modify (cognitive 21) · ×1
  • EnhancedTodoStore.Modify (cognitive 21) internal/tools/todo_enhanced.go:154 — EnhancedTodoStore.Modify has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workflowRunTool.InvokableRun (cognitive 21) · ×1
  • workflowRunTool.InvokableRun (cognitive 21) REDACTED:88 — workflowRunTool.InvokableRun has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 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 · uitree.RenderStates (cognitive 21) · ×1
  • uitree.RenderStates (cognitive 21) internal/uitree/uitree.go:248 — uitree.RenderStates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.runMCPLogin (cognitive 21) · ×1
  • Server.runMCPLogin (cognitive 21) internal/web/mcp.go:615 — Server.runMCPLogin has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2 (nesting depth added 3). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · toolsearch_report._case_summaries (cognitive 21) · ×1
  • toolsearch_report._case_summaries (cognitive 21) agent-eval/analysis/toolsearch_report.py:967 — toolsearch_report._case_summaries has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_cases._validate_hard_gates (cognitive 21) · ×1
  • toolsearch_cases._validate_hard_gates (cognitive 21) agent-eval/suite/toolsearch_cases.py:646 — toolsearch_cases._validate_hard_gates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_expect._check_searches (cognitive 21) · ×1
  • toolsearch_expect._check_searches (cognitive 21) agent-eval/suite/toolsearch_expect.py:594 — toolsearch_expect._check_searches has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · groupExploring.summarizeExploringSteps (cognitive 21) · ×1
  • groupExploring.summarizeExploringSteps (cognitive 21) packages/jcode-ui-core/src/timeline/groupExploring.ts:144 — groupExploring.summarizeExploringSteps has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, loops 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · turnGroups.groupCompletedTurns (cognitive 21) · ×1
  • turnGroups.groupCompletedTurns (cognitive 21) packages/jcode-ui-core/src/timeline/turnGroups.ts:195 — turnGroups.groupCompletedTurns has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stackTrace.parseGo (cognitive 21) · ×1
  • stackTrace.parseGo (cognitive 21) packages/jcode-ui/src/toolRenderers/stackTrace.tsx:177 — stackTrace.parseGo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (6 pts), boolean chains 4, 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 · Tower.acquireTarget (cognitive 21) · ×1
  • Tower.acquireTarget (cognitive 21) site/public/showcase-projects/game/js/towers.js:81 — Tower.acquireTarget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lab.initLab.renderConfusion (cognitive 21) · ×1
  • lab.initLab.renderConfusion (cognitive 21) site/public/showcase-projects/webgpu-cnn/js/lab.js:459 — lab.initLab.renderConfusion has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (9 pts), boolean chains 5, if/else 2 (4 pts), loops 2 (3 pts) (nesting depth added 9). Of this number, 20 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 · TypingTerminal.TypingTerminal (cognitive 21) · ×1
  • TypingTerminal.TypingTerminal (cognitive 21) site/src/components/TypingTerminal.tsx:12 — TypingTerminal.TypingTerminal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 33, 47, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · toolLifecycle.mergeToolLifecycle (cognitive 21) · ×1
  • toolLifecycle.mergeToolLifecycle (cognitive 21) web/src/app/toolLifecycle.ts:38 — toolLifecycle.mergeToolLifecycle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8 (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 · remote.parseRemoteLabel (cognitive 21) · ×1
  • remote.parseRemoteLabel (cognitive 21) web/src/lib/remote.ts:32 — remote.parseRemoteLabel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 4 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.main (cognitive 20) · ×1
  • main.main (cognitive 20) agent-eval/harness/main.go:201 — main.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, match/switch 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 · reminderMiddleware.BeforeModelRewriteState (cognitive 20) · ×1
  • reminderMiddleware.BeforeModelRewriteState (cognitive 20) REDACTED:104 — reminderMiddleware.BeforeModelRewriteState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (4 pts), boolean chains 3 (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 · browser.CheckExtensionInstalled (cognitive 20) · ×1
  • browser.CheckExtensionInstalled (cognitive 20) internal/browser/discover.go:122 — browser.CheckExtensionInstalled has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 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 · interactiveState.handleResume (cognitive 20) · ×1
  • interactiveState.handleResume (cognitive 20) internal/command/interactive.go:962 — interactiveState.handleResume has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · run.jsAgent (cognitive 20) · ×1
  • run.jsAgent (cognitive 20) internal/flow/run.go:101 — run.jsAgent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 3). Of this number, 12 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, 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 · tools.LoadMCPTools (cognitive 20) · ×1
  • tools.LoadMCPTools (cognitive 20) internal/tools/mcp.go:125 — tools.LoadMCPTools has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 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 · Model.handleThemePickerKey (cognitive 20) · ×1
  • Model.handleThemePickerKey (cognitive 20) internal/tui/theme_picker.go:74 — Model.handleThemePickerKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Server.handleListAutomationRuns (cognitive 20) · ×1
  • Server.handleListAutomationRuns (cognitive 20) internal/web/automation_api.go:350 — Server.handleListAutomationRuns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 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 · Server.handleAddProvider (cognitive 20) · ×1
  • Server.handleAddProvider (cognitive 20) internal/web/providers.go:832 — Server.handleAddProvider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 4. 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, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Server.handleWSMessage (cognitive 20) · ×1
  • Server.handleWSMessage (cognitive 20) internal/web/ws.go:232 — Server.handleWSMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 8). 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 · computer_report.main (cognitive 20) · ×1
  • computer_report.main (cognitive 20) agent-eval/analysis/computer_report.py:39 — computer_report.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 4, ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_cases._validate_browser_fixture (cognitive 20) · ×1
  • toolsearch_cases._validate_browser_fixture (cognitive 20) agent-eval/suite/toolsearch_cases.py:480 — toolsearch_cases._validate_browser_fixture has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_cases.validate_suite (cognitive 20) · ×1
  • toolsearch_cases.validate_suite (cognitive 20) agent-eval/suite/toolsearch_cases.py:673 — toolsearch_cases.validate_suite has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 3 (4 pts), boolean chains 3 (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 · toolsearch_expect._batch_facts (cognitive 20) · ×1
  • toolsearch_expect._batch_facts (cognitive 20) agent-eval/suite/toolsearch_expect.py:333 — toolsearch_expect._batch_facts has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · web_toolsearch_orchestrate._load_selected_provider (cognitive 20) · ×1
  • web_toolsearch_orchestrate._load_selected_provider (cognitive 20) agent-eval/suite/web_toolsearch_orchestrate.py:158 — web_toolsearch_orchestrate._load_selected_provider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, error handling 2, ternaries 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 · ToolCallCard.parseDiffCount (cognitive 20) · ×1
  • ToolCallCard.parseDiffCount (cognitive 20) REDACTED:408 — ToolCallCard.parseDiffCount has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, ternaries 3 (4 pts), loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Game.onProjectileHit (cognitive 20) · ×1
  • Game.onProjectileHit (cognitive 20) site/public/showcase-projects/game/js/game.js:378 — Game.onProjectileHit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (2 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 · jui.initTableSort (cognitive 20) · ×1
  • jui.initTableSort (cognitive 20) site/public/showcase-projects/ui-kit/js/jui.js:682 — jui.initTableSort has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 8, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 710, a function literal at line 717, a function literal at line 686, …). 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 · Sidebar.compareProjectGroups (cognitive 20) · ×1
  • Sidebar.compareProjectGroups (cognitive 20) web/src/components/Sidebar.tsx:1158 — Sidebar.compareProjectGroups has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 8, if/else 3 (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 · useAppUpdate.AppUpdateProvider (cognitive 20) · ×1
  • useAppUpdate.AppUpdateProvider (cognitive 20) web/src/lib/useAppUpdate.tsx:70 — useAppUpdate.AppUpdateProvider has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 6 (7 pts), boolean chains 2, error handling 2, match/switch 1 (nesting depth added 5). None of this is in the body itself: all 20 points belong to 6 function literals inside it that branch (lines 82, 115, 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 · ComputerShotPiP.ComputerShotPiP (cognitive 20) · ×1
  • ComputerShotPiP.ComputerShotPiP (cognitive 20) web/src/components/ComputerShotPiP.tsx:31 — ComputerShotPiP.ComputerShotPiP has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 4 (6 pts), loops 1 (nesting depth added 5). Of this number, 14 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 · App.AutomationRunReplay (cognitive 20) · ×1
  • App.AutomationRunReplay (cognitive 20) web/src/App.tsx:561 — App.AutomationRunReplay has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (8 pts), if/else 1 (nesting depth added 2). Of this number, 19 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.
D2 · Cognitive Complexity · reminderMiddleware.refreshAgentsMd (cognitive 19) · ×1
  • reminderMiddleware.refreshAgentsMd (cognitive 19) REDACTED:262 — reminderMiddleware.refreshAgentsMd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 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 · automation.validateTrigger (cognitive 19) · ×1
  • automation.validateTrigger (cognitive 19) internal/automation/validate.go:79 — automation.validateTrigger has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, match/switch 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 · ArtifactSharePublisher.Publish (cognitive 19) · ×1
  • ArtifactSharePublisher.Publish (cognitive 19) internal/cloud/artifact_share.go:97 — ArtifactSharePublisher.Publish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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 · Connector.syncSessions (cognitive 19) · ×1
  • Connector.syncSessions (cognitive 19) internal/cloud/sessions.go:94 — Connector.syncSessions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, 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 · command.runDoctorMode (cognitive 19) · ×1
  • command.runDoctorMode (cognitive 19) internal/command/commands.go:27 — command.runDoctorMode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 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, 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 · command.installEvalComputerBackend (cognitive 19) · ×1
  • command.installEvalComputerBackend (cognitive 19) internal/command/computer_eval_disabled.go:12 — command.installEvalComputerBackend has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 6). 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 · handler.pendingWebToolCallIndex (cognitive 19) · ×1
  • handler.pendingWebToolCallIndex (cognitive 19) internal/handler/web.go:673 — handler.pendingWebToolCallIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pathGuardMiddleware.checkArgs (cognitive 19) · ×1
  • pathGuardMiddleware.checkArgs (cognitive 19) internal/memory/guard.go:62 — pathGuardMiddleware.checkArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.messageFromResponsesItem (cognitive 19) · ×1
  • model.messageFromResponsesItem (cognitive 19) internal/model/responses_parse.go:191 — model.messageFromResponsesItem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model.classifyByStatus (cognitive 19) · ×1
  • model.classifyByStatus (cognitive 19) REDACTED:201 — model.classifyByStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CalibratedCounter.Count (cognitive 19) · ×1
  • CalibratedCounter.Count (cognitive 19) internal/model/token_estimate.go:122 — CalibratedCounter.Count has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, 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 · Engine.reviewCached (cognitive 19) · ×1
  • Engine.reviewCached (cognitive 19) internal/review/session_cache.go:54 — Engine.reviewCached has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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 · skills.parseFrontmatter (cognitive 19) · ×1
  • skills.parseFrontmatter (cognitive 19) internal/skills/skills.go:310 — skills.parseFrontmatter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 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 · tools.validate (cognitive 19) · ×1
  • tools.validate (cognitive 19) internal/tools/todo_enhanced.go:348 — tools.validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), 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 · BackgroundManager.execute (cognitive 19) · ×1
  • BackgroundManager.execute (cognitive 19) internal/tools/background.go:126 — BackgroundManager.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (19 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · grepTool.buildRgArgs (cognitive 19) · ×1
  • grepTool.buildRgArgs (cognitive 19) internal/tools/grep.go:192 — grepTool.buildRgArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1, loops 1, match/switch 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 · Server.handleTruncateHistory (cognitive 19) · ×1
  • Server.handleTruncateHistory (cognitive 19) internal/web/sessions.go:450 — Server.handleTruncateHistory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 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 · ActivityGroupCard.ActivityGroupCard (cognitive 19) · ×1
  • ActivityGroupCard.ActivityGroupCard (cognitive 19) packages/jcode-ui/src/components/ActivityGroupCard.tsx:32 — ActivityGroupCard.ActivityGroupCard has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Tower.update (cognitive 19) · ×1
  • Tower.update (cognitive 19) site/public/showcase-projects/game/js/towers.js:100 — Tower.update has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (2 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 · jui.init (cognitive 19) · ×1
  • jui.init (cognitive 19) site/public/showcase-projects/ui-kit/js/jui.js:991 — jui.init has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 19. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · worker.onmessage (cognitive 19) · ×1
  • worker.onmessage (cognitive 19) site/public/showcase-projects/webgpu-cnn/js/worker.js:578 — worker.onmessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, error handling 1, match/switch 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 · store.replayArtifacts (cognitive 19) · ×1
  • store.replayArtifacts (cognitive 19) web/src/app/store.ts:160 — store.replayArtifacts has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 2 (4 pts), ternaries 1 (2 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 · SetupView.SetupView (cognitive 19) · ×1
  • SetupView.SetupView (cognitive 19) web/src/components/SetupView.tsx:27 — SetupView.SetupView has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 30, ternaries 19 (23 pts), if/else 15 (18 pts), error handling 4 (5 pts), loops 1 (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. This shape REPEATS in the file: one other method here (SetupView.SetupView::validateInputs) 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 · SettingsView.ApprovalReviewSection (cognitive 19) · ×1
  • SettingsView.ApprovalReviewSection (cognitive 19) web/src/components/SettingsView.tsx:2180 — SettingsView.ApprovalReviewSection has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 7 (8 pts), if/else 2, error handling 1 (nesting depth added 1). Of this number, 11 points are the body's own statements and 8 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 · SettingsView.buildMCPRequest (cognitive 19) · ×1
  • SettingsView.buildMCPRequest (cognitive 19) web/src/components/SettingsView.tsx:2822 — SettingsView.buildMCPRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, ternaries 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · SettingsView.SkillsTab (cognitive 19) · ×1
  • SettingsView.SkillsTab (cognitive 19) web/src/components/SettingsView.tsx:3337 — SettingsView.SkillsTab has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (7 pts), if/else 3, error handling 2 (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 5 function items inside it that branch (a function literal at line 3367, a function literal at line 3406, load, …). 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 · DesktopTitlebar.TaskDetails (cognitive 19) · ×1
  • DesktopTitlebar.TaskDetails (cognitive 19) web/src/components/DesktopTitlebar.tsx:153 — DesktopTitlebar.TaskDetails has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (6 pts), if/else 3, error handling 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 5 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · RightPanel.TaskList (cognitive 19) · ×1
  • RightPanel.TaskList (cognitive 19) web/src/components/RightPanel.tsx:247 — RightPanel.TaskList has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 3, if/else 1 (nesting depth added 6). None of this is in the body itself: all 19 points belong to 2 function literals inside it that branch (lines 262, 251). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · UpdateBanner.UpdateBanner (cognitive 19) · ×1
  • UpdateBanner.UpdateBanner (cognitive 19) web/src/components/UpdateBanner.tsx:14 — UpdateBanner.UpdateBanner has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 15, if/else 2, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · nativeConnect (cognitive 19) · ×1
  • nativeConnect (cognitive 19) extension/background.js:56 — nativeConnect has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 4 (5 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 5). None of this is in the body itself: all 19 points belong to 4 function items inside it that branch (a function literal at line 68, a function literal at line 57, (anonymous)::done, …). 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 · agent.trimTrailingToolImagesWithBudget (cognitive 18) · ×1
  • agent.trimTrailingToolImagesWithBudget (cognitive 18) internal/agent/turn_budget.go:210 — agent.trimTrailingToolImagesWithBudget 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 · browser.InstallNativeHost (cognitive 18) · ×1
  • browser.InstallNativeHost (cognitive 18) internal/browser/nativehost.go:186 — browser.InstallNativeHost has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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 · wsCDP.send (cognitive 18) · ×1
  • wsCDP.send (cognitive 18) internal/browser/cdp.go:141 — wsCDP.send has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 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 · Session.Act (cognitive 18) · ×1
  • Session.Act (cognitive 18) internal/browser/actions.go:23 — Session.Act has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, match/switch 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 · Client.writeJSON (cognitive 18) · ×1
  • Client.writeJSON (cognitive 18) internal/cloud/client.go:158 — Client.writeJSON has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · interactiveState.handlePlanCompletion (cognitive 18) · ×1
  • interactiveState.handlePlanCompletion (cognitive 18) internal/command/interactive.go:848 — interactiveState.handlePlanCompletion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · handler.todoWriteSubtitle (cognitive 18) · ×1
  • handler.todoWriteSubtitle (cognitive 18) internal/handler/web.go:300 — handler.todoWriteSubtitle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, match/switch 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 · WebHandler.releasePendingToolCallForResult (cognitive 18) · ×1
  • WebHandler.releasePendingToolCallForResult (cognitive 18) internal/handler/web.go:802 — WebHandler.releasePendingToolCallForResult has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 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 · memory.recordArgsUsage (cognitive 18) · ×1
  • memory.recordArgsUsage (cognitive 18) internal/memory/usage.go:59 — memory.recordArgsUsage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 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 · model.mergeResponsesMessage (cognitive 18) · ×1
  • model.mergeResponsesMessage (cognitive 18) internal/model/responses_parse.go:232 — model.mergeResponsesMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (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 · chatModel.Stream (cognitive 18) · ×1
  • chatModel.Stream (cognitive 18) internal/model/chatmodel.go:702 — chatModel.Stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). 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 722). 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 · release.comparePre (cognitive 18) · ×1
  • release.comparePre (cognitive 18) internal/release/release.go:147 — release.comparePre has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (4 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 · session.DeleteSessionByUUID (cognitive 18) · ×1
  • session.DeleteSessionByUUID (cognitive 18) internal/session/session.go:1729 — session.DeleteSessionByUUID has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · tools.collectMCPToolCandidates (cognitive 18) · ×1
  • tools.collectMCPToolCandidates (cognitive 18) internal/tools/mcp.go:270 — tools.collectMCPToolCandidates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generateImageTool.InvokableRun (cognitive 18) · ×1
  • generateImageTool.InvokableRun (cognitive 18) internal/tools/generate_image.go:138 — generateImageTool.InvokableRun has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 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 · tui.formatSubagentOutput (cognitive 18) · ×1
  • tui.formatSubagentOutput (cognitive 18) internal/tui/format.go:341 — tui.formatSubagentOutput has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatusBarComponent.View (cognitive 18) · ×1
  • StatusBarComponent.View (cognitive 18) internal/tui/statusbar_component.go:34 — StatusBarComponent.View has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Model.renderCommandSuggestions (cognitive 18) · ×1
  • Model.renderCommandSuggestions (cognitive 18) internal/tui/input_views.go:154 — Model.renderCommandSuggestions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 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 · Server.handleDevOptionsConfig (cognitive 18) · ×1
  • Server.handleDevOptionsConfig (cognitive 18) internal/web/dev_options.go:64 — Server.handleDevOptionsConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, match/switch 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 · Server.handleMemoryStatus (cognitive 18) · ×1
  • Server.handleMemoryStatus (cognitive 18) internal/web/memory.go:179 — Server.handleMemoryStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, 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 · Server.handleMemorySync (cognitive 18) · ×1
  • Server.handleMemorySync (cognitive 18) internal/web/memory.go:309 — Server.handleMemorySync has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2 (nesting depth added 1). 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, 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 · toolsearch_report._evaluate_gates (cognitive 18) · ×1
  • toolsearch_report._evaluate_gates (cognitive 18) agent-eval/analysis/toolsearch_report.py:828 — toolsearch_report._evaluate_gates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 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 · toolsearch_report._failure_rows (cognitive 18) · ×1
  • toolsearch_report._failure_rows (cognitive 18) agent-eval/analysis/toolsearch_report.py:1040 — toolsearch_report._failure_rows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_campaign.normalize_options (cognitive 18) · ×1
  • toolsearch_campaign.normalize_options (cognitive 18) agent-eval/suite/toolsearch_campaign.py:460 — toolsearch_campaign.normalize_options has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 7, 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 · jcode_computerd_onboarding · ×1
  • jcode_computerd_onboarding::locator::find_settings_window (cognitive 18) cmd/jcode-computerd/onboarding/src/locator.rs:52 — jcode_computerd_onboarding::locator::find_settings_window has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (6 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 · turnChanges.diffStatForTool (cognitive 18) · ×1
  • turnChanges.diffStatForTool (cognitive 18) packages/jcode-ui-core/src/timeline/turnChanges.ts:39 — turnChanges.diffStatForTool has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, 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 · ThreadList.RowActions (cognitive 18) · ×1
  • ThreadList.RowActions (cognitive 18) packages/jcode-ui/src/components/ThreadList.tsx:240 — ThreadList.RowActions has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 1 (2 pts) (nesting depth added 2). 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 (onMenuKeyDown, a function literal at line 259, close, …). 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 · Game.render (cognitive 18) · ×1
  • Game.render (cognitive 18) site/public/showcase-projects/game/js/game.js:405 — Game.render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 4, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MomentumSGD.step (cognitive 18) · ×1
  • MomentumSGD.step (cognitive 18) site/public/showcase-projects/webgpu-cnn/js/nn/model.js:75 — MomentumSGD.step has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 2 (3 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 · worker.handleConfusion (cognitive 18) · ×1
  • worker.handleConfusion (cognitive 18) site/public/showcase-projects/webgpu-cnn/js/worker.js:547 — worker.handleConfusion has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (7 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocPage.DocPage (cognitive 18) · ×1
  • DocPage.DocPage (cognitive 18) site/src/pages/docs/DocPage.tsx:110 — DocPage.DocPage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 7, boolean chains 2 (nesting depth added 1). Of this number, 15 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, 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 · store.retryRemoteConnection (cognitive 18) · ×1
  • store.retryRemoteConnection (cognitive 18) web/src/app/store.ts:2607 — store.retryRemoteConnection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AutomationsView.AutomationEditor · ×1
  • AutomationsView.AutomationEditor::save (cognitive 18) web/src/components/AutomationsView.tsx:451 — AutomationsView.AutomationEditor::save has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, ternaries 1 (2 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, 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 (AutomationsView.AutomationEditor) 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 · ProviderAuthSection.ProviderAuthSection · ×1
  • ProviderAuthSection.ProviderAuthSection::runStatusAction (cognitive 18) web/src/components/settings/ProviderAuthSection.tsx:577 — ProviderAuthSection.ProviderAuthSection::runStatusAction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (5 pts), boolean chains 2, 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. This shape REPEATS in the file: one other method here (ProviderAuthSection.ProviderAuthSection) 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 · SettingsView.SettingsView (cognitive 18) · ×1
  • SettingsView.SettingsView (cognitive 18) web/src/components/SettingsView.tsx:233 — SettingsView.SettingsView has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, ternaries 2. 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, name the conditions: bind each compound test to a 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 · SettingsView.ToolSearchSection (cognitive 18) · ×1
  • SettingsView.ToolSearchSection (cognitive 18) web/src/components/SettingsView.tsx:2063 — SettingsView.ToolSearchSection has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (7 pts), error handling 2, if/else 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 4 function items inside it that branch (toggle, a function literal at line 2076, a function literal at line 2088, …). 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 · GeneratedImageToolRenderer.GeneratedImageToolRenderer (cognitive 18) · ×1
  • GeneratedImageToolRenderer.GeneratedImageToolRenderer (cognitive 18) web/src/components/GeneratedImageToolRenderer.tsx:11 — GeneratedImageToolRenderer.GeneratedImageToolRenderer has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 7, ternaries 2. Of this number, 10 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · toolSearchSkillReminderMiddleware.BeforeModelRewriteState (cognitive 17) · ×1
  • toolSearchSkillReminderMiddleware.BeforeModelRewriteState (cognitive 17) internal/agent/toolsearch_skill_reminder.go:48 — toolSearchSkillReminderMiddleware.BeforeModelRewriteState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (5 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 · Service.openManaged (cognitive 17) · ×1
  • Service.openManaged (cognitive 17) internal/artifact/managed.go:290 — Service.openManaged has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 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 · automation.NextCronFire (cognitive 17) · ×1
  • automation.NextCronFire (cognitive 17) internal/automation/cronexpr.go:134 — automation.NextCronFire has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 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 · Store.Update (cognitive 17) · ×1
  • Store.Update (cognitive 17) internal/automation/store.go:274 — Store.Update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5 (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 one function literal inside it that branches (line 276). 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 · browser.FindChrome (cognitive 17) · ×1
  • browser.FindChrome (cognitive 17) internal/browser/discover.go:40 — browser.FindChrome has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), match/switch 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 · Client.PollForToken (cognitive 17) · ×1
  • Client.PollForToken (cognitive 17) internal/cloud/client.go:295 — Client.PollForToken has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Connector.collectSessions (cognitive 17) · ×1
  • Connector.collectSessions (cognitive 17) internal/cloud/sessions.go:24 — Connector.collectSessions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command.startWebServer (cognitive 17) · ×1
  • command.startWebServer (cognitive 17) internal/command/web.go:1238 — command.startWebServer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (17 pts) (nesting depth added 2). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1336, 1352, 1311). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · interactiveState.handleWeChatAction (cognitive 17) · ×1
  • interactiveState.handleWeChatAction (cognitive 17) internal/command/channel.go:25 — interactiveState.handleWeChatAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (nesting depth added 8). Of this number, 9 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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 · config.loadConfig (cognitive 17) · ×1
  • config.loadConfig (cognitive 17) internal/config/config.go:1102 — config.loadConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, 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 · pipeline.buildTranscript (cognitive 17) · ×1
  • pipeline.buildTranscript (cognitive 17) internal/memory/pipeline/phase1.go:93 — pipeline.buildTranscript has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), boolean chains 2, match/switch 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 · pipeline.firstJSONObject (cognitive 17) · ×1
  • pipeline.firstJSONObject (cognitive 17) internal/memory/pipeline/phase1.go:337 — pipeline.firstJSONObject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1, jumps 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 · model.ClassifyError (cognitive 17) · ×1
  • model.ClassifyError (cognitive 17) REDACTED:148 — model.ClassifyError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3, boolean chains 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 · modelcatalog.parseAttachment (cognitive 17) · ×1
  • modelcatalog.parseAttachment (cognitive 17) internal/modelcatalog/modelcatalog.go:304 — modelcatalog.parseAttachment 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 · session.PruneOldToolOutputs (cognitive 17) · ×1
  • session.PruneOldToolOutputs (cognitive 17) internal/session/history.go:64 — session.PruneOldToolOutputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 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 · tools.longestCommonSubstring (cognitive 17) · ×1
  • tools.longestCommonSubstring (cognitive 17) internal/tools/edit.go:395 — tools.longestCommonSubstring has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 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 · askUserTool.runBatch (cognitive 17) · ×1
  • askUserTool.runBatch (cognitive 17) internal/tools/ask_user.go:196 — askUserTool.runBatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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 · grepTool.runRemote (cognitive 17) · ×1
  • grepTool.runRemote (cognitive 17) internal/tools/grep.go:535 — grepTool.runRemote has cognitive complexity 17 (threshold 15). Drivers by points: if/else 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 · SubagentTaskManager.evictOldest (cognitive 17) · ×1
  • SubagentTaskManager.evictOldest (cognitive 17) internal/tools/subagent_manager.go:281 — SubagentTaskManager.evictOldest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (6 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 · enhancedTodoWriteTool.InvokableRun (cognitive 17) · ×1
  • enhancedTodoWriteTool.InvokableRun (cognitive 17) internal/tools/todo_enhanced.go:677 — enhancedTodoWriteTool.InvokableRun has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, match/switch 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 · Model.toggleSubagentExpand (cognitive 17) · ×1
  • Model.toggleSubagentExpand (cognitive 17) internal/tui/content_render.go:47 — Model.toggleSubagentExpand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 3, match/switch 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 · Server.handleToggleModelEnabled (cognitive 17) · ×1
  • Server.handleToggleModelEnabled (cognitive 17) internal/web/models.go:733 — Server.handleToggleModelEnabled has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 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 · orchestrate.build_jobs (cognitive 17) · ×1
  • orchestrate.build_jobs (cognitive 17) agent-eval/suite/orchestrate.py:862 — orchestrate.build_jobs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 3 (6 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolsearch_expect._fixture_scope_contract_valid (cognitive 17) · ×1
  • toolsearch_expect._fixture_scope_contract_valid (cognitive 17) agent-eval/suite/toolsearch_expect.py:719 — toolsearch_expect._fixture_scope_contract_valid has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 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 · main.swift.serveConnection (cognitive 17) · ×1
  • main.swift.serveConnection (cognitive 17) cmd/jcode-computerd/main.swift:1766 — main.swift.serveConnection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.swift.runServer (cognitive 17) · ×1
  • main.swift.runServer (cognitive 17) cmd/jcode-computerd/main.swift:1897 — main.swift.runServer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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 · aguiRuntime.createAGUIRuntime.handleEvent (cognitive 17) · ×1
  • aguiRuntime.createAGUIRuntime.handleEvent (cognitive 17) packages/jcode-ui-core/src/runtime/aguiRuntime.ts:307 — aguiRuntime.createAGUIRuntime.handleEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 8). 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 · Thread.VirtualizedThread (cognitive 17) · ×1
  • Thread.VirtualizedThread (cognitive 17) packages/jcode-ui-core/src/primitives/Thread.tsx:149 — Thread.VirtualizedThread has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6. 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 239, 279, 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.
D2 · Cognitive Complexity · turnChanges.appendTurnChangeSummaries (cognitive 17) · ×1
  • turnChanges.appendTurnChangeSummaries (cognitive 17) packages/jcode-ui-core/src/timeline/turnChanges.ts:174 — turnChanges.appendTurnChangeSummaries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 4 (6 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diff.buildDiff (cognitive 17) · ×1
  • diff.buildDiff (cognitive 17) packages/jcode-ui/src/toolRenderers/diff.tsx:79 — diff.buildDiff has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · computerAct.ComputerActRenderer (cognitive 17) · ×1
  • computerAct.ComputerActRenderer (cognitive 17) packages/jcode-ui/src/toolRenderers/computerAct.tsx:63 — computerAct.ComputerActRenderer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, loops 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 64). 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 · Attachment.PendingTile (cognitive 17) · ×1
  • Attachment.PendingTile (cognitive 17) packages/jcode-ui/src/components/Attachment.tsx:208 — Attachment.PendingTile has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (6 pts), if/else 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 · stackTrace.parseJs (cognitive 17) · ×1
  • stackTrace.parseJs (cognitive 17) packages/jcode-ui/src/toolRenderers/stackTrace.tsx:147 — stackTrace.parseJs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (6 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 · DayNightSystem.update (cognitive 17) · ×1
  • DayNightSystem.update (cognitive 17) site/public/showcase-projects/city3d/js/daynight.js:365 — DayNightSystem.update has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 4 (6 pts), boolean chains 1, loops 1 (nesting depth added 8). 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 · traffic.createTraffic.update (cognitive 17) · ×1
  • traffic.createTraffic.update (cognitive 17) site/public/showcase-projects/city3d/js/traffic.js:171 — traffic.createTraffic.update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (6 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 · store.findReplayTool (cognitive 17) · ×1
  • store.findReplayTool (cognitive 17) web/src/app/store.ts:342 — store.findReplayTool has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, 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 · saveFileLink.saveFileLink (cognitive 17) · ×1
  • saveFileLink.saveFileLink (cognitive 17) web/src/lib/saveFileLink.ts:37 — saveFileLink.saveFileLink has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (6 pts), boolean chains 2, 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 · SetupView.SetupView · ×1
  • SetupView.SetupView::validateInputs (cognitive 17) web/src/components/SetupView.tsx:129 — SetupView.SetupView::validateInputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 1 (3 pts), boolean chains 2, 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. This shape REPEATS in the file: one other method here (SetupView.SetupView) 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 · SettingsView.DeveloperTab (cognitive 17) · ×1
  • SettingsView.DeveloperTab (cognitive 17) web/src/components/SettingsView.tsx:2394 — SettingsView.DeveloperTab has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 6, error handling 1, if/else 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (toggle, a function literal at line 2407, a function literal at line 2422). 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 · agent.collectBillableIntentPreparers (cognitive 16) · ×1
  • agent.collectBillableIntentPreparers (cognitive 16) internal/agent/agent.go:183 — agent.collectBillableIntentPreparers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.rewriteToolSearchExactNameList (cognitive 16) · ×1
  • agent.rewriteToolSearchExactNameList (cognitive 16) internal/agent/toolsearch_disclosure.go:170 — agent.rewriteToolSearchExactNameList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 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 · browser.Launch (cognitive 16) · ×1
  • browser.Launch (cognitive 16) internal/browser/discover.go:244 — browser.Launch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 4). Of this number, 10 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 · wsCDP.readLoop (cognitive 16) · ×1
  • wsCDP.readLoop (cognitive 16) internal/browser/cdp.go:105 — wsCDP.readLoop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cloud.UnwrapAccountSyncKey (cognitive 16) · ×1
  • cloud.UnwrapAccountSyncKey (cognitive 16) internal/cloud/config_sync_crypto.go:113 — cloud.UnwrapAccountSyncKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 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 · cloud.LoadCredentials (cognitive 16) · ×1
  • cloud.LoadCredentials (cognitive 16) internal/cloud/credentials.go:77 — cloud.LoadCredentials has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 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 · cloud.providerModelStateSnapshot (cognitive 16) · ×1
  • cloud.providerModelStateSnapshot (cognitive 16) internal/cloud/provider_sync.go:138 — cloud.providerModelStateSnapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (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 · command.configuredGenerateImageTool (cognitive 16) · ×1
  • command.configuredGenerateImageTool (cognitive 16) internal/command/image_generation.go:23 — command.configuredGenerateImageTool has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command.splitProviderSearchMCPTools (cognitive 16) · ×1
  • command.splitProviderSearchMCPTools (cognitive 16) internal/command/provider_search.go:135 — command.splitProviderSearchMCPTools has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · command.runUpdate (cognitive 16) · ×1
  • command.runUpdate (cognitive 16) internal/command/update.go:26 — command.runUpdate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (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 · command.newFlowRunCmd (cognitive 16) · ×1
  • command.newFlowRunCmd (cognitive 16) REDACTED:128 — command.newFlowRunCmd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 pts) (nesting depth added 4). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 139). 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 · handler.resolvedACPArtifactMetadata (cognitive 16) · ×1
  • handler.resolvedACPArtifactMetadata (cognitive 16) internal/handler/acp.go:634 — handler.resolvedACPArtifactMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · modelcatalog.parseEffortTiers (cognitive 16) · ×1
  • modelcatalog.parseEffortTiers (cognitive 16) internal/modelcatalog/modelcatalog.go:394 — modelcatalog.parseEffortTiers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (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 · Recorder.ensureFile (cognitive 16) · ×1
  • Recorder.ensureFile (cognitive 16) internal/session/session.go:1422 — Recorder.ensureFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Manager.SpawnTeammate (cognitive 16) · ×1
  • Manager.SpawnTeammate (cognitive 16) internal/team/manager.go:205 — Manager.SpawnTeammate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 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 · tools.hasCycle (cognitive 16) · ×1
  • tools.hasCycle (cognitive 16) internal/tools/todo_enhanced.go:409 — tools.hasCycle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 6 (8 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 · editTool.editFile (cognitive 16) · ×1
  • editTool.editFile (cognitive 16) internal/tools/edit.go:181 — editTool.editFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FileTracker.ScanExternalChanges (cognitive 16) · ×1
  • FileTracker.ScanExternalChanges (cognitive 16) REDACTED:369 — FileTracker.ScanExternalChanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.walkDir (cognitive 16) · ×1
  • utils.walkDir (cognitive 16) internal/util/envinfo.go:134 — utils.walkDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). 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 · Server.handleAccountPreferences (cognitive 16) · ×1
  • Server.handleAccountPreferences (cognitive 16) internal/web/account_preferences.go:21 — Server.handleAccountPreferences has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4 (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 · Server.assembleLocalEngine (cognitive 16) · ×1
  • Server.assembleLocalEngine (cognitive 16) internal/web/engine.go:709 — Server.assembleLocalEngine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4 (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 · generate_data.main (cognitive 16) · ×1
  • generate_data.main (cognitive 16) agent-eval/showcase/generate_data.py:66 — generate_data.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), loops 2, 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 · toolsearch_cases._expand_mcp_case (cognitive 16) · ×1
  • toolsearch_cases._expand_mcp_case (cognitive 16) agent-eval/suite/toolsearch_cases.py:225 — toolsearch_cases._expand_mcp_case has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 2 (4 pts), ternaries 1 (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 · web_toolsearch_orchestrate.read_usage_metadata (cognitive 16) · ×1
  • web_toolsearch_orchestrate.read_usage_metadata (cognitive 16) agent-eval/suite/web_toolsearch_orchestrate.py:542 — web_toolsearch_orchestrate.read_usage_metadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aguiRuntime.applyOp (cognitive 16) · ×1
  • aguiRuntime.applyOp (cognitive 16) packages/jcode-ui-core/src/runtime/aguiRuntime.ts:86 — aguiRuntime.applyOp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 1 (2 pts), boolean chains 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 · ThreadList.ThreadList (cognitive 16) · ×1
  • ThreadList.ThreadList (cognitive 16) packages/jcode-ui/src/components/ThreadList.tsx:40 — ThreadList.ThreadList has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, ternaries 1 (2 pts), if/else 1, loops 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · jui.commandPalette.render (cognitive 16) · ×1
  • jui.commandPalette.render (cognitive 16) site/public/showcase-projects/ui-kit/js/jui.js:922 — jui.commandPalette.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 928, 931, 935, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · dataset.blur3x3 (cognitive 16) · ×1
  • dataset.blur3x3 (cognitive 16) site/public/showcase-projects/webgpu-cnn/js/dataset.js:75 — dataset.blur3x3 has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (5 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling · ×1
  • Change coupling: format.go ↔ tui.go internal/tui/format.go:1 — `internal/tui/format.go` and `internal/tui/tui.go` change together 77% of the time (10 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `397cdac8` fix(tui): address PR review feedback — sanitize fast path & debounce …; `940d29de` perf(tui): add multi-layer render cache and stream debounce; `abf1c3f9` feat: add ACPExecutor to delegate fs/terminal ops via ACP client prot… — run `git show` on any of them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (22 shared lines) · ×1
  • Near-duplicate member pair (22 shared lines) internal/web/remote.go:471 — internal/web/remote.go:471-518 | internal/web/remote.go:522-566 — These two members are variants of one another: 22 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) internal/computer/screenshot_filelock_windows.go:16 — internal/computer/screenshot_filelock_windows.go:16-29 | internal/config/config_filelock_windows.go:13-26 | internal/memory/filelock_windows.go:13-24 | internal/providerauth/filelock_windows.go:14-27 | internal/session/security_filelock_windows.go:13-26 | internal/tools/ssh_known_hosts_lock_windows.go:13-24 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) internal/artifact/managed.go:514 — internal/artifact/managed.go:514-573 | internal/imagegen/client.go:714-774 — These two members are one piece of code written twice and then edited apart: 60 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 (92 corresponding lines) · ×1
  • Edited copy of a member (92 corresponding lines) internal/agent/middleware.go:46 — internal/agent/middleware.go:46-152 | internal/agent/middleware.go:162-253 — These two members are one piece of code written twice and then edited apart: 92 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 (82 corresponding lines) · ×1
  • Edited copy of a member (82 corresponding lines) internal/tools/edit.go:181 — internal/tools/edit.go:181-264 | internal/tools/edit.go:491-572 — These two members are one piece of code written twice and then edited apart: 82 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 (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) internal/telemetry/langfuse.go:323 — internal/telemetry/langfuse.go:323-389 | internal/telemetry/langfuse.go:399-466 — These two members are one piece of code written twice and then edited apart: 67 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 (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) internal/providerauth/copilot.go:71 — internal/providerauth/copilot.go:71-128 | internal/providerauth/xai.go:130-192 — These two members are one piece of code written twice and then edited apart: 58 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 (3 members, 44+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 44+ corresponding lines) internal/cloud/credentials.go:129 — internal/cloud/credentials.go:129-182 | internal/cloud/sync_store.go:192-235 | internal/config/config.go:1261-1325 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) internal/cloud/client.go:158 — internal/cloud/client.go:158-209 | internal/cloud/client.go:214-258 — These two members are one piece of code written twice and then edited apart: 45 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 (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) internal/tools/grep.go:192 — internal/tools/grep.go:192-250 | internal/tools/grep.go:581-640 — These two members are one piece of code written twice and then edited apart: 59 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 (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) internal/providerauth/codex.go:175 — internal/providerauth/codex.go:175-218 | internal/providerauth/xai.go:214-261 — These two members are one piece of code written twice and then edited apart: 44 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 (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) internal/cloud/config_sync_crypto.go:70 — internal/cloud/config_sync_crypto.go:70-109 | internal/cloud/crypto.go:421-461 — These two members are one piece of code written twice and then edited apart: 40 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 (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) internal/cloud/history_sync.go:77 — internal/cloud/history_sync.go:77-113 | internal/providerauth/store.go:203-244 — These two members are one piece of code written twice and then edited apart: 37 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 (3 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 40+ corresponding lines) internal/providerauth/codex.go:20 — internal/providerauth/codex.go:20-59 | internal/providerauth/copilot.go:24-69 | internal/providerauth/xai.go:27-74 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) internal/review/investigate.go:120 — internal/review/investigate.go:120-180 | REDACTED:176-231 — These two members are one piece of code written twice and then edited apart: 56 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 (3 members, 36+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 36+ corresponding lines) internal/tui/pickers.go:322 — internal/tui/pickers.go:322-357 | internal/tui/pickers.go:411-455 | internal/tui/pickers.go:639-674 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) internal/web/session_changes.go:76 — internal/web/session_changes.go:76-107 | internal/web/session_draft_pr.go:116-142 | internal/web/session_draft_pr.go:313-336 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) internal/tui/pickers.go:550 — internal/tui/pickers.go:550-597 | internal/tui/pickers.go:599-637 — These two members are one piece of code written twice and then edited apart: 39 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 (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) internal/prompts/prompts.go:23 — internal/prompts/prompts.go:23-80 | internal/prompts/prompts.go:97-142 — These two members are one piece of code written twice and then edited apart: 46 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 (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) internal/runner/approval.go:561 — internal/runner/approval.go:561-601 | internal/runner/approval.go:827-858 — These two members are one piece of code written twice and then edited apart: 32 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 (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) internal/cloud/connector.go:1087 — internal/cloud/connector.go:1087-1109 | internal/cloud/connector.go:1111-1136 | internal/cloud/connector.go:1138-1160 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) internal/cloud/history_sync.go:234 — internal/cloud/history_sync.go:234-260 | internal/session/security_journal_strict.go:17-46 | internal/session/session.go:1926-1963 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) REDACTED:226 — REDACTED:226-264 | internal/browser/cdp.go:105-138 — These two members are one piece of code written twice and then edited apart: 34 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 (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) internal/web/cloud_pairings.go:67 — internal/web/cloud_pairings.go:67-93 | internal/web/cloud_pairings.go:106-126 — These two members are one piece of code written twice and then edited apart: 21 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 (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) internal/session/security_dispatch.go:40 — internal/session/security_dispatch.go:40-71 | internal/session/security_dispatch.go:79-107 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) internal/handler/acp.go:97 — internal/handler/acp.go:97-143 | internal/handler/web.go:673-713 — These two members are one piece of code written twice and then edited apart: 41 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 (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) internal/web/browser.go:130 — internal/web/browser.go:130-153 | internal/web/computer.go:340-363 — These two members are one piece of code written twice and then edited apart: 24 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 (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) internal/cloud/crypto.go:267 — internal/cloud/crypto.go:267-293 | internal/cloud/crypto.go:298-322 — These two members are one piece of code written twice and then edited apart: 25 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 (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) internal/web/engine.go:797 — internal/web/engine.go:797-818 | internal/web/engine.go:873-895 — These two members are one piece of code written twice and then edited apart: 22 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 (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) internal/web/channel.go:70 — internal/web/channel.go:70-83 | internal/web/channel.go:85-95 | internal/web/channel.go:97-107 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) internal/web/provider_auth.go:207 — internal/web/provider_auth.go:207-223 | internal/web/provider_auth.go:255-276 | internal/web/provider_auth.go:278-299 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) internal/flow/loader.go:112 — internal/flow/loader.go:112-121 | internal/skills/skills.go:201-212 | internal/team/manager.go:492-503 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) internal/web/providers.go:138 — internal/web/providers.go:138-151 | internal/web/providers.go:162-178 | internal/web/providers.go:206-218 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) REDACTED:544 — REDACTED:544-558 | REDACTED:560-573 | REDACTED:779-792 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) agent-eval/suite/orchestrate.py:156 — agent-eval/suite/orchestrate.py:156-160 | agent-eval/suite/session_extract.py:202-207 | agent-eval/suite/web_toolsearch_orchestrate.py:139-143 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) internal/handler/web.go:1242 — internal/handler/web.go:1242-1252 | internal/tools/background.go:248-257 | internal/web/pty.go:177-185 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×1
  • Edited copy of a member (9 corresponding lines) internal/session/provider_tool_operation.go:83 — internal/session/provider_tool_operation.go:83-91 | internal/session/session.go:156-164 — These two members are one piece of code written twice and then edited apart: 9 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 · Duplicated block (49–52 lines × 2) · ×1
  • Duplicated block (49–52 lines × 2) internal/telemetry/langfuse.go:330 — internal/telemetry/langfuse.go:330-381 | internal/telemetry/langfuse.go:410-458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/telemetry/langfuse.go:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) internal/tui/update.go:940 — internal/tui/update.go:940-967 | internal/tui/update.go:1323-1349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/update.go:940` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) internal/computer/configmap.go:66 — internal/computer/configmap.go:66-90 | internal/computer/manager.go:247-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/computer/configmap.go:66` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–24 lines × 2) · ×1
  • Duplicated block (19–24 lines × 2) internal/agent/middleware.go:66 — internal/agent/middleware.go:66-89 | internal/agent/middleware.go:186-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agent/middleware.go:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) internal/tools/grep.go:208 — internal/tools/grep.go:208-231 | internal/tools/grep.go:592-614 — 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.
D4 · Code Duplication · Duplicated block (23 lines × 5) · ×1
  • Duplicated block (23 lines × 5) internal/tui/channel_panel.go:100 — internal/tui/channel_panel.go:100-122 | internal/tui/manage_models.go:200-222 | internal/tui/pickers.go:271-293 | internal/tui/pickers.go:360-382 | internal/tui/theme_picker.go:137-159 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/tui/manage_models.go:225` calls `NewStyle`, `Foreground`, `Render` and `internal/tui/channel_panel.go:125` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) internal/tui/update.go:655 — internal/tui/update.go:655-676 | internal/tui/update.go:1100-1122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–21 lines × 2) · ×1
  • Duplicated block (16–21 lines × 2) internal/agent/middleware.go:108 — internal/agent/middleware.go:108-128 | internal/agent/middleware.go:223-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agent/middleware.go:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) internal/tui/pickers.go:551 — internal/tui/pickers.go:551-570 | internal/tui/pickers.go:600-619 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) internal/tui/pickers.go:323 — internal/tui/pickers.go:323-340 | internal/tui/pickers.go:412-429 | internal/tui/pickers.go:640-657 — 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) internal/tui/update.go:812 — internal/tui/update.go:812-828 | internal/tui/update.go:1297-1312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/update.go:812` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) internal/providerauth/store.go:141 — internal/providerauth/store.go:141-156 | internal/providerauth/store.go:164-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) internal/web/providers.go:861 — internal/web/providers.go:861-876 | internal/web/setup.go:284-296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/providers.go:861` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) internal/session/session.go:1789 — internal/session/session.go:1789-1803 | internal/session/session.go:1814-1828 | internal/session/session.go:1869-1883 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) internal/command/acp.go:1280 — internal/command/acp.go:1280-1292 | internal/command/acp.go:1362-1376 — 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.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) internal/config/config.go:1262 — internal/config/config.go:1262-1276 | internal/config/config_mutation.go:66-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) internal/tools/edit.go:238 — internal/tools/edit.go:238-252 | internal/tools/edit.go:321-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/edit.go:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `internal/tools/edit.go:238` is reached only past a guard at line 182 that tests `input.NewString` and `input.OldString` and leaves the function early, and `internal/tools/edit.go:321` reads `input.NewString` and `input.OldString` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) internal/tui/pickers.go:56 — internal/tui/pickers.go:56-68 | internal/tui/pickers.go:173-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/pickers.go:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) internal/artifact/managed.go:526 — internal/artifact/managed.go:526-552 | internal/imagegen/client.go:724-750 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/artifact/managed.go:526` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–12 lines × 3) · ×1
  • Duplicated block (9–12 lines × 3) internal/command/acp.go:523 — internal/command/acp.go:523-534 | internal/command/interactive.go:1485-1494 | REDACTED:228-236 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/command/acp.go:523` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) internal/cloud/client.go:189 — internal/cloud/client.go:189-200 | internal/cloud/client.go:238-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cloud/client.go:189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) internal/tui/input_views.go:265 — internal/tui/input_views.go:265-275 | internal/tui/input_views.go:465-475 | internal/tui/input_views.go:510-520 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/input_views.go:265` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) internal/tui/theme_picker.go:77 — internal/tui/theme_picker.go:77-85 | internal/tui/theme_picker.go:123-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tui/theme_picker.go:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) internal/computer/screenshot_filelock_windows.go:18 — internal/computer/screenshot_filelock_windows.go:18-27 | internal/config/config_filelock_windows.go:15-24 | internal/providerauth/filelock_windows.go:16-25 | internal/session/security_filelock_windows.go:15-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) internal/web/channel.go:134 — internal/web/channel.go:134-143 | internal/web/mcp.go:452-461 | internal/web/mcp.go:536-545 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) internal/session/provider_tool_operation.go:143 — internal/session/provider_tool_operation.go:143-151 | internal/session/security_dispatch.go:110-119 | internal/session/session.go:1035-1043 | internal/session/session.go:1227-1236 | internal/session/session.go:1276-1284 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/session/provider_tool_operation.go:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) internal/web/chat.go:37 — internal/web/chat.go:37-40 | internal/web/remote.go:475-480 | internal/web/remote.go:526-531 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/remote.go:475` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/web/chat.go:37` calls `NewDecoder`, `LimitReader`, `Decode` and `internal/web/remote.go:475` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) internal/computer/screenshot_filelock_windows.go:17 — internal/computer/screenshot_filelock_windows.go:17-22 | internal/config/config_filelock_windows.go:14-19 | internal/memory/filelock_windows.go:14-18 | internal/providerauth/filelock_windows.go:15-20 | internal/session/security_filelock_windows.go:14-19 | internal/tools/ssh_known_hosts_lock_windows.go:14-18 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `internal/computer/screenshot_filelock_windows.go:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) internal/command/interactive.go:841 — internal/command/interactive.go:841-845 | internal/command/interactive.go:884-888 | internal/command/interactive.go:914-917 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/command/interactive.go:848` calls `handlePlanCompletion` and `internal/command/interactive.go:889` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) internal/agent/tool_result.go:21 — internal/agent/tool_result.go:21-32 | internal/telemetry/langfuse.go:468-479 | internal/tools/subagent.go:220-231 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) internal/config/config_filelock_windows.go:28 — internal/config/config_filelock_windows.go:28-35 | internal/providerauth/filelock_windows.go:29-36 | internal/session/security_filelock_windows.go:28-35 | internal/tools/ssh_known_hosts_lock_windows.go:26-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) internal/web/cloud.go:49 — internal/web/cloud.go:49-54 | internal/web/computer.go:232-237 | internal/web/dev_options.go:70-75 | internal/web/memory.go:269-274 | internal/web/tool_search.go:48-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/web/cloud.go:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) cmd/jcode-computerd/main.swift:431 — cmd/jcode-computerd/main.swift:431-437 | cmd/jcode-computerd/main.swift:1327-1334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/jcode-ui/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
R10 · Code Duplication · Duplication concentrated across 2 sibling directories (21 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (21 clone groups) packages/jcode-ui/src/product/types.ts:19 — 21 duplicated blocks under the repository root have copies in at least two of the sibling directories packages, web — 13 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 21 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 21 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 21 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 (7 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (7 clone groups) packages/jcode-ui-core/src/primitives/Composer.tsx:534 — 7 duplicated blocks under packages/ have copies in at least two of the sibling directories jcode-ui, jcode-ui-core — 4 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 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 · Duplicated block with local edits (32 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (32 matched lines × 2 locations) packages/jcode-ui-core/src/timeline/groupActivity.ts:23 — packages/jcode-ui-core/src/timeline/groupActivity.ts:23 · packages/jcode-ui-core/src/timeline/groupExploring.ts:41 — the two spans are one implementation copied and then locally edited — 242 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 (31 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (31 matched lines × 2 locations) packages/jcode-ui/src/product/types.ts:19 — packages/jcode-ui/src/product/types.ts:19 · web/src/lib/types.ts:200 — 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 (30 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (30 matched lines × 2 locations) REDACTED:181 — REDACTED:181 · REDACTED:44 — the two spans are one implementation copied and then locally edited — 189 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 (28 lines × 2 locations) · ×1
  • Duplicated block (28 lines × 2 locations) packages/jcode-ui/src/toolRenderers/team.tsx:90 — packages/jcode-ui/src/toolRenderers/team.tsx:90 · packages/jcode-ui/src/toolRenderers/team.tsx:149 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (27 lines × 2 locations) · ×1
  • Duplicated block (27 lines × 2 locations) packages/jcode-ui/src/canvas/WorkflowEdge.tsx:17 — packages/jcode-ui/src/canvas/WorkflowEdge.tsx:17 · packages/jcode-ui/src/canvas/WorkflowEdge.tsx:45 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (25 lines × 2 locations) · ×1
  • Duplicated block (25 lines × 2 locations) packages/jcode-ui/src/toolRenderers/diff.tsx:51 — packages/jcode-ui/src/toolRenderers/diff.tsx:51 · packages/jcode-ui/src/toolRenderers/fileViewer.tsx:37 — 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 (21 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (21 matched lines × 2 locations) packages/jcode-ui-core/src/primitives/Composer.tsx:534 — packages/jcode-ui-core/src/primitives/Composer.tsx:534 · packages/jcode-ui/src/product/ChatInput.tsx:969 — the two spans are one implementation copied and then locally edited — 89 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) · ×1
  • Duplicated block (17 lines × 2 locations) web/src/components/RemoteConnectionNotice.tsx:54 — web/src/components/RemoteConnectionNotice.tsx:54 · web/src/components/RemoteConnectionNotice.tsx:80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (16 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (16 matched lines × 2 locations) packages/jcode-ui/src/components/TurnChangesCard.tsx:49 — packages/jcode-ui/src/components/TurnChangesCard.tsx:49 · packages/jcode-ui/src/components/TurnChangesCard.tsx:112 — the two spans are one implementation copied and then locally edited — 89 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 (13 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (13 matched lines × 2 locations) web/src/app/store.ts:668 — web/src/app/store.ts:668 · web/src/app/store.ts:708 — the two spans are one implementation copied and then locally edited — 162 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.
R2 · Cyclomatic Complexity · Complex function ChatInput (cyclomatic 96, cognitive 86) · ×1
  • Complex function ChatInput (cyclomatic 96, cognitive 86) packages/jcode-ui/src/product/ChatInput.tsx:306 — ChatInput has cyclomatic complexity 96 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 MemoryTab (cyclomatic 80, cognitive 60) · ×1
  • Complex function MemoryTab (cyclomatic 80, cognitive 60) web/src/components/SettingsView.tsx:3451 — MemoryTab has cyclomatic complexity 80 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 addToolCall (cyclomatic 68, cognitive 71) · ×1
  • Complex function addToolCall (cyclomatic 68, cognitive 71) web/src/app/store.ts:606 — addToolCall has cyclomatic complexity 68 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ComputerTab (cyclomatic 66, cognitive 60) · ×1
  • Complex function ComputerTab (cyclomatic 66, cognitive 60) web/src/components/SettingsView.tsx:4420 — ComputerTab has cyclomatic complexity 66 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 resolveToolCall (cyclomatic 53, cognitive 68) · ×1
  • Complex function resolveToolCall (cyclomatic 53, cognitive 68) web/src/app/store.ts:764 — resolveToolCall has cyclomatic complexity 53 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 extractSymbols (cyclomatic 51, cognitive 88) · ×1
  • Complex function extractSymbols (cyclomatic 51, cognitive 88) script/generate_jcode_ui_api_docs.mjs:52 — extractSymbols has cyclomatic complexity 51 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function CloudTab (cyclomatic 47, cognitive 42) · ×1
  • Complex function CloudTab (cyclomatic 47, cognitive 42) web/src/components/settings/CloudTab.tsx:89 — CloudTab has cyclomatic complexity 47 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 RemoteConnectWizard (cyclomatic 46, cognitive 44) · ×1
  • Complex function RemoteConnectWizard (cyclomatic 46, cognitive 44) web/src/components/RemoteConnectWizard.tsx:36 — RemoteConnectWizard has cyclomatic complexity 46 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ProviderAuthSection (cyclomatic 46, cognitive 39) · ×1
  • Complex function ProviderAuthSection (cyclomatic 46, cognitive 39) web/src/components/settings/ProviderAuthSection.tsx:250 — ProviderAuthSection has cyclomatic complexity 46 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ToolCallView (cyclomatic 46, cognitive 34) · ×1
  • Complex function ToolCallView (cyclomatic 46, cognitive 34) packages/jcode-ui-core/src/primitives/ToolCallView.tsx:63 — ToolCallView has cyclomatic complexity 46 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ProviderForm (cyclomatic 45, cognitive 43) · ×1
  • Complex function ProviderForm (cyclomatic 45, cognitive 43) web/src/components/SettingsView.tsx:1235 — ProviderForm has cyclomatic complexity 45 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ToolRowHeader (cyclomatic 45, cognitive 40) · ×1
  • Complex function ToolRowHeader (cyclomatic 45, cognitive 40) REDACTED:43 — ToolRowHeader has cyclomatic complexity 45 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 Message (cyclomatic 45, cognitive 32) · ×1
  • Complex function Message (cyclomatic 45, cognitive 32) REDACTED:59 — Message has cyclomatic complexity 45 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 GeneratedImageCard (cyclomatic 44, cognitive 38) · ×1
  • Complex function GeneratedImageCard (cyclomatic 44, cognitive 38) packages/jcode-ui/src/components/GeneratedImageCard.tsx:100 — GeneratedImageCard has cyclomatic complexity 44 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ProviderCard (cyclomatic 43, cognitive 39) · ×1
  • Complex function ProviderCard (cyclomatic 43, cognitive 39) web/src/components/SettingsView.tsx:893 — ProviderCard has cyclomatic complexity 43 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function Composer (cyclomatic 42, cognitive 36) · ×1
  • Complex function Composer (cyclomatic 42, cognitive 36) packages/jcode-ui-core/src/primitives/Composer.tsx:219 — Composer has cyclomatic complexity 42 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ConversationLoadingView (cyclomatic 41, cognitive 39) · ×1
  • Complex function ConversationLoadingView (cyclomatic 41, cognitive 39) web/src/components/ConversationLoadingView.tsx:23 — ConversationLoadingView has cyclomatic complexity 41 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ToolHeader (cyclomatic 41, cognitive 36) · ×1
  • Complex function ToolHeader (cyclomatic 41, cognitive 36) REDACTED:169 — ToolHeader has cyclomatic complexity 41 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 save (cyclomatic 38, cognitive 47) · ×1
  • Complex function save (cyclomatic 38, cognitive 47) web/src/components/SettingsView.tsx:1329 — save has cyclomatic complexity 38 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 replayOperationsByOccurrence (cyclomatic 38, cognitive 45) · ×1
  • Complex function replayOperationsByOccurrence (cyclomatic 38, cognitive 45) web/src/app/store.ts:212 — replayOperationsByOccurrence has cyclomatic complexity 38 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseTestOutput (cyclomatic 37, cognitive 68) · ×1
  • Complex function parseTestOutput (cyclomatic 37, cognitive 68) packages/jcode-ui/src/toolRenderers/testResults.tsx:131 — parseTestOutput has cyclomatic complexity 37 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 WorkspacePicker (cyclomatic 36, cognitive 33) · ×1
  • Complex function WorkspacePicker (cyclomatic 36, cognitive 33) packages/jcode-ui/src/product/WorkspacePicker.tsx:51 — WorkspacePicker has cyclomatic complexity 36 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 provisionNewChat (cyclomatic 35, cognitive 31) · ×1
  • Complex function provisionNewChat (cyclomatic 35, cognitive 31) web/src/app/store.ts:2830 — provisionNewChat has cyclomatic complexity 35 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 replayTimeline (cyclomatic 34, cognitive 55) · ×1
  • Complex function replayTimeline (cyclomatic 34, cognitive 55) web/src/app/store.ts:72 — replayTimeline has cyclomatic complexity 34 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 poll (cyclomatic 34, cognitive 38) · ×1
  • Complex function poll (cyclomatic 34, cognitive 38) web/src/components/settings/ProviderAuthSection.tsx:403 — poll has cyclomatic complexity 34 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 resumeConversationEnvironment (cyclomatic 32, cognitive 34) · ×1
  • Complex function resumeConversationEnvironment (cyclomatic 32, cognitive 34) web/src/app/store.ts:2468 — resumeConversationEnvironment has cyclomatic complexity 32 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 TerminalRenderer (cyclomatic 31, cognitive 27) · ×1
  • Complex function TerminalRenderer (cyclomatic 31, cognitive 27) packages/jcode-ui/src/toolRenderers/terminal.tsx:12 — TerminalRenderer has cyclomatic complexity 31 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 boot (cyclomatic 29, cognitive 33) · ×1
  • Complex function boot (cyclomatic 29, cognitive 33) web/src/App.tsx:111 — boot has cyclomatic complexity 29 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 AutomationEditor (cyclomatic 29, cognitive 25) · ×1
  • Complex function AutomationEditor (cyclomatic 29, cognitive 25) web/src/components/AutomationsView.tsx:371 — AutomationEditor has cyclomatic complexity 29 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 revealSessionInSidebar (cyclomatic 29, cognitive 16) · ×1
  • Complex function revealSessionInSidebar (cyclomatic 29, cognitive 16) web/src/app/store.ts:1829 — revealSessionInSidebar has cyclomatic complexity 29 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 RemoteConnectionNotice (cyclomatic 28, cognitive 31) · ×1
  • Complex function RemoteConnectionNotice (cyclomatic 28, cognitive 31) web/src/components/RemoteConnectionNotice.tsx:25 — RemoteConnectionNotice has cyclomatic complexity 28 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 mergeToolLifecycle (cyclomatic 28, cognitive 25) · ×1
  • Complex function mergeToolLifecycle (cyclomatic 28, cognitive 25) web/src/app/toolLifecycle.ts:38 — mergeToolLifecycle has cyclomatic complexity 28 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 28, cognitive 23) · ×1
  • Complex function (anonymous) (cyclomatic 28, cognitive 23) web/src/components/Sidebar.tsx:635 — (anonymous) has cyclomatic complexity 28 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 27, cognitive 41) · ×1
  • Complex function (anonymous) (cyclomatic 27, cognitive 41) packages/jcode-ui/src/product/ChatInput.tsx:564 — (anonymous) has cyclomatic complexity 27 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleEvent (cyclomatic 27, cognitive 18) · ×1
  • Complex function handleEvent (cyclomatic 27, cognitive 18) packages/jcode-ui-core/src/runtime/aguiRuntime.ts:307 — handleEvent has cyclomatic complexity 27 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 SubagentHeader (cyclomatic 26, cognitive 27) · ×1
  • Complex function SubagentHeader (cyclomatic 26, cognitive 27) REDACTED:291 — SubagentHeader has cyclomatic complexity 26 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 applyForegroundAgentDone (cyclomatic 26, cognitive 23) · ×1
  • Complex function applyForegroundAgentDone (cyclomatic 26, cognitive 23) web/src/app/wsBridge.ts:39 — applyForegroundAgentDone has cyclomatic complexity 26 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 UpdateBanner (cyclomatic 26, cognitive 21) · ×1
  • Complex function UpdateBanner (cyclomatic 26, cognitive 21) web/src/components/UpdateBanner.tsx:14 — UpdateBanner has cyclomatic complexity 26 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 SetupView (cyclomatic 25, cognitive 23) · ×1
  • Complex function SetupView (cyclomatic 25, cognitive 23) web/src/components/SetupView.tsx:27 — SetupView has cyclomatic complexity 25 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 CompactToolRow (cyclomatic 25, cognitive 22) · ×1
  • Complex function CompactToolRow (cyclomatic 25, cognitive 22) packages/jcode-ui/src/components/CompactToolRow.tsx:14 — CompactToolRow has cyclomatic complexity 25 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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.
R3 · Large Files · web/src/components/SettingsView.tsx · ×1
  • web/src/components/SettingsView.tsx: 5094 lines of code web/src/components/SettingsView.tsx:1 — web/src/components/SettingsView.tsx has 5094 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/app/store.ts · ×1
  • web/src/app/store.ts: 2841 lines of code web/src/app/store.ts:1 — web/src/app/store.ts has 2841 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 · packages/jcode-ui/src/product/ChatInput.tsx · ×1
  • packages/jcode-ui/src/product/ChatInput.tsx: 2000 lines of code packages/jcode-ui/src/product/ChatInput.tsx:1 — packages/jcode-ui/src/product/ChatInput.tsx has 2000 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/i18n/locales/en.ts · ×1
  • web/src/i18n/locales/en.ts: 1618 lines of code web/src/i18n/locales/en.ts:1 — web/src/i18n/locales/en.ts has 1618 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/i18n/locales/zh-Hans.ts · ×1
  • web/src/i18n/locales/zh-Hans.ts: 1592 lines of code web/src/i18n/locales/zh-Hans.ts:1 — web/src/i18n/locales/zh-Hans.ts has 1592 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/i18n/locales/ja.ts · ×1
  • web/src/i18n/locales/ja.ts: 1484 lines of code web/src/i18n/locales/ja.ts:1 — web/src/i18n/locales/ja.ts has 1484 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/i18n/locales/ko.ts · ×1
  • web/src/i18n/locales/ko.ts: 1483 lines of code web/src/i18n/locales/ko.ts:1 — web/src/i18n/locales/ko.ts has 1483 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/i18n/locales/zh-Hant.ts · ×1
  • web/src/i18n/locales/zh-Hant.ts: 1478 lines of code web/src/i18n/locales/zh-Hant.ts:1 — web/src/i18n/locales/zh-Hant.ts has 1478 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/AutomationsView.tsx · ×1
  • web/src/components/AutomationsView.tsx: 1176 lines of code web/src/components/AutomationsView.tsx:1 — web/src/components/AutomationsView.tsx has 1176 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/Sidebar.tsx · ×1
  • web/src/components/Sidebar.tsx: 1168 lines of code web/src/components/Sidebar.tsx:1 — web/src/components/Sidebar.tsx has 1168 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/RemoteConnectWizard.tsx · ×1
  • web/src/components/RemoteConnectWizard.tsx: 1152 lines of code web/src/components/RemoteConnectWizard.tsx:1 — web/src/components/RemoteConnectWizard.tsx has 1152 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/api.ts · ×1
  • web/src/lib/api.ts: 982 lines of code web/src/lib/api.ts:1 — web/src/lib/api.ts has 982 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/lib/types.ts · ×1
  • web/src/lib/types.ts: 951 lines of code web/src/lib/types.ts:1 — web/src/lib/types.ts has 951 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/settings/ProviderAuthSection.tsx · ×1
  • web/src/components/settings/ProviderAuthSection.tsx: 880 lines of code web/src/components/settings/ProviderAuthSection.tsx:1 — web/src/components/settings/ProviderAuthSection.tsx has 880 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/settings/CloudTab.tsx · ×1
  • web/src/components/settings/CloudTab.tsx: 748 lines of code web/src/components/settings/CloudTab.tsx:1 — web/src/components/settings/CloudTab.tsx has 748 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 · packages/jcode-ui-core/src/primitives/Composer.tsx · ×1
  • packages/jcode-ui-core/src/primitives/Composer.tsx: 683 lines of code packages/jcode-ui-core/src/primitives/Composer.tsx:1 — packages/jcode-ui-core/src/primitives/Composer.tsx has 683 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/App.tsx · ×1
  • web/src/App.tsx: 656 lines of code web/src/App.tsx:1 — web/src/App.tsx has 656 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/RightPanel.tsx · ×1
  • web/src/components/RightPanel.tsx: 649 lines of code web/src/components/RightPanel.tsx:1 — web/src/components/RightPanel.tsx has 649 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 · packages/jcode-ui/src/product/WorkspacePicker.tsx · ×1
  • packages/jcode-ui/src/product/WorkspacePicker.tsx: 624 lines of code packages/jcode-ui/src/product/WorkspacePicker.tsx:1 — packages/jcode-ui/src/product/WorkspacePicker.tsx has 624 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/ArtifactsPanel.tsx · ×1
  • web/src/components/ArtifactsPanel.tsx: 596 lines of code web/src/components/ArtifactsPanel.tsx:1 — web/src/components/ArtifactsPanel.tsx has 596 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/DesktopTitlebar.tsx · ×1
  • web/src/components/DesktopTitlebar.tsx: 559 lines of code web/src/components/DesktopTitlebar.tsx:1 — web/src/components/DesktopTitlebar.tsx has 559 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 · packages/jcode-ui-core/src/types/index.ts · ×1
  • packages/jcode-ui-core/src/types/index.ts: 489 lines of code packages/jcode-ui-core/src/types/index.ts:1 — packages/jcode-ui-core/src/types/index.ts has 489 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/fixture-tool-ux/main.tsx · ×1
  • web/fixture-tool-ux/main.tsx: 454 lines of code web/fixture-tool-ux/main.tsx:1 — web/fixture-tool-ux/main.tsx has 454 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 · packages/jcode-ui-core/src/runtime/aguiRuntime.ts · ×1
  • packages/jcode-ui-core/src/runtime/aguiRuntime.ts: 452 lines of code packages/jcode-ui-core/src/runtime/aguiRuntime.ts:1 — packages/jcode-ui-core/src/runtime/aguiRuntime.ts has 452 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: 448 lines of code REDACTED:1 — REDACTED has 448 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: 413 lines of code REDACTED:1 — REDACTED has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~91 LoC) · ×1
  • Dead file (~91 LoC) internal/flow/prelude.js — no import path from any entry point (27 application, 11 tooling, 77 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~64 LoC) · ×1
  • Dead file (~64 LoC) internal/flow/builtin/pr-review.js — no import path from any entry point (27 application, 11 tooling, 77 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~56 LoC) · ×1
  • Dead file (~56 LoC) internal/flow/builtin/roundtable.js — no import path from any entry point (27 application, 11 tooling, 77 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~54 LoC) · ×1
  • Dead file (~54 LoC) web/src/components/ProjectHeader.tsx — no import path from any entry point (27 application, 11 tooling, 77 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~50 LoC) · ×1
  • Dead file (~50 LoC) internal/flow/builtin/repo-audit.js — no import path from any entry point (27 application, 11 tooling, 77 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'highlight.js' · ×1
  • Unused dependency 'highlight.js' REDACTED:27 — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X27 · Collection changed while being enumerated · Collection is structurally changed while it is being enumerated · ×1
  • Collection is structurally changed while it is being enumerated internal/agent/turn_budget.go:187 — `msgs` is walked by the `for … range` at line 187, and line 192 reassigns `msgs`. The loop keeps walking the collection it started with, while the body from here on reads and writes another one.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) web/src/lib/useDesktop.ts:130 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Minor — 107 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate internal/command/provider_search.go:157 — `!exact || original != providertools.BigModelSearchMCPToolName` appears character-identically in 2 files — internal/command/provider_search.go, internal/runner/approval.go. 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 internal/artifact/managed.go:560 — `animated && canvasWidth > 0 && canvasHeight > 0` appears character-identically in 2 files — internal/artifact/managed.go, internal/imagegen/client.go. 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 internal/artifact/managed.go:567 — `canvasWidth <= 0 || canvasHeight <= 0 || imageWidth > canvasWidth || imageHeight > canvasHeight` appears character-identically in 2 files — internal/artifact/managed.go, internal/imagegen/client.go. 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 internal/command/acp.go:589 — `config.TracingEnabled(cfg) && cfg.Telemetry != nil && cfg.Telemetry.Langfuse != nil` appears character-identically in 3 files — internal/command/acp.go, internal/command/interactive.go, internal/command/web.go. 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 internal/cloud/artifact_share.go:222 — `creds == nil || strings.TrimSpace(creds.DeviceToken) == ""` appears character-identically in 2 files — internal/cloud/artifact_share.go, internal/web/artifacts.go. 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 internal/providerauth/copilot.go:44 — `deviceCode == "" || userCode == "" || verificationURI == ""` appears character-identically in 2 files — internal/providerauth/copilot.go, internal/providerauth/xai.go. 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 internal/model/chatmodel.go:867 — `end < len(input) && input[end] != nil && input[end].Role == schema.Tool` appears character-identically in 2 files — internal/model/chatmodel.go, internal/model/responses_convert.go. 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 internal/web/activation.go:559 — `eng.env != nil && eng.env.GoalStore != nil` appears character-identically in 2 files — internal/web/activation.go, internal/web/sessions.go. 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 internal/artifact/service.go:216 — `err != nil && !errors.Is(err, os.ErrNotExist)` appears character-identically in 3 files — internal/artifact/service.go, internal/command/provider_search.go, internal/tools/provider_managed_billable.go. 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 internal/artifact/service.go:487 — `err != nil || rel == ".." || strings.HasPrefix(rel, ".."+string(filepath.Separator))` appears character-identically in 2 files — internal/artifact/service.go, internal/computer/helper_dial.go. 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 internal/config/project.go:78 — `err != nil || strings.HasPrefix(rel, "..")` appears character-identically in 2 files — internal/config/project.go, internal/prompts/memory.go. 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 internal/browser/perms.go:16 — `err != nil || u.Scheme == "" || u.Host == ""` appears character-identically in 3 files — internal/browser/perms.go, internal/model/responses.go, internal/runner/approval.go. 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 internal/imagegen/client.go:779 — `errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded)` appears character-identically in 2 files — internal/imagegen/client.go, internal/tools/provider_managed_billable.go. 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 internal/review/investigate.go:145 — `event.Output == nil || event.Output.MessageOutput == nil` appears character-identically in 5 files — internal/review/investigate.go, internal/runner/runner.go, internal/team/manager.go, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/command/login.go:100 — `existing != nil && existing.CloudURL == baseURL` appears character-identically in 2 files — internal/command/login.go, internal/web/cloud_login.go. 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 internal/artifact/managed.go:515 — `len(data) < 20 || string(data[:4]) != "RIFF" || string(data[8:12]) != "WEBP"` appears character-identically in 2 files — internal/artifact/managed.go, internal/imagegen/client.go. 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 internal/model/factory.go:195 — `len(parts) != 2 || parts[0] == "" || parts[1] == ""` appears character-identically in 2 files — internal/model/factory.go, internal/web/memory.go. 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 internal/artifact/managed.go:530 — `length < 0 || end < start || end > len(data)` appears character-identically in 2 files — internal/artifact/managed.go, internal/imagegen/client.go. 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 internal/tui/input_views.go:128 — `m.cmdSuggestionActive && len(m.cmdSuggestions) > 0` appears character-identically in 2 files — internal/tui/input_views.go, internal/tui/update.go. 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 internal/tui/manage_models.go:178 — `msg.String() == "up" || msg.String() == "down"` appears character-identically in 2 files — internal/tui/manage_models.go, internal/tui/update.go. 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 internal/providerauth/copilot.go:288 — `parsed.Scheme == "http" || parsed.Scheme == "https"` appears character-identically in 2 files — internal/providerauth/copilot.go, internal/providerauth/manager.go. 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 internal/agent/turn_budget.go:226 — `part.Type != schema.ChatMessagePartTypeImageURL || part.Image == nil` appears character-identically in 3 files — internal/agent/turn_budget.go, internal/model/chatmodel.go, internal/model/responses_convert.go. 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 internal/agent/turn_budget.go:271 — `part.Type == schema.ChatMessagePartTypeImageURL && part.Image != nil` appears character-identically in 2 files — internal/agent/turn_budget.go, internal/model/chatmodel.go. 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 internal/agent/turn_budget.go:285 — `part.Type == schema.ChatMessagePartTypeText && part.Text != ""` appears character-identically in 2 files — internal/agent/turn_budget.go, internal/runner/runner.go. 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 internal/session/provider_tool_operation.go:112 — `previous.State.IsTerminal() && previous.State != next.State` appears character-identically in 2 files — internal/session/provider_tool_operation.go, internal/session/session.go. 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 on error · ×24
  • Silent fallback default on error internal/browser/discover.go:86 — `ChromeVersion` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/browser/discover.go:154 — `scanPreferences` turns a non-nil `err` into `return ExtensionInstallState{}` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/browser/session.go:283 — `titleURL` turns a non-nil `err` into `return "", ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/channel/ble/ble_nocgo.go:71 — `helperPath` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/command/interactive.go:147 — `buildTeamChildPrompt` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/command/interactive.go:2155 — `computeGitDiffStats` turns a non-nil `err` into `return 0, 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/command/login.go:257 — `credentialsPathForDisplay` turns a non-nil `err` into `return "~/.jcode/cloud.json"` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/computer/helper_dial.go:223 — `helperBinPath` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/config/project.go:30 — `GitRoot` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/handler/acp.go:881 — `subagentNameFromArgs` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/memory/inject.go:85 — `readTruncated` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/prompts/prompts.go:25 — `GetSystemPrompt` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/prompts/prompts.go:85 — `HasAgentsMd` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/prompts/prompts.go:99 — `GetPlanSystemPrompt` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/prompts/prompts.go:158 — `loadAgentsMd` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/runner/runner.go:940 — `modelContextLimit` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/session/lastsession.go:104 — `LoadMostRecentSession` turns a non-nil `err` into `return "", ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/session/lastsession.go:134 — `inferMostRecentLegacySession` turns a non-nil `err` into `return "", ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/session/lastsession.go:163 — `validateLastSessionID` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/tui/format.go:444 — `todoInProgressTitle` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/usage/stats.go:157 — `currentStreak` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/util/envinfo.go:82 — `gitCommand` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/web/memory.go:251 — `countMemoryNotes` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error internal/web/usage.go:166 — `countSessions` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
X7 · Silent fallback defaults · Silent fallback default in catch · ×11
  • Silent fallback default in catch agent-eval/suite/verify.py:54 — `_sha` swallows every exception into `return 'MISSING'` — 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 packages/jcode-ui/src/toolRenderers/fileViewer.tsx:73 — `buildLines` 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 packages/jcode-ui/src/components/ApprovalBanner.tsx:281 — `extractTarget` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:304 — `SubagentHeader` swallows every exception into `return 'subagent'` — 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 packages/jcode-ui/src/product/drafts.ts:18 — `readDraft` 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 site/public/showcase-projects/game/js/game.js:123 — `bests` 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 site/public/showcase-projects/ui-kit/js/docs.js:245 — `loadCustomizer` 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 site/public/showcase-projects/ui-kit/js/jui.js:909 — `commandPalette.recents` 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 web/src/lib/authToken.ts:17 — `getAuthToken` 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 web/src/lib/useTheme.ts:60 — `loadStored` swallows every exception into `return 'system'` — 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 web/src/components/GeneratedImageToolRenderer.tsx:142 — `parseImageArgs` 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.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×4
  • Projects may be oversized for their cohesion REDACTED:1 — `(repository root)` (109396 LoC, 723 module-visible types across 74 directories) overshoots its size bounds. 4 of 8 build unit(s) (Cargo, Go, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `web` (31789 LoC, 242 module-visible types across 7 directories) overshoots its size bounds. 4 of 8 build unit(s) (Cargo, Go, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion site/package.json:1 — `site` (16630 LoC, 103 module-visible types across 24 directories) overshoots its size bounds. 4 of 8 build unit(s) (Cargo, Go, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion packages/jcode-ui/package.json:1 — `packages/jcode-ui` (13714 LoC, 155 module-visible types across 10 directories) overshoots its size bounds. 4 of 8 build unit(s) (Cargo, Go, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D30 · Dependency Vulnerabilities · Low CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D10 · Test Quality · Mock-dominated test · ×2
  • Mock-dominated test: focuses a newly bound workspace explicitly web/src/components/RemoteConnectWizard.contract.test.tsx:14 — This test sets up 3 test doubles (for example `vi.spyOn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: passes the selected task to status, goal, todos, models, agents, and approval-mode loads web/src/app/taskScope.test.ts:41 — This test sets up 6 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
M2 · Architecture documentation · Architecture diagram out of date · ×2
  • Architecture diagram out of date internal-doc/artifacts-design.md:80 — `internal-doc/artifacts-design.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `jcode-site`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date internal-doc/image-generation-architecture.md:44 — `internal-doc/image-generation-architecture.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `jcode-site`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
AX6 · Interface segregation · Fat interface · ×1
  • Fat interface: CloudSupervisor (17 methods) REDACTED:254 — `CloudSupervisor` declares 17 methods: `Status`, `SetAutoConnect`, `SetConfigSync`, `SyncCredentials`, `PairingRecords`, `ApprovePairing`, `DenyPairing`, `RevokePairing`, `SyncAccountSettings`, `SyncProviderConfigs`, `AccountSyncKeyStatus`, `PendingAccountSyncDevices`, `ApprovedAccountSyncDevices`, `ApproveAccountSyncDevice`, `DenyAccountSyncDevice`, `RevokeAccountSyncDevice`, `LastPaired`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found internal/theme/gen/main.go:11 — 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 `internal/theme/gen/main.go` makes this repository a deployable product (line 11).
D21 · Naming Consistency · `recreateMDRenderer` spells `MD` where 12 names in the project spell it `Md` · ×1
  • `recreateMDRenderer` spells `MD` where 12 names in the project spell it `Md` internal/tui/content_render.go:294 — 12 of 13 names in project github.com/cnjack/jcode spell the token `Md` (12 of 13; unit: names in project github.com/cnjack/jcode containing `Md`). Peers: reminderMiddleware.agentsMdInit (REDACTED:84); reminderMiddleware.agentsMdPath (REDACTED:85); reminderMiddleware.agentsMdMtime (REDACTED:86); reminderMiddleware.agentsMdHash (REDACTED:87); reminderMiddleware.refreshAgentsMd (REDACTED:262). Rename to `recreateMdRenderer`. [rule N6]
D24 · Comment Value · redundant comment · ×1
  • redundant comment site/public/showcase-projects/game/js/utils.js:32 — "rotate a toward b by at most maxStep radians" repeats the code it sits on: 4 of its 5 words (rotate, toward, max, step) are already in `export function rotateToward(a, b, maxStep)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 2/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `agent-eval/harness`, `cmd/jcode-computerd/onboarding`, `desktop/src-tauri`, `packages/jcode-ui`.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation desktop/package.json:13 — `desktop/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate REDACTED:696 — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
R7 · Dead Code · Unused export 'signOut' · ×1
  • Unused export 'signOut' web/src/components/AuthGate.tsx:82 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'isMacOSDesktop' · ×1
  • Unused export 'isMacOSDesktop' web/src/lib/useDesktop.ts:12 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'notify' · ×1
  • Unused export 'notify' web/src/lib/useDesktop.ts:151 — Nothing imports this binding — it is safe to review for removal.
X2 · Cancellation propagation · Not all functions that make a request accept a context.Context or an AbortSignal · ×1
  • Not all functions that make a request accept a context.Context or an AbortSignal — Only 25/36 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial) accept a context.Context or an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Go: `ctx context.Context`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~0.7 `!` null assertions per 1k TypeScript source lines — 41 assertion(s) across the 59142 source line(s) of the 203 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: web/src/components/settings/ProviderAuthSection.tsx (21), web/src/components/SettingsView.tsx (4), packages/jcode-ui/src/components/ModelSelector.tsx (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
X7 · Silent fallback defaults · Pending state with no failure state · ×1
  • Pending state with no failure state packages/jcode-ui/src/components/ThreadList.tsx:90 — The view draws `Loading…` under `loading && threads . length === 0`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure agent-eval/suite/toolsearch_expect.py:487 — `_fixture_path_matches` returns `False` when `(FixtureScopeError, OSError, RuntimeError, TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Minor — 8 finding(s)
D12 · Dependency Hygiene · Outdated · ×7
  • Outdated: charm.land/bubbletea/v2 — `charm.land/bubbletea/v2` is required at v2.1.0 in REDACTED, but v2.1.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get charm.land/bubbletea/v2@v2.1.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: charm.land/lipgloss/v2 — `charm.land/lipgloss/v2` is required at v2.0.6 in REDACTED, but v2.1.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get charm.land/lipgloss/v2@v2.1.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/cloudwego/eino — `github.com/cloudwego/eino` is required at v0.9.21 in REDACTED, but v0.9.23 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/cloudwego/eino@v0.9.23 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/mark3labs/mcp-go — `github.com/mark3labs/mcp-go` is required at v1.2.1 in REDACTED, but v1.5.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/mark3labs/mcp-go@v1.5.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/crypto — `golang.org/x/crypto` is required at v0.58.0 in REDACTED, but v0.59.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/crypto@v0.59.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sys — `golang.org/x/sys` is required at v0.49.0 in REDACTED, but v0.50.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sys@v0.50.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: tinygo.org/x/bluetooth — `tinygo.org/x/bluetooth` is required at v0.16.0 in REDACTED, but v0.17.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get tinygo.org/x/bluetooth@v0.17.0 && go mod tidy` and commit the updated REDACTED and go.sum.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names packages/jcode-ui-core/src/primitives/attachmentAdapter.ts:65 — 0 of 0 documented parameters and 2 of 363 summaries in `jcode-ui-core` only repeat the member or parameter name (e.g. "Options for ." for `InlineImageAdapterOptions`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-def18ee46c2c4e079fbdc5579f578f19/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=631" --report-format json --report-path /tmp/watchdog-gitleaks-def18ee46c2c4e079fbdc5579f578f19/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.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-def18ee46c2c4e079fbdc5579f578f19/tree.json --exit-code 0 --source .0artifacts/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 agent-eval/site/docs/assets/js/vendor --exclude web/src/styles .72artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .55artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
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 6 file(s) — `cmd/jcode-computerd/main.swift`, `packages/jcode-ui-core/src/hooks/index.ts`, `packages/jcode-ui-core/src/primitives/Thread.tsx`, `web/src/app/store.ts`, `web/src/lib/types.ts`, … (+1 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious 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 01a1e6d5-e60d-738f-943c-4a0d177c0f3a · 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