Public report of wsshow/feikong-teams, 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, 06:51 UTC · Survey ID cd_bee28ce1659b4aacb31ab92aa6fbba7c

wsshow/feikong-teams

Measured 17 November 2026, 06:50 UTC, at code version ab64610

First survey, so nothing to compare with yet
CAI score 51.3out 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 medium codebase: 86,389 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 1.0 person-years · Weakest lens: Accessibility, 45.4

Findings by how serious they are

52 critical 996 serious 116 minor

19 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, 06:50 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 ▸

78of 78 dimensions measured by tools.
1114of 1164 findings point to an exact file and line, so you can open each one in the code. The other 50 concern the repository as a whole, such as missing documentation.
78dimensions across 8 lenses, read from 86,389 lines of product code in 2 projects.
Chapters

Executive summary

wsshow/feikong-teams is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 51.3 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Accessibility, at 45.4, is the weakest lens and counts most in the score. The best first step for the work it takes is checking whether the largest projects should be split, worth about 3.7 points. Making the controls keyboard-usable would lift Accessibility itself, worth about 3.8 points. Raising Accessibility to 65 would lift the score to about 55.6.

Twenty-three pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Seventeen known security holes in the packages the code depends on can be used by attackers, and four secrets can leak from the build pipeline. Pinning each tool to an exact version, updating the vulnerable packages and limiting each secret to its own step would close these risks. Fixing the weaknesses the scanner points to would fix the two security weaknesses in the code, and the two unsafe settings in infrastructure or container files need changing to safe values. The button or link with no name needs a name, even when it only shows an icon.

The product code is 86,389 lines, about €150,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 45.4 · counts for 45%Architecture 47.1 · counts for 25%Code Health 60.2 · counts for 14%Production Readiness 61.2 · counts for 8%Security and Compliance 62.3 · counts for 4%Maturity 75.1 · counts for 2%Domain Modelling 87.2 · counts for 1%Performance 91.4 · counts for 1%

If Accessibility rose from 45.4 to 65, the lowest score rated Strong, the score would rise from 51.3 to about 55.6.

Code composition: what the lines of code are
Product code 68%Tests 32%
Rebuild cost: about €150,000 · Estimate
Cost to rebuild€50,000 to €250,000, for 841 to 2,668 hours of work, about 1.0 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 51. 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.
SizeMedium: 86,389 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED, REDACTED.
Raises the score by about 3.7 points · Low effort · Project Cohesion
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 3.8 points · Medium effort · Keyboard semantics
3
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
Raises the score by about 3.7 points · Medium effort · Import Boundaries

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 €150,000 to build again, about 1.0 person-years of work. Its weakest lens is Accessibility, at 45.4 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion. Of all the actions in this report, it raises the score most for the work it takes: about 3.7 points for low effort, because it clears the 2 Project Cohesion findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.4 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 62,651 lines over the last 90 days, which is about 254,085 lines a year. At that pace, the extra work comes to an estimated 40.8 to 244.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

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

222 modules, with 392 dependencies between them. 2 loops run through 5 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 182 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 fkteams/internal/adapters/model/providers/providerkit2 fkteams/internal/app/agent/catalog/toolmeta3 fkteams/internal/app/config4 fkteams/internal/domain/memory5 fkteams/internal/domain/message6 fkteams/internal/runtime/resources7 web.src.api8 web.src.features.chat9 fkteams/internal/app/appstate10 fkteams/internal/domain/event11 fkteams/internal/domain/migration12 fkteams/internal/ports/memory13 fkteams/internal/app/chat/presentation14 fkteams/internal/app/lifecycle15 fkteams/internal/app/memory16 fkteams/internal/domain/history17 fkteams/internal/app/chat/taskstream18 fkteams/internal/app/process19 fkteams/internal/ports/storage20 fkteams/internal/adapters/storage/sqlite21 fkteams/internal/app/session22 fkteams/internal/ports/runtime23 fkteams/internal/adapters/model/providers24 fkteams/internal/adapters/runtime/agentkit25 fkteams/internal/adapters/tools/javascript26 fkteams/internal/app/tools27 fkteams/internal/runtime/hooks28 fkteams/internal/runtime/model29 fkteams/internal/app/agent/catalog/common30 fkteams/internal/bootstrap31 fkteams/internal/bootstrap/tools32 fkteams/internal/runtime/turn33 fkteams/internal/app/chat34 fkteams/internal/adapters/storage/file/history35 fkteams/internal/app/execution36 fkteams/internal/app/schedule37 fkteams/internal/adapters/transport/channel38 fkteams/internal/adapters/transport/cli/runtime39 fkteams/internal/adapters/transport/http/handler40 fkteams/internal/bootstrap/services
1 fkteams/internal/adapters/model/providers/providerkit
2 fkteams/internal/app/agent/catalog/toolmeta
3 fkteams/internal/app/config
4 fkteams/internal/domain/memory
5 fkteams/internal/domain/message
6 fkteams/internal/runtime/resources
7 web.src.api
8 web.src.features.chat
9 fkteams/internal/app/appstate21
10 fkteams/internal/domain/event4
11 fkteams/internal/domain/migration1
12 fkteams/internal/ports/memory1
13 fkteams/internal/app/chat/presentation251
14 fkteams/internal/app/lifecycle1
15 fkteams/internal/app/memory7221
16 fkteams/internal/domain/history63
17 fkteams/internal/app/chat/taskstream21023
18 fkteams/internal/app/process1
19 fkteams/internal/ports/storage21
20 fkteams/internal/adapters/storage/sqlite1311
21 fkteams/internal/app/session15
22 fkteams/internal/ports/runtime621
23 fkteams/internal/adapters/model/providers11
24 fkteams/internal/adapters/runtime/agentkit103133
25 fkteams/internal/adapters/tools/javascript224
26 fkteams/internal/app/tools2312
27 fkteams/internal/runtime/hooks211
28 fkteams/internal/runtime/model15
29 fkteams/internal/app/agent/catalog/common11101
30 fkteams/internal/bootstrap1121111
31 fkteams/internal/bootstrap/tools11133
32 fkteams/internal/runtime/turn151
33 fkteams/internal/app/chat117411252812
34 fkteams/internal/adapters/storage/file/history34514613
35 fkteams/internal/app/execution11221111
36 fkteams/internal/app/schedule112
37 fkteams/internal/adapters/transport/channel45111121
38 fkteams/internal/adapters/transport/cli/runtime113343241323
39 fkteams/internal/adapters/transport/http/handler141842111121221411241
40 fkteams/internal/bootstrap/services222211
Uses a module listed above itPart of a loopThe module itself
1 fkteams/internal/adapters/model/providers/providerkit2 fkteams/internal/app/agent/catalog/toolmeta3 fkteams/internal/app/config4 fkteams/internal/domain/memory5 fkteams/internal/domain/message6 fkteams/internal/runtime/resources7 web.src.api8 web.src.features.chat9 fkteams/internal/app/appstate10 fkteams/internal/domain/event11 fkteams/internal/domain/migration12 fkteams/internal/ports/memory13 fkteams/internal/app/chat/presentation14 fkteams/internal/app/lifecycle15 fkteams/internal/app/memory16 fkteams/internal/domain/history17 fkteams/internal/app/chat/taskstream18 fkteams/internal/app/process19 fkteams/internal/ports/storage20 fkteams/internal/adapters/storage/sqlite21 fkteams/internal/app/session22 fkteams/internal/ports/runtime23 fkteams/internal/adapters/model/providers24 fkteams/internal/adapters/runtime/agentkit25 fkteams/internal/adapters/tools/javascript26 fkteams/internal/app/tools27 fkteams/internal/runtime/hooks28 fkteams/internal/runtime/model29 fkteams/internal/app/agent/catalog/common30 fkteams/internal/bootstrap31 fkteams/internal/bootstrap/tools32 fkteams/internal/runtime/turn33 fkteams/internal/app/chat34 fkteams/internal/adapters/storage/file/history35 fkteams/internal/app/execution36 fkteams/internal/app/schedule37 fkteams/internal/adapters/transport/channel38 fkteams/internal/adapters/transport/cli/runtime39 fkteams/internal/adapters/transport/http/handler40 fkteams/internal/bootstrap/servicesfkteams/internal/adapters/model/providers/providerkit1fkteams/internal/app/agent/catalog/toolmeta2fkteams/internal/app/config3fkteams/internal/domain/memory4fkteams/internal/domain/message5fkteams/internal/runtime/resources6web.src.api7web.src.features.chat8fkteams/internal/app/appstate9fkteams/internal/domain/event10fkteams/internal/domain/migration11fkteams/internal/ports/memory12fkteams/internal/app/chat/presentation13fkteams/internal/app/lifecycle14fkteams/internal/app/memory15fkteams/internal/domain/history16fkteams/internal/app/chat/taskstream17fkteams/internal/app/process18fkteams/internal/ports/storage19fkteams/internal/adapters/storage/sqlite20fkteams/internal/app/session21fkteams/internal/ports/runtime22fkteams/internal/adapters/model/providers23fkteams/internal/adapters/runtime/agentkit24fkteams/internal/adapters/tools/javascript25fkteams/internal/app/tools26fkteams/internal/runtime/hooks27fkteams/internal/runtime/model28fkteams/internal/app/agent/catalog/common29fkteams/internal/bootstrap30fkteams/internal/bootstrap/tools31fkteams/internal/runtime/turn32fkteams/internal/app/chat33fkteams/internal/adapters/storage/file/history34fkteams/internal/app/execution35fkteams/internal/app/schedule36fkteams/internal/adapters/transport/channel37fkteams/internal/adapters/transport/cli/runtime38fkteams/internal/adapters/transport/http/handler39fkteams/internal/bootstrap/services40214112511722163210231211311156211110313322423122111511101112111111133151117411252812345146131122111111245111121113343241323141842111121221411241222211+182 more modules (most-connected shown)

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

At a glance — Architecture · 47.1 · Adequate · gated by D26, R11, AX7 ·

At a glance — Maturity · 75.1 · Strong ·

At a glance — Readiness · 61.2 · Adequate · gated by P3 ·

At a glance — Security · 62.3 · Checked 5 of 11 · gated by D29, D36 ·

At a glance — Domain Modelling · 87.2 · Exemplary ·

At a glance — Accessibility · 45.4 · Adequate · gated by AC4, AC6 ·

At a glance — Performance · 91.4 · 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 — Injection36High / Critical
A03:2025 — Software Supply Chain Failures33High / Critical
A02:2025 — Security Misconfiguration9High / Critical

Roadmap

Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED, REDACTED; Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.

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

Do thisHelpsEffortDimension
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED, REDACTED.+3.7 ptsLowProject Cohesion
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+3.8 ptsMediumKeyboard semantics
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.+3.7 ptsMediumImport Boundaries
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.+3.4 ptsMediumVisual & motion safety
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.+2.3 ptsMediumSlice cohesion
Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with main.go.+1.0 ptsLowChange Coupling
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.+1.9 ptsMediumText alternatives
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+1.8 ptsMediumForms & labels

File quality

Per-file score 0–10 — a quality signature. Of 230 files carrying findings, judged against the Preview bar: 2% slop · 5% mixed · 93% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.9SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.0MixedDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
internal/adapters/transport/http/handler/http_chat.go5.6MixedCyclomatic Complexity: Runtime.ChatHandlerWithState (cyclomatic 17)
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
internal/app/config/config.go5.7MixedCyclomatic Complexity: Config.ValidateJavaScript (cyclomatic 22)
internal/adapters/transport/channel/bridge.go5.7MixedCyclomatic Complexity: replyCollector.handleEvent (cyclomatic 20)
internal/adapters/transport/http/handler/runtime.go5.9MixedCyclomatic Complexity: handler.NewRuntime (cyclomatic 19)
internal/adapters/tools/builtin/todo/func.go6.0MixedExplicit Debt: TodoComment
internal/adapters/transport/channel/qq/qq.go6.9MixedCognitive Complexity: Channel.Send (cognitive 19)
web/src/features/skills/SkillPanel.tsx7.0Near-cleanCyclomatic Complexity: SkillPanel.SkillPanel (cyclomatic 85)
internal/adapters/storage/file/history/history_record.go7.0Near-cleanCyclomatic Complexity: HistoryRecorder.RecordEvent (cyclomatic 69)
internal/adapters/transport/http/handler/files.go7.0Near-cleanCyclomatic Complexity: Runtime.UploadChunkHandler (cyclomatic 42)

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

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

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

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

Could not be resolved — 19

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

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

What we checked — 78 dimensions across the health lenses
D1D2D3D4D5D6D10D11D12D13D14D15D17D19D20D21D26D27D28D29D30D31D34D35D36D43D44AC1AC2AC3AC4AC5AC6AX10AX2AX3AX5AX6AX7DM1DM10DM11DM12DM4DM5DM6DM7DM9M1M2M3M4P1P2P3P4P6P7PF1PF3R1R10R11R2R3R4R6R7R8R9X2X26X27X28X3X30X4X5

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, 1114 of 1164 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

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

Every finding is locatable in findings.md. Run 01a1e845-d303-7790-8493-0dcf6cddc222.

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

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — 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. Coverage NOT MEASURED: this repository's production source spans .ts, .tsx, .go, and our analyzer cannot run the .go test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 65.5% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
  • 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 127 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 254 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.
  • 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 npm package 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.
  • 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-contributor repository — bus factor is not applicable (1 contributor(s) across 1260 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so 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.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D24 Comment Value — 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. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
  • D24 Comment Value — 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `internal/adapters/storage/file/share/preview.go`, `internal/adapters/storage/file/share/session.go`, `internal/app/config/config.go`, `web/tailwind.config.ts` 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.
  • 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.
  • DM8 Value-object opportunities — 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 finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
  • DM9 Scattered domain decisions — 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. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
  • DM9 Scattered domain decisions — 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. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
  • 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 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 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.
  • 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. 27 further occurrence(s) are not listed individually; the score already reflects all 67.
  • 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. 21 further occurrence(s) are not listed individually; the score already reflects all 61.
  • 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.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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. 49 further occurrence(s) are not listed individually; the score already reflects all 89.

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.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 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.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (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.
  • DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of 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 Complexity3.3 / 10Weak✓ 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 3.3 / 10 · rule-coverage 100% · ceiling Prevented

171 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was eventview.newPrintEvent at 154.

eventview.newPrintEvent (cyclomatic 154)internal/adapters/transport/cli/eventview/print.go:75
runtimeModel.Update (cyclomatic 97)internal/adapters/transport/cli/runtime/runtime_update.go:24
ChatComposer.ChatComposer (cyclomatic 96)web/src/features/chat/ChatComposer.tsx:53
Projector.Apply (cyclomatic 88)internal/app/chat/presentation/projector.go:70
SkillPanel.SkillPanel (cyclomatic 85)web/src/features/skills/SkillPanel.tsx:50

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

What to do

  1. Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with eventview.newPrintEvent (cyclomatic 154). — Refactoring it lifts Cyclomatic Complexity from 3.3 to about 3.8/10.

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

239 method(s) exceeded the cognitive complexity threshold of 15; the worst was eventview.newPrintEvent at 287.

eventview.newPrintEvent (cognitive 287)internal/adapters/transport/cli/eventview/print.go:75
Projector.Apply (cognitive 156)internal/app/chat/presentation/projector.go:70
runtimeModel.Update (cognitive 123)internal/adapters/transport/cli/runtime/runtime_update.go:24
HistoryRecorder.RecordEvent (cognitive 112)internal/adapters/storage/file/history/history_record.go:591
ChatComposer.ChatComposer (cognitive 107)web/src/features/chat/ChatComposer.tsx:53

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

What to do

  1. Bring the 13 bodies over 60 down to 60 or less in Cognitive Complexity — start with eventview.newPrintEvent (cognitive 287), Projector.Apply (cognitive 156), runtimeModel.Update (cognitive 123). — 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 13 together lifts Cognitive Complexity from 2.0 to about 4.1/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes7.3 / 10Strong✓ Tool-verified

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

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

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

76 god class(es) detected.

FunctionTooLong: eventview.newPrintEvent · ×26internal/adapters/transport/cli/eventview/print.go:75
FileTooLong: handler/files.go · ×25internal/adapters/transport/http/handler/files.go
MethodTooLong: runtimeModel.Update · ×11internal/adapters/transport/cli/runtime/runtime_update.go:24
ClassTooLong: Scheduler · ×7internal/adapters/scheduler/filecron/scheduler.go:31
TooManyMethods: runtimeModel · ×6internal/adapters/transport/cli/runtime/runtime_model.go:13

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

What to do

  1. Resolve the 26 FunctionTooLong finding(s) in God Classes — start with SkillPanel.tsx (3), AgentEditors.tsx (3), print.go. — One of this dimension's main actionable groups (26 warning-level).
  2. Resolve the 25 FileTooLong finding(s) in God Classes — start with func.go (3), stream.go (2), files.go. — One of this dimension's main actionable groups (25 warning-level).
  3. Resolve the 11 MethodTooLong finding(s) in God Classes — start with history_record.go (2), runtime_update.go, projector.go. — One of this dimension's main actionable groups (11 warning-level).

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

D4 · Code Duplication6.6 / 10Adequate✓ 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 6.6 / 10 · rule-coverage 100% · ceiling Verified

109 duplicated block group(s) detected. 8.5 % of the production lines (7,364 of 86,389) are in a reported copy. A further 121 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (13 lines × 2) · ×13internal/adapters/tools/builtin/script/bun/func.go:180
Duplicated block (10 lines × 2) · ×13internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:201
Edited copy of a member (15 corresponding lines) · ×12internal/adapters/transport/cli/update/zip.go:81
Edited copy of a member (14 corresponding lines) · ×10internal/adapters/tools/builtin/scheduler/tool.go:110
Duplicated block (11 lines × 2) · ×10internal/adapters/model/providers/providers.go:123

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

What to do

  1. Resolve the 13 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with func.go (3), print_format.go (2), REDACTED. — One of this dimension's main actionable groups (13 warning-level).
  2. Resolve the 13 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with backend.go, scheduler.go, session_repository.go. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 12 Edited copy of a member (15 corresponding lines) finding(s) in Code Duplication — start with zip.go, session_repository.go, runtime_history.go. — One of this dimension's main actionable groups (12 warning-level).

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

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

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

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

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

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

2 production modules (npm+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.9 / 10Stronggated by 2 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.9 / 10 · rule-coverage 100% · ceiling Verified

2 of 160 classes have LCOM4 above 3.

Low cohesion: Runtime (LCOM4 46) · ×2internal/adapters/transport/http/handler/runtime.go:32

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with runtime.go, config.go. — One of this dimension's main actionable groups (2 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 127 tests. Measured on the JavaScript/TypeScript suite only — at least 254 test source file(s) (.go) went unread, so its test quality is unmeasured and is not in these counts.

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

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

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

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

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

0 flaky across 2 measured tier(s). JavaScript/TypeScript (bun:test via `npm install --ignore-scripts` (no lockfile) in web/ (166 tests)): measured (0 flaky); Go (fkteams): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene8.4 7.8 / 10Strong✓ 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 7.8 / 10 · rule-coverage 93% · ceiling Verified

27 outdated, 0 author-deprecated direct Go module(s), 1 pinning or checksum defect(s). 56 of 56 direct requirement(s) were graded against proxy.golang.org (0 not served there, 4 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.

Dependency pinned to a stale untagged commit: github.com/skip2/go-qrcode
Outdated: charm.land/bubbles/v2 · ×27

What to do

  1. Resolve the 1 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).

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 419 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 419 package(s) this repository's committed lockfile installs for a consumer — its 20 production, optional and peer dependency(ies), across 1 product REDACTED manifest(s), and everything those install in turn. Its 11 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. No third-party code was found shipping without a manifest entry (vendored or copied-in directories, licence comments preserved in committed bundles, bundled module paths, compiled wasm modules). ★ COVERAGE OF THIS VERDICT: it grades this repository's npm package dependencies and nothing else. The repository also declares a Go module (REDACTED/go.sum), and the licences of those dependencies 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 Hotspots9.5 / 10Stronggated by 33 serious findings✓ 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 9.5 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: internal/adapters/storage/file/history/history_record.go (7×69=483); web/src/features/chat/ChatInput.tsx (6×78=468); web/src/components/layout/Sidebar.tsx (8×47=376)

Hotspot: internal/adapters/storage/file/history/history_record.go · ×33internal/adapters/storage/file/history/history_record.go:591

What to do

  1. Resolve the 33 Hotspot finding(s) in Churn × Complexity Hotspots — start with store.go (2), history_record.go, ChatInput.tsx. — One of this dimension's main actionable groups (33 warning-level).

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

D17 · Explicit Debt10.0 / 10Stronggated by 2 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

2 deducted task-comment markers across 86389 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 · ×2internal/runtime/toolpolicy/policy.go:92

What to do

  1. Resolve the 2 TodoComment finding(s) in Explicit Debt — start with policy.go, func.go. — One of this dimension's main actionable groups (2 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

1 of 1 documentation facets pass in full. 34 document(s) read across 2 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs foundcmd/fkteams/main.go:1

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

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

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

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

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

`groupATMessageHandler` spells `AT` where 76 names in the project spell it `At`internal/adapters/transport/channel/qq/qq.go:293

What to do

  1. Resolve the 1 `groupATMessageHandler` spells `AT` where 76 names in the project spell… finding(s) in Naming Consistency — start with qq.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.

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

2 of 2 build units (Go, npm) flagged as possibly oversized/incoherent.

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

What to do

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

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

D27 · Navigability8.9 / 10Strong✓ 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 8.9 / 10 · rule-coverage 100% · ceiling Documented

42 % of calls cross a namespace and 3 % go through an interface, but 56 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

Scattered collaborators

What to do

  1. Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).

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

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

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

36 finding(s): 0 critical, 29 high, 7 medium, 0 low. 23 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 4 file(s) — `internal/adapters/storage/file/share/preview.go` (lines 15–17), `internal/adapters/storage/file/share/session.go` (line 41, line 44), `internal/app/config/config.go` (line 719), `web/tailwind.config.ts` (line 76) — 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.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

28 finding(s): 3 critical, 14 high, 9 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D34 · Knowledge 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 304 of the 522 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 Coupling9.8 / 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 9.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: http_chat.go↔websocket.go 82%; prompt.go↔prompt.go 60%; sessionThunks.ts↔chat.ts 58%

Boundary-crossing change coupling: main.go ↔ runtimes.gocmd/fkteams/main.go:1
Change coupling: http_chat.go ↔ websocket.go · ×6internal/adapters/transport/http/handler/http_chat.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 6 Change coupling finding(s) in Change Coupling — start with http_chat.go, prompt.go, sessionThunks.ts. — One of this dimension's main actionable groups (6 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

  • Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). — REDACTED:390

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.6 / 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 <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — REDACTED:10
  • This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — web/src/features/chat/MessageList.tsx:1184, web/src/features/config/IntegrationEditors.tsx:408, web/src/features/skills/SkillPanel.tsx:888
  • A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. (×4) — web/src/features/chat/openui/interaction.tsx:11, web/src/features/config/ConfigEditor.tsx:193, web/src/features/config/ConfigEditor.tsx:244, …
  • This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×2) — web/src/features/config/IntegrationEditors.tsx:405, web/src/features/skills/SkillPanel.tsx:801
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — REDACTED:350

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 structure10.0 / 10Exemplary○ Nothing flagged

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.

AC4 · Keyboard semantics2.1 / 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".

  • 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. (×7) — web/src/components/layout/SessionShareDialog.tsx:88, web/src/components/layout/Sidebar.tsx:515, web/src/components/ui/action-dialog.tsx:30, …
  • 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. (×2) — web/src/components/layout/Sidebar.tsx:453, web/src/components/ui/action-dialog.tsx:97
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. — REDACTED:10
  • This <section 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. — web/src/features/migration/MigrationGate.tsx:55

What to do

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

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

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

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

AC6 · Visual & motion safety2.7 / 10Weak✓ Tool-verified

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

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

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

  • <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — web/src/components/layout/Sidebar.tsx:352, web/src/features/chat/ChatComposer.tsx:342
  • <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — web/src/features/chat/ChatComposer.tsx:768
  • <i> moves — its `animate-bounce` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×3) — web/src/features/chat/MessageList.tsx:394, web/src/features/chat/MessageList.tsx:395, web/src/features/chat/MessageList.tsx:396
  • `.prose .markdown-code-copy[data-copied="true"]` 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. — web/src/styles/globals.css:589
  • `.prose .markdown-footnote-ref a` moves (`transition: background-color 150ms ease, color 150ms ease, transform 150ms 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. — web/src/styles/globals.css:295

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 composition4.0 / 10Weak✓ 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.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. 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.

AX7 · Slice cohesion3.7 / 10Weak✓ Tool-verified

Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.

Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.

  • `ChatInput` (slice 'chat') depends on `clearAssistant` from slice 'sessions'. — web/src/features/chat/ChatInput.tsx:144
  • `ChatInput` (slice 'chat') depends on `renameAssistant` from slice 'sessions'. — web/src/features/chat/ChatInput.tsx:145
  • `ChatPage` (slice 'chat') depends on `loadSessionDetail` from slice 'sessions'. — web/src/features/chat/ChatPage.tsx:48
  • `finishFromStatus` (slice 'chat') depends on `refreshAssistant` from slice 'sessions'. — web/src/features/chat/TaskStreamController.tsx:254
  • `ShareThread` (slice 'share') depends on `ConversationItems` from slice 'chat'. — web/src/features/share/SharePage.tsx:126

What to do

  • Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
DM1 · Aggregate boundaries10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.

Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.

Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.

DM10 · One transaction, one aggregate10.0 / 10Exemplary○ Nothing flagged

Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.

Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.

DM11 · Constructible invalid state10.0 / 10Exemplary○ Nothing flagged

Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.

Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.

DM12 · Ambient inputs in the domain10.0 / 10Exemplary○ Nothing flagged

Other · Domain Modelling — Whether domain types receive the time and randomness their rules depend on, rather than reading the process clock or a global random source directly — an ambient read makes the rule it feeds untestable at the instant that matters and lets two reads inside one operation disagree.

Method: Roslyn (DDD-gated, C#/VB only): domain-layer types scanned for ambient reads — DateTime/DateTimeOffset.Now/UtcNow/Today, Random.Shared, new Random(), Stopwatch.GetTimestamp — resolved against the semantic model, with a comment/string-stripped token fallback only where resolution fails. Body reads are scored; field/property initialisers are surfaced unscored. Apply/When folds excluded (ES1 owns them). Deterministic, symbol-resolved.

DM4 · Rich vs anemic model10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

DM5 · Encapsulated state5.4 / 10Adequate✓ Tool-verified

Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

  • `HistoryRecorder` exposes publicly writable state (Documents). — internal/adapters/storage/file/history/history.go:126

What to do

  • Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).
DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies (EF/Marten/HTTP/ASP.NET) — the clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

DM7 · Repository granularity10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether repositories are per aggregate root (not per child entity) and keep the persistence query handle behind the contract, so the root's invariants can't be bypassed.

Method: Roslyn (DDD-gated): repository abstraction detection; repositories over non-aggregate-root entities flagged, and (C#/VB) repository INTERFACES whose members return a live persistence query handle (IQueryable/DbSet/IMongoQueryable) — implementations and specification evaluators are out of population by design, since composing a query internally is what an implementation is for. Deterministic, DDD-native.

Coverage: Population: repositories + aggregate roots by NAME convention; per-root repository rule checked within the set.

DM9 · Scattered domain decisions10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.

Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.

M1 · Documentation (README)6.7 / 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.

What to do

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

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

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

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

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

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

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

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

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

P2 · Observability10.0 / 10Exemplary○ Nothing flagged

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.

P3 · Security & performance tooling1.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add gosec / govulncheck (or golangci-lint) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 3 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:5
  • `REDACTED` 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`. — REDACTED:16

What to do

  • Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & 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.

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

What to do

  • Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
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 resilience10.0 / 10Exemplary○ Nothing flagged

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.

PF1 · Benchmark discipline8.5 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

  • A Go testing.B suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured. — internal/runtime/mdiff/mdiff_bench_test.go

What to do

  • Call b.ReportAllocs() in the benchmarks, or run them with `go test -bench . -benchmem`, so allocation regressions are visible, not just time.
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 Safety10.0 / 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 Duplication5.2 / 10Adequate✓ 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.

  • 27 duplicated blocks under web/src/features/ have copies in at least two of the sibling directories chat, config, files, memory, migration, schedules (+2 more sibling(s) not listed) — 21 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 27 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 27 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 27 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/src/features/chat/ChatPage.tsx:269
  • 9 duplicated blocks under web/src/ have copies in at least two of the sibling directories components, features — 6 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 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/src/components/layout/SessionShareDialog.tsx:18
  • web/src/components/layout/SessionShareDialog.tsx:18 · web/src/features/files/FileShareDialog.tsx:13 — the two spans are one implementation copied and then locally edited — 865 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/components/layout/SessionShareDialog.tsx:18
  • web/src/features/chat/ChatPage.tsx:269 · web/src/features/share/SharePage.tsx:190 — the two spans are one implementation copied and then locally edited — 318 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/features/chat/ChatPage.tsx:269
  • web/src/features/share/ShareManagerPanel.tsx:298 · web/src/features/share/ShareManagerPanel.tsx:397 — 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/features/share/ShareManagerPanel.tsx:298
  • web/src/features/config/IntegrationEditors.tsx:220 · web/src/features/config/IntegrationEditors.tsx:259 — 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/features/config/IntegrationEditors.tsx:220
  • web/src/features/share/ShareManagerPanel.tsx:255 · web/src/features/share/ShareManagerPanel.tsx:352 — 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/features/share/ShareManagerPanel.tsx:255
  • web/src/features/share/ShareManagerPanel.tsx:449 · web/src/features/share/ShareManagerPanel.tsx:498 — 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/features/share/ShareManagerPanel.tsx:449
  • web/src/features/share/ShareManagerPanel.tsx:140 · web/src/features/skills/SkillPanel.tsx:355 — 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/features/share/ShareManagerPanel.tsx:140
  • web/src/features/schedules/SchedulePanel.tsx:289 · web/src/features/skills/SkillPanel.tsx:525 — 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/features/schedules/SchedulePanel.tsx:289
  • web/src/components/layout/Sidebar.tsx:534 · web/src/features/share/ShareManagerPanel.tsx:485 · web/src/features/share/ShareManagerPanel.tsx:535 — 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/layout/Sidebar.tsx:534
  • web/src/features/chat/MessageList.tsx:674 · web/src/features/chat/MessageList.tsx:797 — 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/features/chat/MessageList.tsx:674
  • web/src/features/share/ShareManagerPanel.tsx:194 · web/src/features/share/ShareManagerPanel.tsx:214 — 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/features/share/ShareManagerPanel.tsx:194
  • web/src/features/schedules/SchedulePanel.tsx:194 · web/src/features/share/ShareManagerPanel.tsx:147 · web/src/features/skills/SkillPanel.tsx:362 — the 3 copies are spread across 3 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/features/schedules/SchedulePanel.tsx:194
  • web/scripts/stream_frontend_logic_check.ts:188 · web/src/api/stream.ts:112 — 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/scripts/stream_frontend_logic_check.ts:188
  • web/src/components/layout/Sidebar.tsx:508 · web/src/features/share/ShareManagerPanel.tsx:459 — 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/layout/Sidebar.tsx:508
  • web/src/features/schedules/SchedulePanel.tsx:506 · web/src/features/skills/SkillPanel.tsx:676 — 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/features/schedules/SchedulePanel.tsx:506
  • web/src/features/schedules/SchedulePanel.tsx:98 · web/src/features/schedules/SchedulePanel.tsx:143 — 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/features/schedules/SchedulePanel.tsx:98
  • web/src/features/schedules/SchedulePanel.tsx:465 · web/src/features/skills/SkillPanel.tsx:602 — 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/features/schedules/SchedulePanel.tsx:465
  • web/scripts/stream_frontend_logic_check.ts:229 · web/src/app/store.ts:205 — the two spans are one implementation copied and then locally edited — 88 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/scripts/stream_frontend_logic_check.ts:229
  • web/src/features/config/AgentEditors.tsx:664 · web/src/features/config/ConfigFields.tsx:71 — the two spans are one implementation copied and then locally edited — 88 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/features/config/AgentEditors.tsx:664
  • web/src/features/schedules/SchedulePanel.tsx:606 · web/src/features/skills/SkillPanel.tsx:945 — the 2 copies are spread across 2 files, 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/features/schedules/SchedulePanel.tsx:606
  • web/src/features/share/ShareManagerPanel.tsx:346 · web/src/features/share/ShareManagerPanel.tsx:443 — 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/features/share/ShareManagerPanel.tsx:346
  • web/src/components/ui/action-dialog.tsx:28 · web/src/components/ui/action-dialog.tsx:95 — 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/ui/action-dialog.tsx:28
  • web/src/features/chat/ChatComposer.tsx:642 · web/src/features/chat/ChatComposer.tsx:662 — 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/features/chat/ChatComposer.tsx:642
  • web/src/features/chat/ChatPage.tsx:219 · web/src/features/chat/ChatPage.tsx:290 — 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. — web/src/features/chat/ChatPage.tsx:219
  • web/src/features/config/ConfigFields.tsx:86 · web/src/features/config/IntegrationEditors.tsx:559 — the two spans are one implementation copied and then locally edited — 123 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/features/config/ConfigFields.tsx:86
  • web/src/features/share/ShareManagerPanel.tsx:42 · web/src/features/share/ShareManagerPanel.tsx:57 — 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/features/share/ShareManagerPanel.tsx:42
  • web/src/features/share/SharePage.tsx:162 · web/src/features/share/SharePage.tsx:210 — 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/features/share/SharePage.tsx:162
  • web/src/features/config/AgentEditors.tsx:338 · web/src/features/config/IntegrationEditors.tsx:31 — 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/features/config/AgentEditors.tsx:338
  • web/src/features/schedules/SchedulePanel.tsx:267 · web/src/features/schedules/SchedulePanel.tsx:282 — 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/features/schedules/SchedulePanel.tsx:267
  • web/src/features/share/ShareManagerPanel.tsx:83 · web/src/features/share/ShareManagerPanel.tsx:96 — 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/features/share/ShareManagerPanel.tsx:83
  • web/src/features/skills/SkillPanel.tsx:184 · web/src/features/skills/SkillPanel.tsx:213 — 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/features/skills/SkillPanel.tsx:184
  • web/scripts/stream_frontend_logic_check.ts:464 · web/scripts/stream_frontend_logic_check.ts: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. — web/scripts/stream_frontend_logic_check.ts:464
  • web/src/app/store.ts:336 · web/src/app/store.ts:347 — 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/app/store.ts:336
  • web/src/features/schedules/SchedulePanel.tsx:77 · web/src/features/skills/SkillPanel.tsx:100 — 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/features/schedules/SchedulePanel.tsx:77
  • web/src/features/schedules/SchedulePanel.tsx:151 · web/src/features/skills/SkillPanel.tsx:339 — 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/features/schedules/SchedulePanel.tsx:151
  • web/src/features/schedules/SchedulePanel.tsx:241 · web/src/features/share/ShareManagerPanel.tsx:202 · web/src/features/share/ShareManagerPanel.tsx:222 — 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/features/schedules/SchedulePanel.tsx:241
  • web/src/features/skills/SkillPanel.tsx:203 · web/src/features/skills/SkillPanel.tsx:249 — 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/features/skills/SkillPanel.tsx:203
  • web/src/components/layout/Sidebar.tsx:82 · web/src/features/chat/ChatComposer.tsx:754 — the two spans are one implementation copied and then locally edited — 66 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/components/layout/Sidebar.tsx:82

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries0.0 / 10Critical✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • web/src/lib/markdown.ts:3 imports highlight.js/lib/core, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:3
  • web/src/lib/markdown.ts:4 imports highlight.js/lib/languages/bash, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:4
  • web/src/lib/markdown.ts:5 imports highlight.js/lib/languages/css, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:5
  • web/src/lib/markdown.ts:6 imports highlight.js/lib/languages/diff, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:6
  • web/src/lib/markdown.ts:7 imports highlight.js/lib/languages/go, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:7
  • web/src/lib/markdown.ts:8 imports highlight.js/lib/languages/javascript, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:8
  • web/src/lib/markdown.ts:9 imports highlight.js/lib/languages/json, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:9
  • web/src/lib/markdown.ts:10 imports highlight.js/lib/languages/markdown, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:10
  • web/src/lib/markdown.ts:11 imports highlight.js/lib/languages/python, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:11
  • web/src/lib/markdown.ts:12 imports highlight.js/lib/languages/sql, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:12
  • web/src/lib/markdown.ts:13 imports highlight.js/lib/languages/typescript, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:13
  • web/src/lib/markdown.ts:14 imports highlight.js/lib/languages/xml, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:14
  • web/src/lib/markdown.ts:15 imports highlight.js/lib/languages/yaml, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/src/lib/markdown.ts:15

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity6.5 / 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.

  • decodeChatEvent has cyclomatic complexity 43 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/types/events.ts:177
  • ChatComposer has cyclomatic complexity 34 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. — web/src/features/chat/ChatComposer.tsx:53
  • analyzeEvents has cyclomatic complexity 32 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/scripts/stream_frontend_logic_check.ts:247
  • MigrationGate 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/features/migration/MigrationGate.tsx:9
  • handleKeyDown 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. — web/src/components/ui/select.tsx:58
  • ToolCallCard has cyclomatic complexity 25 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. — web/src/features/chat/ToolCallCard.tsx:7
  • applyChatEvent has cyclomatic complexity 24 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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:187
  • PreviewPage has cyclomatic complexity 24 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/preview/PreviewPage.tsx:7
  • InteractiveBlock has cyclomatic complexity 23 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/chat/openui/AssistantUIContent.tsx:25
  • analyzeMemberCompletedText has cyclomatic complexity 22 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/scripts/stream_frontend_logic_check.ts:430
  • normalizeConfig has cyclomatic complexity 22 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/features/config/configModel.ts:147
  • manualChunks has cyclomatic complexity 22 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/vite.config.ts:34
  • subscribeStream has cyclomatic complexity 21 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. — web/src/api/stream.ts:97
  • (anonymous) has cyclomatic complexity 21 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/features/chat/sendMessage.ts:19
  • Sidebar has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/layout/Sidebar.tsx:56
  • memberRenderParts has cyclomatic complexity 20 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/scripts/stream_frontend_logic_check.ts:522
  • followTaskStream has cyclomatic complexity 19 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/features/chat/TaskStreamController.tsx:85
  • SkillPanel has cyclomatic complexity 19 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/skills/SkillPanel.tsx:50
  • timelineItemSpacingClass has cyclomatic complexity 19 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/chat/timeline.ts:10
  • AskPanel has cyclomatic complexity 19 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/chat/MessageList.tsx:1083
  • SkillDetail has cyclomatic complexity 18 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/features/skills/SkillPanel.tsx:640
  • splitUIMessage has cyclomatic complexity 17 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/features/chat/openui/protocol.ts:88
  • applyPresentationUpdate has cyclomatic complexity 17 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/types/presentation.ts:244
  • AgentCatalogEditor has cyclomatic complexity 17 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/features/config/AgentEditors.tsx:572
  • FileManager has cyclomatic complexity 17 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. — REDACTED:42
  • (anonymous) has cyclomatic complexity 16 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/features/chat/ChatComposer.tsx:979
  • subscribeStream has cyclomatic complexity 15 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/scripts/stream_frontend_logic_check.ts:178
  • completedMemberCallIDs has cyclomatic complexity 15 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/scripts/stream_frontend_logic_check.ts:351
  • monitorTaskStream has cyclomatic complexity 15 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/features/chat/TaskStreamController.tsx:141
  • FileViewerContent has cyclomatic complexity 15 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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:335
  • ConfigPanel has cyclomatic complexity 15 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/features/config/ConfigPanel.tsx:36
  • normalizeDeepConfig has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/config/configModel.ts:186
  • JavaScriptToolEditor has cyclomatic complexity 15 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/config/IntegrationEditors.tsx:314
  • CreateSkillDialog has cyclomatic complexity 15 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/skills/SkillPanel.tsx:822
  • ChatPage has cyclomatic complexity 15 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/chat/ChatPage.tsx:19
  • addAttachments has cyclomatic complexity 14 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/features/chat/ChatInput.tsx:202
  • assertReport has cyclomatic complexity 14 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/scripts/stream_frontend_logic_check.ts:412
  • encodeUIAction has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/features/chat/openui/protocol.ts:25
  • ChatInput has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/chat/ChatInput.tsx:22
  • ChannelsTab has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/config/ConfigPanel.tsx:243
R3 · Large Files4.6 / 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/features/chat/MessageList.tsx has 1345 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/features/chat/MessageList.tsx:1
  • web/src/features/skills/SkillPanel.tsx has 1006 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/features/skills/SkillPanel.tsx:1
  • web/src/features/chat/ChatComposer.tsx has 996 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/features/chat/ChatComposer.tsx:1
  • web/src/features/config/AgentEditors.tsx has 750 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/features/config/AgentEditors.tsx:1
  • web/src/components/layout/Sidebar.tsx has 699 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/layout/Sidebar.tsx:1
  • web/src/features/schedules/SchedulePanel.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. — web/src/features/schedules/SchedulePanel.tsx:1
  • web/src/features/share/ShareManagerPanel.tsx has 628 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/features/share/ShareManagerPanel.tsx:1
  • web/scripts/stream_frontend_logic_check.ts has 616 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/scripts/stream_frontend_logic_check.ts:1
  • web/src/features/config/IntegrationEditors.tsx has 611 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/features/config/IntegrationEditors.tsx:1
  • REDACTED has 610 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • web/src/features/config/ConfigFields.tsx has 604 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/features/config/ConfigFields.tsx:1
  • web/src/app/store.ts has 474 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
  • web/src/features/chat/ChatInput.tsx has 422 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/features/chat/ChatInput.tsx:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage8.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. (×16) — web/src/features/skills/SkillPanel.tsx:1, web/src/features/share/ShareManagerPanel.tsx:1, web/scripts/stream_frontend_logic_check.ts: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.5 / 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.

  • 1 file(s) (~99 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
  • Nothing imports this binding — it is safe to review for removal. (×9) — web/src/api/chat.ts:30, web/src/api/config.ts:20, web/src/api/providers.ts:4, …
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. — web/src/features/config/configModel.ts:118

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 Hygiene9.0 / 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 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:22, REDACTED:23

What to do

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

X2 · Cancellation propagation9.2 / 10Exemplary✓ 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/29 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.
  • `clearServerAuthentication` 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/auth-session.ts:12
  • `request` 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/api/client.ts:19
  • `post` 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/scripts/stream_frontend_logic_check.ts:141
  • `CheckForUpdates` 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/adapters/transport/cli/update/update.go:59

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 enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — 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.

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 handling7.0 / 10Strong✓ Tool-verified

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

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

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — web/src/features/schedules/ScheduleNotifications.tsx:15, web/src/components/layout/useSidebarResize.ts:13, web/src/components/layout/useSidebarResize.ts:32
  • `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. (×3) — web/src/features/chat/MessageList.tsx:1048, REDACTED:29, web/src/api/stream.ts:136
  • `processes.Close()` returns an error, and the statement drops it: when `processes.Close` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := processes.Close(); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — internal/bootstrap/composition.go:81
  • `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×19) — internal/app/tools/catalog.go:40, internal/app/skill/export.go:156, internal/app/skill/export.go:468, …
  • `if err := yaml.Unmarshal([]byte(parts[1]), &info); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/app/skill/export.go:87
  • `data, _ := json.Marshal(typed)` writes the call's error to `_` and then uses `data` as if the call succeeded. When `json.Marshal` fails, `data` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `data` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/app/chat/taskstream/stream.go:576
  • `n, _ := strconv.Atoi(v)` writes the call's error to `_` and then uses `n` as if the call succeeded. When `strconv.Atoi` fails, `n` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `n` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×2) — internal/app/agent/catalog/deep/deep.go:57, internal/app/agent/catalog/common/definition.go:224
  • `newBody, _ := json.Marshal(bodyMap)` writes the call's error to `_` and then uses `newBody` as if the call succeeded. When `json.Marshal` fails, `newBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `newBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/adapters/transport/http/handler/openai_api.go:109
  • `if readErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/adapters/transport/http/handler/openai_api.go:169
  • `if _, err := fmt.Fprint(w, chunk); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/adapters/transport/http/handler/stream.go:641
  • `if _, err := hex.DecodeString(fields[0]); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/adapters/transport/cli/update/exec.go:91
  • `r, _ = glamour.NewTermRenderer( customDarkStyle(), glamour.WithWordWrap(width), glamour.WithChromaFormatter("terminal16m"), )` writes the call's error to `_` and then uses `r` as if the call succeeded. When `glamour.NewTermRenderer` fails, `r` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `r` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/adapters/transport/cli/tui/markdown.go:193
  • `if err := quick.Highlight(&out, code, lexer, " ", " "); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — internal/adapters/transport/cli/tui/markdown.go:506
  • `if err := json.Unmarshal([]byte(args), &payload); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — internal/adapters/transport/cli/tui/panel_render.go:203, internal/adapters/transport/cli/runtime/runtime_events.go:296
  • `spinner, _ := pterm.DefaultSpinner.Start("执行中...")` writes the call's error to `_` and then uses `spinner` as if the call succeeded. When `pterm.DefaultSpinner.Start` fails, `spinner` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `spinner` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/adapters/transport/cli/runtime/query_view.go:48
  • `rel, _ := filepath.Rel(p.baseDir, p.currentDir)` writes the call's error to `_` and then uses `rel` as if the call succeeded. When `filepath.Rel` fails, `rel` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `rel` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — internal/adapters/transport/cli/runtime/runtime_picker.go:218

What to do

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

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

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

X4 · Structured logging10.0 / 10Exemplary○ Nothing flagged

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

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

X5 · Nullable reference types7.2 / 10Strong✓ 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.

  • 2/3 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
  • ~0.4 `!` null assertions per 1k TypeScript source lines — 6 assertion(s) across the 16806 source line(s) of the 97 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/features/chat/openui/fieldState.tsx (3), web/src/features/chat/MessageList.tsx (1), web/src/features/schedules/notifications.ts (1). 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). A further 1 got runtime (rendered axe-core) evidence this scan: 1.4.12. The other 39 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 39 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.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 Health60.2Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture47.1Adequate — gated by D26, R11, AX7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity75.1StrongSolid.
Readiness61.2Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security62.3Checked 5 of 11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling87.2ExemplarySolid.
Accessibility45.4Adequate — gated by AC4, AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance91.4ExemplaryStrongest area.
Unscored — 5 check(s) recorded observations but carry no score

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

  • AXH1 Runtime security headers — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXI1 Runtime container hardening — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X10 Duplicated predicate — 37 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 17 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 3 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 — 56 check(s) not relevant to this codebase

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

  • AX1 Captive dependencies — Not applicable: this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXA1 Runtime unauthenticated reachability — This run crawled public routes only — it had no logged-in session, so there is no authenticated surface to compare anonymous access against and nothing was measured. This is a statement about this run, not about your application: nothing here says access control is missing, and nothing here says it is present.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility (rendered) — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXS1 Runtime exposed surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.
  • D16 Bus Factor — single-contributor 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 — N/A — too few peer members to establish a convention across 1 exposed Go types.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (adapters), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — 35 of 35 comment blocks were not judged (35 in a non-Latin script): redundancy is judged by word overlap with the code's identifiers, which cannot be measured across languages.
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — 4 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 — polyglot repository, one half has no runner
  • DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
  • DM3 Integration-event coupling — no integration events detected — coupling check not applicable
  • DM8 Value-object opportunities — not scored — the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 4 domain event(s); 19 event-sourced shape(s) (event folds / event-recording aggregates)
  • 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): 2 aggregate(s) with Apply/When folds; 15 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 data present for 77 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R5 Dependency Freshness — uses a bun 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.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — X1 reached only 18% of this repository's production lines — go (70,716 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 18% of this repository's production lines — go (70,716 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 18% of this repository's production lines — go (70,716 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — X21 reached only 18% of this repository's production lines — go (70,716 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 18% of this repository's production lines — go (70,716 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 18% of this repository's production lines — go (70,716 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 18% of this repository's production lines — go (70,716 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • X6 Hand-rolled structured-format parsing — 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 — 52 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
D30 · Dependency Vulnerabilities · High CVE · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
AC2 · Forms & labels · Custom control with no accessible name on <div> · ×1
  • Custom control with no accessible name on <div> REDACTED:10 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label REDACTED:350 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×1
  • Click handler on a non-interactive <div> REDACTED:10 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: main.go ↔ runtimes.go cmd/fkteams/main.go:1 — `cmd/fkteams/main.go` (context cmd) and `internal/bootstrap/runtimes/runtimes.go` (context internal) sit in DIFFERENT parts of the tree yet change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `e69865df` refactor: 拆分 runtime 端口并移除过宽 Engine 聚合; `1444d26b` refactor: 显式连接 MCP 工具桥接; `90e9f769` refactor: 实例化启动组合根 — run `git show` on any of them.
Serious — 996 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×33
  • Hotspot: internal/adapters/storage/file/history/history_record.go internal/adapters/storage/file/history/history_record.go:591 — internal/adapters/storage/file/history/history_record.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in HistoryRecorder.RecordEvent at line 591. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/storage/file/history/history_record.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/features/chat/ChatInput.tsx web/src/features/chat/ChatInput.tsx:22 — web/src/features/chat/ChatInput.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in ChatInput.ChatInput at line 22. 1 of those changes was a fix/bug commit, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/features/chat/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: web/src/components/layout/Sidebar.tsx web/src/components/layout/Sidebar.tsx:56 — web/src/components/layout/Sidebar.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in Sidebar.Sidebar at line 56. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/components/layout/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/features/chat/MessageList.tsx web/src/features/chat/MessageList.tsx:1083 — web/src/features/chat/MessageList.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in MessageList.AskPanel at line 1083. 3 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/features/chat/MessageList.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/features/chat/ChatComposer.tsx web/src/features/chat/ChatComposer.tsx:53 — web/src/features/chat/ChatComposer.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in ChatComposer.ChatComposer at line 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/features/chat/ChatComposer.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/features/chat/ChatPage.tsx web/src/features/chat/ChatPage.tsx:134 — web/src/features/chat/ChatPage.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in ChatPage.QuestionNavigator at line 134. 3 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/features/chat/ChatPage.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/app/chat/input.go internal/app/chat/input.go:232 — internal/app/chat/input.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in chat.agentMessageToCoreMessages at line 232. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/app/chat/input.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/bootstrap/tools/tools.go internal/bootstrap/tools/tools.go:58 — internal/bootstrap/tools/tools.go changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in tools.RegisterWithProcesses at line 58. 1 of those changes was a fix/bug commit, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/bootstrap/tools/tools.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/adapters/transport/http/handler/stream.go internal/adapters/transport/http/handler/stream.go:37 — internal/adapters/transport/http/handler/stream.go changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Runtime.StreamStartHandlerWithState at line 37. 4 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/transport/http/handler/stream.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/types/events.ts web/src/types/events.ts:177 — web/src/types/events.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in events.decodeChatEvent at line 177. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/types/events.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/adapters/transport/http/handler/runtime.go internal/adapters/transport/http/handler/runtime.go:74 — internal/adapters/transport/http/handler/runtime.go changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in handler.NewRuntime at line 74. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/transport/http/handler/runtime.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/features/memory/MemoryPanel.tsx web/src/features/memory/MemoryPanel.tsx:18 — web/src/features/memory/MemoryPanel.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in MemoryPanel.MemoryPanel at line 18. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/features/memory/MemoryPanel.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/app/chat/queue.go internal/app/chat/queue.go:30 — internal/app/chat/queue.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in Service.RunQueued at line 30. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/app/chat/queue.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/features/config/AgentEditors.tsx web/src/features/config/AgentEditors.tsx:286 — web/src/features/config/AgentEditors.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in AgentEditors.AgentsTab at line 286. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/features/config/AgentEditors.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/adapters/storage/file/history/history_persist.go internal/adapters/storage/file/history/history_persist.go:115 — internal/adapters/storage/file/history/history_persist.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in eventlog.projectTranscriptEvents at line 115. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/storage/file/history/history_persist.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/adapters/transport/cli/commands/chat.go internal/adapters/transport/cli/commands/chat.go:24 — internal/adapters/transport/cli/commands/chat.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in commands.runChat at line 24. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/transport/cli/commands/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/adapters/transport/cli/runtime/query.go internal/adapters/transport/cli/runtime/query.go:250 — internal/adapters/transport/cli/runtime/query.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in QueryExecutor.Execute at line 250. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/transport/cli/runtime/query.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/features/config/ConfigPanel.tsx web/src/features/config/ConfigPanel.tsx:36 — web/src/features/config/ConfigPanel.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in ConfigPanel.ConfigPanel 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/features/config/ConfigPanel.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/store.ts web/src/app/store.ts:187 — web/src/app/store.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in store.applyChatEvent at line 187. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +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: internal/adapters/storage/file/queue/store.go internal/adapters/storage/file/queue/store.go:68 — internal/adapters/storage/file/queue/store.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in Store.save at line 68. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/storage/file/queue/store.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/features/chat/timeline.ts web/src/features/chat/timeline.ts:10 — web/src/features/chat/timeline.ts changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in timeline.timelineItemSpacingClass at line 10. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- web/src/features/chat/timeline.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/adapters/transport/http/handler/http_chat.go internal/adapters/transport/http/handler/http_chat.go:36 — internal/adapters/transport/http/handler/http_chat.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Runtime.ChatHandlerWithState 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/transport/http/handler/http_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/adapters/transport/http/handler/config.go internal/adapters/transport/http/handler/config.go:80 — internal/adapters/transport/http/handler/config.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Runtime.UpdateConfigHandlerWithState at line 80. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/transport/http/handler/config.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/app/chat/service.go internal/app/chat/service.go:163 — internal/app/chat/service.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in AssistantTextCollector.Record at line 163. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/app/chat/service.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/adapters/transport/http/handler/session_share.go internal/adapters/transport/http/handler/session_share.go:138 — internal/adapters/transport/http/handler/session_share.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Runtime.CreateSessionShareHandler at line 138. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 12:08:44 +08:00' --until='2026-11-13 12:08:44 +08:00' --full-history --no-merges -- internal/adapters/transport/http/handler/session_share.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.
  • + 8 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×29
  • Swallowed exception (caught, then discarded) web/src/features/chat/MessageList.tsx:1048 — `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.
  • Swallowed exception (caught, then discarded) REDACTED:29 — `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.
  • Swallowed exception (caught, then discarded) web/src/api/stream.ts:136 — `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.
  • Swallowed exception (caught, then discarded) internal/app/tools/catalog.go:40 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/app/skill/export.go:87 — `if err := yaml.Unmarshal([]byte(parts[1]), &info); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/app/skill/export.go:156 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/app/skill/export.go:468 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/app/chat/taskstream/stream.go:594 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/app/appdata/dirs.go:16 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/app/aiassist/service.go:357 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/app/agent/runner.go:62 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/http/handler/aiassist.go:161 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/http/handler/auth.go:58 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/http/handler/auth.go:80 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/http/handler/files.go:359 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/http/handler/openai_api.go:169 — `if readErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:486 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/http/handler/stream.go:622 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/http/handler/stream.go:641 — `if _, err := fmt.Fprint(w, chunk); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/cli/update/exec.go:91 — `if _, err := hex.DecodeString(fields[0]); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/cli/tui/markdown.go:235 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/cli/tui/markdown.go:277 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/cli/tui/markdown.go:506 — `if err := quick.Highlight(&out, code, lexer, " ", " "); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/cli/tui/markdown.go:866 — `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/adapters/transport/cli/tui/panel_render.go:203 — `if err := json.Unmarshal([]byte(args), &payload); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • + 4 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×26
  • FunctionTooLong: eventview.newPrintEvent internal/adapters/transport/cli/eventview/print.go:75 — FunctionTooLong — newPrintEvent runs 484 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 384 over it, 4.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: SkillPanel.SkillPanel web/src/features/skills/SkillPanel.tsx:50 — FunctionTooLong — SkillPanel runs 415 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 315 over it, 4.15× 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: ChatComposer.ChatComposer web/src/features/chat/ChatComposer.tsx:53 — FunctionTooLong — ChatComposer runs 362 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 262 over it, 3.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: Sidebar.Sidebar web/src/components/layout/Sidebar.tsx:56 — FunctionTooLong — Sidebar runs 312 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 212 over it, 3.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChatInput.ChatInput web/src/features/chat/ChatInput.tsx:22 — FunctionTooLong — ChatInput 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: tools.RegisterWithProcesses internal/bootstrap/tools/tools.go:58 — FunctionTooLong — RegisterWithProcesses runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: FileManager.FileManager REDACTED:42 — FunctionTooLong — FileManager runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× 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: SchedulePanel.SchedulePanel web/src/features/schedules/SchedulePanel.tsx:44 — FunctionTooLong — SchedulePanel runs 219 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 119 over it, 2.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ShareManagerPanel.ShareManagerPanel web/src/features/share/ShareManagerPanel.tsx:31 — FunctionTooLong — ShareManagerPanel runs 197 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: config.GenerateExample internal/app/config/config.go:850 — FunctionTooLong — GenerateExample runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× 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: SkillPanel.SkillDetail web/src/features/skills/SkillPanel.tsx:640 — FunctionTooLong — SkillDetail runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChatPage.QuestionNavigator web/src/features/chat/ChatPage.tsx:134 — FunctionTooLong — QuestionNavigator runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SessionShareDialog.SessionShareDialog web/src/components/layout/SessionShareDialog.tsx:25 — FunctionTooLong — SessionShareDialog runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: IntegrationEditors.JavaScriptTab web/src/features/config/IntegrationEditors.tsx:145 — FunctionTooLong — JavaScriptTab 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.
  • FunctionTooLong: ConfigFields.ToolSelectField web/src/features/config/ConfigFields.tsx:118 — FunctionTooLong — ToolSelectField runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: select.Select web/src/components/ui/select.tsx:15 — FunctionTooLong — Select runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: taskstream.RuntimeEventPayload internal/app/chat/taskstream/protocol.go:17 — FunctionTooLong — RuntimeEventPayload runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: FileShareDialog.FileShareDialog web/src/features/files/FileShareDialog.tsx:20 — FunctionTooLong — FileShareDialog runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: chat.agentMessageToCoreMessages internal/app/chat/input.go:232 — FunctionTooLong — agentMessageToCoreMessages 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.
  • FunctionTooLong: router.registerAPIRoutesWithRuntime internal/adapters/transport/http/router/router.go:49 — FunctionTooLong — registerAPIRoutesWithRuntime 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.
  • FunctionTooLong: SkillPanel.CreateSkillDialog web/src/features/skills/SkillPanel.tsx:822 — FunctionTooLong — CreateSkillDialog 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.
  • FunctionTooLong: AgentEditors.AgentsTab web/src/features/config/AgentEditors.tsx:286 — FunctionTooLong — AgentsTab runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AgentEditors.AgentDraftDialog web/src/features/config/AgentEditors.tsx:653 — FunctionTooLong — AgentDraftDialog 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.
  • FunctionTooLong: ConfigEditor.ConfigEditingProvider web/src/features/config/ConfigEditor.tsx:29 — FunctionTooLong — ConfigEditingProvider 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.
  • FunctionTooLong: AgentEditors.ModelsTab web/src/features/config/AgentEditors.tsx:21 — FunctionTooLong — ModelsTab runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 1 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×25
  • FileTooLong: handler/files.go internal/adapters/transport/http/handler/files.go — FileTooLong — 1168 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 668 over it, 2.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: chat/MessageList.tsx web/src/features/chat/MessageList.tsx — FileTooLong — 1164 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 664 over it, 2.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: skills/SkillPanel.tsx web/src/features/skills/SkillPanel.tsx — FileTooLong — 904 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 404 over it, 1.81× 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: chat/ChatComposer.tsx web/src/features/chat/ChatComposer.tsx — FileTooLong — 880 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 380 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: filecron/scheduler.go internal/adapters/scheduler/filecron/scheduler.go — FileTooLong — 802 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: Scheduler (36 blocks, 31-1195). The bar is 500 significant lines; this is 302 over it, 1.60× 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: config/config.go internal/app/config/config.go — FileTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 212 over it, 1.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: config/AgentEditors.tsx web/src/features/config/AgentEditors.tsx — FileTooLong — 650 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 150 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: tui/markdown.go internal/adapters/transport/cli/tui/markdown.go — FileTooLong — 631 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 131 over it, 1.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: layout/Sidebar.tsx web/src/components/layout/Sidebar.tsx — FileTooLong — 631 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 131 over it, 1.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: history/history_record.go internal/adapters/storage/file/history/history_record.go — FileTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: HistoryRecorder (13 blocks, 81-851). The bar is 500 significant lines; this is 125 over it, 1.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: schedules/SchedulePanel.tsx web/src/features/schedules/SchedulePanel.tsx — FileTooLong — 606 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 106 over it, 1.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: taskstream/stream.go internal/app/chat/taskstream/stream.go — FileTooLong — 599 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: Stream (48 blocks, 192-942). The bar is 500 significant lines; this is 99 over it, 1.20× 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: file/func.go internal/adapters/tools/builtin/file/func.go — FileTooLong — 597 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 97 over it, 1.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: handler/stream.go internal/adapters/transport/http/handler/stream.go — FileTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: Runtime (16 blocks, 37-864). The bar is 500 significant lines; this is 95 over it, 1.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: Bot (25 blocks, 43-758). The bar is 500 significant lines; this is 66 over it, 1.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: runtime/runtime_history.go internal/adapters/transport/cli/runtime/runtime_history.go — FileTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: runtimeModel (22 blocks, 15-807). The bar is 500 significant lines; this is 66 over it, 1.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: share/ShareManagerPanel.tsx web/src/features/share/ShareManagerPanel.tsx — FileTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 66 over it, 1.13× 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: runtime/runtime_render.go internal/adapters/transport/cli/runtime/runtime_render.go — FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: runtimeModel (43 blocks, 16-795). The bar is 500 significant lines; this is 58 over it, 1.12× 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: todo/func.go internal/adapters/tools/builtin/todo/func.go — FileTooLong — 539 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: TodoTools (12 blocks, 45-808). The bar is 500 significant lines; this is 39 over it, 1.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 38 over it, 1.08× 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: uv/func.go internal/adapters/tools/builtin/script/uv/func.go — FileTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: UVTools (13 blocks, 22-886). The bar is 500 significant lines; this is 35 over it, 1.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: config/IntegrationEditors.tsx web/src/features/config/IntegrationEditors.tsx — FileTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 31 over it, 1.06× 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: eventview/print.go internal/adapters/transport/cli/eventview/print.go — FileTooLong — 530 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: newPrintEvent (75-741). The bar is 500 significant lines; this is 30 over it, 1.06× 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: config/ConfigFields.tsx web/src/features/config/ConfigFields.tsx — FileTooLong — 521 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 21 over it, 1.04× 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: scripts/stream_frontend_logic_check.ts web/scripts/stream_frontend_logic_check.ts — FileTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 9 over it, 1.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.
R4 · Test Coverage · No test reaches this file · ×16
  • No test reaches this file web/src/features/skills/SkillPanel.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/features/share/ShareManagerPanel.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/scripts/stream_frontend_logic_check.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 REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/src/features/share/SharePage.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/features/files/FileShareDialog.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/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 web/src/features/preview/PreviewPage.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/api/skills.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/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/features/auth/LoginPage.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/api/preview.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/features/schedules/ScheduleNotifications.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/scripts/generate_assistant_ui_prompt.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/api/agents.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/lib/openui-devtools.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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×13
  • Duplicated block (13 lines × 2) internal/adapters/tools/builtin/script/bun/func.go:180 — internal/adapters/tools/builtin/script/bun/func.go:180-192 | internal/adapters/tools/builtin/script/uv/func.go:192-204 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/adapters/tools/builtin/script/bun/func.go:180` 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 (13 lines × 2) internal/adapters/tools/builtin/script/bun/func.go:234 — internal/adapters/tools/builtin/script/bun/func.go:234-246 | internal/adapters/tools/builtin/script/uv/func.go:239-251 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/adapters/tools/builtin/script/bun/func.go:234` 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 (13 lines × 2) internal/adapters/tools/builtin/script/bun/func.go:455 — internal/adapters/tools/builtin/script/bun/func.go:455-467 | internal/adapters/tools/builtin/script/uv/func.go:429-441 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/adapters/tools/builtin/script/bun/func.go:455` 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) REDACTED:142 — REDACTED:142-154 | REDACTED:162-174 — 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:142` 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 (13 lines × 2) internal/adapters/transport/cli/eventview/print_format.go:101 — internal/adapters/transport/cli/eventview/print_format.go:101-113 | internal/adapters/transport/cli/eventview/print_format.go:500-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/adapters/transport/cli/eventview/print_format.go:101` 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 (13 lines × 2) internal/adapters/transport/cli/eventview/print_format.go:340 — internal/adapters/transport/cli/eventview/print_format.go:340-352 | internal/adapters/transport/cli/eventview/print_format.go:362-374 — 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/adapters/transport/cli/eventview/print_format.go:340` 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/adapters/transport/cli/eventview/print_format.go:360` calls `WriteString` and `internal/adapters/transport/cli/eventview/print_format.go:338` 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 (13 lines × 2) internal/adapters/transport/cli/eventview/print_stream.go:351 — internal/adapters/transport/cli/eventview/print_stream.go:351-363 | internal/app/agent/catalog/toolmeta/tool_display.go:119-131 — 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 (13 lines × 2) internal/adapters/transport/http/handler/chat.go:299 — internal/adapters/transport/http/handler/chat.go:299-311 | internal/app/chat/taskstream/protocol.go:204-216 — 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 (13 lines × 2) internal/app/skill/export.go:258 — internal/app/skill/export.go:258-270 | internal/app/skill/export.go:289-301 — 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 (13 lines × 2) internal/adapters/transport/cli/tui/member_panel.go:463 — internal/adapters/transport/cli/tui/member_panel.go:463-475 | internal/adapters/transport/cli/tui/tool_panel.go:192-204 — 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 (13 lines × 2) REDACTED:154 — REDACTED:154-166 | internal/adapters/transport/http/handler/session_share.go:176-188 — 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 (13 lines × 2) internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:76 — internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:76-88 | internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:323-335 — 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/adapters/runtime/agentkit/middlewares/fkfs/backend.go:76` 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 (13 lines × 2) internal/adapters/environment/bun.go:40 — internal/adapters/environment/bun.go:40-52 | internal/adapters/environment/uv.go:40-52 — 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/adapters/environment/bun.go:40` 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 (10 lines × 2) · ×13
  • Duplicated block (10 lines × 2) internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:201 — internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:201-210 | internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:340-349 — 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/adapters/runtime/agentkit/middlewares/fkfs/backend.go:201` 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/adapters/runtime/agentkit/middlewares/fkfs/backend.go:338` calls `HasPrefix` and `internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:199` 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 (10 lines × 2) internal/adapters/scheduler/filecron/scheduler.go:920 — internal/adapters/scheduler/filecron/scheduler.go:920-929 | internal/adapters/scheduler/filecron/scheduler.go:1025-1034 — 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/adapters/scheduler/filecron/scheduler.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.
  • Duplicated block (10 lines × 2) internal/adapters/storage/file/history/session_repository.go:137 — internal/adapters/storage/file/history/session_repository.go:137-146 | internal/adapters/storage/file/history/session_repository.go:173-182 — 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 (10 lines × 2) REDACTED:413 — REDACTED:413-422 | REDACTED:434-443 — 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:413` 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/adapters/transport/http/handler/files.go:154 — internal/adapters/transport/http/handler/files.go:154-163 | internal/adapters/transport/http/handler/files.go:196-205 — 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/adapters/transport/http/handler/files.go:154` 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 (10 lines × 2) internal/adapters/transport/http/handler/http_chat.go:78 — internal/adapters/transport/http/handler/http_chat.go:78-87 | internal/adapters/transport/http/handler/stream.go:84-93 — 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 (10 lines × 2) internal/adapters/transport/http/handler/schedule.go:32 — internal/adapters/transport/http/handler/schedule.go:32-41 | internal/adapters/transport/http/handler/schedule.go:61-70 — 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 lines × 2) internal/runtime/pathguard/pathguard.go:100 — internal/runtime/pathguard/pathguard.go:100-109 | internal/runtime/pathguard/pathguard.go:122-131 — 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/runtime/pathguard/pathguard.go:100` 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/adapters/storage/file/history/history_persist.go:189 — internal/adapters/storage/file/history/history_persist.go:189-198 | internal/adapters/storage/file/history/history_persist.go:318-327 — 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/adapters/storage/file/history/history_persist.go:188` calls `ensure` and `internal/adapters/storage/file/history/history_persist.go:317` 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 (10 lines × 2) internal/adapters/transport/channel/weixin/sdk/protocol/api.go:215 — internal/adapters/transport/channel/weixin/sdk/protocol/api.go:215-224 | internal/adapters/transport/cli/update/update.go:229-238 — 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/adapters/transport/cli/commands/model.go:243 — internal/adapters/transport/cli/commands/model.go:243-252 | internal/adapters/transport/cli/commands/model.go:360-370 — 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/adapters/transport/cli/commands/model.go:243` 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 (10 lines × 2) internal/adapters/transport/cli/update/update.go:279 — internal/adapters/transport/cli/update/update.go:279-288 | internal/app/skill/install.go:89-98 — 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/adapters/transport/cli/update/update.go:279` 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/adapters/environment/bun.go:24 — internal/adapters/environment/bun.go:24-33 | internal/adapters/environment/uv.go:24-33 — 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/adapters/environment/bun.go:24` 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.
R11 · Import Boundaries · Boundary violation [package · ×13
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:3 — web/src/lib/markdown.ts:3 imports highlight.js/lib/core, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:4 — web/src/lib/markdown.ts:4 imports highlight.js/lib/languages/bash, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:5 — web/src/lib/markdown.ts:5 imports highlight.js/lib/languages/css, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:6 — web/src/lib/markdown.ts:6 imports highlight.js/lib/languages/diff, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:7 — web/src/lib/markdown.ts:7 imports highlight.js/lib/languages/go, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:8 — web/src/lib/markdown.ts:8 imports highlight.js/lib/languages/javascript, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:9 — web/src/lib/markdown.ts:9 imports highlight.js/lib/languages/json, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:10 — web/src/lib/markdown.ts:10 imports highlight.js/lib/languages/markdown, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:11 — web/src/lib/markdown.ts:11 imports highlight.js/lib/languages/python, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:12 — web/src/lib/markdown.ts:12 imports highlight.js/lib/languages/sql, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:13 — web/src/lib/markdown.ts:13 imports highlight.js/lib/languages/typescript, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:14 — web/src/lib/markdown.ts:14 imports highlight.js/lib/languages/xml, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/src/lib/markdown.ts:15 — web/src/lib/markdown.ts:15 imports highlight.js/lib/languages/yaml, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×12
  • Edited copy of a member (15 corresponding lines) internal/adapters/transport/cli/update/zip.go:81 — internal/adapters/transport/cli/update/zip.go:81-95 | internal/app/skill/install.go:153-167 — 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/adapters/storage/file/history/session_repository.go:76 — internal/adapters/storage/file/history/session_repository.go:76-94 | internal/adapters/storage/file/history/session_repository.go:120-134 — 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/adapters/transport/cli/runtime/runtime_history.go:684 — internal/adapters/transport/cli/runtime/runtime_history.go:684-698 | internal/adapters/transport/cli/runtime/runtime_history.go:792-807 — 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/adapters/transport/channel/weixin/sdk/protocol/api.go:251 — internal/adapters/transport/channel/weixin/sdk/protocol/api.go:251-265 | internal/adapters/transport/channel/weixin/sdk/protocol/api.go:278-293 — 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/adapters/environment/bun.go:56 — internal/adapters/environment/bun.go:56-70 | internal/adapters/environment/uv.go:56-70 — 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/adapters/tools/mcp/client.go:124 — internal/adapters/tools/mcp/client.go:124-138 | internal/app/agent/catalog/common/definition.go:197-212 — 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/adapters/model/providers/copilot/token.go:255 — internal/adapters/model/providers/copilot/token.go:255-269 | internal/adapters/tools/builtin/script/bun/func.go:349-369 — 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/adapters/runtime/agentkit/providers/claude/claude.go:14 — internal/adapters/runtime/agentkit/providers/claude/claude.go:14-28 | internal/adapters/runtime/agentkit/providers/openrouter/openrouter.go:14-28 — 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/adapters/transport/channel/discord/discord.go:479 — internal/adapters/transport/channel/discord/discord.go:479-496 | internal/adapters/transport/channel/qq/qq.go:321-335 — 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/app/agent/catalog/deep/deep.go:127 — internal/app/agent/catalog/deep/deep.go:127-141 | internal/app/aiassist/service.go:633-648 — 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/runtime/events/emitter.go:166 — internal/runtime/events/emitter.go:166-181 | internal/runtime/events/emitter.go:197-211 — 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/adapters/transport/cli/runtime/query.go:71 — internal/adapters/transport/cli/runtime/query.go:71-85 | internal/adapters/transport/cli/runtime/query.go:458-473 — 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.
AXH1 · Runtime security headers · Runtime security header not set · ×11
  • Runtime security header not set: content-security-policy — The live app's responses did not include content-security-policy (restricts the sources a page may load — mitigates XSS/injection). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-embedder-policy — The live app's responses did not include cross-origin-embedder-policy (recommended by the OWASP Secure Headers Project (value: require-corp)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-opener-policy — The live app's responses did not include cross-origin-opener-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-resource-policy — The live app's responses did not include cross-origin-resource-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: permissions-policy — The live app's responses did not include permissions-policy (restricts powerful browser features (camera, geolocation, …)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: referrer-policy — The live app's responses did not include referrer-policy (limits referrer leakage to third parties). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: strict-transport-security — The live app's responses did not include strict-transport-security (forces HTTPS on subsequent requests — mitigates downgrade/MITM). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-content-type-options — The live app's responses did not include x-content-type-options (stops MIME-sniffing (expects 'nosniff')). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-dns-prefetch-control — The live app's responses did not include x-dns-prefetch-control (recommended by the OWASP Secure Headers Project (value: off)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-frame-options — The live app's responses did not include x-frame-options (blocks clickjacking via framing (or use CSP frame-ancestors)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-permitted-cross-domain-policies — The live app's responses did not include x-permitted-cross-domain-policies (recommended by the OWASP Secure Headers Project (value: none)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
D3 · God Classes · MethodTooLong · ×11
  • MethodTooLong: runtimeModel.Update internal/adapters/transport/cli/runtime/runtime_update.go:24 — MethodTooLong — Update runs 276 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 176 over it, 2.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Projector.Apply internal/app/chat/presentation/projector.go:70 — MethodTooLong — Apply runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HistoryRecorder.RecordEvent internal/adapters/storage/file/history/history_record.go:591 — MethodTooLong — RecordEvent runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.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.
  • MethodTooLong: Runtime.UploadChunkHandler internal/adapters/transport/http/handler/files.go:963 — MethodTooLong — UploadChunkHandler runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HistoryRecorder.recordTranscript internal/adapters/storage/file/history/history_record.go:258 — MethodTooLong — recordTranscript runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Runtime.StreamStartHandlerWithState internal/adapters/transport/http/handler/stream.go:37 — MethodTooLong — StreamStartHandlerWithState runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Service.Execute internal/app/process/service.go:149 — MethodTooLong — Execute 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: QueryExecutor.Execute internal/adapters/transport/cli/runtime/query.go:250 — MethodTooLong — Execute 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.
  • MethodTooLong: Runtime.WebSocketHandlerWithState internal/adapters/transport/http/handler/websocket.go:55 — MethodTooLong — WebSocketHandlerWithState runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: GitTools.GitDiff internal/adapters/tools/builtin/git/diff.go:52 — MethodTooLong — GitDiff runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: memberModel.applyEvent internal/adapters/transport/cli/tui/member_panel.go:71 — MethodTooLong — applyEvent runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×10
  • Modal dialog does not manage focus web/src/components/layout/SessionShareDialog.tsx:88 — 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/layout/Sidebar.tsx:453 — 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/layout/Sidebar.tsx:515 — 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/ui/action-dialog.tsx:30 — 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/ui/action-dialog.tsx:97 — 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 REDACTED:492 — 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/features/files/FileShareDialog.tsx:79 — 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/features/migration/MigrationGate.tsx:55 — This <section 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/features/share/ShareManagerPanel.tsx:466 — 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/features/share/ShareManagerPanel.tsx:516 — 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.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×10
  • Edited copy of a member (14 corresponding lines) internal/adapters/tools/builtin/scheduler/tool.go:110 — internal/adapters/tools/builtin/scheduler/tool.go:110-128 | internal/adapters/tools/builtin/scheduler/tool.go:226-239 — 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/adapters/storage/sqlite/lock_unix.go:12 — internal/adapters/storage/sqlite/lock_unix.go:12-25 | internal/adapters/storage/sqlite/lock_windows.go:10-24 — 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/adapters/transport/cli/runtime/query.go:183 — internal/adapters/transport/cli/runtime/query.go:183-196 | internal/app/chat/taskstream/queue.go:119-133 — 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/app/lifecycle/lifecycle.go:291 — internal/app/lifecycle/lifecycle.go:291-304 | internal/app/lifecycle/lifecycle.go:306-319 — 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/adapters/storage/file/share/preview.go:88 — internal/adapters/storage/file/share/preview.go:88-101 | internal/adapters/storage/file/share/session.go:110-123 — 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/adapters/runtime/agentkit/middleware.go:21 — internal/adapters/runtime/agentkit/middleware.go:21-34 | internal/adapters/runtime/agentkit/middleware.go:51-64 — 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/adapters/transport/http/handler/memory.go:68 — internal/adapters/transport/http/handler/memory.go:68-82 | internal/adapters/transport/http/handler/memory_editor.go:39-52 — 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/adapters/transport/cli/runtime/runtime_history.go:618 — internal/adapters/transport/cli/runtime/runtime_history.go:618-633 | internal/adapters/transport/cli/runtime/runtime_history.go:635-648 — 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/adapters/transport/cli/tui/member_panel.go:447 — internal/adapters/transport/cli/tui/member_panel.go:447-461 | internal/adapters/transport/cli/tui/tool_panel.go:177-190 — 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/adapters/runtime/agentkit/middlewares/dispatch/view.go:193 — internal/adapters/runtime/agentkit/middlewares/dispatch/view.go:193-208 | internal/adapters/transport/cli/tui/member_panel.go:229-242 — 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 · Duplicated block (11 lines × 2) · ×10
  • Duplicated block (11 lines × 2) internal/adapters/model/providers/providers.go:123 — internal/adapters/model/providers/providers.go:123-133 | internal/runtime/model/model.go:71-81 — before extracting anything, compare `internal/adapters/model/providers/providers.go` and `internal/runtime/model/model.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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/adapters/tools/builtin/excel/batch.go:238 — internal/adapters/tools/builtin/excel/batch.go:238-248 | internal/adapters/tools/builtin/excel/batch.go:748-758 — 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/adapters/tools/builtin/excel/batch.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 (11 lines × 2) internal/adapters/tools/builtin/script/bun/func.go:71 — internal/adapters/tools/builtin/script/bun/func.go:71-81 | internal/adapters/tools/builtin/script/uv/func.go:73-83 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (11 lines × 2) internal/adapters/transport/cli/runtime/runtime_history.go:200 — internal/adapters/transport/cli/runtime/runtime_history.go:200-210 | internal/adapters/transport/cli/runtime/runtime_history.go:222-232 — 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 (11 lines × 2) internal/adapters/transport/cli/runtime/runtime_picker.go:176 — internal/adapters/transport/cli/runtime/runtime_picker.go:176-186 | internal/adapters/transport/cli/tui/select.go:59-69 — 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 (11 lines × 2) internal/adapters/transport/http/handler/files.go:633 — internal/adapters/transport/http/handler/files.go:633-643 | internal/adapters/transport/http/handler/files.go:971-981 — 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/adapters/transport/http/handler/schedule.go:84 — internal/adapters/transport/http/handler/schedule.go:84-94 | internal/adapters/transport/http/handler/schedule.go:130-141 — 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/adapters/transport/http/handler/schedule.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 (11 lines × 2) internal/adapters/transport/http/handler/stream.go:507 — internal/adapters/transport/http/handler/stream.go:507-517 | internal/adapters/transport/http/handler/stream.go:831-841 — 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 (11 lines × 2) internal/adapters/storage/sqlite/documents.go:75 — internal/adapters/storage/sqlite/documents.go:75-85 | internal/adapters/storage/sqlite/documents.go:98-108 — 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 (11 lines × 2) internal/adapters/storage/file/share/preview.go:59 — internal/adapters/storage/file/share/preview.go:59-69 | internal/adapters/storage/file/share/session.go:74-84 — 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/adapters/storage/file/share/preview.go:59` 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 (7 lines × 2) · ×10
  • Duplicated block (7 lines × 2) internal/adapters/model/providers/providerkit/config.go:83 — internal/adapters/model/providers/providerkit/config.go:83-89 | internal/adapters/transport/http/handler/openai_api.go:190-196 — 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/adapters/model/providers/providerkit/config.go:83` 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 `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 (7 lines × 2) internal/adapters/storage/file/queue/store.go:267 — internal/adapters/storage/file/queue/store.go:267-273 | internal/adapters/storage/file/queue/store.go:302-308 — 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/adapters/storage/file/queue/store.go:267` 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/adapters/storage/file/history/history_persist.go:181 — internal/adapters/storage/file/history/history_persist.go:181-187 | internal/adapters/storage/file/history/history_persist.go:311-317 — 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/adapters/transport/channel/discord/discord.go:442 — internal/adapters/transport/channel/discord/discord.go:442-448 | internal/adapters/transport/channel/weixin/weixin.go:368-374 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `c *Channel) removeTyping(chatID` in one and `c *Channel) removeTyping(userID` 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 (7 lines × 2) internal/adapters/transport/cli/commands/auth.go:181 — internal/adapters/transport/cli/commands/auth.go:181-187 | REDACTED:475-481 — 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/adapters/transport/cli/eventview/print_stream.go:389 — internal/adapters/transport/cli/eventview/print_stream.go:389-395 | internal/adapters/transport/cli/tui/member_panel.go:409-415 — 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/adapters/runtime/agentkit/message.go:106 — internal/adapters/runtime/agentkit/message.go:106-112 | internal/adapters/runtime/agentkit/model.go:186-192 — 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/app/tools/registry.go:63 — internal/app/tools/registry.go:63-69 | internal/ports/runtime/tool.go:48-54 — 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) REDACTED:424 — REDACTED:424-430 | REDACTED:445-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:424` 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 (7 lines × 2) internal/adapters/skill/skillhub/provider.go:65 — internal/adapters/skill/skillhub/provider.go:65-71 | internal/adapters/skill/skillhub/provider.go:128-134 — 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 · ×7
  • ClassTooLong: Scheduler internal/adapters/scheduler/filecron/scheduler.go:31 — ClassTooLong — 707 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods, 36 blocks, lines 31-1195. The bar is 400 significant lines; this is 307 over it, 1.77× 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: Stream internal/app/chat/taskstream/stream.go:192 — ClassTooLong — 435 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods, 48 blocks, lines 192-942. 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: Projector internal/app/chat/presentation/projector.go:22 — ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods, 13 blocks, lines 22-600. The bar is 400 significant lines; this is 29 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Bot REDACTED:43 — ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods, 25 blocks, lines 43-758. The bar is 400 significant lines; this is 21 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TodoTools internal/adapters/tools/builtin/todo/func.go:45 — ClassTooLong — 420 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods, 12 blocks, lines 45-808. The bar is 400 significant lines; this is 20 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SkillPanel web/src/features/skills/SkillPanel.tsx:1 — ClassTooLong — 415 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 15 over it, 1.04× 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: UVTools internal/adapters/tools/builtin/script/uv/func.go:22 — ClassTooLong — 410 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods, 13 blocks, lines 22-886. The bar is 400 significant lines; this is 10 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×7
  • Duplicated block (12 lines × 2) internal/adapters/model/providers/providers.go:117 — internal/adapters/model/providers/providers.go:117-128 | internal/adapters/model/providers/providers.go:219-230 — 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) internal/adapters/runtime/agentkit/message.go:168 — internal/adapters/runtime/agentkit/message.go:168-179 | internal/adapters/runtime/agentkit/message.go:223-234 — 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/adapters/runtime/agentkit/message.go:168` 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 (12 lines × 2) internal/adapters/storage/sqlite/documents.go:74 — internal/adapters/storage/sqlite/documents.go:74-85 | internal/adapters/storage/sqlite/documents.go:117-128 — 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 (12 lines × 2) internal/adapters/transport/cli/tui/member_panel.go:478 — internal/adapters/transport/cli/tui/member_panel.go:478-489 | internal/adapters/transport/cli/tui/tool_panel.go:207-218 — 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. 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 (12 lines × 2) internal/adapters/transport/http/handler/files.go:497 — internal/adapters/transport/http/handler/files.go:497-508 | internal/adapters/transport/http/handler/files.go:1217-1228 — 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/adapters/transport/http/handler/files.go:497` 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/adapters/transport/http/handler/schedule.go:156 — internal/adapters/transport/http/handler/schedule.go:156-167 | internal/adapters/transport/http/handler/schedule.go:182-193 — 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/adapters/transport/http/handler/schedule.go:156` 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/adapters/transport/http/router/router.go:247 — internal/adapters/transport/http/router/router.go:247-258 | internal/adapters/transport/http/router/router.go:359-370 — 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 (8 lines × 2) · ×7
  • Duplicated block (8 lines × 2) internal/adapters/storage/file/history/session_repository.go:111 — internal/adapters/storage/file/history/session_repository.go:111-118 | internal/adapters/storage/file/history/session_repository.go:127-134 — 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/adapters/storage/file/history/session_repository.go:111` 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 (8 lines × 2) internal/adapters/transport/cli/runtime/runtime_picker.go:166 — internal/adapters/transport/cli/runtime/runtime_picker.go:166-173 | internal/adapters/transport/cli/tui/select.go:49-56 — 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/adapters/transport/cli/runtime/runtime_picker.go:166` 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/adapters/tools/builtin/file/func.go:531 — internal/adapters/tools/builtin/file/func.go:531-538 | internal/adapters/tools/builtin/file/func.go:642-649 — 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/adapters/tools/builtin/file/func.go:531` 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/adapters/storage/file/history/chat_store.go:84 — internal/adapters/storage/file/history/chat_store.go:84-91 | internal/adapters/transport/cli/runtime/query.go:506-513 — 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/adapters/transport/channel/discord/discord.go:433 — internal/adapters/transport/channel/discord/discord.go:433-440 | internal/adapters/transport/channel/weixin/weixin.go:359-366 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `c *Channel) stopTyping(chatID` in one and `c *Channel) stopTyping(userID` 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 (8 lines × 2) internal/adapters/transport/channel/discord/discord.go:450 — internal/adapters/transport/channel/discord/discord.go:450-457 | internal/adapters/transport/channel/weixin/weixin.go:376-383 — 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/adapters/transport/cli/update/zip.go:46 — internal/adapters/transport/cli/update/zip.go:46-53 | internal/app/skill/install.go:122-130 — 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.
X3 · Exception handling · Discarded error (assigned to `_`, then its result used) · ×7
  • Discarded error (assigned to `_`, then its result used) internal/app/chat/taskstream/stream.go:576 — `data, _ := json.Marshal(typed)` writes the call's error to `_` and then uses `data` as if the call succeeded. When `json.Marshal` fails, `data` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `data` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/app/agent/catalog/deep/deep.go:57 — `n, _ := strconv.Atoi(v)` writes the call's error to `_` and then uses `n` as if the call succeeded. When `strconv.Atoi` fails, `n` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `n` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/app/agent/catalog/common/definition.go:224 — `n, _ := strconv.Atoi(v)` writes the call's error to `_` and then uses `n` as if the call succeeded. When `strconv.Atoi` fails, `n` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `n` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/adapters/transport/http/handler/openai_api.go:109 — `newBody, _ := json.Marshal(bodyMap)` writes the call's error to `_` and then uses `newBody` as if the call succeeded. When `json.Marshal` fails, `newBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `newBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/adapters/transport/cli/tui/markdown.go:193 — `r, _ = glamour.NewTermRenderer( customDarkStyle(), glamour.WithWordWrap(width), glamour.WithChromaFormatter("terminal16m"), )` writes the call's error to `_` and then uses `r` as if the call succeeded. When `glamour.NewTermRenderer` fails, `r` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `r` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/adapters/transport/cli/runtime/query_view.go:48 — `spinner, _ := pterm.DefaultSpinner.Start("执行中...")` writes the call's error to `_` and then uses `spinner` as if the call succeeded. When `pterm.DefaultSpinner.Start` fails, `spinner` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `spinner` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
  • Discarded error (assigned to `_`, then its result used) internal/adapters/transport/cli/runtime/runtime_picker.go:218 — `rel, _ := filepath.Rel(p.baseDir, p.currentDir)` writes the call's error to `_` and then uses `rel` as if the call succeeded. When `filepath.Rel` fails, `rel` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `rel` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
D3 · God Classes · TooManyMethods · ×6
  • TooManyMethods: runtimeModel internal/adapters/transport/cli/runtime/runtime_model.go:13 — TooManyMethods — 129 methods, declared across 9 files: runtime/runtime_render.go (43), runtime/runtime_history.go (22), runtime/runtime_input.go (22), runtime/runtime_update.go (16), +5 more file(s). The bar is 30 methods; this is 99 over it, 4.30× 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: Runtime internal/adapters/transport/http/handler/runtime.go:32 — TooManyMethods — 96 methods, declared across 22 files: handler/runtime.go (18), handler/stream.go (16), handler/session.go (12), handler/schedule.go (8), +18 more file(s). The bar is 30 methods; this is 66 over it, 3.20× 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: Stream internal/app/chat/taskstream/stream.go:192 — TooManyMethods — 60 methods, declared across 2 files: taskstream/stream.go (47), taskstream/queue.go (13). The bar is 30 methods; this is 30 over it, 2.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: HistoryRecorder internal/adapters/storage/file/history/history.go:126 — TooManyMethods — 46 methods, declared across 8 files: history/history_access.go (15), history/history_record.go (13), history/history.go (6), history/history_persist.go (4), +4 more file(s). The bar is 30 methods; this is 16 over it, 1.53× 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: ExcelTools internal/adapters/tools/builtin/excel/excel.go:19 — TooManyMethods — 45 methods, declared across 9 files: excel/data.go (11), excel/batch.go (10), excel/cell.go (6), excel/sheet.go (6), +5 more file(s). The bar is 30 methods; this is 15 over it, 1.50× 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: Scheduler internal/adapters/scheduler/filecron/scheduler.go:31 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D31 · IaC & Container Security · Medium IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×6
  • Change coupling: http_chat.go ↔ websocket.go internal/adapters/transport/http/handler/http_chat.go:1 — `internal/adapters/transport/http/handler/http_chat.go` and `internal/adapters/transport/http/handler/websocket.go` change together 82% of the time (23 of the 28 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 23 shared commits counted here, the most recent 3 are `c475451f` fix(chat): 友好提示旧格式会话及序列化错误; `fb0f36c5` fix: 为会话历史缓存增加安全淘汰; `547fe29c` refactor: 重建 turn 执行请求并移除重复 option 层 — run `git show` on any of them.
  • Change coupling: prompt.go ↔ prompt.go internal/app/agent/catalog/assistant/prompt.go:1 — `internal/app/agent/catalog/assistant/prompt.go` and `internal/app/agent/catalog/tasker/prompt.go` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `7f7da012` refactor: 充分利用提示词缓存 (at that commit the files were still `agents/assistant/prompt.go` and `agents/tasker/prompt.go`); `04611af6` chore: 提示词优化降低反复确认频率 (at that commit the files were still `agents/assistant/prompt.go` and `agents/tasker/prompt.go`); `932c5eac` feat(tools): 使用工具名称来获取工具 (at that commit the files were still `agents/assistant/prompt.go` and `agents/tasker/prompt.go`) — run `git show` on any of them.
  • Change coupling: sessionThunks.ts ↔ chat.ts web/src/features/sessions/sessionThunks.ts:1 — `web/src/features/sessions/sessionThunks.ts` and `web/src/types/chat.ts` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `3d99ae55` fix: 按会话管理前端运行任务状态; `e79bedd2` fix: 修复会话重复请求与流切换竞态; `9e52a9f2` fix: 修复 Web 流式任务的重复请求 — run `git show` on any of them.
  • Change coupling: chat.go ↔ conn.go internal/adapters/transport/http/handler/chat.go:1 — `internal/adapters/transport/http/handler/chat.go` and `internal/adapters/transport/http/handler/conn.go` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 6 shared commits counted here, the most recent 3 are `fb9c5ca9` fix: 保证同会话任务与队列状态原子性; `9511d03e` refactor: 迁移任务流到聊天用例 (at that commit the files were still `server/handler/chat.go` and `server/handler/conn.go`); `7ac9a85f` feat: 新增ask工具用于智能体与用户交互 (at that commit the files were still `server/handler/chat.go` and `server/handler/conn.go`) — run `git show` on any of them.
  • Change coupling: bridge.go ↔ http_chat.go internal/adapters/transport/channel/bridge.go:1 — `internal/adapters/transport/channel/bridge.go` and `internal/adapters/transport/http/handler/http_chat.go` change together 54% of the time (15 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `1181fd9c` fix(chat): 统一各入口交互记录与 Web 会话展示; `fb0f36c5` fix: 为会话历史缓存增加安全淘汰; `547fe29c` refactor: 重建 turn 执行请求并移除重复 option 层 — run `git show` on any of them.
  • Change coupling: discussant.go ↔ visitor.go internal/app/agent/catalog/discussant/discussant.go:1 — `internal/app/agent/catalog/discussant/discussant.go` and `internal/app/agent/catalog/visitor/visitor.go` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `0546aea7` refactor: 拆分 agent 定义解析和组装流程; `e80d374a` feat(context): agent继承上下文 (at that commit the files were still `agents/discussant/discussant.go` and `agents/visitor/visitor.go`); `932c5eac` feat(tools): 使用工具名称来获取工具 (at that commit the files were still `agents/discussant/discussant.go` and `agents/visitor/visitor.go`) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×6
  • Edited copy of a member (17 corresponding lines) internal/adapters/transport/channel/weixin/sdk/protocol/api.go:108 — internal/adapters/transport/channel/weixin/sdk/protocol/api.go:108-124 | internal/adapters/transport/channel/weixin/sdk/protocol/api.go:127-144 — 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/adapters/transport/channel/weixin/sdk/crypto/aes.go:15 — internal/adapters/transport/channel/weixin/sdk/crypto/aes.go:15-31 | internal/adapters/transport/channel/weixin/sdk/crypto/aes.go:34-52 — 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/adapters/transport/channel/discord/discord.go:62 — internal/adapters/transport/channel/discord/discord.go:62-78 | internal/adapters/transport/channel/weixin/weixin.go:58-76 — 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/adapters/transport/cli/tui/panel_render.go:95 — internal/adapters/transport/cli/tui/panel_render.go:95-111 | internal/adapters/transport/cli/tui/runtime_widgets.go:333-349 — 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/adapters/transport/cli/runtime/runtime_ask.go:96 — internal/adapters/transport/cli/runtime/runtime_ask.go:96-112 | internal/adapters/transport/cli/runtime/runtime_approval.go:64-80 — 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/adapters/tools/builtin/script/bun/func.go:249 — internal/adapters/tools/builtin/script/bun/func.go:249-265 | internal/adapters/tools/builtin/script/uv/func.go:254-270 — 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 (16 corresponding lines) · ×6
  • Edited copy of a member (16 corresponding lines) internal/testmodel/model.go:78 — internal/testmodel/model.go:78-93 | internal/testmodel/model.go:95-113 — 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/adapters/runtime/agentkit/middlewares/tools/warperror/warperror.go:135 — internal/adapters/runtime/agentkit/middlewares/tools/warperror/warperror.go:135-150 | internal/adapters/runtime/agentkit/middlewares/tools/warperror/warperror.go:153-170 — 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/app/tools/registry.go:204 — internal/app/tools/registry.go:204-219 | internal/app/tools/registry.go:221-236 — 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/adapters/tools/javascript/state.go:58 — internal/adapters/tools/javascript/state.go:58-73 | internal/adapters/tools/javascript/state.go:75-90 — 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/runtime/turn/interrupt.go:26 — internal/runtime/turn/interrupt.go:26-43 | internal/runtime/turn/interrupt.go:45-60 — 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/adapters/scheduler/filecron/scheduler.go:499 — internal/adapters/scheduler/filecron/scheduler.go:499-514 | REDACTED:383-399 — 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.
AC2 · Forms & labels · <Textarea> field component without a label · ×5
  • <Textarea> field component without a label web/src/features/chat/MessageList.tsx:1184 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label web/src/features/config/IntegrationEditors.tsx:405 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label web/src/features/config/IntegrationEditors.tsx:408 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label web/src/features/skills/SkillPanel.tsx:801 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label web/src/features/skills/SkillPanel.tsx:888 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AX7 · Slice cohesion · Cross-slice coupling · ×5
  • Cross-slice coupling: chat → sessions web/src/features/chat/ChatInput.tsx:144 — `ChatInput` (slice 'chat') depends on `clearAssistant` from slice 'sessions'.
  • Cross-slice coupling: chat → sessions web/src/features/chat/ChatInput.tsx:145 — `ChatInput` (slice 'chat') depends on `renameAssistant` from slice 'sessions'.
  • Cross-slice coupling: chat → sessions web/src/features/chat/ChatPage.tsx:48 — `ChatPage` (slice 'chat') depends on `loadSessionDetail` from slice 'sessions'.
  • Cross-slice coupling: chat → sessions web/src/features/chat/TaskStreamController.tsx:254 — `finishFromStatus` (slice 'chat') depends on `refreshAssistant` from slice 'sessions'.
  • Cross-slice coupling: share → chat web/src/features/share/SharePage.tsx:126 — `ShareThread` (slice 'share') depends on `ConversationItems` from slice 'chat'.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×5
  • Edited copy of a member (21 corresponding lines) internal/adapters/transport/channel/discord/discord.go:499 — internal/adapters/transport/channel/discord/discord.go:499-524 | internal/adapters/transport/channel/qq/qq.go:338-358 — 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.
  • Edited copy of a member (21 corresponding lines) internal/app/schedule/collector.go:50 — internal/app/schedule/collector.go:50-70 | internal/app/schedule/collector.go:72-92 — 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.
  • Edited copy of a member (21 corresponding lines) internal/adapters/transport/http/handler/schedule.go:30 — internal/adapters/transport/http/handler/schedule.go:30-50 | internal/adapters/transport/http/handler/schedule.go:54-79 — 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.
  • Edited copy of a member (21 corresponding lines) internal/adapters/environment/mirror_config.go:23 — internal/adapters/environment/mirror_config.go:23-43 | internal/adapters/transport/cli/report/report.go:39-60 — 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.
  • Edited copy of a member (21 corresponding lines) internal/adapters/transport/cli/runtime/runtime_render.go:253 — internal/adapters/transport/cli/runtime/runtime_render.go:253-273 | internal/adapters/transport/cli/tui/text_render.go:22-43 — 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 (11 corresponding lines) · ×5
  • Edited copy of a member (11 corresponding lines) internal/adapters/runtime/agentkit/model.go:72 — internal/adapters/runtime/agentkit/model.go:72-82 | internal/adapters/runtime/agentkit/model.go:159-176 — 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/adapters/transport/cli/tui/markdown.go:886 — internal/adapters/transport/cli/tui/markdown.go:886-896 | internal/adapters/transport/cli/tui/runtime_widgets.go:475-487 — 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/adapters/transport/http/handler/config.go:292 — internal/adapters/transport/http/handler/config.go:292-302 | internal/adapters/transport/http/handler/config.go:306-316 — 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/adapters/storage/file/share/preview.go:29 — internal/adapters/storage/file/share/preview.go:29-39 | internal/adapters/storage/file/share/session.go:44-54 — 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/adapters/hooks/javascript/handler.go:180 — internal/adapters/hooks/javascript/handler.go:180-190 | internal/adapters/tools/javascript/tool.go:40-50 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×5
  • Duplicated block (5 lines × 2) internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:68 — internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:68-72 | internal/runtime/pathguard/pathguard.go:92-96 — 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 (5 lines × 2) internal/adapters/tools/builtin/ssh/ssh.go:222 — internal/adapters/tools/builtin/ssh/ssh.go:222-226 | internal/runtime/executil/output.go:72-76 — 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 (5 lines × 2) internal/adapters/transport/cli/update/zip.go:85 — internal/adapters/transport/cli/update/zip.go:85-89 | internal/app/skill/install.go:157-161 — 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 (5 lines × 2) internal/adapters/transport/cli/update/zip.go:91 — internal/adapters/transport/cli/update/zip.go:91-95 | internal/app/skill/install.go:163-167 — 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/adapters/transport/cli/update/zip.go:91` 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 (5 lines × 2) internal/adapters/transport/channel/discord/discord.go:514 — internal/adapters/transport/channel/discord/discord.go:514-518 | internal/adapters/transport/channel/qq/qq.go:347-351 — 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.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×5
  • Duplicated block (13 lines × 2 locations) web/src/components/ui/action-dialog.tsx:28 — web/src/components/ui/action-dialog.tsx:28 · web/src/components/ui/action-dialog.tsx:95 — 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 (13 lines × 2 locations) web/src/features/chat/ChatComposer.tsx:642 — web/src/features/chat/ChatComposer.tsx:642 · web/src/features/chat/ChatComposer.tsx:662 — 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 (13 lines × 2 locations) web/src/features/chat/ChatPage.tsx:219 — web/src/features/chat/ChatPage.tsx:219 · web/src/features/chat/ChatPage.tsx:290 — 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/features/share/ShareManagerPanel.tsx:42 — web/src/features/share/ShareManagerPanel.tsx:42 · web/src/features/share/ShareManagerPanel.tsx:57 — 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 (13 lines × 2 locations) web/src/features/share/SharePage.tsx:162 — web/src/features/share/SharePage.tsx:162 · web/src/features/share/SharePage.tsx:210 — 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 (11 lines × 2 locations) · ×5
  • Duplicated block (11 lines × 2 locations) web/scripts/stream_frontend_logic_check.ts:464 — web/scripts/stream_frontend_logic_check.ts:464 · web/scripts/stream_frontend_logic_check.ts: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.
  • Duplicated block (11 lines × 2 locations) web/src/app/store.ts:336 — web/src/app/store.ts:336 · web/src/app/store.ts:347 — 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 (11 lines × 2 locations) web/src/features/schedules/SchedulePanel.tsx:77 — web/src/features/schedules/SchedulePanel.tsx:77 · web/src/features/skills/SkillPanel.tsx:100 — 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 (11 lines × 2 locations) web/src/features/schedules/SchedulePanel.tsx:151 — web/src/features/schedules/SchedulePanel.tsx:151 · web/src/features/skills/SkillPanel.tsx:339 — 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 (11 lines × 2 locations) web/src/features/skills/SkillPanel.tsx:203 — web/src/features/skills/SkillPanel.tsx:203 · web/src/features/skills/SkillPanel.tsx:249 — 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.
AC2 · Forms & labels · <fieldset> without a <legend> · ×4
  • <fieldset> without a <legend> web/src/features/chat/openui/interaction.tsx:11 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> web/src/features/config/ConfigEditor.tsx:193 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> web/src/features/config/ConfigEditor.tsx:244 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> web/src/features/schedules/SchedulePanel.tsx:329 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×4
  • Animation without a prefers-reduced-motion guard web/src/features/chat/MessageList.tsx:394 — <i> moves — its `animate-bounce` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/src/features/chat/MessageList.tsx:395 — <i> moves — its `animate-bounce` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/src/features/chat/MessageList.tsx:396 — <i> moves — its `animate-bounce` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard web/src/styles/globals.css:295 — `.prose .markdown-footnote-ref a` moves (`transition: background-color 150ms ease, color 150ms ease, transform 150ms 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) internal/adapters/tools/builtin/script/uv/func.go:492 — internal/adapters/tools/builtin/script/uv/func.go:492-506 | internal/adapters/tools/builtin/script/uv/func.go:636-650 — 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/adapters/tools/builtin/script/uv/func.go:492` 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 (15 lines × 2) internal/adapters/transport/cli/runtime/runtime_render.go:257 — internal/adapters/transport/cli/runtime/runtime_render.go:257-271 | internal/adapters/transport/cli/tui/text_render.go:27-41 — 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 (15 lines × 2) internal/adapters/tools/builtin/script/bun/func.go:436 — internal/adapters/tools/builtin/script/bun/func.go:436-450 | internal/adapters/tools/builtin/script/uv/func.go:402-416 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (15 lines × 2) internal/adapters/transport/cli/commands/login.go:401 — internal/adapters/transport/cli/commands/login.go:401-415 | internal/adapters/transport/cli/commands/model.go:188-202 — 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 (14 lines × 2) · ×4
  • Duplicated block (14 lines × 2) internal/adapters/hooks/javascript/handler.go:65 — internal/adapters/hooks/javascript/handler.go:65-78 | internal/runtime/hooks/bus.go:140-153 — 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/adapters/hooks/javascript/handler.go:65` 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/runtime/hooks/bus.go:140` is reached only past a guard at line 129 that tests `inv.Payload` and leaves the function early, and `internal/adapters/hooks/javascript/handler.go:65` reads `inv.Payload` 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.
  • Duplicated block (14 lines × 2) internal/adapters/transport/channel/discord/discord.go:65 — internal/adapters/transport/channel/discord/discord.go:65-78 | internal/adapters/transport/channel/weixin/weixin.go:63-76 — 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/adapters/transport/channel/discord/discord.go:65` 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 `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 (14 lines × 2) internal/adapters/transport/channel/qq/qq.go:273 — internal/adapters/transport/channel/qq/qq.go:273-286 | internal/adapters/transport/channel/qq/qq.go:301-314 — 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 (14 lines × 2) internal/adapters/transport/cli/runtime/runtime_ask.go:292 — internal/adapters/transport/cli/runtime/runtime_ask.go:292-305 | internal/adapters/transport/cli/runtime/runtime_update.go:199-212 — 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.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×4
  • Duplicated block (12 lines × 2 locations) web/src/features/config/AgentEditors.tsx:338 — web/src/features/config/AgentEditors.tsx:338 · web/src/features/config/IntegrationEditors.tsx:31 — 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) web/src/features/schedules/SchedulePanel.tsx:267 — web/src/features/schedules/SchedulePanel.tsx:267 · web/src/features/schedules/SchedulePanel.tsx:282 — 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) web/src/features/share/ShareManagerPanel.tsx:83 — web/src/features/share/ShareManagerPanel.tsx:83 · web/src/features/share/ShareManagerPanel.tsx:96 — 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 (12 lines × 2 locations) web/src/features/skills/SkillPanel.tsx:184 — web/src/features/skills/SkillPanel.tsx:184 · web/src/features/skills/SkillPanel.tsx:213 — 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.
AC6 · Visual & motion safety · Focus outline removed inline · ×3
  • Focus outline removed inline web/src/components/layout/Sidebar.tsx:352 — <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/features/chat/ChatComposer.tsx:342 — <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/src/features/chat/ChatComposer.tsx:768 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×3
  • Edited copy of a member (34 corresponding lines) internal/adapters/transport/cli/update/zip.go:97 — internal/adapters/transport/cli/update/zip.go:97-130 | internal/app/skill/install.go:169-204 — 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.
  • Edited copy of a member (34 corresponding lines) internal/adapters/transport/http/handler/stream.go:330 — internal/adapters/transport/http/handler/stream.go:330-363 | internal/adapters/transport/http/handler/stream.go:367-405 — 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.
  • Edited copy of a member (34 corresponding lines) internal/adapters/model/providers/providers.go:19 — internal/adapters/model/providers/providers.go:19-55 | internal/runtime/model/model.go:13-46 — 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 (30 corresponding lines) · ×3
  • Edited copy of a member (30 corresponding lines) internal/adapters/scheduler/filecron/scheduler.go:1122 — internal/adapters/scheduler/filecron/scheduler.go:1122-1156 | internal/app/skill/export.go:398-427 — These two members are one piece of code written twice and then edited apart: 30 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 (30 corresponding lines) internal/adapters/transport/cli/commands/serve.go:13 — internal/adapters/transport/cli/commands/serve.go:13-42 | internal/adapters/transport/cli/commands/web.go:13-42 — These two members are one piece of code written twice and then edited apart: 30 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 (30 corresponding lines) internal/adapters/transport/cli/runtime/runtime_history.go:461 — internal/adapters/transport/cli/runtime/runtime_history.go:461-490 | internal/adapters/transport/cli/runtime/runtime_history.go:700-729 — These two members are one piece of code written twice and then edited apart: 30 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 (18 corresponding lines) · ×3
  • Edited copy of a member (18 corresponding lines) internal/adapters/transport/http/handler/skills.go:150 — internal/adapters/transport/http/handler/skills.go:150-168 | internal/adapters/transport/http/handler/skills.go:171-188 — 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:137 — REDACTED:137-154 | REDACTED:157-174 — 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/adapters/tools/builtin/doc/func.go:334 — internal/adapters/tools/builtin/doc/func.go:334-351 | internal/adapters/transport/cli/update/update.go:340-357 — 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 (13 corresponding lines) · ×3
  • Edited copy of a member (13 corresponding lines) internal/adapters/transport/cli/runtime/runtime_picker.go:161 — internal/adapters/transport/cli/runtime/runtime_picker.go:161-173 | internal/adapters/transport/cli/tui/select.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/adapters/transport/cli/tui/markdown.go:543 — internal/adapters/transport/cli/tui/markdown.go:543-555 | internal/adapters/transport/cli/tui/runtime_widgets.go:120-136 — 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/adapters/storage/file/share/preview.go:103 — internal/adapters/storage/file/share/preview.go:103-115 | internal/adapters/storage/file/share/session.go:125-140 — 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 · Edited copy of a member (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) internal/adapters/model/providers/providerkit/config.go:82 — internal/adapters/model/providers/providerkit/config.go:82-93 | internal/adapters/transport/http/handler/openai_api.go:189-200 — 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/bootstrap/tools/javascript.go:130 — internal/bootstrap/tools/javascript.go:130-141 | internal/adapters/transport/http/handler/javascript.go:113-124 — 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/adapters/tools/builtin/script/bun/func.go:135 — internal/adapters/tools/builtin/script/bun/func.go:135-147 | internal/adapters/tools/builtin/script/uv/func.go:156-167 — 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 (10 corresponding lines) · ×3
  • Edited copy of a member (10 corresponding lines) internal/adapters/transport/http/handler/session.go:35 — internal/adapters/transport/http/handler/session.go:35-44 | internal/adapters/transport/http/handler/session.go:47-56 — 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/adapters/tools/workspace/fs.go:22 — internal/adapters/tools/workspace/fs.go:22-35 | internal/adapters/tools/builtin/doc/func.go:381-390 — 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/adapters/transport/channel/qq/session.go:164 — internal/adapters/transport/channel/qq/session.go:164-176 | REDACTED:735-744 — 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 (6 lines × 2) · ×3
  • Duplicated block (6 lines × 2) internal/adapters/transport/http/handler/aiassist.go:176 — internal/adapters/transport/http/handler/aiassist.go:176-182 | internal/adapters/transport/http/handler/javascript.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 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 (6 lines × 2) internal/adapters/transport/cli/tui/markdown.go:25 — internal/adapters/transport/cli/tui/markdown.go:25-30 | internal/adapters/transport/cli/tui/panel_render.go:27-32 — 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 (6 lines × 2) internal/adapters/transport/cli/eventview/print_markdown.go:210 — internal/adapters/transport/cli/eventview/print_markdown.go:210-215 | internal/adapters/transport/cli/eventview/print_markdown.go:246-251 — 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/adapters/transport/cli/eventview/print_markdown.go:210` 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 (17 lines × 2 locations) · ×3
  • Duplicated block (17 lines × 2 locations) web/scripts/stream_frontend_logic_check.ts:188 — web/scripts/stream_frontend_logic_check.ts:188 · web/src/api/stream.ts:112 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (17 lines × 2 locations) web/src/components/layout/Sidebar.tsx:508 — web/src/components/layout/Sidebar.tsx:508 · web/src/features/share/ShareManagerPanel.tsx:459 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (17 lines × 2 locations) web/src/features/schedules/SchedulePanel.tsx:506 — web/src/features/schedules/SchedulePanel.tsx:506 · web/src/features/skills/SkillPanel.tsx:676 — 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.
X2 · Cancellation propagation · Async function without AbortSignal · ×3
  • Async function without AbortSignal: clearServerAuthentication web/src/lib/auth-session.ts:12 — `clearServerAuthentication` 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: request web/src/api/client.ts:19 — `request` 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: post web/scripts/stream_frontend_logic_check.ts:141 — `post` 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 })`.
X3 · Exception handling · Swallowed exception (empty catch) · ×3
  • Swallowed exception (empty catch) web/src/features/schedules/ScheduleNotifications.tsx:15 — 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/layout/useSidebarResize.ts:13 — 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/layout/useSidebarResize.ts:32 — 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.
D17 · Explicit Debt · TodoComment · ×2
  • TodoComment internal/runtime/toolpolicy/policy.go:92 — // TODO 工具 — 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/adapters/tools/builtin/todo/func.go:27 — // Todo 待办事项结构 — 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • Edited copy of a member (22 corresponding lines) internal/adapters/tools/builtin/script/bun/func.go:36 — internal/adapters/tools/builtin/script/bun/func.go:36-67 | internal/adapters/tools/builtin/script/uv/func.go:35-69 — 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.
  • Edited copy of a member (22 corresponding lines) internal/adapters/transport/cli/runtime/runtime_markdown.go:97 — internal/adapters/transport/cli/runtime/runtime_markdown.go:97-118 | internal/adapters/transport/cli/runtime/runtime_markdown.go:120-141 — 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/adapters/transport/http/handler/http_chat.go:36 — internal/adapters/transport/http/handler/http_chat.go:36-132 | internal/adapters/transport/http/handler/stream.go:37-180 | internal/adapters/transport/http/handler/stream.go:196-236 | internal/adapters/transport/http/handler/stream.go:261-291 — 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) REDACTED:206 — REDACTED:206-285 | REDACTED:315-344 | REDACTED:347-431 | REDACTED:636-715 — 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 (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) internal/adapters/transport/http/handler/files.go:124 — internal/adapters/transport/http/handler/files.go:124-167 | internal/adapters/transport/http/handler/files.go:169-209 — 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.
  • Edited copy of a member (41 corresponding lines) internal/adapters/storage/file/share/preview.go:46 — internal/adapters/storage/file/share/preview.go:46-86 | internal/adapters/storage/file/share/session.go:61-108 — 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 (43 corresponding lines) · ×2
  • Edited copy of a member (43 corresponding lines) internal/adapters/tools/builtin/excel/batch.go:567 — internal/adapters/tools/builtin/excel/batch.go:567-610 | internal/adapters/tools/builtin/excel/data.go:570-612 — These two members are one piece of code written twice and then edited apart: 43 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 (43 corresponding lines) internal/adapters/tools/builtin/excel/batch.go:431 — internal/adapters/tools/builtin/excel/batch.go:431-480 | internal/adapters/tools/builtin/excel/data.go:449-491 — These two members are one piece of code written twice and then edited apart: 43 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 (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) internal/adapters/environment/bun.go:19 — internal/adapters/environment/bun.go:19-53 | internal/adapters/environment/uv.go:19-53 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) internal/adapters/tools/builtin/file/func.go:355 — internal/adapters/tools/builtin/file/func.go:355-390 | internal/adapters/tools/builtin/file/func.go:406-440 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) internal/adapters/transport/channel/qq/qq.go:265 — internal/adapters/transport/channel/qq/qq.go:265-290 | internal/adapters/transport/channel/qq/qq.go:293-318 — 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/adapters/transport/channel/discord/discord.go:380 — internal/adapters/transport/channel/discord/discord.go:380-405 | internal/adapters/transport/channel/weixin/weixin.go:297-330 — 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 (28 corresponding lines) · ×2
  • Edited copy of a member (28 corresponding lines) internal/adapters/transport/http/handler/stream.go:760 — internal/adapters/transport/http/handler/stream.go:760-787 | internal/adapters/transport/http/handler/stream.go:791-825 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) internal/adapters/tools/builtin/ssh/func.go:141 — internal/adapters/tools/builtin/ssh/func.go:141-168 | internal/adapters/tools/builtin/ssh/func.go:184-211 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) internal/adapters/tools/builtin/file/func.go:38 — internal/adapters/tools/builtin/file/func.go:38-67 | internal/adapters/tools/builtin/git/func.go:29-51 — These two members are one piece of code written twice and then edited apart: 23 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 (23 corresponding lines) internal/adapters/transport/cli/tui/ask.go:364 — internal/adapters/transport/cli/tui/ask.go:364-388 | internal/adapters/transport/cli/tui/prompt.go:45-67 — These two members are one piece of code written twice and then edited apart: 23 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, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) internal/adapters/runtime/agentkit/middlewares/tools/warperror/warperror.go:61 — internal/adapters/runtime/agentkit/middlewares/tools/warperror/warperror.go:61-74 | internal/adapters/runtime/agentkit/middlewares/tools/warperror/warperror.go:76-91 | internal/adapters/runtime/agentkit/middlewares/tools/warperror/warperror.go:93-110 — 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.
  • Edited copies of one member (3 members, 14+ corresponding lines) internal/adapters/transport/cli/runtime/runtime_picker.go:95 — internal/adapters/transport/cli/runtime/runtime_picker.go:95-108 | internal/adapters/transport/cli/runtime/runtime_picker.go:110-123 | internal/adapters/transport/cli/runtime/runtime_picker.go:125-141 — 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 · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) internal/adapters/model/providers/providers.go:19 — internal/adapters/model/providers/providers.go:19-41 | internal/runtime/model/model.go:13-35 — before extracting anything, compare `internal/adapters/model/providers/providers.go` and `internal/runtime/model/model.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) internal/adapters/transport/cli/eventview/print_stream.go:254 — internal/adapters/transport/cli/eventview/print_stream.go:254-276 | internal/adapters/transport/cli/tui/panel_render.go:67-89 — 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) internal/adapters/tools/builtin/script/bun/func.go:38 — internal/adapters/tools/builtin/script/bun/func.go:38-54 | internal/adapters/tools/builtin/script/uv/func.go:37-53 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (17 lines × 2) internal/adapters/transport/http/handler/http_chat.go:40 — internal/adapters/transport/http/handler/http_chat.go:40-56 | internal/adapters/transport/http/handler/stream.go:41-57 — 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/adapters/transport/http/handler/http_chat.go:40` 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 (12 lines × 3) · ×2
  • Duplicated block (12 lines × 3) internal/adapters/transport/cli/runtime/runtime_ask.go:293 — internal/adapters/transport/cli/runtime/runtime_ask.go:293-304 | internal/adapters/transport/cli/runtime/runtime_update.go:200-211 | internal/adapters/transport/cli/runtime/runtime_update.go:268-279 — 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/adapters/transport/cli/runtime/runtime_ask.go:293` 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 (12 lines × 3) internal/adapters/transport/http/handler/stream.go:209 — internal/adapters/transport/http/handler/stream.go:209-220 | internal/adapters/transport/http/handler/stream.go:768-779 | internal/adapters/transport/http/handler/stream.go:801-812 — 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/adapters/transport/http/handler/stream.go:209` 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 (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) internal/adapters/storage/file/history/history_record.go:103 — internal/adapters/storage/file/history/history_record.go:103-113 | internal/adapters/storage/file/history/history_record.go:135-145 | internal/adapters/storage/file/history/history_record.go:837-847 — 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/adapters/storage/file/history/history_record.go:103` 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 × 3) internal/adapters/tools/builtin/script/bun/func.go:524 — internal/adapters/tools/builtin/script/bun/func.go:524-534 | internal/adapters/tools/builtin/script/uv/func.go:499-509 | internal/adapters/tools/builtin/script/uv/func.go:643-653 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/adapters/tools/builtin/script/bun/func.go:524` 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 lines × 2) · ×2
  • Duplicated block (9 lines × 2) internal/adapters/storage/file/history/history_record.go:365 — internal/adapters/storage/file/history/history_record.go:365-373 | internal/adapters/storage/file/history/history_record.go:768-776 — 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) internal/adapters/transport/http/handler/files.go:592 — internal/adapters/transport/http/handler/files.go:592-601 | internal/adapters/transport/http/handler/files.go:1581-1589 — 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/adapters/transport/http/handler/files.go:592` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: Runtime (LCOM4 46) internal/adapters/transport/http/handler/runtime.go:32 — Runtime's methods fall into 46 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 46 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 4) internal/app/config/config.go:432 — Config's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×2
  • Duplicated block (15 lines × 2 locations) web/src/features/schedules/SchedulePanel.tsx:98 — web/src/features/schedules/SchedulePanel.tsx:98 · web/src/features/schedules/SchedulePanel.tsx:143 — 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/features/schedules/SchedulePanel.tsx:465 — web/src/features/schedules/SchedulePanel.tsx:465 · web/src/features/skills/SkillPanel.tsx:602 — 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 (14 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (14 matched lines × 2 locations) web/scripts/stream_frontend_logic_check.ts:229 — web/scripts/stream_frontend_logic_check.ts:229 · web/src/app/store.ts:205 — the two spans are one implementation copied and then locally edited — 88 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (14 matched lines × 2 locations) web/src/features/config/AgentEditors.tsx:664 — web/src/features/config/AgentEditors.tsx:664 · web/src/features/config/ConfigFields.tsx:71 — the two spans are one implementation copied and then locally edited — 88 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 (14 lines × 2 locations) · ×2
  • Duplicated block (14 lines × 2 locations) web/src/features/schedules/SchedulePanel.tsx:606 — web/src/features/schedules/SchedulePanel.tsx:606 · web/src/features/skills/SkillPanel.tsx:945 — the 2 copies are spread across 2 files, 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 (14 lines × 2 locations) web/src/features/share/ShareManagerPanel.tsx:346 — web/src/features/share/ShareManagerPanel.tsx:346 · web/src/features/share/ShareManagerPanel.tsx:443 — 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.
AC1 · Text alternatives · <video> without a captions track · ×1
  • <video> without a captions track REDACTED:390 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement web/src/styles/globals.css:589 — `.prose .markdown-code-copy[data-copied="true"]` 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.
AXI1 · Runtime container hardening · Container process runs as root · ×1
  • Container process runs as root: fkteams — 'fkteams' (fkteams/fkteams:latest) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
D1 · Cyclomatic Complexity · eventview.newPrintEvent (cyclomatic 154) · ×1
  • eventview.newPrintEvent (cyclomatic 154) internal/adapters/transport/cli/eventview/print.go:75 — eventview.newPrintEvent has cyclomatic complexity 154 (threshold 15). Most of this is not in the body itself: 1 of the 154 points is its own statement and the rest belongs to 21 function literals inside it that branch (lines 381, 198, 238, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · runtimeModel.Update (cyclomatic 97) · ×1
  • runtimeModel.Update (cyclomatic 97) internal/adapters/transport/cli/runtime/runtime_update.go:24 — runtimeModel.Update has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatComposer.ChatComposer (cyclomatic 96) · ×1
  • ChatComposer.ChatComposer (cyclomatic 96) web/src/features/chat/ChatComposer.tsx:53 — ChatComposer.ChatComposer has cyclomatic complexity 96 (threshold 15). Of this number, 34 points are the body's own statements and 62 belong to 26 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Projector.Apply (cyclomatic 88) · ×1
  • Projector.Apply (cyclomatic 88) internal/app/chat/presentation/projector.go:70 — Projector.Apply has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SkillPanel.SkillPanel (cyclomatic 85) · ×1
  • SkillPanel.SkillPanel (cyclomatic 85) web/src/features/skills/SkillPanel.tsx:50 — SkillPanel.SkillPanel has cyclomatic complexity 85 (threshold 15). Of this number, 19 points are the body's own statements and 66 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 · ChatInput.ChatInput (cyclomatic 78) · ×1
  • ChatInput.ChatInput (cyclomatic 78) web/src/features/chat/ChatInput.tsx:22 — ChatInput.ChatInput has cyclomatic complexity 78 (threshold 15). Most of this is not in the body itself: 14 of the 78 points are its own statements and the rest belongs to 15 function items inside it that branch (addAttachments, submit, confirmCommand, …). 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 · HistoryRecorder.RecordEvent (cyclomatic 69) · ×1
  • HistoryRecorder.RecordEvent (cyclomatic 69) internal/adapters/storage/file/history/history_record.go:591 — HistoryRecorder.RecordEvent has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · taskstream.RuntimeEventPayload (cyclomatic 58) · ×1
  • taskstream.RuntimeEventPayload (cyclomatic 58) internal/app/chat/taskstream/protocol.go:17 — taskstream.RuntimeEventPayload has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chat.agentMessageToCoreMessages (cyclomatic 51) · ×1
  • chat.agentMessageToCoreMessages (cyclomatic 51) internal/app/chat/input.go:232 — chat.agentMessageToCoreMessages has cyclomatic complexity 51 (threshold 15). Of this number, 47 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 · Sidebar.Sidebar (cyclomatic 47) · ×1
  • Sidebar.Sidebar (cyclomatic 47) web/src/components/layout/Sidebar.tsx:56 — Sidebar.Sidebar has cyclomatic complexity 47 (threshold 15). Of this number, 21 points are the body's own statements and 26 belong to 11 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Service.Save (cyclomatic 44) · ×1
  • Service.Save (cyclomatic 44) internal/app/task/service.go:97 — Service.Save has cyclomatic complexity 44 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ShareManagerPanel.ShareManagerPanel (cyclomatic 44) · ×1
  • ShareManagerPanel.ShareManagerPanel (cyclomatic 44) web/src/features/share/ShareManagerPanel.tsx:31 — ShareManagerPanel.ShareManagerPanel has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 3 of the 44 points are its own statements and the rest belongs to 13 function items inside it that branch (load, confirmDelete, confirmDeleteFile, …). 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 · GitTools.GitDiff (cyclomatic 42) · ×1
  • GitTools.GitDiff (cyclomatic 42) internal/adapters/tools/builtin/git/diff.go:52 — GitTools.GitDiff 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 · memberModel.applyEvent (cyclomatic 42) · ×1
  • memberModel.applyEvent (cyclomatic 42) internal/adapters/transport/cli/tui/member_panel.go:71 — memberModel.applyEvent 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 · Runtime.UploadChunkHandler (cyclomatic 42) · ×1
  • Runtime.UploadChunkHandler (cyclomatic 42) internal/adapters/transport/http/handler/files.go:963 — Runtime.UploadChunkHandler has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to one function literal inside it that branches (line 964). 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 · events.ValidateEventContract (cyclomatic 42) · ×1
  • events.ValidateEventContract (cyclomatic 42) internal/runtime/events/protocol.go:59 — events.ValidateEventContract 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 · events.decodeChatEvent (cyclomatic 42) · ×1
  • events.decodeChatEvent (cyclomatic 42) web/src/types/events.ts:177 — events.decodeChatEvent 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 · SchedulePanel.SchedulePanel (cyclomatic 41) · ×1
  • SchedulePanel.SchedulePanel (cyclomatic 41) web/src/features/schedules/SchedulePanel.tsx:44 — SchedulePanel.SchedulePanel has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 12 function items inside it that branch (showDetail, saveTask, confirmRemove, …). 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 · FileManager.FileManager (cyclomatic 39) · ×1
  • FileManager.FileManager (cyclomatic 39) REDACTED:42 — FileManager.FileManager has cyclomatic complexity 39 (threshold 15). Of this number, 17 points are the body's own statements and 22 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MigrationGate.MigrationGate (cyclomatic 39) · ×1
  • MigrationGate.MigrationGate (cyclomatic 39) web/src/features/migration/MigrationGate.tsx:9 — MigrationGate.MigrationGate has cyclomatic complexity 39 (threshold 15). Of this number, 28 points are the body's own statements and 11 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.Execute (cyclomatic 38) · ×1
  • Service.Execute (cyclomatic 38) internal/app/process/service.go:149 — Service.Execute has cyclomatic complexity 38 (threshold 15). Of this number, 33 points are the body's own statements and 5 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 · HistoryRecorder.recordTranscript (cyclomatic 37) · ×1
  • HistoryRecorder.recordTranscript (cyclomatic 37) internal/adapters/storage/file/history/history_record.go:258 — HistoryRecorder.recordTranscript 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 · Manager.SaveEntry (cyclomatic 37) · ×1
  • Manager.SaveEntry (cyclomatic 37) internal/app/memory/editor.go:36 — Manager.SaveEntry has cyclomatic complexity 37 (threshold 15). Of this number, 35 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 · AgentEditors.AgentDraftDialog (cyclomatic 37) · ×1
  • AgentEditors.AgentDraftDialog (cyclomatic 37) web/src/features/config/AgentEditors.tsx:653 — AgentEditors.AgentDraftDialog has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 13 of the 37 points are its own statements and the rest belongs to 7 function items inside it that branch (generate, a function literal at line 755, 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 · AssistantUIContent.InteractiveBlock (cyclomatic 36) · ×1
  • AssistantUIContent.InteractiveBlock (cyclomatic 36) web/src/features/chat/openui/AssistantUIContent.tsx:25 — AssistantUIContent.InteractiveBlock has cyclomatic complexity 36 (threshold 15). Of this number, 22 points are the body's own statements and 14 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MessageList.AskPanel (cyclomatic 36) · ×1
  • MessageList.AskPanel (cyclomatic 36) web/src/features/chat/MessageList.tsx:1083 — MessageList.AskPanel has cyclomatic complexity 36 (threshold 15). Of this number, 19 points are the body's own statements and 17 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IntegrationEditors.JavaScriptTab (cyclomatic 35) · ×1
  • IntegrationEditors.JavaScriptTab (cyclomatic 35) web/src/features/config/IntegrationEditors.tsx:145 — IntegrationEditors.JavaScriptTab has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 10 of the 35 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 197, a function literal at line 152, a function literal at line 174, …). 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 · PreviewPage.PreviewPage (cyclomatic 34) · ×1
  • PreviewPage.PreviewPage (cyclomatic 34) web/src/features/preview/PreviewPage.tsx:7 — PreviewPage.PreviewPage has cyclomatic complexity 34 (threshold 15). Of this number, 24 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 · Source.Prepare (cyclomatic 33) · ×1
  • Source.Prepare (cyclomatic 33) internal/adapters/storage/migration/source.go:34 — Source.Prepare has cyclomatic complexity 33 (threshold 15). Of this number, 28 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtimeModel.applyEvent (cyclomatic 33) · ×1
  • runtimeModel.applyEvent (cyclomatic 33) internal/adapters/transport/cli/runtime/runtime_events.go:21 — runtimeModel.applyEvent 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 · stream_frontend_logic_check.analyzeEvents (cyclomatic 33) · ×1
  • stream_frontend_logic_check.analyzeEvents (cyclomatic 33) web/scripts/stream_frontend_logic_check.ts:247 — stream_frontend_logic_check.analyzeEvents has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · commands.runChat (cyclomatic 32) · ×1
  • commands.runChat (cyclomatic 32) internal/adapters/transport/cli/commands/chat.go:24 — commands.runChat has cyclomatic complexity 32 (threshold 15). Of this number, 17 points are the body's own statements and 15 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 · events.NormalizeFriendlyError (cyclomatic 32) · ×1
  • events.NormalizeFriendlyError (cyclomatic 32) internal/runtime/events/friendly_error.go:13 — events.NormalizeFriendlyError has cyclomatic complexity 32 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · mdiff.buildHunks (cyclomatic 32) · ×1
  • mdiff.buildHunks (cyclomatic 32) internal/runtime/mdiff/format.go:78 — mdiff.buildHunks 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 · MemoryPanel.MemoryPanel (cyclomatic 32) · ×1
  • MemoryPanel.MemoryPanel (cyclomatic 32) web/src/features/memory/MemoryPanel.tsx:18 — MemoryPanel.MemoryPanel has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 14 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (remove, a function literal at line 60, save, …). 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 · eventview.formatTodoResult (cyclomatic 31) · ×1
  • eventview.formatTodoResult (cyclomatic 31) internal/adapters/transport/cli/eventview/print_format.go:306 — eventview.formatTodoResult has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Service.RunQueued (cyclomatic 31) · ×1
  • Service.RunQueued (cyclomatic 31) internal/app/chat/queue.go:30 — Service.RunQueued has cyclomatic complexity 31 (threshold 15). Of this number, 23 points are the body's own statements and 8 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 · AgentEditors.AgentsTab (cyclomatic 31) · ×1
  • AgentEditors.AgentsTab (cyclomatic 31) web/src/features/config/AgentEditors.tsx:286 — AgentEditors.AgentsTab has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 5 of the 31 points are its own statements and the rest belongs to 9 function items inside it that branch (buildAgentsDraft, duplicateBuiltinAgent, a function literal at line 382, …). 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 · ChatPage.QuestionNavigator (cyclomatic 30) · ×1
  • ChatPage.QuestionNavigator (cyclomatic 30) web/src/features/chat/ChatPage.tsx:134 — ChatPage.QuestionNavigator has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 162, 144, 187, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.save (cyclomatic 29) · ×1
  • Store.save (cyclomatic 29) internal/adapters/storage/file/queue/store.go:68 — Store.save 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 · runtimeModel.handleSubmit (cyclomatic 29) · ×1
  • runtimeModel.handleSubmit (cyclomatic 29) internal/adapters/transport/cli/runtime/runtime_input.go:126 — runtimeModel.handleSubmit 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 · askModel.Update (cyclomatic 29) · ×1
  • askModel.Update (cyclomatic 29) internal/adapters/transport/cli/tui/ask.go:74 — askModel.Update 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 · eventlog.projectTranscriptEvents (cyclomatic 28) · ×1
  • eventlog.projectTranscriptEvents (cyclomatic 28) internal/adapters/storage/file/history/history_persist.go:115 — eventlog.projectTranscriptEvents has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · memory.loadMarkdownFile (cyclomatic 28) · ×1
  • memory.loadMarkdownFile (cyclomatic 28) internal/adapters/storage/file/memory/store.go:131 — memory.loadMarkdownFile 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 · Runtime.WebSocketHandlerWithState (cyclomatic 28) · ×1
  • Runtime.WebSocketHandlerWithState (cyclomatic 28) internal/adapters/transport/http/handler/websocket.go:55 — Runtime.WebSocketHandlerWithState has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to one function literal inside it that branches (line 56). 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 · ConfigFields.ToolSelectField (cyclomatic 27) · ×1
  • ConfigFields.ToolSelectField (cyclomatic 27) web/src/features/config/ConfigFields.tsx:118 — ConfigFields.ToolSelectField has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 216, a function literal at line 173, a function literal at line 135, …). 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 · autocontinue.repairJSON (cyclomatic 26) · ×1
  • autocontinue.repairJSON (cyclomatic 26) internal/adapters/runtime/agentkit/middlewares/autocontinue/repair.go:6 — autocontinue.repairJSON 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 · Database.Import (cyclomatic 26) · ×1
  • Database.Import (cyclomatic 26) internal/adapters/storage/sqlite/migration.go:26 — Database.Import 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 · TodoTools.TodoUpdate (cyclomatic 26) · ×1
  • TodoTools.TodoUpdate (cyclomatic 26) internal/adapters/tools/builtin/todo/func.go:354 — TodoTools.TodoUpdate 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 · auth.Login (cyclomatic 26) · ×1
  • auth.Login (cyclomatic 26) internal/adapters/transport/channel/weixin/sdk/auth/login.go:134 — auth.Login 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 · Updater.Apply (cyclomatic 26) · ×1
  • Updater.Apply (cyclomatic 26) internal/adapters/transport/cli/update/update.go:99 — Updater.Apply has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 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 · select.Select · ×1
  • select.Select::handleKeyDown (cyclomatic 26) web/src/components/ui/select.tsx:58 — select.Select::handleKeyDown 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 · LocalBackend.GrepRaw (cyclomatic 25) · ×1
  • LocalBackend.GrepRaw (cyclomatic 25) internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:167 — LocalBackend.GrepRaw has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 201). 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 · migration.validateBackup (cyclomatic 25) · ×1
  • migration.validateBackup (cyclomatic 25) internal/adapters/storage/migration/validate.go:20 — migration.validateBackup 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 · command.splitShellCommands (cyclomatic 25) · ×1
  • command.splitShellCommands (cyclomatic 25) internal/adapters/tools/builtin/command/security.go:153 — command.splitShellCommands has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · GitTools.GitConfig (cyclomatic 25) · ×1
  • GitTools.GitConfig (cyclomatic 25) internal/adapters/tools/builtin/git/config.go:31 — GitTools.GitConfig 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 · commands.switchModel (cyclomatic 25) · ×1
  • commands.switchModel (cyclomatic 25) internal/adapters/transport/cli/commands/model.go:238 — commands.switchModel 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 · handler.UploadFileHandler (cyclomatic 25) · ×1
  • handler.UploadFileHandler (cyclomatic 25) internal/adapters/transport/http/handler/files.go:631 — handler.UploadFileHandler has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to one function literal inside it that branches (line 632). 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 · Runtime.UpdateConfigHandlerWithState (cyclomatic 25) · ×1
  • Runtime.UpdateConfigHandlerWithState (cyclomatic 25) internal/adapters/transport/http/handler/config.go:80 — Runtime.UpdateConfigHandlerWithState has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to one function literal inside it that branches (line 81). 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 · ToolCallCard.ToolCallCard (cyclomatic 25) · ×1
  • ToolCallCard.ToolCallCard (cyclomatic 25) web/src/features/chat/ToolCallCard.tsx:7 — ToolCallCard.ToolCallCard has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ConfigPanel.ConfigPanel (cyclomatic 25) · ×1
  • ConfigPanel.ConfigPanel (cyclomatic 25) web/src/features/config/ConfigPanel.tsx:36 — ConfigPanel.ConfigPanel has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 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 · SharePage.SharePage (cyclomatic 25) · ×1
  • SharePage.SharePage (cyclomatic 25) web/src/features/share/SharePage.tsx:13 — SharePage.SharePage has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 25, a function literal at line 22, 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 · ExecutionDependencies.prepareStorage (cyclomatic 24) · ×1
  • ExecutionDependencies.prepareStorage (cyclomatic 24) internal/bootstrap/storage.go:24 — ExecutionDependencies.prepareStorage has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mdiff.Diff (cyclomatic 24) · ×1
  • mdiff.Diff (cyclomatic 24) internal/runtime/mdiff/diff.go:27 — mdiff.Diff has cyclomatic complexity 24 (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 · store.applyChatEvent (cyclomatic 24) · ×1
  • store.applyChatEvent (cyclomatic 24) web/src/app/store.ts:187 — store.applyChatEvent 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 · TaskStreamController.followTaskStream (cyclomatic 24) · ×1
  • TaskStreamController.followTaskStream (cyclomatic 24) web/src/features/chat/TaskStreamController.tsx:85 — TaskStreamController.followTaskStream has cyclomatic complexity 24 (threshold 15). Of this number, 18 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 · IntegrationEditors.JavaScriptAIDialog (cyclomatic 24) · ×1
  • IntegrationEditors.JavaScriptAIDialog (cyclomatic 24) web/src/features/config/IntegrationEditors.tsx:526 — IntegrationEditors.JavaScriptAIDialog has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 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 · SkillPanel.SkillDetail (cyclomatic 24) · ×1
  • SkillPanel.SkillDetail (cyclomatic 24) web/src/features/skills/SkillPanel.tsx:640 — SkillPanel.SkillDetail has cyclomatic complexity 24 (threshold 15). Of this number, 18 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 · Tools.snapshot (cyclomatic 23) · ×1
  • Tools.snapshot (cyclomatic 23) internal/adapters/tools/builtin/doc/func.go:392 — Tools.snapshot 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 · Channel.Start (cyclomatic 23) · ×1
  • Channel.Start (cyclomatic 23) internal/adapters/transport/channel/discord/discord.go:84 — Channel.Start has cyclomatic complexity 23 (threshold 15). 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: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · eventview.NewMarkdownCollector (cyclomatic 23) · ×1
  • eventview.NewMarkdownCollector (cyclomatic 23) internal/adapters/transport/cli/eventview/print_markdown.go:15 — eventview.NewMarkdownCollector has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 29, 22, 94). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · middleware.Auth (cyclomatic 23) · ×1
  • middleware.Auth (cyclomatic 23) internal/adapters/transport/http/middleware/auth.go:14 — middleware.Auth has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to one function literal inside it that branches (line 15). 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 · common.resolveMiddlewares (cyclomatic 23) · ×1
  • common.resolveMiddlewares (cyclomatic 23) internal/app/agent/catalog/common/definition.go:124 — common.resolveMiddlewares 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 · SkillPanel.CreateSkillDialog (cyclomatic 23) · ×1
  • SkillPanel.CreateSkillDialog (cyclomatic 23) web/src/features/skills/SkillPanel.tsx:822 — SkillPanel.CreateSkillDialog has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · agentkit.NewDeepAgent (cyclomatic 22) · ×1
  • agentkit.NewDeepAgent (cyclomatic 22) internal/adapters/runtime/agentkit/deep.go:18 — agentkit.NewDeepAgent has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Runner.Run (cyclomatic 22) · ×1
  • Runner.Run (cyclomatic 22) internal/adapters/runtime/agentkit/runner.go:28 — Runner.Run 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 · handler.OpenAIChatCompletionsHandler (cyclomatic 22) · ×1
  • handler.OpenAIChatCompletionsHandler (cyclomatic 22) internal/adapters/transport/http/handler/openai_api.go:52 — handler.OpenAIChatCompletionsHandler has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 53). 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 · Config.ValidateJavaScript (cyclomatic 22) · ×1
  • Config.ValidateJavaScript (cyclomatic 22) internal/app/config/config.go:524 — Config.ValidateJavaScript 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 · tools.RegisterWithProcesses (cyclomatic 22) · ×1
  • tools.RegisterWithProcesses (cyclomatic 22) internal/bootstrap/tools/tools.go:58 — tools.RegisterWithProcesses has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 297, 335, 116, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · stream_frontend_logic_check.analyzeMemberCompletedText (cyclomatic 22) · ×1
  • stream_frontend_logic_check.analyzeMemberCompletedText (cyclomatic 22) web/scripts/stream_frontend_logic_check.ts:430 — stream_frontend_logic_check.analyzeMemberCompletedText 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 · configModel.normalizeConfig (cyclomatic 22) · ×1
  • configModel.normalizeConfig (cyclomatic 22) web/src/features/config/configModel.ts:147 — configModel.normalizeConfig has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ConfigEditor.ConfigEditingProvider (cyclomatic 22) · ×1
  • ConfigEditor.ConfigEditingProvider (cyclomatic 22) web/src/features/config/ConfigEditor.tsx:29 — ConfigEditor.ConfigEditingProvider has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 6 function items inside it that branch (begin, confirmRemove, confirm, …). 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 · Scheduler.ListHistoryEntries (cyclomatic 21) · ×1
  • Scheduler.ListHistoryEntries (cyclomatic 21) internal/adapters/scheduler/filecron/scheduler.go:946 — Scheduler.ListHistoryEntries 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 · eventview.formatSSHResult (cyclomatic 21) · ×1
  • eventview.formatSSHResult (cyclomatic 21) internal/adapters/transport/cli/eventview/print_format.go:225 — eventview.formatSSHResult 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 · QueryExecutor.Execute (cyclomatic 21) · ×1
  • QueryExecutor.Execute (cyclomatic 21) internal/adapters/transport/cli/runtime/query.go:250 — QueryExecutor.Execute has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Runtime.StreamStartHandlerWithState (cyclomatic 21) · ×1
  • Runtime.StreamStartHandlerWithState (cyclomatic 21) internal/adapters/transport/http/handler/stream.go:37 — Runtime.StreamStartHandlerWithState has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 38). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Runtime.StreamSubscribeHandler (cyclomatic 21) · ×1
  • Runtime.StreamSubscribeHandler (cyclomatic 21) internal/adapters/transport/http/handler/stream.go:505 — Runtime.StreamSubscribeHandler has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 506). 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 · mdiff.parseHunk (cyclomatic 21) · ×1
  • mdiff.parseHunk (cyclomatic 21) internal/runtime/mdiff/parse.go:130 — mdiff.parseHunk 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 · mdiff.applyHunksForward (cyclomatic 21) · ×1
  • mdiff.applyHunksForward (cyclomatic 21) internal/runtime/mdiff/patch.go:80 — mdiff.applyHunksForward 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 · mdiff.ApplyMultiFileDiff (cyclomatic 21) · ×1
  • mdiff.ApplyMultiFileDiff (cyclomatic 21) internal/runtime/mdiff/patch.go:420 — mdiff.ApplyMultiFileDiff 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 · SessionShareDialog.SessionShareDialog (cyclomatic 21) · ×1
  • SessionShareDialog.SessionShareDialog (cyclomatic 21) web/src/components/layout/SessionShareDialog.tsx:25 — SessionShareDialog.SessionShareDialog has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (createShare, copyShareURL, 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 · AgentEditors.AgentCatalogEditor (cyclomatic 21) · ×1
  • AgentEditors.AgentCatalogEditor (cyclomatic 21) web/src/features/config/AgentEditors.tsx:572 — AgentEditors.AgentCatalogEditor has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · autocontinue.trimTrailingJSONGarbage (cyclomatic 20) · ×1
  • autocontinue.trimTrailingJSONGarbage (cyclomatic 20) internal/adapters/runtime/agentkit/middlewares/autocontinue/repair.go:94 — autocontinue.trimTrailingJSONGarbage has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · eventlog.loadTranscriptRecords (cyclomatic 20) · ×1
  • eventlog.loadTranscriptRecords (cyclomatic 20) internal/adapters/storage/file/history/transcript.go:165 — eventlog.loadTranscriptRecords 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 · queue.cleanupQueueAttachmentDirs (cyclomatic 20) · ×1
  • queue.cleanupQueueAttachmentDirs (cyclomatic 20) internal/adapters/storage/file/queue/store.go:361 — queue.cleanupQueueAttachmentDirs 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 · FileTools.Grep (cyclomatic 20) · ×1
  • FileTools.Grep (cyclomatic 20) internal/adapters/tools/builtin/file/func.go:584 — FileTools.Grep has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · replyCollector.handleEvent (cyclomatic 20) · ×1
  • replyCollector.handleEvent (cyclomatic 20) internal/adapters/transport/channel/bridge.go:551 — replyCollector.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 · Bus.Invoke (cyclomatic 20) · ×1
  • Bus.Invoke (cyclomatic 20) internal/runtime/hooks/bus.go:108 — Bus.Invoke 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 · stream_frontend_logic_check.memberRenderParts (cyclomatic 20) · ×1
  • stream_frontend_logic_check.memberRenderParts (cyclomatic 20) web/scripts/stream_frontend_logic_check.ts:522 — stream_frontend_logic_check.memberRenderParts 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 · stream.subscribeStream (cyclomatic 20) · ×1
  • stream.subscribeStream (cyclomatic 20) web/src/api/stream.ts:97 — stream.subscribeStream 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 · ChatComposer.ReferenceMenu (cyclomatic 20) · ×1
  • ChatComposer.ReferenceMenu (cyclomatic 20) web/src/features/chat/ChatComposer.tsx:591 — ChatComposer.ReferenceMenu has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 617, 663, 643). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · sendMessage.sendChatMessage.<returned closure> (cyclomatic 20) · ×1
  • sendMessage.sendChatMessage.<returned closure> (cyclomatic 20) web/src/features/chat/sendMessage.ts:19 — sendMessage.sendChatMessage.<returned closure> 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 · ChatPage.ChatPage (cyclomatic 20) · ×1
  • ChatPage.ChatPage (cyclomatic 20) web/src/features/chat/ChatPage.tsx:19 — ChatPage.ChatPage has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · IntegrationEditors.JavaScriptToolEditor (cyclomatic 20) · ×1
  • IntegrationEditors.JavaScriptToolEditor (cyclomatic 20) web/src/features/config/IntegrationEditors.tsx:314 — IntegrationEditors.JavaScriptToolEditor has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · eventlog.saveMessagesToMarkdown (cyclomatic 19) · ×1
  • eventlog.saveMessagesToMarkdown (cyclomatic 19) REDACTED:25 — eventlog.saveMessagesToMarkdown 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 · Store.Load (cyclomatic 19) · ×1
  • Store.Load (cyclomatic 19) internal/adapters/storage/file/queue/store.go:153 — Store.Load 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 · command.interpretExitCode (cyclomatic 19) · ×1
  • command.interpretExitCode (cyclomatic 19) internal/adapters/tools/builtin/command/func.go:205 — command.interpretExitCode has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · excel.readSheetRows (cyclomatic 19) · ×1
  • excel.readSheetRows (cyclomatic 19) internal/adapters/tools/builtin/excel/data.go:676 — excel.readSheetRows 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 · Bot.Run (cyclomatic 19) · ×1
  • Bot.Run (cyclomatic 19) REDACTED:274 — Bot.Run 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 · runtimeModel.applyMemberEvent (cyclomatic 19) · ×1
  • runtimeModel.applyMemberEvent (cyclomatic 19) internal/adapters/transport/cli/runtime/runtime_events.go:130 — runtimeModel.applyMemberEvent 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 · runtimeModel.appendHistoryMessage (cyclomatic 19) · ×1
  • runtimeModel.appendHistoryMessage (cyclomatic 19) internal/adapters/transport/cli/runtime/runtime_history.go:57 — runtimeModel.appendHistoryMessage 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 · askModel.View (cyclomatic 19) · ×1
  • askModel.View (cyclomatic 19) internal/adapters/transport/cli/tui/ask.go:213 — askModel.View 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 · handler.DeleteFileHandler (cyclomatic 19) · ×1
  • handler.DeleteFileHandler (cyclomatic 19) internal/adapters/transport/http/handler/files.go:1556 — handler.DeleteFileHandler has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 1557). 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 · handler.collectPreviewPaths (cyclomatic 19) · ×1
  • handler.collectPreviewPaths (cyclomatic 19) REDACTED:38 — handler.collectPreviewPaths has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 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.
D1 · Cyclomatic Complexity · handler.NewRuntime (cyclomatic 19) · ×1
  • handler.NewRuntime (cyclomatic 19) internal/adapters/transport/http/handler/runtime.go:74 — handler.NewRuntime 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 · interactionRecorder.interruptHandler (cyclomatic 19) · ×1
  • interactionRecorder.interruptHandler (cyclomatic 19) internal/app/chat/interactions.go:117 — interactionRecorder.interruptHandler has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 121). 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 · Service.Update (cyclomatic 19) · ×1
  • Service.Update (cyclomatic 19) internal/app/session/service.go:83 — Service.Update has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · timeline.timelineItemSpacingClass (cyclomatic 19) · ×1
  • timeline.timelineItemSpacingClass (cyclomatic 19) web/src/features/chat/timeline.ts:10 — timeline.timelineItemSpacingClass has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FileShareDialog.FileShareDialog (cyclomatic 19) · ×1
  • FileShareDialog.FileShareDialog (cyclomatic 19) web/src/features/files/FileShareDialog.tsx:20 — FileShareDialog.FileShareDialog has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (createShare, copyPreviewURL, a function literal at line 84, …). 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 · GitTools.GitRemote (cyclomatic 18) · ×1
  • GitTools.GitRemote (cyclomatic 18) internal/adapters/tools/builtin/git/remote.go:32 — GitTools.GitRemote 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 · SshClient.CopyLocalFileToRemote (cyclomatic 18) · ×1
  • SshClient.CopyLocalFileToRemote (cyclomatic 18) internal/adapters/tools/builtin/ssh/ssh.go:266 — SshClient.CopyLocalFileToRemote has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Channel.messageCreate (cyclomatic 18) · ×1
  • Channel.messageCreate (cyclomatic 18) internal/adapters/transport/channel/discord/discord.go:302 — Channel.messageCreate 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 · sessionRunner.runShard (cyclomatic 18) · ×1
  • sessionRunner.runShard (cyclomatic 18) internal/adapters/transport/channel/qq/session.go:96 — sessionRunner.runShard 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 · eventview.formatSchedulerResult (cyclomatic 18) · ×1
  • eventview.formatSchedulerResult (cyclomatic 18) internal/adapters/transport/cli/eventview/print_markdown.go:161 — eventview.formatSchedulerResult 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 · update.unzipWithLimits (cyclomatic 18) · ×1
  • update.unzipWithLimits (cyclomatic 18) internal/adapters/transport/cli/update/zip.go:25 — update.unzipWithLimits 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 · agent.assistantMemberTools (cyclomatic 18) · ×1
  • agent.assistantMemberTools (cyclomatic 18) internal/app/agent/assistant.go:39 — agent.assistantMemberTools 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 · deep.NewAgent (cyclomatic 18) · ×1
  • deep.NewAgent (cyclomatic 18) internal/app/agent/catalog/deep/deep.go:17 — deep.NewAgent 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 · Projector.closeRun (cyclomatic 18) · ×1
  • Projector.closeRun (cyclomatic 18) internal/app/chat/presentation/projector.go:567 — Projector.closeRun 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 · TranscriptEvent.RuntimeEvent (cyclomatic 18) · ×1
  • TranscriptEvent.RuntimeEvent (cyclomatic 18) internal/domain/history/runtime.go:14 — TranscriptEvent.RuntimeEvent 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 · OutputLayout.Complete (cyclomatic 18) · ×1
  • OutputLayout.Complete (cyclomatic 18) internal/domain/message/output.go:63 — OutputLayout.Complete 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 · mdiff.applyOneHunk (cyclomatic 18) · ×1
  • mdiff.applyOneHunk (cyclomatic 18) internal/runtime/mdiff/patch.go:211 — mdiff.applyOneHunk 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 · pathguard.ResolveWorkspace (cyclomatic 18) · ×1
  • pathguard.ResolveWorkspace (cyclomatic 18) internal/runtime/pathguard/pathguard.go:21 — pathguard.ResolveWorkspace 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 · KeyedLocks.acquire (cyclomatic 18) · ×1
  • KeyedLocks.acquire (cyclomatic 18) internal/runtime/resources/locks.go:35 — KeyedLocks.acquire has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MessageList.ApprovalPanel (cyclomatic 18) · ×1
  • MessageList.ApprovalPanel (cyclomatic 18) web/src/features/chat/MessageList.tsx:1304 — MessageList.ApprovalPanel has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TaskStreamController.monitorTaskStream (cyclomatic 18) · ×1
  • TaskStreamController.monitorTaskStream (cyclomatic 18) web/src/features/chat/TaskStreamController.tsx:141 — TaskStreamController.monitorTaskStream has cyclomatic complexity 18 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentEditors.ModelsTab (cyclomatic 18) · ×1
  • AgentEditors.ModelsTab (cyclomatic 18) web/src/features/config/AgentEditors.tsx:21 — AgentEditors.ModelsTab has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 75, removeModel, loadProviderModels, …). 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 · AgentEditors.ModelNameField (cyclomatic 18) · ×1
  • AgentEditors.ModelNameField (cyclomatic 18) web/src/features/config/AgentEditors.tsx:179 — AgentEditors.ModelNameField has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · copilotTransport.RoundTrip (cyclomatic 17) · ×1
  • copilotTransport.RoundTrip (cyclomatic 17) internal/adapters/model/providers/copilot/copilot.go:89 — copilotTransport.RoundTrip 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 · HistoryRecorder.recordToolResult (cyclomatic 17) · ×1
  • HistoryRecorder.recordToolResult (cyclomatic 17) internal/adapters/storage/file/history/history_record.go:81 — HistoryRecorder.recordToolResult 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 · sqlite.Open (cyclomatic 17) · ×1
  • sqlite.Open (cyclomatic 17) internal/adapters/storage/sqlite/database.go:33 — sqlite.Open 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 · ExcelTools.CreateStyle (cyclomatic 17) · ×1
  • ExcelTools.CreateStyle (cyclomatic 17) internal/adapters/tools/builtin/excel/style.go:41 — ExcelTools.CreateStyle 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 · fetch.fetchWithClient (cyclomatic 17) · ×1
  • fetch.fetchWithClient (cyclomatic 17) internal/adapters/tools/builtin/fetch/func.go:51 — fetch.fetchWithClient 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 · BunTools.ListPackage (cyclomatic 17) · ×1
  • BunTools.ListPackage (cyclomatic 17) internal/adapters/tools/builtin/script/bun/func.go:268 — BunTools.ListPackage 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 · runtimeModel.updateCurrentMemberAsk (cyclomatic 17) · ×1
  • runtimeModel.updateCurrentMemberAsk (cyclomatic 17) internal/adapters/transport/cli/runtime/runtime_ask.go:260 — runtimeModel.updateCurrentMemberAsk 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 · runtimeModel.renderBottom (cyclomatic 17) · ×1
  • runtimeModel.renderBottom (cyclomatic 17) internal/adapters/transport/cli/runtime/runtime_render.go:454 — runtimeModel.renderBottom has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tui.DeleteInlineTokenNearCursor (cyclomatic 17) · ×1
  • tui.DeleteInlineTokenNearCursor (cyclomatic 17) internal/adapters/transport/cli/tui/inline_input.go:91 — tui.DeleteInlineTokenNearCursor 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 · tui.markdownTableColumnWidths (cyclomatic 17) · ×1
  • tui.markdownTableColumnWidths (cyclomatic 17) internal/adapters/transport/cli/tui/markdown.go:671 — tui.markdownTableColumnWidths has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Runtime.ChatHandlerWithState (cyclomatic 17) · ×1
  • Runtime.ChatHandlerWithState (cyclomatic 17) internal/adapters/transport/http/handler/http_chat.go:36 — Runtime.ChatHandlerWithState has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 37). 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 · Runtime.CreateSessionShareHandler (cyclomatic 17) · ×1
  • Runtime.CreateSessionShareHandler (cyclomatic 17) internal/adapters/transport/http/handler/session_share.go:138 — Runtime.CreateSessionShareHandler has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 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.
D1 · Cyclomatic Complexity · Stream.SubmitInterruptWithID (cyclomatic 17) · ×1
  • Stream.SubmitInterruptWithID (cyclomatic 17) internal/app/chat/taskstream/stream.go:814 — Stream.SubmitInterruptWithID 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 · Service.Read (cyclomatic 17) · ×1
  • Service.Read (cyclomatic 17) internal/app/process/service.go:329 — Service.Read 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 · skill.ListSkillFiles (cyclomatic 17) · ×1
  • skill.ListSkillFiles (cyclomatic 17) internal/app/skill/export.go:115 — skill.ListSkillFiles has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · javascriptHost.Call (cyclomatic 17) · ×1
  • javascriptHost.Call (cyclomatic 17) internal/bootstrap/tools/javascript.go:45 — javascriptHost.Call 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 · Sidebar.SessionRenameDialog (cyclomatic 17) · ×1
  • Sidebar.SessionRenameDialog (cyclomatic 17) web/src/components/layout/Sidebar.tsx:425 — Sidebar.SessionRenameDialog has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 483, submit, a function literal at line 458, …). 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 · presentation.applyPresentationUpdate (cyclomatic 17) · ×1
  • presentation.applyPresentationUpdate (cyclomatic 17) web/src/types/presentation.ts:244 — presentation.applyPresentationUpdate 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 · agentkit.adaptOutputPartsFromRunner (cyclomatic 16) · ×1
  • agentkit.adaptOutputPartsFromRunner (cyclomatic 16) internal/adapters/runtime/agentkit/message.go:213 — agentkit.adaptOutputPartsFromRunner 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 · dispatchModel.handleKey (cyclomatic 16) · ×1
  • dispatchModel.handleKey (cyclomatic 16) internal/adapters/runtime/agentkit/middlewares/dispatch/view.go:99 — dispatchModel.handleKey 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 · modelObservation.chunk (cyclomatic 16) · ×1
  • modelObservation.chunk (cyclomatic 16) internal/adapters/runtime/agentkit/model_events.go:88 — modelObservation.chunk has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scheduler.checkAndExecute (cyclomatic 16) · ×1
  • Scheduler.checkAndExecute (cyclomatic 16) internal/adapters/scheduler/filecron/scheduler.go:565 — Scheduler.checkAndExecute 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 · Bot.sendContent (cyclomatic 16) · ×1
  • Bot.sendContent (cyclomatic 16) REDACTED:401 — Bot.sendContent 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 · commands.saveProviderConfig (cyclomatic 16) · ×1
  • commands.saveProviderConfig (cyclomatic 16) internal/adapters/transport/cli/commands/login.go:325 — commands.saveProviderConfig 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 · eventview.formatSingleTodo (cyclomatic 16) · ×1
  • eventview.formatSingleTodo (cyclomatic 16) internal/adapters/transport/cli/eventview/print_format.go:403 — eventview.formatSingleTodo has cyclomatic complexity 16 (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 · runtimeModel.acceptPicker (cyclomatic 16) · ×1
  • runtimeModel.acceptPicker (cyclomatic 16) internal/adapters/transport/cli/runtime/runtime_picker.go:287 — runtimeModel.acceptPicker 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 · handler.enrichJavaScriptDraftRequest (cyclomatic 16) · ×1
  • handler.enrichJavaScriptDraftRequest (cyclomatic 16) internal/adapters/transport/http/handler/aiassist.go:103 — handler.enrichJavaScriptDraftRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Runtime.CreatePreviewLinkHandler (cyclomatic 16) · ×1
  • Runtime.CreatePreviewLinkHandler (cyclomatic 16) REDACTED:114 — Runtime.CreatePreviewLinkHandler has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 115). 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 · Runtime.handleChatMessage (cyclomatic 16) · ×1
  • Runtime.handleChatMessage (cyclomatic 16) internal/adapters/transport/http/handler/websocket.go:211 — Runtime.handleChatMessage 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 · AssistantTextCollector.Record (cyclomatic 16) · ×1
  • AssistantTextCollector.Record (cyclomatic 16) internal/app/chat/service.go:163 — AssistantTextCollector.Record 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 · QueryService.Query (cyclomatic 16) · ×1
  • QueryService.Query (cyclomatic 16) internal/app/session/query.go:81 — QueryService.Query has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useSidebarResize.useSidebarResize (cyclomatic 16) · ×1
  • useSidebarResize.useSidebarResize (cyclomatic 16) web/src/components/layout/useSidebarResize.ts:19 — useSidebarResize.useSidebarResize has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 7 function items inside it that branch (onPointerDown, onKeyDown, onPointerMove, …). 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 · ChatComposer.domPointFromTextOffset · ×1
  • ChatComposer.domPointFromTextOffset::scan (cyclomatic 16) web/src/features/chat/ChatComposer.tsx:979 — ChatComposer.domPointFromTextOffset::scan 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 · IntegrationEditors.MCPServerEditor (cyclomatic 16) · ×1
  • IntegrationEditors.MCPServerEditor (cyclomatic 16) web/src/features/config/IntegrationEditors.tsx:593 — IntegrationEditors.MCPServerEditor has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D12 · Dependency Hygiene · Dependency pinned to a stale untagged commit · ×1
  • Dependency pinned to a stale untagged commit: github.com/skip2/go-qrcode — Direct dependency `github.com/skip2/go-qrcode` is required at `v0.0.0-20200617195104-da1b6568686e` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2020-06-17, 6.4 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/skip2/go-qrcode` and has not moved this requirement in 6.4 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/skip2/go-qrcode` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
D2 · Cognitive Complexity · eventview.newPrintEvent (cognitive 287) · ×1
  • eventview.newPrintEvent (cognitive 287) internal/adapters/transport/cli/eventview/print.go:75 — eventview.newPrintEvent has cognitive complexity 287 (threshold 15). Drivers by points: if/else 120 (251 pts), boolean chains 17, loops 9 (15 pts), match/switch 3 (4 pts) (nesting depth added 138). None of this is in the body itself: all 287 points belong to 21 function literals inside it that branch (lines 381, 238, 289, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Projector.Apply (cognitive 156) · ×1
  • Projector.Apply (cognitive 156) internal/app/chat/presentation/projector.go:70 — Projector.Apply has cognitive complexity 156 (threshold 15). Drivers by points: if/else 58 (132 pts), loops 6 (11 pts), boolean chains 9, match/switch 2 (4 pts) (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtimeModel.Update (cognitive 123) · ×1
  • runtimeModel.Update (cognitive 123) internal/adapters/transport/cli/runtime/runtime_update.go:24 — runtimeModel.Update has cognitive complexity 123 (threshold 15). Drivers by points: if/else 40 (106 pts), match/switch 5 (11 pts), boolean chains 6 (nesting depth added 72). 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 · HistoryRecorder.RecordEvent (cognitive 112) · ×1
  • HistoryRecorder.RecordEvent (cognitive 112) internal/adapters/storage/file/history/history_record.go:591 — HistoryRecorder.RecordEvent has cognitive complexity 112 (threshold 15). Drivers by points: if/else 38 (88 pts), boolean chains 13, loops 3 (8 pts), match/switch 2 (3 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatComposer.ChatComposer (cognitive 107) · ×1
  • ChatComposer.ChatComposer (cognitive 107) web/src/features/chat/ChatComposer.tsx:53 — ChatComposer.ChatComposer has cognitive complexity 107 (threshold 15). Drivers by points: if/else 42 (46 pts), ternaries 27 (37 pts), boolean chains 24 (nesting depth added 14). Of this number, 40 points are the body's own statements and 67 belong to 26 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · SkillPanel.SkillPanel (cognitive 98) · ×1
  • SkillPanel.SkillPanel (cognitive 98) web/src/features/skills/SkillPanel.tsx:50 — SkillPanel.SkillPanel has cognitive complexity 98 (threshold 15). Drivers by points: ternaries 25 (40 pts), if/else 23 (25 pts), boolean chains 20, error handling 13 (nesting depth added 17). Of this number, 19 points are the body's own statements and 79 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 · chat.agentMessageToCoreMessages (cognitive 89) · ×1
  • chat.agentMessageToCoreMessages (cognitive 89) internal/app/chat/input.go:232 — chat.agentMessageToCoreMessages has cognitive complexity 89 (threshold 15). Drivers by points: if/else 27 (68 pts), loops 7 (11 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 46). Of this number, 84 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 · memberModel.applyEvent (cognitive 79) · ×1
  • memberModel.applyEvent (cognitive 79) internal/adapters/transport/cli/tui/member_panel.go:71 — memberModel.applyEvent has cognitive complexity 79 (threshold 15). Drivers by points: if/else 28 (65 pts), loops 2 (8 pts), boolean chains 5, match/switch 1 (nesting depth added 43). 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 · taskstream.RuntimeEventPayload (cognitive 79) · ×1
  • taskstream.RuntimeEventPayload (cognitive 79) internal/app/chat/taskstream/protocol.go:17 — taskstream.RuntimeEventPayload has cognitive complexity 79 (threshold 15). Drivers by points: if/else 55 (76 pts), loops 1 (2 pts), boolean chains 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 · GitTools.GitDiff (cognitive 73) · ×1
  • GitTools.GitDiff (cognitive 73) internal/adapters/tools/builtin/git/diff.go:52 — GitTools.GitDiff has cognitive complexity 73 (threshold 15). Drivers by points: if/else 29 (58 pts), boolean chains 8, loops 4 (7 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · askModel.Update (cognitive 70) · ×1
  • askModel.Update (cognitive 70) internal/adapters/transport/cli/tui/ask.go:74 — askModel.Update has cognitive complexity 70 (threshold 15). Drivers by points: if/else 16 (48 pts), loops 3 (13 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eventview.formatTodoResult (cognitive 69) · ×1
  • eventview.formatTodoResult (cognitive 69) internal/adapters/transport/cli/eventview/print_format.go:306 — eventview.formatTodoResult has cognitive complexity 69 (threshold 15). Drivers by points: if/else 19 (54 pts), loops 3 (11 pts), boolean chains 3, match/switch 1 (nesting depth added 43). 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 · mdiff.buildHunks (cognitive 62) · ×1
  • mdiff.buildHunks (cognitive 62) internal/runtime/mdiff/format.go:78 — mdiff.buildHunks has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 7 (13 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · auth.Login (cognitive 59) · ×1
  • auth.Login (cognitive 59) internal/adapters/transport/channel/weixin/sdk/auth/login.go:134 — auth.Login has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (48 pts), match/switch 2 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Source.Prepare (cognitive 58) · ×1
  • Source.Prepare (cognitive 58) internal/adapters/storage/migration/source.go:34 — Source.Prepare has cognitive complexity 58 (threshold 15). Drivers by points: if/else 29 (54 pts), loops 3 (4 pts) (nesting depth added 26). Of this number, 48 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stream_frontend_logic_check.analyzeEvents (cognitive 54) · ×1
  • stream_frontend_logic_check.analyzeEvents (cognitive 54) web/scripts/stream_frontend_logic_check.ts:247 — stream_frontend_logic_check.analyzeEvents has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 15, loops 3 (8 pts) (nesting depth added 24). 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 · Sidebar.Sidebar (cognitive 54) · ×1
  • Sidebar.Sidebar (cognitive 54) web/src/components/layout/Sidebar.tsx:56 — Sidebar.Sidebar has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 18 (26 pts), boolean chains 14, if/else 11, error handling 3 (nesting depth added 8). Of this number, 21 points are the body's own statements and 33 belong to 11 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · memory.loadMarkdownFile (cognitive 52) · ×1
  • memory.loadMarkdownFile (cognitive 52) internal/adapters/storage/file/memory/store.go:131 — memory.loadMarkdownFile has cognitive complexity 52 (threshold 15). Drivers by points: if/else 23 (45 pts), loops 3 (6 pts), boolean chains 1 (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 · runtimeModel.applyEvent (cognitive 52) · ×1
  • runtimeModel.applyEvent (cognitive 52) internal/adapters/transport/cli/runtime/runtime_events.go:21 — runtimeModel.applyEvent has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (42 pts), match/switch 3 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Service.RunQueued (cognitive 52) · ×1
  • Service.RunQueued (cognitive 52) internal/app/chat/queue.go:30 — Service.RunQueued has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29 (49 pts), boolean chains 2, loops 1 (nesting depth added 20). Of this number, 39 points are the body's own statements and 13 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 · askModel.View (cognitive 51) · ×1
  • askModel.View (cognitive 51) internal/adapters/transport/cli/tui/ask.go:213 — askModel.View has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (45 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExecutionDependencies.prepareStorage (cognitive 49) · ×1
  • ExecutionDependencies.prepareStorage (cognitive 49) internal/bootstrap/storage.go:24 — ExecutionDependencies.prepareStorage has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (48 pts), boolean chains 1 (nesting depth added 25). Of this number, 48 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 · mdiff.ApplyMultiFileDiff (cognitive 49) · ×1
  • mdiff.ApplyMultiFileDiff (cognitive 49) internal/runtime/mdiff/patch.go:420 — mdiff.ApplyMultiFileDiff has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 4 (12 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Runtime.WebSocketHandlerWithState (cognitive 48) · ×1
  • Runtime.WebSocketHandlerWithState (cognitive 48) internal/adapters/transport/http/handler/websocket.go:55 — Runtime.WebSocketHandlerWithState has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 25). None of this is in the body itself: all 48 points belong to one function literal inside it that branches (line 56). 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 · ShareManagerPanel.ShareManagerPanel (cognitive 48) · ×1
  • ShareManagerPanel.ShareManagerPanel (cognitive 48) web/src/features/share/ShareManagerPanel.tsx:31 — ShareManagerPanel.ShareManagerPanel has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16, boolean chains 15, ternaries 7 (12 pts), error handling 5 (nesting depth added 5). Most of this is not in the body itself: 2 of the 48 points are its own statements and the rest belongs to 13 function items inside it that branch (load, confirmDelete, confirmDeleteFile, …). 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 · events.ValidateEventContract (cognitive 47) · ×1
  • events.ValidateEventContract (cognitive 47) internal/runtime/events/protocol.go:59 — events.ValidateEventContract has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 14, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileManager.FileManager (cognitive 46) · ×1
  • FileManager.FileManager (cognitive 46) REDACTED:42 — FileManager.FileManager has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 11, if/else 7 (8 pts), error handling 2 (nesting depth added 11). Of this number, 22 points are the body's own statements and 24 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · events.decodeChatEvent (cognitive 46) · ×1
  • events.decodeChatEvent (cognitive 46) web/src/types/events.ts:177 — events.decodeChatEvent has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 14, loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SchedulePanel.SchedulePanel (cognitive 44) · ×1
  • SchedulePanel.SchedulePanel (cognitive 44) web/src/features/schedules/SchedulePanel.tsx:44 — SchedulePanel.SchedulePanel has cognitive complexity 44 (threshold 15). Drivers by points: boolean chains 18, ternaries 7 (12 pts), if/else 9, error handling 5 (nesting depth added 5). Most of this is not in the body itself: 8 of the 44 points are its own statements and the rest belongs to 12 function items inside it that branch (saveTask, showDetail, confirmRemove, …). 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 · Bot.Run (cognitive 41) · ×1
  • Bot.Run (cognitive 41) REDACTED:274 — Bot.Run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 23). Of this number, 40 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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 · HistoryRecorder.recordTranscript (cognitive 40) · ×1
  • HistoryRecorder.recordTranscript (cognitive 40) internal/adapters/storage/file/history/history_record.go:258 — HistoryRecorder.recordTranscript has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 4, loops 1 (2 pts), match/switch 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 · stream.subscribeStream (cognitive 40) · ×1
  • stream.subscribeStream (cognitive 40) web/src/api/stream.ts:97 — stream.subscribeStream has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentkit.adaptOutputPartsFromRunner (cognitive 39) · ×1
  • agentkit.adaptOutputPartsFromRunner (cognitive 39) internal/adapters/runtime/agentkit/message.go:213 — agentkit.adaptOutputPartsFromRunner has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scheduler.executeTask (cognitive 39) · ×1
  • Scheduler.executeTask (cognitive 39) internal/adapters/scheduler/filecron/scheduler.go:659 — Scheduler.executeTask has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 1 (nesting depth added 23). 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 · eventlog.saveMessagesToMarkdown (cognitive 39) · ×1
  • eventlog.saveMessagesToMarkdown (cognitive 39) REDACTED:25 — eventlog.saveMessagesToMarkdown has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 4 (5 pts), match/switch 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migration.validateBackup (cognitive 39) · ×1
  • migration.validateBackup (cognitive 39) internal/adapters/storage/migration/validate.go:20 — migration.validateBackup has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (28 pts), boolean chains 5, match/switch 2 (5 pts), loops 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 · commands.switchModel (cognitive 39) · ×1
  • commands.switchModel (cognitive 39) internal/adapters/transport/cli/commands/model.go:238 — commands.switchModel has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eventview.NewMarkdownCollector (cognitive 39) · ×1
  • eventview.NewMarkdownCollector (cognitive 39) internal/adapters/transport/cli/eventview/print_markdown.go:15 — eventview.NewMarkdownCollector has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 20). None of this is in the body itself: all 39 points belong to 3 function literals inside it that branch (lines 29, 22, 94). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Runtime.UploadChunkHandler (cognitive 39) · ×1
  • Runtime.UploadChunkHandler (cognitive 39) internal/adapters/transport/http/handler/files.go:963 — Runtime.UploadChunkHandler has cognitive complexity 39 (threshold 15). Drivers by points: if/else 31 (32 pts), boolean chains 7 (nesting depth added 1). None of this is in the body itself: all 39 points belong to one function literal inside it that branches (line 964). 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 · mdiff.applyHunksForward (cognitive 39) · ×1
  • mdiff.applyHunksForward (cognitive 39) internal/runtime/mdiff/patch.go:80 — mdiff.applyHunksForward has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 5 (8 pts), match/switch 1 (3 pts), boolean chains 2 (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 · MigrationGate.MigrationGate (cognitive 39) · ×1
  • MigrationGate.MigrationGate (cognitive 39) web/src/features/migration/MigrationGate.tsx:9 — MigrationGate.MigrationGate has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 20, if/else 8 (10 pts), ternaries 5 (7 pts), error handling 2 (nesting depth added 4). Of this number, 25 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.
D2 · Cognitive Complexity · GitTools.GitConfig (cognitive 38) · ×1
  • GitTools.GitConfig (cognitive 38) internal/adapters/tools/builtin/git/config.go:31 — GitTools.GitConfig has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 3 (5 pts), loops 2 (4 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 · TodoTools.TodoUpdate (cognitive 38) · ×1
  • TodoTools.TodoUpdate (cognitive 38) internal/adapters/tools/builtin/todo/func.go:354 — TodoTools.TodoUpdate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · commands.runChat (cognitive 38) · ×1
  • commands.runChat (cognitive 38) internal/adapters/transport/cli/commands/chat.go:24 — commands.runChat has cognitive complexity 38 (threshold 15). Drivers by points: if/else 29 (34 pts), boolean chains 4 (nesting depth added 5). Of this number, 20 points are the body's own statements and 18 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ConfigFields.ToolSelectField (cognitive 38) · ×1
  • ConfigFields.ToolSelectField (cognitive 38) web/src/features/config/ConfigFields.tsx:118 — ConfigFields.ToolSelectField has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 15 (28 pts), boolean chains 7, if/else 3 (nesting depth added 13). Most of this is not in the body itself: 8 of the 38 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 216, a function literal at line 173, a function literal at line 135, …). 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 · SharePage.SharePage (cognitive 38) · ×1
  • SharePage.SharePage (cognitive 38) web/src/features/share/SharePage.tsx:13 — SharePage.SharePage has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 9 (21 pts), if/else 7 (11 pts), boolean chains 4, error handling 2 (nesting depth added 16). Of this number, 22 points are the body's own statements and 16 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.save (cognitive 37) · ×1
  • Store.save (cognitive 37) internal/adapters/storage/file/queue/store.go:68 — Store.save has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 6, 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 · Database.Import (cognitive 37) · ×1
  • Database.Import (cognitive 37) internal/adapters/storage/sqlite/migration.go:26 — Database.Import has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (33 pts), loops 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QueryExecutor.Execute (cognitive 37) · ×1
  • QueryExecutor.Execute (cognitive 37) internal/adapters/transport/cli/runtime/query.go:250 — QueryExecutor.Execute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). Of this number, 17 points are the body's own statements and 20 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 · AgentEditors.AgentDraftDialog (cognitive 37) · ×1
  • AgentEditors.AgentDraftDialog (cognitive 37) web/src/features/config/AgentEditors.tsx:653 — AgentEditors.AgentDraftDialog has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 14, if/else 5 (6 pts), error handling 2 (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 7 function items inside it that branch (generate, a function literal at line 755, a function literal at line 733, …). 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 · IntegrationEditors.JavaScriptTab (cognitive 37) · ×1
  • IntegrationEditors.JavaScriptTab (cognitive 37) web/src/features/config/IntegrationEditors.tsx:145 — IntegrationEditors.JavaScriptTab has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 21, ternaries 7 (9 pts), if/else 6 (7 pts) (nesting depth added 3). Most of this is not in the body itself: 11 of the 37 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 197, a function literal at line 152, a function literal at line 174, …). 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 · queue.cleanupQueueAttachmentDirs (cognitive 36) · ×1
  • queue.cleanupQueueAttachmentDirs (cognitive 36) internal/adapters/storage/file/queue/store.go:361 — queue.cleanupQueueAttachmentDirs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 4 (6 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 · handler.collectPreviewPaths (cognitive 36) · ×1
  • handler.collectPreviewPaths (cognitive 36) REDACTED:38 — handler.collectPreviewPaths has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 2, boolean chains 1 (nesting depth added 18). Of this number, 16 points are the body's own statements and 20 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 · TaskStreamController.followTaskStream (cognitive 36) · ×1
  • TaskStreamController.followTaskStream (cognitive 36) web/src/features/chat/TaskStreamController.tsx:85 — TaskStreamController.followTaskStream has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 9, error handling 1 (2 pts), loops 1 (nesting depth added 13). Of this number, 28 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eventview.formatSSHResult (cognitive 35) · ×1
  • eventview.formatSSHResult (cognitive 35) internal/adapters/transport/cli/eventview/print_format.go:225 — eventview.formatSSHResult has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (6 pts), boolean chains 4, match/switch 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 · handler.OpenAIChatCompletionsHandler (cognitive 35) · ×1
  • handler.OpenAIChatCompletionsHandler (cognitive 35) internal/adapters/transport/http/handler/openai_api.go:52 — handler.OpenAIChatCompletionsHandler has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (27 pts), loops 4 (8 pts) (nesting depth added 11). None of this is in the body itself: all 35 points belong to one function literal inside it that branches (line 53). 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 · Manager.SaveEntry (cognitive 35) · ×1
  • Manager.SaveEntry (cognitive 35) internal/app/memory/editor.go:36 — Manager.SaveEntry has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 12, loops 3 (nesting depth added 7). 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 · Service.Save (cognitive 35) · ×1
  • Service.Save (cognitive 35) internal/app/task/service.go:97 — Service.Save has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 13, 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 · eventlog.loadTranscriptRecords (cognitive 34) · ×1
  • eventlog.loadTranscriptRecords (cognitive 34) internal/adapters/storage/file/history/transcript.go:165 — eventlog.loadTranscriptRecords has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 2, loops 1 (nesting depth added 16). 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 · stream_frontend_logic_check.memberRenderParts (cognitive 34) · ×1
  • stream_frontend_logic_check.memberRenderParts (cognitive 34) web/scripts/stream_frontend_logic_check.ts:522 — stream_frontend_logic_check.memberRenderParts has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 6, 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 · ChatPage.QuestionNavigator (cognitive 34) · ×1
  • ChatPage.QuestionNavigator (cognitive 34) web/src/features/chat/ChatPage.tsx:134 — ChatPage.QuestionNavigator has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 10, if/else 7 (9 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 162, 187, 272, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · sessionRunner.runShard (cognitive 33) · ×1
  • sessionRunner.runShard (cognitive 33) internal/adapters/transport/channel/qq/session.go:96 — sessionRunner.runShard has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · handler.UploadFileHandler (cognitive 33) · ×1
  • handler.UploadFileHandler (cognitive 33) internal/adapters/transport/http/handler/files.go:631 — handler.UploadFileHandler has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 3, loops 3 (nesting depth added 9). None of this is in the body itself: all 33 points belong to one function literal inside it that branches (line 632). 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 · SkillPanel.SkillDetail (cognitive 33) · ×1
  • SkillPanel.SkillDetail (cognitive 33) web/src/features/skills/SkillPanel.tsx:640 — SkillPanel.SkillDetail has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 17 (28 pts), boolean chains 4, if/else 1 (nesting depth added 11). Of this number, 22 points are the body's own statements and 11 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 · skill.searchSkills (cognitive 32) · ×1
  • skill.searchSkills (cognitive 32) internal/adapters/transport/cli/commands/skill/search.go:51 — skill.searchSkills has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (3 pts), 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 · interactionRecorder.interruptHandler (cognitive 32) · ×1
  • interactionRecorder.interruptHandler (cognitive 32) internal/app/chat/interactions.go:117 — interactionRecorder.interruptHandler has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 4, loops 2 (nesting depth added 12). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to one function literal inside it that branches (line 121). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Config.ValidateJavaScript (cognitive 32) · ×1
  • Config.ValidateJavaScript (cognitive 32) internal/app/config/config.go:524 — Config.ValidateJavaScript has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentkit.NewDeepAgent (cognitive 31) · ×1
  • agentkit.NewDeepAgent (cognitive 31) internal/adapters/runtime/agentkit/deep.go:18 — agentkit.NewDeepAgent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (24 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). Of this number, 22 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tui.computeToolArgsSummary (cognitive 31) · ×1
  • tui.computeToolArgsSummary (cognitive 31) internal/adapters/transport/cli/tui/panel_render.go:134 — tui.computeToolArgsSummary has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (8 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 · handler.DeleteFileHandler (cognitive 31) · ×1
  • handler.DeleteFileHandler (cognitive 31) internal/adapters/transport/http/handler/files.go:1556 — handler.DeleteFileHandler has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 2 (nesting depth added 12). None of this is in the body itself: all 31 points belong to one function literal inside it that branches (line 1557). 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 · OutputLayout.Complete (cognitive 31) · ×1
  • OutputLayout.Complete (cognitive 31) internal/domain/message/output.go:63 — OutputLayout.Complete has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 6 (10 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 · MemoryPanel.MemoryPanel (cognitive 31) · ×1
  • MemoryPanel.MemoryPanel (cognitive 31) web/src/features/memory/MemoryPanel.tsx:18 — MemoryPanel.MemoryPanel has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, ternaries 3 (6 pts), if/else 5, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 7 function items inside it that branch (remove, a function literal at line 60, save, …). 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 · autocontinue.repairJSON (cognitive 30) · ×1
  • autocontinue.repairJSON (cognitive 30) internal/adapters/runtime/agentkit/middlewares/autocontinue/repair.go:6 — autocontinue.repairJSON has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 3 (7 pts), boolean chains 4, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Runner.Run (cognitive 30) · ×1
  • Runner.Run (cognitive 30) internal/adapters/runtime/agentkit/runner.go:28 — Runner.Run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Bridge.sessionWorker (cognitive 30) · ×1
  • Bridge.sessionWorker (cognitive 30) internal/adapters/transport/channel/bridge.go:323 — Bridge.sessionWorker has cognitive complexity 30 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (8 pts), loops 3 (6 pts), jumps 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eventview.formatSchedulerResult (cognitive 30) · ×1
  • eventview.formatSchedulerResult (cognitive 30) internal/adapters/transport/cli/eventview/print_markdown.go:161 — eventview.formatSchedulerResult has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 2 (5 pts), loops 1 (3 pts) (nesting depth added 16). 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 · Updater.Apply (cognitive 30) · ×1
  • Updater.Apply (cognitive 30) internal/adapters/transport/cli/update/update.go:99 — Updater.Apply has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). Of this number, 20 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Runtime.StreamSubscribeHandler (cognitive 30) · ×1
  • Runtime.StreamSubscribeHandler (cognitive 30) internal/adapters/transport/http/handler/stream.go:505 — Runtime.StreamSubscribeHandler has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 13). None of this is in the body itself: all 30 points belong to one function literal inside it that branches (line 506). 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 · Service.Execute (cognitive 30) · ×1
  • Service.Execute (cognitive 30) internal/app/process/service.go:149 — Service.Execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 7, match/switch 2, loops 1 (nesting depth added 4). Of this number, 28 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · MessageList.AskPanel (cognitive 30) · ×1
  • MessageList.AskPanel (cognitive 30) web/src/features/chat/MessageList.tsx:1083 — MessageList.AskPanel has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 10, if/else 3, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 4 function items inside it that branch (submit, a function literal at line 1153, a function literal at line 1112, …). 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 · autocontinue.trimTrailingJSONGarbage (cognitive 29) · ×1
  • autocontinue.trimTrailingJSONGarbage (cognitive 29) internal/adapters/runtime/agentkit/middlewares/autocontinue/repair.go:94 — autocontinue.trimTrailingJSONGarbage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 7, loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 12). 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 · LocalBackend.GrepRaw (cognitive 29) · ×1
  • LocalBackend.GrepRaw (cognitive 29) internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:167 — LocalBackend.GrepRaw has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 3, loops 1 (nesting depth added 4). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 201). 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 · excel.readSheetRows (cognitive 29) · ×1
  • excel.readSheetRows (cognitive 29) internal/adapters/tools/builtin/excel/data.go:676 — excel.readSheetRows has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.assistantMemberTools (cognitive 29) · ×1
  • agent.assistantMemberTools (cognitive 29) internal/app/agent/assistant.go:39 — agent.assistantMemberTools has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 2 (3 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 · mdiff.Diff (cognitive 29) · ×1
  • mdiff.Diff (cognitive 29) internal/runtime/mdiff/diff.go:27 — mdiff.Diff has cognitive complexity 29 (threshold 15). Drivers by points: loops 9 (14 pts), if/else 8, boolean chains 4, match/switch 1 (3 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · mdiff.applyOneHunk (cognitive 29) · ×1
  • mdiff.applyOneHunk (cognitive 29) internal/runtime/mdiff/patch.go:211 — mdiff.applyOneHunk has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssistantUIContent.InteractiveBlock (cognitive 29) · ×1
  • AssistantUIContent.InteractiveBlock (cognitive 29) web/src/features/chat/openui/AssistantUIContent.tsx:25 — AssistantUIContent.InteractiveBlock has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 11, ternaries 7 (9 pts), if/else 7 (8 pts), error handling 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 14 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · PreviewPage.PreviewPage (cognitive 29) · ×1
  • PreviewPage.PreviewPage (cognitive 29) web/src/features/preview/PreviewPage.tsx:7 — PreviewPage.PreviewPage has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 9, if/else 6, error handling 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Store.Load (cognitive 28) · ×1
  • Store.Load (cognitive 28) internal/adapters/storage/file/queue/store.go:153 — Store.Load has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileTools.Grep (cognitive 28) · ×1
  • FileTools.Grep (cognitive 28) internal/adapters/tools/builtin/file/func.go:584 — FileTools.Grep has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 1 (nesting depth added 8). Of this number, 14 points are the body's own statements and 14 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Channel.Start (cognitive 28) · ×1
  • Channel.Start (cognitive 28) internal/adapters/transport/channel/discord/discord.go:84 — Channel.Start has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 3 (nesting depth added 6). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · Stream.SubmitInterruptWithID (cognitive 28) · ×1
  • Stream.SubmitInterruptWithID (cognitive 28) internal/app/chat/taskstream/stream.go:814 — Stream.SubmitInterruptWithID has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, loops 1 (3 pts), 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 · Bus.Invoke (cognitive 28) · ×1
  • Bus.Invoke (cognitive 28) internal/runtime/hooks/bus.go:108 — Bus.Invoke has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 4, 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 · eventlog.projectTranscriptEvents (cognitive 27) · ×1
  • eventlog.projectTranscriptEvents (cognitive 27) internal/adapters/storage/file/history/history_persist.go:115 — eventlog.projectTranscriptEvents has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 9). Of this number, 20 points are the body's own statements and 7 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 · Tools.snapshot (cognitive 27) · ×1
  • Tools.snapshot (cognitive 27) internal/adapters/tools/builtin/doc/func.go:392 — Tools.snapshot has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · FileTools.grepFile (cognitive 27) · ×1
  • FileTools.grepFile (cognitive 27) internal/adapters/tools/builtin/file/func.go:680 — FileTools.grepFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (7 pts), boolean chains 3 (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 · GitTools.GitRemote (cognitive 27) · ×1
  • GitTools.GitRemote (cognitive 27) internal/adapters/tools/builtin/git/remote.go:32 — GitTools.GitRemote has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 1 (2 pts), boolean chains 1, match/switch 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 · replyCollector.handleEvent (cognitive 27) · ×1
  • replyCollector.handleEvent (cognitive 27) internal/adapters/transport/channel/bridge.go:551 — replyCollector.handleEvent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 11). 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 · update.unzipWithLimits (cognitive 27) · ×1
  • update.unzipWithLimits (cognitive 27) internal/adapters/transport/cli/update/zip.go:25 — update.unzipWithLimits has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3, 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 · common.resolveMiddlewares (cognitive 27) · ×1
  • common.resolveMiddlewares (cognitive 27) internal/app/agent/catalog/common/definition.go:124 — common.resolveMiddlewares has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (24 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 · Projector.closeRun (cognitive 27) · ×1
  • Projector.closeRun (cognitive 27) internal/app/chat/presentation/projector.go:567 — Projector.closeRun has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, loops 5 (7 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 · mdiff.parseHunk (cognitive 27) · ×1
  • mdiff.parseHunk (cognitive 27) internal/runtime/mdiff/parse.go:130 — mdiff.parseHunk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, 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 · select.Select · ×1
  • select.Select::handleKeyDown (cognitive 27) web/src/components/ui/select.tsx:58 — select.Select::handleKeyDown has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4 (11 pts), boolean chains 3, 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 · ChatComposer.ReferenceMenu (cognitive 27) · ×1
  • ChatComposer.ReferenceMenu (cognitive 27) web/src/features/chat/ChatComposer.tsx:591 — ChatComposer.ReferenceMenu has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 6, if/else 3 (nesting depth added 8). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 617, 663, 643). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · LocalBackend.applyContext (cognitive 26) · ×1
  • LocalBackend.applyContext (cognitive 26) internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:260 — LocalBackend.applyContext has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (7 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 · Bot.sendContent (cognitive 26) · ×1
  • Bot.sendContent (cognitive 26) REDACTED:401 — Bot.sendContent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (26 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 · commands.saveProviderConfig (cognitive 26) · ×1
  • commands.saveProviderConfig (cognitive 26) internal/adapters/transport/cli/commands/login.go:325 — commands.saveProviderConfig has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtimeModel.handleSubmit (cognitive 26) · ×1
  • runtimeModel.handleSubmit (cognitive 26) internal/adapters/transport/cli/runtime/runtime_input.go:126 — runtimeModel.handleSubmit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deep.NewAgent (cognitive 26) · ×1
  • deep.NewAgent (cognitive 26) internal/app/agent/catalog/deep/deep.go:17 — deep.NewAgent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (25 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 · stream_frontend_logic_check.subscribeStream (cognitive 26) · ×1
  • stream_frontend_logic_check.subscribeStream (cognitive 26) web/scripts/stream_frontend_logic_check.ts:178 — stream_frontend_logic_check.subscribeStream has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stream_frontend_logic_check.completedMemberCallIDs (cognitive 26) · ×1
  • stream_frontend_logic_check.completedMemberCallIDs (cognitive 26) web/scripts/stream_frontend_logic_check.ts:351 — stream_frontend_logic_check.completedMemberCallIDs has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 4 (9 pts), boolean chains 5 (nesting depth added 12). 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 · TaskStreamController.monitorTaskStream (cognitive 26) · ×1
  • TaskStreamController.monitorTaskStream (cognitive 26) web/src/features/chat/TaskStreamController.tsx:141 — TaskStreamController.monitorTaskStream has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 10). Of this number, 21 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 · AgentEditors.AgentsTab (cognitive 26) · ×1
  • AgentEditors.AgentsTab (cognitive 26) web/src/features/config/AgentEditors.tsx:286 — AgentEditors.AgentsTab has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 21, ternaries 4, loops 1. Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 9 function items inside it that branch (buildAgentsDraft, a function literal at line 382, a function literal at line 343, …). 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 · ConfigPanel.ConfigPanel (cognitive 26) · ×1
  • ConfigPanel.ConfigPanel (cognitive 26) web/src/features/config/ConfigPanel.tsx:36 — ConfigPanel.ConfigPanel has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 15 (17 pts), boolean chains 5, if/else 3, error handling 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 11 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · agentkit.AdaptToolsForRunner (cognitive 25) · ×1
  • agentkit.AdaptToolsForRunner (cognitive 25) internal/adapters/runtime/agentkit/tool.go:19 — agentkit.AdaptToolsForRunner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autocontinue.countRecentContinues (cognitive 25) · ×1
  • autocontinue.countRecentContinues (cognitive 25) internal/adapters/runtime/agentkit/middlewares/autocontinue/autocontinue.go:173 — autocontinue.countRecentContinues has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scheduler.checkAndExecute (cognitive 25) · ×1
  • Scheduler.checkAndExecute (cognitive 25) internal/adapters/scheduler/filecron/scheduler.go:565 — Scheduler.checkAndExecute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtimeModel.appendHistoryMessage (cognitive 25) · ×1
  • runtimeModel.appendHistoryMessage (cognitive 25) internal/adapters/transport/cli/runtime/runtime_history.go:57 — runtimeModel.appendHistoryMessage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Runtime.StreamStartHandlerWithState (cognitive 25) · ×1
  • Runtime.StreamStartHandlerWithState (cognitive 25) internal/adapters/transport/http/handler/stream.go:37 — Runtime.StreamStartHandlerWithState has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 25 points belong to one function literal inside it that branches (line 38). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TranscriptEvent.RuntimeEvent (cognitive 25) · ×1
  • TranscriptEvent.RuntimeEvent (cognitive 25) internal/domain/history/runtime.go:14 — TranscriptEvent.RuntimeEvent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 1 (3 pts), match/switch 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 · KeyedLocks.acquire (cognitive 25) · ×1
  • KeyedLocks.acquire (cognitive 25) internal/runtime/resources/locks.go:35 — KeyedLocks.acquire has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stream_frontend_logic_check.analyzeMemberCompletedText (cognitive 25) · ×1
  • stream_frontend_logic_check.analyzeMemberCompletedText (cognitive 25) web/scripts/stream_frontend_logic_check.ts:430 — stream_frontend_logic_check.analyzeMemberCompletedText has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, 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 · sendMessage.sendChatMessage.<returned closure> (cognitive 25) · ×1
  • sendMessage.sendChatMessage.<returned closure> (cognitive 25) web/src/features/chat/sendMessage.ts:19 — sendMessage.sendChatMessage.<returned closure> has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (6 pts), boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · copilotTransport.RoundTrip (cognitive 24) · ×1
  • copilotTransport.RoundTrip (cognitive 24) internal/adapters/model/providers/copilot/copilot.go:89 — copilotTransport.RoundTrip has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BunTools.ListPackage (cognitive 24) · ×1
  • BunTools.ListPackage (cognitive 24) internal/adapters/tools/builtin/script/bun/func.go:268 — BunTools.ListPackage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 8). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · skill.unzipSkill (cognitive 24) · ×1
  • skill.unzipSkill (cognitive 24) internal/app/skill/install.go:104 — skill.unzipSkill has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, 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 · SessionShareDialog.SessionShareDialog (cognitive 24) · ×1
  • SessionShareDialog.SessionShareDialog (cognitive 24) web/src/components/layout/SessionShareDialog.tsx:25 — SessionShareDialog.SessionShareDialog has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 5, boolean chains 4, error handling 2 (nesting depth added 4). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 5 function items inside it that branch (createShare, copyShareURL, 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.
D2 · Cognitive Complexity · TaskStreamController.TaskStreamController (cognitive 24) · ×1
  • TaskStreamController.TaskStreamController (cognitive 24) web/src/features/chat/TaskStreamController.tsx:20 — TaskStreamController.TaskStreamController has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 10). None of this is in the body itself: all 24 points belong to 4 function literals inside it that branch (lines 36, 67, 71, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · IntegrationEditors.JavaScriptAIDialog (cognitive 24) · ×1
  • IntegrationEditors.JavaScriptAIDialog (cognitive 24) web/src/features/config/IntegrationEditors.tsx:526 — IntegrationEditors.JavaScriptAIDialog has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 13 (16 pts), boolean chains 3, if/else 3, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 2 function items inside it that branch (generate, a function literal at line 572). 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 · autocontinue.afterChatModel (cognitive 23) · ×1
  • autocontinue.afterChatModel (cognitive 23) internal/adapters/runtime/agentkit/middlewares/autocontinue/autocontinue.go:101 — autocontinue.afterChatModel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 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 · modelObservation.chunk (cognitive 23) · ×1
  • modelObservation.chunk (cognitive 23) internal/adapters/runtime/agentkit/model_events.go:88 — modelObservation.chunk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.execute (cognitive 23) · ×1
  • Runner.execute (cognitive 23) internal/adapters/runtime/agentkit/runner.go:89 — Runner.execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 8). 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 · filecron.NewScheduler (cognitive 23) · ×1
  • filecron.NewScheduler (cognitive 23) internal/adapters/scheduler/filecron/scheduler.go:61 — filecron.NewScheduler has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (23 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 · Scheduler.ListHistoryEntries (cognitive 23) · ×1
  • Scheduler.ListHistoryEntries (cognitive 23) internal/adapters/scheduler/filecron/scheduler.go:946 — Scheduler.ListHistoryEntries has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Channel.messageCreate (cognitive 23) · ×1
  • Channel.messageCreate (cognitive 23) internal/adapters/transport/channel/discord/discord.go:302 — Channel.messageCreate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · eventview.formatCommandResult (cognitive 23) · ×1
  • eventview.formatCommandResult (cognitive 23) internal/adapters/transport/cli/eventview/print_format.go:93 — eventview.formatCommandResult has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 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 · tui.markdownTableColumnWidths (cognitive 23) · ×1
  • tui.markdownTableColumnWidths (cognitive 23) internal/adapters/transport/cli/tui/markdown.go:671 — tui.markdownTableColumnWidths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (7 pts) (nesting depth added 7). Of this number, 18 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.enrichAgentDraftRequest (cognitive 23) · ×1
  • handler.enrichAgentDraftRequest (cognitive 23) internal/adapters/transport/http/handler/aiassist.go:205 — handler.enrichAgentDraftRequest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 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 · Runtime.UpdateConfigHandlerWithState (cognitive 23) · ×1
  • Runtime.UpdateConfigHandlerWithState (cognitive 23) internal/adapters/transport/http/handler/config.go:80 — Runtime.UpdateConfigHandlerWithState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 81). 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.RegisterWithProcesses (cognitive 23) · ×1
  • tools.RegisterWithProcesses (cognitive 23) internal/bootstrap/tools/tools.go:58 — tools.RegisterWithProcesses has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 2, boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 335, 297, 116, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · dispatchModel.handleKey (cognitive 22) · ×1
  • dispatchModel.handleKey (cognitive 22) internal/adapters/runtime/agentkit/middlewares/dispatch/view.go:99 — dispatchModel.handleKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 pts), 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 · runtimeModel.renderBottom (cognitive 22) · ×1
  • runtimeModel.renderBottom (cognitive 22) internal/adapters/transport/cli/runtime/runtime_render.go:454 — runtimeModel.renderBottom has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tui.splitMarkdownSegments (cognitive 22) · ×1
  • tui.splitMarkdownSegments (cognitive 22) internal/adapters/transport/cli/tui/markdown.go:286 — tui.splitMarkdownSegments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 11). 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 · ToolCallCard.ToolCallCard (cognitive 22) · ×1
  • ToolCallCard.ToolCallCard (cognitive 22) web/src/features/chat/ToolCallCard.tsx:7 — ToolCallCard.ToolCallCard has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, ternaries 8 (11 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FileShareDialog.FileShareDialog (cognitive 22) · ×1
  • FileShareDialog.FileShareDialog (cognitive 22) web/src/features/files/FileShareDialog.tsx:20 — FileShareDialog.FileShareDialog has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 5, boolean chains 2, error handling 2 (nesting depth added 4). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 5 function items inside it that branch (createShare, copyPreviewURL, a function literal at line 84, …). 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 · presentation.applyPresentationUpdate (cognitive 22) · ×1
  • presentation.applyPresentationUpdate (cognitive 22) web/src/types/presentation.ts:244 — presentation.applyPresentationUpdate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionMessageReader.LoadSessionMessages (cognitive 21) · ×1
  • SessionMessageReader.LoadSessionMessages (cognitive 21) internal/adapters/storage/file/history/session_reader.go:26 — SessionMessageReader.LoadSessionMessages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (7 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 · UVTools.RunScript (cognitive 21) · ×1
  • UVTools.RunScript (cognitive 21) internal/adapters/tools/builtin/script/uv/func.go:419 — UVTools.RunScript has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 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 · UVTools.CheckSyntax (cognitive 21) · ×1
  • UVTools.CheckSyntax (cognitive 21) internal/adapters/tools/builtin/script/uv/func.go:701 — UVTools.CheckSyntax has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 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 · wechatbot.extractText (cognitive 21) · ×1
  • wechatbot.extractText (cognitive 21) REDACTED:778 — wechatbot.extractText 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 · eventview.formatFileOpResult (cognitive 21) · ×1
  • eventview.formatFileOpResult (cognitive 21) internal/adapters/transport/cli/eventview/print_format.go:156 — eventview.formatFileOpResult has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2 (4 pts) (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 · tui.previewJSONValue (cognitive 21) · ×1
  • tui.previewJSONValue (cognitive 21) internal/adapters/transport/cli/tui/runtime_widgets.go:543 — tui.previewJSONValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (4 pts), match/switch 1 (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 · handler.restoreModelSecrets (cognitive 21) · ×1
  • handler.restoreModelSecrets (cognitive 21) internal/adapters/transport/http/handler/config.go:184 — handler.restoreModelSecrets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, 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 · handler.sessionShareTranscript (cognitive 21) · ×1
  • handler.sessionShareTranscript (cognitive 21) internal/adapters/transport/http/handler/session_share.go:86 — handler.sessionShareTranscript has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat.logMessages (cognitive 21) · ×1
  • chat.logMessages (cognitive 21) internal/app/chat/input.go:169 — chat.logMessages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 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 · pathguard.ResolveWorkspace (cognitive 21) · ×1
  • pathguard.ResolveWorkspace (cognitive 21) internal/runtime/pathguard/pathguard.go:21 — pathguard.ResolveWorkspace has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · protocol.splitUIMessage (cognitive 21) · ×1
  • protocol.splitUIMessage (cognitive 21) web/src/features/chat/openui/protocol.ts:88 — protocol.splitUIMessage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · configModel.normalizeConfig (cognitive 21) · ×1
  • configModel.normalizeConfig (cognitive 21) web/src/features/config/configModel.ts:147 — configModel.normalizeConfig has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 21. To reduce it, name the conditions: bind each compound test to a 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 · ConfigEditor.ConfigEditingProvider (cognitive 21) · ×1
  • ConfigEditor.ConfigEditingProvider (cognitive 21) web/src/features/config/ConfigEditor.tsx:29 — ConfigEditor.ConfigEditingProvider has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8, ternaries 4 (6 pts), boolean chains 5, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (confirmRemove, confirm, begin, …). 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 · SkillPanel.CreateSkillDialog (cognitive 21) · ×1
  • SkillPanel.CreateSkillDialog (cognitive 21) web/src/features/skills/SkillPanel.tsx:822 — SkillPanel.CreateSkillDialog has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (8 pts), if/else 3 (nesting depth added 2). Of this number, 13 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · local.readLog (cognitive 20) · ×1
  • local.readLog (cognitive 20) internal/adapters/process/local/local.go:195 — local.readLog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Backend.Load (cognitive 20) · ×1
  • Backend.Load (cognitive 20) internal/adapters/process/local/local.go:77 — Backend.Load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HistoryRecorder.recordToolResult (cognitive 20) · ×1
  • HistoryRecorder.recordToolResult (cognitive 20) internal/adapters/storage/file/history/history_record.go:81 — HistoryRecorder.recordToolResult has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 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 · GitTools.validatePath (cognitive 20) · ×1
  • GitTools.validatePath (cognitive 20) internal/adapters/tools/builtin/git/func.go:54 — GitTools.validatePath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 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 · BunTools.RunScript (cognitive 20) · ×1
  • BunTools.RunScript (cognitive 20) internal/adapters/tools/builtin/script/bun/func.go:453 — BunTools.RunScript has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 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 · runtimeModel.applyMemberEvent (cognitive 20) · ×1
  • runtimeModel.applyMemberEvent (cognitive 20) internal/adapters/transport/cli/runtime/runtime_events.go:130 — runtimeModel.applyMemberEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 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 · runtimeModel.appendHistoryMemberMessage (cognitive 20) · ×1
  • runtimeModel.appendHistoryMemberMessage (cognitive 20) internal/adapters/transport/cli/runtime/runtime_history.go:104 — runtimeModel.appendHistoryMemberMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), 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 · tui.WrapStyledLine (cognitive 20) · ×1
  • tui.WrapStyledLine (cognitive 20) internal/adapters/transport/cli/tui/text_render.go:59 — tui.WrapStyledLine has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · selectModel.Update (cognitive 20) · ×1
  • selectModel.Update (cognitive 20) internal/adapters/transport/cli/tui/select.go:73 — selectModel.Update has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (3 pts) (nesting depth added 11). 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 · middleware.Auth (cognitive 20) · ×1
  • middleware.Auth (cognitive 20) internal/adapters/transport/http/middleware/auth.go:14 — middleware.Auth has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 7 (nesting depth added 1). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 15). 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 · Projector.recoverQuestion (cognitive 20) · ×1
  • Projector.recoverQuestion (cognitive 20) internal/app/chat/presentation/projector.go:357 — Projector.recoverQuestion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QueryService.Query (cognitive 20) · ×1
  • QueryService.Query (cognitive 20) internal/app/session/query.go:81 — QueryService.Query has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.Update (cognitive 20) · ×1
  • Service.Update (cognitive 20) internal/app/session/service.go:83 — Service.Update has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5 (nesting depth added 4). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · skill.ListSkillFiles (cognitive 20) · ×1
  • skill.ListSkillFiles (cognitive 20) internal/app/skill/export.go:115 — skill.ListSkillFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2, boolean chains 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · ChatComposer.domPointFromTextOffset · ×1
  • ChatComposer.domPointFromTextOffset::scan (cognitive 20) web/src/features/chat/ChatComposer.tsx:979 — ChatComposer.domPointFromTextOffset::scan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, 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 · AgentEditors.AgentCatalogEditor (cognitive 20) · ×1
  • AgentEditors.AgentCatalogEditor (cognitive 20) web/src/features/config/AgentEditors.tsx:572 — AgentEditors.AgentCatalogEditor has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, ternaries 8. Of this number, 16 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · copilot.PollForToken (cognitive 19) · ×1
  • copilot.PollForToken (cognitive 19) internal/adapters/model/providers/copilot/oauth.go:61 — copilot.PollForToken has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), 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 · filecron.pruneTaskHistory (cognitive 19) · ×1
  • filecron.pruneTaskHistory (cognitive 19) internal/adapters/scheduler/filecron/results.go:100 — filecron.pruneTaskHistory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (4 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 · Scheduler.cleanupExpiredTasks (cognitive 19) · ×1
  • Scheduler.cleanupExpiredTasks (cognitive 19) internal/adapters/scheduler/filecron/scheduler.go:730 — Scheduler.cleanupExpiredTasks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlite.Open (cognitive 19) · ×1
  • sqlite.Open (cognitive 19) internal/adapters/storage/sqlite/database.go:33 — sqlite.Open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Channel.Send (cognitive 19) · ×1
  • Channel.Send (cognitive 19) internal/adapters/transport/channel/qq/qq.go:195 — Channel.Send has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · commands.interactiveLogoutAction (cognitive 19) · ×1
  • commands.interactiveLogoutAction (cognitive 19) internal/adapters/transport/cli/commands/login.go:425 — commands.interactiveLogoutAction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 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 · commands.promptModelSelection (cognitive 19) · ×1
  • commands.promptModelSelection (cognitive 19) internal/adapters/transport/cli/commands/login.go:606 — commands.promptModelSelection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tui.normalizeCompactMarkdownTableLine (cognitive 19) · ×1
  • tui.normalizeCompactMarkdownTableLine (cognitive 19) internal/adapters/transport/cli/tui/markdown.go:382 — tui.normalizeCompactMarkdownTableLine has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tui.growMarkdownTableColumns (cognitive 19) · ×1
  • tui.growMarkdownTableColumns (cognitive 19) internal/adapters/transport/cli/tui/markdown.go:812 — tui.growMarkdownTableColumns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (5 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 · handler.enrichJavaScriptDraftRequest (cognitive 19) · ×1
  • handler.enrichJavaScriptDraftRequest (cognitive 19) internal/adapters/transport/http/handler/aiassist.go:103 — handler.enrichJavaScriptDraftRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Runtime.PreviewFileHandler (cognitive 19) · ×1
  • Runtime.PreviewFileHandler (cognitive 19) REDACTED:206 — Runtime.PreviewFileHandler has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 207). 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 · IntegrationEditors.JavaScriptToolEditor (cognitive 19) · ×1
  • IntegrationEditors.JavaScriptToolEditor (cognitive 19) web/src/features/config/IntegrationEditors.tsx:314 — IntegrationEditors.JavaScriptToolEditor has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 4, error handling 2, if/else 2 (nesting depth added 2). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (runTest). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · SessionRepository.ClearSessionHistory (cognitive 18) · ×1
  • SessionRepository.ClearSessionHistory (cognitive 18) internal/adapters/storage/file/history/session_repository.go:172 — SessionRepository.ClearSessionHistory 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 · SshClient.CopyLocalFileToRemote (cognitive 18) · ×1
  • SshClient.CopyLocalFileToRemote (cognitive 18) internal/adapters/tools/builtin/ssh/ssh.go:266 — SshClient.CopyLocalFileToRemote has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3. Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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 · Bot.Download (cognitive 18) · ×1
  • Bot.Download (cognitive 18) REDACTED:219 — Bot.Download has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eventview.unclosedFenceRange (cognitive 18) · ×1
  • eventview.unclosedFenceRange (cognitive 18) internal/adapters/transport/cli/eventview/print_stream.go:308 — eventview.unclosedFenceRange has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.ListSessionsWithDocuments (cognitive 18) · ×1
  • runtime.ListSessionsWithDocuments (cognitive 18) internal/adapters/transport/cli/runtime/session_list.go:20 — runtime.ListSessionsWithDocuments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolModel.applyEvent (cognitive 18) · ×1
  • toolModel.applyEvent (cognitive 18) internal/adapters/transport/cli/tui/tool_panel.go:52 — toolModel.applyEvent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), 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 · handler.NewRuntime (cognitive 18) · ×1
  • handler.NewRuntime (cognitive 18) internal/adapters/transport/http/handler/runtime.go:74 — handler.NewRuntime has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Runtime.CreateSessionShareHandler (cognitive 18) · ×1
  • Runtime.CreateSessionShareHandler (cognitive 18) internal/adapters/transport/http/handler/session_share.go:138 — Runtime.CreateSessionShareHandler has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (nesting depth added 2). None of this is in the body itself: all 18 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 · Runtime.handleChatMessage (cognitive 18) · ×1
  • Runtime.handleChatMessage (cognitive 18) internal/adapters/transport/http/handler/websocket.go:211 — Runtime.handleChatMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · Service.Stop (cognitive 18) · ×1
  • Service.Stop (cognitive 18) internal/adapters/transport/http/server.go:118 — Service.Stop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aiassist.normalizeAgentDrafts (cognitive 18) · ×1
  • aiassist.normalizeAgentDrafts (cognitive 18) internal/app/aiassist/service.go:407 — aiassist.normalizeAgentDrafts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Service.RunTurn (cognitive 18) · ×1
  • Service.RunTurn (cognitive 18) internal/app/chat/service.go:55 — Service.RunTurn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 112, 78, 96). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · javascriptHost.Call (cognitive 18) · ×1
  • javascriptHost.Call (cognitive 18) internal/bootstrap/tools/javascript.go:45 — javascriptHost.Call 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 · approval.Require (cognitive 18) · ×1
  • approval.Require (cognitive 18) internal/runtime/approval/approval.go:166 — approval.Require has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (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 · stream_frontend_logic_check.analyzeMemberRenderParts (cognitive 18) · ×1
  • stream_frontend_logic_check.analyzeMemberRenderParts (cognitive 18) web/scripts/stream_frontend_logic_check.ts:490 — stream_frontend_logic_check.analyzeMemberRenderParts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 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 · ChatInput.ChatInput · ×1
  • ChatInput.ChatInput::addAttachments (cognitive 18) web/src/features/chat/ChatInput.tsx:202 — ChatInput.ChatInput::addAttachments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · configModel.buildToolOptions (cognitive 18) · ×1
  • configModel.buildToolOptions (cognitive 18) web/src/features/config/configModel.ts:49 — configModel.buildToolOptions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 3 (5 pts), boolean chains 4, loops 2 (nesting depth added 6). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentEditors.ModelNameField (cognitive 18) · ×1
  • AgentEditors.ModelNameField (cognitive 18) web/src/features/config/AgentEditors.tsx:179 — AgentEditors.ModelNameField has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (6 pts), if/else 3 (nesting depth added 1). Of this number, 12 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FileManager.FileViewerContent (cognitive 18) · ×1
  • FileManager.FileViewerContent (cognitive 18) REDACTED:335 — FileManager.FileViewerContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agentkit.NewChatModelAgent (cognitive 17) · ×1
  • agentkit.NewChatModelAgent (cognitive 17) internal/adapters/runtime/agentkit/factory.go:12 — agentkit.NewChatModelAgent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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 · agentkit.schemaForType (cognitive 17) · ×1
  • agentkit.schemaForType (cognitive 17) internal/adapters/runtime/agentkit/tool.go:186 — agentkit.schemaForType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalBackend.Read (cognitive 17) · ×1
  • LocalBackend.Read (cognitive 17) internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go:107 — LocalBackend.Read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · HistoryRecorder.flushChunkedToolResults (cognitive 17) · ×1
  • HistoryRecorder.flushChunkedToolResults (cognitive 17) internal/adapters/storage/file/history/history_record.go:813 — HistoryRecorder.flushChunkedToolResults has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionRepository.ListSessions (cognitive 17) · ×1
  • SessionRepository.ListSessions (cognitive 17) internal/adapters/storage/file/history/session_repository.go:30 — SessionRepository.ListSessions 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 · runtimeModel.renderPicker (cognitive 17) · ×1
  • runtimeModel.renderPicker (cognitive 17) internal/adapters/transport/cli/runtime/runtime_render.go:598 — runtimeModel.renderPicker has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.handleSignals (cognitive 17) · ×1
  • Session.handleSignals (cognitive 17) internal/adapters/transport/cli/runtime/session.go:140 — Session.handleSignals has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 2 (7 pts), loops 1 (nesting depth added 11). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 142). 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.GetFilesHandler (cognitive 17) · ×1
  • handler.GetFilesHandler (cognitive 17) internal/adapters/transport/http/handler/files.go:314 — handler.GetFilesHandler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1 (nesting depth added 3). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 315). 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.processArchiveSource (cognitive 17) · ×1
  • handler.processArchiveSource (cognitive 17) internal/adapters/transport/http/handler/files.go:1428 — handler.processArchiveSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 1441). 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 · Runtime.ChatHandlerWithState (cognitive 17) · ×1
  • Runtime.ChatHandlerWithState (cognitive 17) internal/adapters/transport/http/handler/http_chat.go:36 — Runtime.ChatHandlerWithState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2 (nesting depth added 1). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 37). 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 · Runtime.CreatePreviewLinkHandler (cognitive 17) · ×1
  • Runtime.CreatePreviewLinkHandler (cognitive 17) REDACTED:114 — Runtime.CreatePreviewLinkHandler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (nesting depth added 2). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 115). 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 · chat.omittedContentPartsNotice (cognitive 17) · ×1
  • chat.omittedContentPartsNotice (cognitive 17) internal/app/chat/input.go:409 — chat.omittedContentPartsNotice has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 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, 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 · ask.AskQuestions (cognitive 17) · ×1
  • ask.AskQuestions (cognitive 17) internal/app/tools/ask/ask.go:74 — ask.AskQuestions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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 · mdiff.myersDiff (cognitive 17) · ×1
  • mdiff.myersDiff (cognitive 17) internal/runtime/mdiff/diff.go:117 — mdiff.myersDiff has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · store.applyChatEvent (cognitive 17) · ×1
  • store.applyChatEvent (cognitive 17) web/src/app/store.ts:187 — store.applyChatEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AgentEditors.ModelsTab (cognitive 17) · ×1
  • AgentEditors.ModelsTab (cognitive 17) web/src/features/config/AgentEditors.tsx:21 — AgentEditors.ModelsTab has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (7 pts), error handling 1, if/else 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 75, a function literal at line 127, loadProviderModels, …). 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 · environment.mergeUVMirrorConfig (cognitive 16) · ×1
  • environment.mergeUVMirrorConfig (cognitive 16) internal/adapters/environment/mirror_config.go:66 — environment.mergeUVMirrorConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, 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 · HistoryRecorder.bufferAssistantMessage (cognitive 16) · ×1
  • HistoryRecorder.bufferAssistantMessage (cognitive 16) internal/adapters/storage/file/history/history_record.go:441 — HistoryRecorder.bufferAssistantMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionShareStore.Load (cognitive 16) · ×1
  • SessionShareStore.Load (cognitive 16) internal/adapters/storage/file/share/session.go:61 — SessionShareStore.Load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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 · client.TextSearch (cognitive 16) · ×1
  • client.TextSearch (cognitive 16) internal/adapters/tools/builtin/search/text_search.go:18 — client.TextSearch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TodoTools.loadFrom (cognitive 16) · ×1
  • TodoTools.loadFrom (cognitive 16) internal/adapters/tools/builtin/todo/func.go:98 — TodoTools.loadFrom 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.
D2 · Cognitive Complexity · channel.splitMessage (cognitive 16) · ×1
  • channel.splitMessage (cognitive 16) internal/adapters/transport/channel/bridge.go:686 — channel.splitMessage 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 · sessionRunner.Run (cognitive 16) · ×1
  • sessionRunner.Run (cognitive 16) internal/adapters/transport/channel/qq/session.go:36 — sessionRunner.Run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 2 (nesting depth added 2). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · Bot.parseMessage (cognitive 16) · ×1
  • Bot.parseMessage (cognitive 16) REDACTED:666 — Bot.parseMessage 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 · tui.DeleteInlineTokenNearCursor (cognitive 16) · ×1
  • tui.DeleteInlineTokenNearCursor (cognitive 16) internal/adapters/transport/cli/tui/inline_input.go:91 — tui.DeleteInlineTokenNearCursor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 6, loops 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 · handler.processArchiveEntry (cognitive 16) · ×1
  • handler.processArchiveEntry (cognitive 16) internal/adapters/transport/http/handler/files.go:1478 — handler.processArchiveEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), 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 · Runtime.PreviewInfoHandler (cognitive 16) · ×1
  • Runtime.PreviewInfoHandler (cognitive 16) REDACTED:347 — Runtime.PreviewInfoHandler has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1 (nesting depth added 2). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 348). 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 · skill.ListLocalSkills (cognitive 16) · ×1
  • skill.ListLocalSkills (cognitive 16) internal/app/skill/export.go:45 — skill.ListLocalSkills has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mdiff.ApplyFileDiff (cognitive 16) · ×1
  • mdiff.ApplyFileDiff (cognitive 16) internal/runtime/mdiff/patch.go:360 — mdiff.ApplyFileDiff has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 1 (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 · pathguard.EnsureRootDirectory (cognitive 16) · ×1
  • pathguard.EnsureRootDirectory (cognitive 16) internal/runtime/pathguard/pathguard.go:121 — pathguard.EnsureRootDirectory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stream_frontend_logic_check.assertReport (cognitive 16) · ×1
  • stream_frontend_logic_check.assertReport (cognitive 16) web/scripts/stream_frontend_logic_check.ts:412 — stream_frontend_logic_check.assertReport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · useActiveQuestion.useActiveQuestion (cognitive 16) · ×1
  • useActiveQuestion.useActiveQuestion (cognitive 16) web/src/features/chat/useActiveQuestion.ts:4 — useActiveQuestion.useActiveQuestion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 3). None of this is in the body itself: all 16 points belong to 5 function literals inside it that branch (lines 19, 7, 13, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D29 · Static Analysis (SAST) · REDACTED · ×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
D3 · God Classes · TooManyFields · ×1
  • TooManyFields: Event internal/domain/event/event.go:66 — TooManyFields — 45 stored fields. The bar is 30 stored fields; this is 15 over it, 1.50× 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (88 shared lines) · ×1
  • Near-duplicate member pair (88 shared lines) internal/adapters/tools/builtin/script/bun/func.go:453 — internal/adapters/tools/builtin/script/bun/func.go:453-558 | internal/adapters/tools/builtin/script/uv/func.go:419-533 — These two members are variants of one another: 88 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 · Edited copy of a member (64 corresponding lines) · ×1
  • Edited copy of a member (64 corresponding lines) internal/adapters/tools/builtin/todo/func.go:205 — internal/adapters/tools/builtin/todo/func.go:205-268 | internal/adapters/tools/builtin/todo/func.go:548-624 — These two members are one piece of code written twice and then edited apart: 64 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 (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) internal/adapters/transport/cli/update/zip.go:25 — internal/adapters/transport/cli/update/zip.go:25-79 | internal/app/skill/install.go:104-151 — These two members are one piece of code written twice and then edited apart: 48 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 (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) internal/adapters/tools/builtin/excel/batch.go:277 — internal/adapters/tools/builtin/excel/batch.go:277-336 | internal/adapters/tools/builtin/excel/batch.go:354-414 — 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 (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) internal/adapters/tools/builtin/git/add.go:23 — internal/adapters/tools/builtin/git/add.go:23-73 | internal/adapters/tools/builtin/git/remove.go:23-73 — These two members are one piece of code written twice and then edited apart: 51 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, 57+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 57+ corresponding lines) internal/adapters/tools/builtin/excel/batch.go:40 — internal/adapters/tools/builtin/excel/batch.go:40-100 | internal/adapters/tools/builtin/excel/batch.go:117-173 | internal/adapters/tools/builtin/excel/batch.go:197-259 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 57 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/adapters/tools/builtin/git/branch.go:35 — internal/adapters/tools/builtin/git/branch.go:35-79 | internal/adapters/tools/builtin/git/tag.go:39-83 — 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 (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) internal/adapters/tools/builtin/doc/func.go:153 — internal/adapters/tools/builtin/doc/func.go:153-202 | internal/adapters/tools/builtin/doc/func.go:205-259 — These two members are one piece of code written twice and then edited apart: 50 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/adapters/transport/cli/eventview/print_markdown.go:259 — internal/adapters/transport/cli/eventview/print_markdown.go:259-299 | internal/adapters/transport/cli/eventview/print_markdown.go:301-340 — 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 copies of one member (4 members, 46+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 46+ corresponding lines) internal/adapters/tools/builtin/excel/batch.go:497 — internal/adapters/tools/builtin/excel/batch.go:497-550 | internal/adapters/tools/builtin/excel/batch.go:627-674 | internal/adapters/tools/builtin/excel/data.go:508-553 | internal/adapters/tools/builtin/excel/data.go:629-674 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 46 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 copies of one member (3 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 38+ corresponding lines) internal/adapters/tools/builtin/excel/cell.go:183 — internal/adapters/tools/builtin/excel/cell.go:183-220 | internal/adapters/tools/builtin/excel/cell.go:237-274 | internal/adapters/tools/builtin/excel/cell.go:292-329 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 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 (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) internal/adapters/transport/cli/eventview/print_format.go:48 — internal/adapters/transport/cli/eventview/print_format.go:48-91 | internal/adapters/transport/cli/eventview/print_markdown.go:127-159 — These two members are one piece of code written twice and then edited apart: 33 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/adapters/scheduler/filecron/scheduler.go:919 — internal/adapters/scheduler/filecron/scheduler.go:919-943 | internal/adapters/scheduler/filecron/scheduler.go:1024-1053 — 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 copies of one member (4 members, 39+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 39+ corresponding lines) internal/adapters/tools/builtin/excel/sheet.go:24 — internal/adapters/tools/builtin/excel/sheet.go:24-63 | internal/adapters/tools/builtin/excel/sheet.go:78-121 | internal/adapters/tools/builtin/excel/sheet.go:256-294 | internal/adapters/tools/builtin/excel/sheet.go:310-352 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 39 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 (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) internal/app/skill/export.go:257 — internal/app/skill/export.go:257-285 | internal/app/skill/export.go:288-314 — 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 copies of one member (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) internal/adapters/tools/builtin/excel/data.go:31 — internal/adapters/tools/builtin/excel/data.go:31-63 | internal/adapters/tools/builtin/excel/data.go:80-114 | internal/adapters/tools/builtin/excel/data.go:199-239 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 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 (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) internal/adapters/transport/channel/discord/discord.go:205 — internal/adapters/transport/channel/discord/discord.go:205-245 | internal/adapters/transport/channel/weixin/weixin.go:187-223 — 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 (4 members, 32+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 32+ corresponding lines) internal/adapters/tools/builtin/script/bun/func.go:150 — internal/adapters/tools/builtin/script/bun/func.go:150-192 | internal/adapters/tools/builtin/script/bun/func.go:209-246 | internal/adapters/tools/builtin/script/uv/func.go:170-204 | internal/adapters/tools/builtin/script/uv/func.go:220-251 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 32 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 copies of one member (4 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 25+ corresponding lines) internal/adapters/transport/http/handler/aiassist.go:21 — internal/adapters/transport/http/handler/aiassist.go:21-45 | internal/adapters/transport/http/handler/aiassist.go:47-71 | internal/adapters/transport/http/handler/aiassist.go:73-101 | internal/adapters/transport/http/handler/aiassist.go:171-195 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 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 copies of one member (3 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 34+ corresponding lines) internal/adapters/tools/builtin/excel/cell.go:25 — internal/adapters/tools/builtin/excel/cell.go:25-62 | internal/adapters/tools/builtin/excel/cell.go:79-112 | internal/adapters/tools/builtin/excel/cell.go:129-166 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 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/app/aiassist/service.go:117 — internal/app/aiassist/service.go:117-143 | internal/app/aiassist/service.go:145-171 | internal/app/aiassist/service.go:173-199 — 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 copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) internal/adapters/transport/http/handler/session.go:256 — internal/adapters/transport/http/handler/session.go:256-284 | internal/adapters/transport/http/handler/session.go:288-315 | internal/adapters/transport/http/handler/session.go:319-346 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 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 (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) internal/adapters/transport/cli/runtime/runtime_history.go:238 — internal/adapters/transport/cli/runtime/runtime_history.go:238-275 | internal/adapters/transport/cli/runtime/runtime_history.go:329-366 — These two members are one piece of code written twice and then edited apart: 38 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/adapters/transport/cli/runtime/runtime_history.go:492 — internal/adapters/transport/cli/runtime/runtime_history.go:492-523 | internal/adapters/transport/cli/runtime/runtime_history.go:731-762 — 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, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) internal/adapters/model/providers/providers.go:116 — internal/adapters/model/providers/providers.go:116-147 | internal/adapters/model/providers/providers.go:218-248 | internal/runtime/model/model.go:64-87 — 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 (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) internal/adapters/runtime/agentkit/middlewares/inject/chatmodel.go:59 — internal/adapters/runtime/agentkit/middlewares/inject/chatmodel.go:59-78 | internal/adapters/runtime/agentkit/middlewares/inject/chatmodel.go:97-117 — 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 (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) internal/adapters/storage/file/history/session_manager.go:65 — internal/adapters/storage/file/history/session_manager.go:65-83 | internal/adapters/storage/file/history/transcript.go:83-101 — 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 copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) internal/adapters/transport/cli/commands/login.go:390 — internal/adapters/transport/cli/commands/login.go:390-422 | internal/adapters/transport/cli/commands/model.go:186-209 — 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 copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) internal/adapters/storage/sqlite/documents.go:73 — internal/adapters/storage/sqlite/documents.go:73-93 | internal/adapters/storage/sqlite/documents.go:96-113 | internal/adapters/storage/sqlite/documents.go:116-141 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 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/adapters/transport/http/handler/files.go:103 — internal/adapters/transport/http/handler/files.go:103-122 | internal/adapters/transport/http/handler/files.go:211-227 | internal/runtime/pathguard/pathguard.go:99-118 — 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 (5 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 20+ corresponding lines) internal/adapters/transport/http/handler/schedule.go:83 — internal/adapters/transport/http/handler/schedule.go:83-102 | internal/adapters/transport/http/handler/schedule.go:129-151 | internal/adapters/transport/http/handler/schedule.go:155-177 | internal/adapters/transport/http/handler/schedule.go:181-206 | internal/adapters/transport/http/handler/schedule.go:210-233 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) internal/adapters/transport/channel/discord/discord.go:28 — internal/adapters/transport/channel/discord/discord.go:28-59 | internal/adapters/transport/channel/weixin/weixin.go:25-55 — These two members are one piece of code written twice and then edited apart: 31 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, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) internal/adapters/transport/http/handler/skills.go:131 — internal/adapters/transport/http/handler/skills.go:131-147 | internal/adapters/transport/http/handler/skills.go:191-205 | internal/adapters/transport/http/handler/skills.go:230-247 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) internal/runtime/hooks/invoke.go:13 — internal/runtime/hooks/invoke.go:13-28 | internal/runtime/hooks/invoke.go:62-77 | internal/runtime/hooks/invoke.go:89-104 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) internal/runtime/turn/interrupt.go:13 — internal/runtime/turn/interrupt.go:13-23 | internal/runtime/turn/interrupt.go:63-74 | internal/runtime/turn/interrupt.go:77-90 — 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, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) internal/adapters/model/providers/copilot/copilot.go:187 — internal/adapters/model/providers/copilot/copilot.go:187-196 | REDACTED:608-617 | internal/adapters/transport/cli/runtime/input.go:29-41 — 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 (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) internal/adapters/runtime/agentkit/providers/ark/ark.go:14 — internal/adapters/runtime/agentkit/providers/ark/ark.go:14-25 | internal/adapters/runtime/agentkit/providers/ollama/ollama.go:14-24 | internal/adapters/runtime/agentkit/providers/openai/openai.go:14-26 | internal/adapters/runtime/agentkit/providers/qwen/qwen.go:14-25 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) internal/adapters/transport/cli/tui/prompt.go:78 — internal/adapters/transport/cli/tui/prompt.go:78-89 | internal/adapters/transport/cli/tui/prompt.go:92-103 | internal/adapters/transport/cli/tui/textarea.go:68-79 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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/adapters/storage/file/share/store.go:168 — internal/adapters/storage/file/share/store.go:168-176 | internal/runtime/checkpoint/memory.go:28-36 — 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 · Edited copy of a member (8 corresponding lines) · ×1
  • Edited copy of a member (8 corresponding lines) internal/adapters/storage/file/history/transcript.go:258 — internal/adapters/storage/file/history/transcript.go:258-265 | internal/adapters/transport/channel/bridge.go:652-659 — 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 · Edited copies of one member (4 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 8+ corresponding lines) internal/adapters/model/providers/providers.go:193 — internal/adapters/model/providers/providers.go:193-200 | internal/adapters/storage/file/history/history.go:155-162 | internal/adapters/transport/channel/channel.go:95-102 | internal/runtime/model/model.go:54-61 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) internal/adapters/tools/builtin/script/bun/func.go:474 — internal/adapters/tools/builtin/script/bun/func.go:474-512 | internal/adapters/tools/builtin/script/uv/func.go:448-486 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/adapters/tools/builtin/script/bun/func.go:474` 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 (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) internal/adapters/tools/builtin/script/bun/func.go:527 — internal/adapters/tools/builtin/script/bun/func.go:527-558 | internal/adapters/tools/builtin/script/uv/func.go:502-533 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/adapters/tools/builtin/script/bun/func.go:527` 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 (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) REDACTED:207 — REDACTED:207-230 | REDACTED:348-371 | REDACTED:637-660 — 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 `REDACTED:207` 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, `REDACTED:232` calls `authorizePreviewPassword`, `GetHeader` and `REDACTED:372` 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) internal/adapters/transport/channel/discord/discord.go:408 — internal/adapters/transport/channel/discord/discord.go:408-431 | internal/adapters/transport/channel/weixin/weixin.go:333-356 — 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.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) internal/adapters/model/providers/providers.go:151 — internal/adapters/model/providers/providers.go:151-173 | internal/runtime/model/model.go:119-140 — before extracting anything, compare `internal/adapters/model/providers/providers.go` and `internal/runtime/model/model.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) internal/adapters/transport/cli/eventview/print_markdown.go:260 — internal/adapters/transport/cli/eventview/print_markdown.go:260-281 | internal/adapters/transport/cli/eventview/print_markdown.go:302-323 — 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 (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) internal/adapters/transport/cli/commands/serve.go:17 — internal/adapters/transport/cli/commands/serve.go:17-35 | internal/adapters/transport/cli/commands/web.go:17-35 — 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/adapters/transport/cli/commands/serve.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.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) internal/adapters/tools/builtin/search/duckduckgo.go:25 — internal/adapters/tools/builtin/search/duckduckgo.go:25-40 | internal/adapters/transport/cli/update/update.go:141-153 — 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/adapters/tools/builtin/search/duckduckgo.go:25` 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 (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) internal/adapters/transport/cli/eventview/print_format.go:49 — internal/adapters/transport/cli/eventview/print_format.go:49-64 | internal/adapters/transport/cli/eventview/print_markdown.go:128-141 — 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/adapters/transport/cli/eventview/print_format.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `content` in one and `getResult func()` 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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) internal/adapters/tools/builtin/script/bun/func.go:499 — internal/adapters/tools/builtin/script/bun/func.go:499-513 | internal/adapters/tools/builtin/script/uv/func.go:473-487 | internal/adapters/tools/builtin/script/uv/func.go:617-631 — `internal/adapters/tools/builtin/script/bun/func.go` and `internal/adapters/tools/builtin/script/uv/func.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `internal/adapters/tools/builtin/script/bun/func.go:499` 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 (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) internal/adapters/transport/http/handler/files.go:133 — internal/adapters/transport/http/handler/files.go:133-147 | internal/adapters/transport/http/handler/files.go:178-191 — 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) internal/adapters/tools/builtin/ssh/ssh.go:208 — internal/adapters/tools/builtin/ssh/ssh.go:208-220 | internal/runtime/executil/output.go:57-70 — 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) internal/adapters/tools/builtin/file/func.go:359 — internal/adapters/tools/builtin/file/func.go:359-370 | internal/adapters/tools/builtin/file/func.go:411-419 — 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/adapters/tools/builtin/file/func.go:359` 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 (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) internal/adapters/tools/builtin/file/func.go:39 — internal/adapters/tools/builtin/file/func.go:39-49 | internal/adapters/tools/builtin/git/func.go:31-40 — 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×1
  • Duplicated block (8–9 lines × 4) internal/adapters/transport/http/handler/http_chat.go:39 — internal/adapters/transport/http/handler/http_chat.go:39-47 | internal/adapters/transport/http/handler/stream.go:40-48 | internal/adapters/transport/http/handler/stream.go:199-206 | internal/adapters/transport/http/handler/stream.go:266-273 — there are 4 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 4 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 × 3) · ×1
  • Duplicated block (9 lines × 3) internal/adapters/transport/http/handler/stream.go:472 — internal/adapters/transport/http/handler/stream.go:472-480 | internal/adapters/transport/http/handler/stream.go:506-514 | internal/adapters/transport/http/handler/stream.go:830-838 — 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/adapters/transport/http/handler/stream.go:472` 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 (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) internal/adapters/storage/file/history/history.go:244 — internal/adapters/storage/file/history/history.go:244-251 | internal/adapters/storage/file/history/history_record.go:103-110 | internal/adapters/storage/file/history/history_record.go:135-142 | internal/adapters/storage/file/history/history_record.go:837-844 — there are 4 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 4 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/adapters/storage/file/history/history.go:244` 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 (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) internal/adapters/transport/http/handler/session.go:262 — internal/adapters/transport/http/handler/session.go:262-269 | internal/adapters/transport/http/handler/session.go:294-301 | internal/adapters/transport/http/handler/session.go:325-332 — 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 (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) REDACTED:221 — REDACTED:221-227 | REDACTED:322-327 | REDACTED:362-368 | REDACTED:651-657 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:221` 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 (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) internal/adapters/model/providers/providers.go:67 — internal/adapters/model/providers/providers.go:67-75 | internal/app/agent/catalog/registry.go:53-61 | internal/app/tools/registry.go:79-87 | internal/runtime/model/model.go:90-98 — before extracting anything, compare `internal/adapters/model/providers/providers.go` and `internal/runtime/model/model.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) internal/adapters/model/providers/providers.go:78 — internal/adapters/model/providers/providers.go:78-84 | internal/app/agent/catalog/registry.go:64-70 | internal/runtime/model/model.go:101-107 — before extracting anything, compare `internal/adapters/model/providers/providers.go` and `internal/runtime/model/model.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) internal/adapters/scheduler/filecron/scheduler.go:1115 — internal/adapters/scheduler/filecron/scheduler.go:1115-1120 | internal/adapters/transport/http/handler/files.go:1534-1539 | internal/app/skill/install.go:233-238 — 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 (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) internal/ports/runtime/interrupt.go:49 — internal/ports/runtime/interrupt.go:49-55 | internal/ports/runtime/runtime_context.go:40-46 | internal/ports/runtime/runtime_context.go:58-64 | internal/ports/runtime/runtime_context.go:83-89 | internal/ports/runtime/runtime_context.go:108-114 | internal/ports/runtime/runtime_context.go:133-139 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
R10 · Code Duplication · Duplication concentrated across 8 sibling directories (27 clone groups) · ×1
  • Duplication concentrated across 8 sibling directories (27 clone groups) web/src/features/chat/ChatPage.tsx:269 — 27 duplicated blocks under web/src/features/ have copies in at least two of the sibling directories chat, config, files, memory, migration, schedules (+2 more sibling(s) not listed) — 21 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 27 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 27 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 27 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 (9 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (9 clone groups) web/src/components/layout/SessionShareDialog.tsx:18 — 9 duplicated blocks under web/src/ have copies in at least two of the sibling directories components, features — 6 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 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (135 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (135 matched lines × 2 locations) web/src/components/layout/SessionShareDialog.tsx:18 — web/src/components/layout/SessionShareDialog.tsx:18 · web/src/features/files/FileShareDialog.tsx:13 — the two spans are one implementation copied and then locally edited — 865 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 (66 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (66 matched lines × 2 locations) web/src/features/chat/ChatPage.tsx:269 — web/src/features/chat/ChatPage.tsx:269 · web/src/features/share/SharePage.tsx:190 — the two spans are one implementation copied and then locally edited — 318 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (40 lines × 2 locations) · ×1
  • Duplicated block (40 lines × 2 locations) web/src/features/share/ShareManagerPanel.tsx:298 — web/src/features/share/ShareManagerPanel.tsx:298 · web/src/features/share/ShareManagerPanel.tsx:397 — 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 (36 lines × 2 locations) · ×1
  • Duplicated block (36 lines × 2 locations) web/src/features/config/IntegrationEditors.tsx:220 — web/src/features/config/IntegrationEditors.tsx:220 · web/src/features/config/IntegrationEditors.tsx:259 — 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 (34 lines × 2 locations) · ×1
  • Duplicated block (34 lines × 2 locations) web/src/features/share/ShareManagerPanel.tsx:255 — web/src/features/share/ShareManagerPanel.tsx:255 · web/src/features/share/ShareManagerPanel.tsx:352 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (32 lines × 2 locations) · ×1
  • Duplicated block (32 lines × 2 locations) web/src/features/share/ShareManagerPanel.tsx:449 — web/src/features/share/ShareManagerPanel.tsx:449 · web/src/features/share/ShareManagerPanel.tsx:498 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) web/src/features/share/ShareManagerPanel.tsx:140 — web/src/features/share/ShareManagerPanel.tsx:140 · web/src/features/skills/SkillPanel.tsx:355 — 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 (22 lines × 2 locations) · ×1
  • Duplicated block (22 lines × 2 locations) web/src/features/schedules/SchedulePanel.tsx:289 — web/src/features/schedules/SchedulePanel.tsx:289 · web/src/features/skills/SkillPanel.tsx:525 — 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 (20 lines × 3 locations) · ×1
  • Duplicated block (20 lines × 3 locations) web/src/components/layout/Sidebar.tsx:534 — web/src/components/layout/Sidebar.tsx:534 · web/src/features/share/ShareManagerPanel.tsx:485 · web/src/features/share/ShareManagerPanel.tsx:535 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) web/src/features/chat/MessageList.tsx:674 — web/src/features/chat/MessageList.tsx:674 · web/src/features/chat/MessageList.tsx:797 — 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 (19 lines × 2 locations) · ×1
  • Duplicated block (19 lines × 2 locations) web/src/features/share/ShareManagerPanel.tsx:194 — web/src/features/share/ShareManagerPanel.tsx:194 · web/src/features/share/ShareManagerPanel.tsx:214 — 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 (18 lines × 3 locations) · ×1
  • Duplicated block (18 lines × 3 locations) web/src/features/schedules/SchedulePanel.tsx:194 — web/src/features/schedules/SchedulePanel.tsx:194 · web/src/features/share/ShareManagerPanel.tsx:147 · web/src/features/skills/SkillPanel.tsx:362 — the 3 copies are spread across 3 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 (13 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (13 matched lines × 2 locations) web/src/features/config/ConfigFields.tsx:86 — web/src/features/config/ConfigFields.tsx:86 · web/src/features/config/IntegrationEditors.tsx:559 — the two spans are one implementation copied and then locally edited — 123 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 (11 lines × 3 locations) · ×1
  • Duplicated block (11 lines × 3 locations) web/src/features/schedules/SchedulePanel.tsx:241 — web/src/features/schedules/SchedulePanel.tsx:241 · web/src/features/share/ShareManagerPanel.tsx:202 · web/src/features/share/ShareManagerPanel.tsx:222 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (10 matched lines × 2 locations) web/src/components/layout/Sidebar.tsx:82 — web/src/components/layout/Sidebar.tsx:82 · web/src/features/chat/ChatComposer.tsx:754 — the two spans are one implementation copied and then locally edited — 66 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.
R2 · Cyclomatic Complexity · Complex function decodeChatEvent (cyclomatic 43, cognitive 51) · ×1
  • Complex function decodeChatEvent (cyclomatic 43, cognitive 51) web/src/types/events.ts:177 — decodeChatEvent has cyclomatic complexity 43 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 ChatComposer (cyclomatic 34, cognitive 32) · ×1
  • Complex function ChatComposer (cyclomatic 34, cognitive 32) web/src/features/chat/ChatComposer.tsx:53 — ChatComposer has cyclomatic complexity 34 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 analyzeEvents (cyclomatic 32, cognitive 53) · ×1
  • Complex function analyzeEvents (cyclomatic 32, cognitive 53) web/scripts/stream_frontend_logic_check.ts:247 — analyzeEvents has cyclomatic complexity 32 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 MigrationGate (cyclomatic 28, cognitive 25) · ×1
  • Complex function MigrationGate (cyclomatic 28, cognitive 25) web/src/features/migration/MigrationGate.tsx:9 — MigrationGate 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 handleKeyDown (cyclomatic 26, cognitive 27) · ×1
  • Complex function handleKeyDown (cyclomatic 26, cognitive 27) web/src/components/ui/select.tsx:58 — handleKeyDown 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 ToolCallCard (cyclomatic 25, cognitive 18) · ×1
  • Complex function ToolCallCard (cyclomatic 25, cognitive 18) web/src/features/chat/ToolCallCard.tsx:7 — ToolCallCard has cyclomatic complexity 25 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 applyChatEvent (cyclomatic 24, cognitive 19) · ×1
  • Complex function applyChatEvent (cyclomatic 24, cognitive 19) web/src/app/store.ts:187 — applyChatEvent has cyclomatic complexity 24 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 PreviewPage (cyclomatic 24, cognitive 15) · ×1
  • Complex function PreviewPage (cyclomatic 24, cognitive 15) web/src/features/preview/PreviewPage.tsx:7 — PreviewPage has cyclomatic complexity 24 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 InteractiveBlock (cyclomatic 23, cognitive 15) · ×1
  • Complex function InteractiveBlock (cyclomatic 23, cognitive 15) web/src/features/chat/openui/AssistantUIContent.tsx:25 — InteractiveBlock has cyclomatic complexity 23 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 analyzeMemberCompletedText (cyclomatic 22, cognitive 25) · ×1
  • Complex function analyzeMemberCompletedText (cyclomatic 22, cognitive 25) web/scripts/stream_frontend_logic_check.ts:430 — analyzeMemberCompletedText has cyclomatic complexity 22 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 normalizeConfig (cyclomatic 22, cognitive 21) · ×1
  • Complex function normalizeConfig (cyclomatic 22, cognitive 21) web/src/features/config/configModel.ts:147 — normalizeConfig has cyclomatic complexity 22 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 manualChunks (cyclomatic 22, cognitive 12) · ×1
  • Complex function manualChunks (cyclomatic 22, cognitive 12) web/vite.config.ts:34 — manualChunks has cyclomatic complexity 22 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 subscribeStream (cyclomatic 21, cognitive 41) · ×1
  • Complex function subscribeStream (cyclomatic 21, cognitive 41) web/src/api/stream.ts:97 — subscribeStream has cyclomatic complexity 21 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 (anonymous) (cyclomatic 21, cognitive 26) · ×1
  • Complex function (anonymous) (cyclomatic 21, cognitive 26) web/src/features/chat/sendMessage.ts:19 — (anonymous) has cyclomatic complexity 21 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 Sidebar (cyclomatic 21, cognitive 20) · ×1
  • Complex function Sidebar (cyclomatic 21, cognitive 20) web/src/components/layout/Sidebar.tsx:56 — Sidebar has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 memberRenderParts (cyclomatic 20, cognitive 34) · ×1
  • Complex function memberRenderParts (cyclomatic 20, cognitive 34) web/scripts/stream_frontend_logic_check.ts:522 — memberRenderParts has cyclomatic complexity 20 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 followTaskStream (cyclomatic 19, cognitive 29) · ×1
  • Complex function followTaskStream (cyclomatic 19, cognitive 29) web/src/features/chat/TaskStreamController.tsx:85 — followTaskStream has cyclomatic complexity 19 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 SkillPanel (cyclomatic 19, cognitive 17) · ×1
  • Complex function SkillPanel (cyclomatic 19, cognitive 17) web/src/features/skills/SkillPanel.tsx:50 — SkillPanel has cyclomatic complexity 19 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 timelineItemSpacingClass (cyclomatic 19, cognitive 12) · ×1
  • Complex function timelineItemSpacingClass (cyclomatic 19, cognitive 12) web/src/features/chat/timeline.ts:10 — timelineItemSpacingClass has cyclomatic complexity 19 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 AskPanel (cyclomatic 19, cognitive 11) · ×1
  • Complex function AskPanel (cyclomatic 19, cognitive 11) web/src/features/chat/MessageList.tsx:1083 — AskPanel has cyclomatic complexity 19 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 SkillDetail (cyclomatic 18, cognitive 16) · ×1
  • Complex function SkillDetail (cyclomatic 18, cognitive 16) web/src/features/skills/SkillPanel.tsx:640 — SkillDetail has cyclomatic complexity 18 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 splitUIMessage (cyclomatic 17, cognitive 23) · ×1
  • Complex function splitUIMessage (cyclomatic 17, cognitive 23) web/src/features/chat/openui/protocol.ts:88 — splitUIMessage has cyclomatic complexity 17 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 applyPresentationUpdate (cyclomatic 17, cognitive 21) · ×1
  • Complex function applyPresentationUpdate (cyclomatic 17, cognitive 21) web/src/types/presentation.ts:244 — applyPresentationUpdate has cyclomatic complexity 17 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 AgentCatalogEditor (cyclomatic 17, cognitive 16) · ×1
  • Complex function AgentCatalogEditor (cyclomatic 17, cognitive 16) web/src/features/config/AgentEditors.tsx:572 — AgentCatalogEditor has cyclomatic complexity 17 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 FileManager (cyclomatic 17, cognitive 16) · ×1
  • Complex function FileManager (cyclomatic 17, cognitive 16) REDACTED:42 — FileManager has cyclomatic complexity 17 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 (anonymous) (cyclomatic 16, cognitive 20) · ×1
  • Complex function (anonymous) (cyclomatic 16, cognitive 20) web/src/features/chat/ChatComposer.tsx:979 — (anonymous) has cyclomatic complexity 16 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 subscribeStream (cyclomatic 15, cognitive 26) · ×1
  • Complex function subscribeStream (cyclomatic 15, cognitive 26) web/scripts/stream_frontend_logic_check.ts:178 — subscribeStream has cyclomatic complexity 15 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 completedMemberCallIDs (cyclomatic 15, cognitive 26) · ×1
  • Complex function completedMemberCallIDs (cyclomatic 15, cognitive 26) web/scripts/stream_frontend_logic_check.ts:351 — completedMemberCallIDs has cyclomatic complexity 15 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 monitorTaskStream (cyclomatic 15, cognitive 21) · ×1
  • Complex function monitorTaskStream (cyclomatic 15, cognitive 21) web/src/features/chat/TaskStreamController.tsx:141 — monitorTaskStream has cyclomatic complexity 15 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 FileViewerContent (cyclomatic 15, cognitive 18) · ×1
  • Complex function FileViewerContent (cyclomatic 15, cognitive 18) REDACTED:335 — FileViewerContent has cyclomatic complexity 15 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 ConfigPanel (cyclomatic 15, cognitive 15) · ×1
  • Complex function ConfigPanel (cyclomatic 15, cognitive 15) web/src/features/config/ConfigPanel.tsx:36 — ConfigPanel has cyclomatic complexity 15 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 normalizeDeepConfig (cyclomatic 15, cognitive 14) · ×1
  • Complex function normalizeDeepConfig (cyclomatic 15, cognitive 14) web/src/features/config/configModel.ts:186 — normalizeDeepConfig has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 JavaScriptToolEditor (cyclomatic 15, cognitive 13) · ×1
  • Complex function JavaScriptToolEditor (cyclomatic 15, cognitive 13) web/src/features/config/IntegrationEditors.tsx:314 — JavaScriptToolEditor has cyclomatic complexity 15 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 CreateSkillDialog (cyclomatic 15, cognitive 11) · ×1
  • Complex function CreateSkillDialog (cyclomatic 15, cognitive 11) web/src/features/skills/SkillPanel.tsx:822 — CreateSkillDialog has cyclomatic complexity 15 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ChatPage (cyclomatic 15, cognitive 10) · ×1
  • Complex function ChatPage (cyclomatic 15, cognitive 10) web/src/features/chat/ChatPage.tsx:19 — ChatPage has cyclomatic complexity 15 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 addAttachments (cyclomatic 14, cognitive 20) · ×1
  • Complex function addAttachments (cyclomatic 14, cognitive 20) web/src/features/chat/ChatInput.tsx:202 — addAttachments has cyclomatic complexity 14 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 assertReport (cyclomatic 14, cognitive 16) · ×1
  • Complex function assertReport (cyclomatic 14, cognitive 16) web/scripts/stream_frontend_logic_check.ts:412 — assertReport has cyclomatic complexity 14 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 encodeUIAction (cyclomatic 14, cognitive 14) · ×1
  • Complex function encodeUIAction (cyclomatic 14, cognitive 14) web/src/features/chat/openui/protocol.ts:25 — encodeUIAction has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 ChatInput (cyclomatic 14, cognitive 13) · ×1
  • Complex function ChatInput (cyclomatic 14, cognitive 13) web/src/features/chat/ChatInput.tsx:22 — ChatInput has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ChannelsTab (cyclomatic 14, cognitive 13) · ×1
  • Complex function ChannelsTab (cyclomatic 14, cognitive 13) web/src/features/config/ConfigPanel.tsx:243 — ChannelsTab has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/features/chat/MessageList.tsx · ×1
  • web/src/features/chat/MessageList.tsx: 1345 lines of code web/src/features/chat/MessageList.tsx:1 — web/src/features/chat/MessageList.tsx has 1345 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/features/skills/SkillPanel.tsx · ×1
  • web/src/features/skills/SkillPanel.tsx: 1006 lines of code web/src/features/skills/SkillPanel.tsx:1 — web/src/features/skills/SkillPanel.tsx has 1006 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/features/chat/ChatComposer.tsx · ×1
  • web/src/features/chat/ChatComposer.tsx: 996 lines of code web/src/features/chat/ChatComposer.tsx:1 — web/src/features/chat/ChatComposer.tsx has 996 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/features/config/AgentEditors.tsx · ×1
  • web/src/features/config/AgentEditors.tsx: 750 lines of code web/src/features/config/AgentEditors.tsx:1 — web/src/features/config/AgentEditors.tsx has 750 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/layout/Sidebar.tsx · ×1
  • web/src/components/layout/Sidebar.tsx: 699 lines of code web/src/components/layout/Sidebar.tsx:1 — web/src/components/layout/Sidebar.tsx has 699 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/features/schedules/SchedulePanel.tsx · ×1
  • web/src/features/schedules/SchedulePanel.tsx: 683 lines of code web/src/features/schedules/SchedulePanel.tsx:1 — web/src/features/schedules/SchedulePanel.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/features/share/ShareManagerPanel.tsx · ×1
  • web/src/features/share/ShareManagerPanel.tsx: 628 lines of code web/src/features/share/ShareManagerPanel.tsx:1 — web/src/features/share/ShareManagerPanel.tsx has 628 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/scripts/stream_frontend_logic_check.ts · ×1
  • web/scripts/stream_frontend_logic_check.ts: 616 lines of code web/scripts/stream_frontend_logic_check.ts:1 — web/scripts/stream_frontend_logic_check.ts has 616 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/features/config/IntegrationEditors.tsx · ×1
  • web/src/features/config/IntegrationEditors.tsx: 611 lines of code web/src/features/config/IntegrationEditors.tsx:1 — web/src/features/config/IntegrationEditors.tsx has 611 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: 610 lines of code REDACTED:1 — REDACTED has 610 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/features/config/ConfigFields.tsx · ×1
  • web/src/features/config/ConfigFields.tsx: 604 lines of code web/src/features/config/ConfigFields.tsx:1 — web/src/features/config/ConfigFields.tsx has 604 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: 474 lines of code web/src/app/store.ts:1 — web/src/app/store.ts has 474 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/features/chat/ChatInput.tsx · ×1
  • web/src/features/chat/ChatInput.tsx: 422 lines of code web/src/features/chat/ChatInput.tsx:1 — web/src/features/chat/ChatInput.tsx has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R8 · Dependency Hygiene · Unused dependency 'animejs' · ×1
  • Unused dependency 'animejs' REDACTED:22 — 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.
R8 · Dependency Hygiene · Unused dependency 'class-variance-authority' · ×1
  • Unused dependency 'class-variance-authority' REDACTED:23 — 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.
X2 · Cancellation propagation · Function without context.Context · ×1
  • Function without context.Context: CheckForUpdates internal/adapters/transport/cli/update/update.go:59 — `CheckForUpdates` 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, …)`.
X3 · Exception handling · Discarded error (an error-returning call as a bare statement) · ×1
  • Discarded error (an error-returning call as a bare statement) internal/bootstrap/composition.go:81 — `processes.Close()` returns an error, and the statement drops it: when `processes.Close` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := processes.Close(); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Minor — 89 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×37
  • Duplicated predicate internal/adapters/scheduler/filecron/results.go:49 — `!domainsession.ValidID(taskID) || len(taskID) > 160` appears character-identically in 2 files — internal/adapters/scheduler/filecron/results.go, internal/app/schedule/executor.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 REDACTED:443 — `!entry.ExpiresAt.IsZero() && now.After(entry.ExpiresAt)` appears character-identically in 2 files — REDACTED, internal/adapters/transport/http/handler/session_share.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/adapters/storage/file/share/session.go:179 — `!entry.ExpiresAt.IsZero() && time.Now().After(entry.ExpiresAt)` appears character-identically in 2 files — internal/adapters/storage/file/share/session.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/adapters/storage/file/history/history_access.go:249 — `agentName == "user" || agentName == "用户"` appears character-identically in 2 files — internal/adapters/storage/file/history/history_access.go, internal/app/chat/input.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/adapters/transport/cli/update/zip.go:82 — `archivePath == "" || strings.ContainsRune(archivePath, '\x00')` appears character-identically in 2 files — internal/adapters/transport/cli/update/zip.go, internal/app/skill/install.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/adapters/tools/javascript/state.go:174 — `char >= 'a' && char <= 'z' || char >= 'A' && char <= 'Z'` appears character-identically in 2 files — internal/adapters/tools/javascript/state.go, internal/app/config/config.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/adapters/transport/cli/update/zip.go:86 — `cleanRelative == "." || filepath.IsAbs(cleanRelative) || filepath.VolumeName(cleanRelative) != ""` appears character-identically in 2 files — internal/adapters/transport/cli/update/zip.go, internal/app/skill/install.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/adapters/storage/file/history/history_record.go:757 — `content == "" || strings.Contains(chunked, content)` appears character-identically in 2 files — internal/adapters/storage/file/history/history_record.go, internal/adapters/transport/channel/bridge.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/adapters/storage/file/history/session_repository.go:197 — `err != nil && !errors.Is(err, os.ErrNotExist)` appears character-identically in 2 files — internal/adapters/storage/file/history/session_repository.go, internal/adapters/transport/http/handler/files.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/adapters/transport/cli/update/zip.go:91 — `err != nil || relative == ".." || strings.HasPrefix(relative, ".."+string(os.PathSeparator)) || filepath.IsAbs(relative)` appears character-identically in 2 files — internal/adapters/transport/cli/update/zip.go, internal/app/skill/install.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/adapters/transport/channel/bridge.go:571 — `event.Notice != nil && event.Notice.Code == "transfer"` appears character-identically in 2 files — internal/adapters/transport/channel/bridge.go, internal/adapters/transport/cli/eventview/print_markdown.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/adapters/runtime/agentkit/tool.go:127 — `inputType.Kind() != reflect.Pointer || inputType.Elem().Kind() != reflect.Struct` appears character-identically in 2 files — internal/adapters/runtime/agentkit/tool.go, internal/ports/runtime/tool.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/adapters/runtime/agentkit/middlewares/fkfs/backend.go:71 — `path == base || strings.HasPrefix(path, base+string(os.PathSeparator))` appears character-identically in 3 files — internal/adapters/runtime/agentkit/middlewares/fkfs/backend.go, internal/adapters/tools/builtin/file/func.go, internal/runtime/pathguard/pathguard.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/adapters/scheduler/filecron/scheduler.go:989 — `readErr != nil && !errors.Is(readErr, io.EOF)` appears character-identically in 2 files — internal/adapters/scheduler/filecron/scheduler.go, internal/adapters/transport/http/handler/files.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/adapters/transport/http/handler/http_chat.go:44 — `req.Message == "" && len(req.Contents) == 0` appears character-identically in 2 files — internal/adapters/transport/http/handler/http_chat.go, internal/adapters/transport/http/handler/stream.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/adapters/model/providers/copilot/oauth.go:126 — `resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices` appears character-identically in 2 files — internal/adapters/model/providers/copilot/oauth.go, internal/adapters/transport/channel/weixin/sdk/protocol/api.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/runtime/hooks/bus.go:154 — `result.Action == ActionSkip || result.Action == ActionReject` appears character-identically in 2 files — internal/runtime/hooks/bus.go, internal/runtime/hooks/invoke.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/adapters/transport/http/handler/stream.go:217 — `stream == nil || stream.Status() != "processing"` appears character-identically in 2 files — internal/adapters/transport/http/handler/stream.go, internal/adapters/transport/http/handler/websocket.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/adapters/transport/cli/eventview/print_stream.go:391 — `strings.Contains(content, "执行出错") || strings.Contains(lower, "error") || strings.Contains(lower, "failed") || strings.Contains(content, "失败"…` appears character-identically in 2 files — internal/adapters/transport/cli/eventview/print_stream.go, internal/adapters/transport/cli/tui/member_panel.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/adapters/model/providers/providers.go:156 — `strings.Contains(lower, "anthropic") || strings.Contains(lower, "claude")` appears character-identically in 2 files — internal/adapters/model/providers/providers.go, internal/runtime/model/model.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/adapters/model/providers/providers.go:168 — `strings.Contains(lower, "copilot") || strings.Contains(lower, "githubcopilot")` appears character-identically in 2 files — internal/adapters/model/providers/providers.go, internal/runtime/model/model.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/adapters/model/providers/providers.go:164 — `strings.Contains(lower, "dashscope") || strings.Contains(lower, "qwen")` appears character-identically in 2 files — internal/adapters/model/providers/providers.go, internal/runtime/model/model.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/adapters/model/providers/providers.go:162 — `strings.Contains(lower, "generativelanguage.googleapis.com") || strings.Contains(lower, "gemini")` appears character-identically in 2 files — internal/adapters/model/providers/providers.go, internal/runtime/model/model.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/adapters/model/providers/providers.go:158 — `strings.Contains(lower, "ollama") || strings.Contains(lower, "11434")` appears character-identically in 2 files — internal/adapters/model/providers/providers.go, internal/runtime/model/model.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/adapters/model/providers/providers.go:160 — `strings.Contains(lower, "volces.com") || strings.Contains(lower, "volcengine")` appears character-identically in 2 files — internal/adapters/model/providers/providers.go, internal/runtime/model/model.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.
  • + 12 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on error · ×15
  • Silent fallback default on error internal/adapters/transport/cli/eventview/print_format.go:58 — `formatSearchResults` 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/adapters/transport/cli/eventview/print_format.go:104 — `formatCommandResult` 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/adapters/transport/cli/eventview/print_format.go:167 — `formatFileOpResult` 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/adapters/transport/cli/eventview/print_format.go:227 — `formatSSHResult` 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/adapters/transport/cli/eventview/print_format.go:308 — `formatTodoResult` 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/adapters/transport/cli/eventview/print_format.go:503 — `formatFilePatchResult` 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/adapters/transport/cli/eventview/print_markdown.go:136 — `formatSearchResultMarkdown` 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/adapters/transport/cli/eventview/print_markdown.go:179 — `formatSchedulerResult` 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/adapters/transport/cli/runtime/runtime_events.go:296 — `runtimeAgentTaskFromCompleteArgs` 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/adapters/transport/cli/runtime/runtime_picker.go:256 — `currentRel` 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/adapters/transport/cli/tui/panel_render.go:203 — `stableToolArgsSummary` 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/adapters/transport/cli/tui/runtime_widgets.go:633 — `compactJSONPreviewValue` 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/app/aiassist/service.go:357 — `marshalPromptPayload` 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/app/appdata/dirs.go:16 — `Dir` turns a non-nil `err` into `return ".fkteams"` — 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/app/chat/taskstream/stream.go:594 — `estimateEventValueSize` turns a non-nil `err` into `return 64` — 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.
X9 · Subsumed condition operand · Subsumed condition operand · ×3
  • Subsumed condition operand internal/runtime/events/friendly_error.go:78 — `strings.Contains(lower, "invalid api key")` can never decide this `||` — every value satisfying `strings.Contains(lower, "invalid api key")` also satisfies `strings.Contains(lower, "api key")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand internal/adapters/transport/cli/tui/markdown.go:877 — `strings.Contains(s, "**")` can never decide this `||` — every value satisfying `strings.Contains(s, "**")` also satisfies `strings.Contains(s, "*")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand internal/adapters/transport/cli/tui/markdown.go:877 — `strings.Contains(s, "__")` can never decide this `||` — every value satisfying `strings.Contains(s, "__")` also satisfies `strings.Contains(s, "_")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×2
  • Projects may be oversized for their cohesion REDACTED:1 — `(repository root)` (70698 LoC, 934 module-visible types across 161 directories) overshoots its size bounds. 2 of 2 build unit(s) (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` (15691 LoC, 182 module-visible types across 22 directories) overshoots its size bounds. 2 of 2 build unit(s) (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 · ×2
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default in catch · ×2
  • Silent fallback default in catch web/src/features/preview/PreviewPage.tsx:128 — `previewLinkIDFromPath` 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/navigation.ts:20 — `chatSessionIDFromPath` 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.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found cmd/fkteams/main.go:1 — 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 `cmd/fkteams/main.go` makes this repository a deployable product (line 1).
D21 · Naming Consistency · `groupATMessageHandler` spells `AT` where 76 names in the project spell it `At` · ×1
  • `groupATMessageHandler` spells `AT` where 76 names in the project spell it `At` internal/adapters/transport/channel/qq/qq.go:293 — 76 of 77 names in project fkteams spell the token `At` (76 of 77; unit: names in project fkteams containing `At`). Peers: Token.ExpiresAt (internal/adapters/model/providers/copilot/token.go:41); Scheduler.AcknowledgeResult(runAt) (internal/adapters/scheduler/filecron/scheduler.go:1171); pendingToolCall.CreatedAt (internal/adapters/storage/file/history/history.go:83); queueSnapshotFile.UpdatedAt (internal/adapters/storage/file/queue/store.go:52); shareFileEntry.ExpiresAt (internal/adapters/storage/file/share/preview.go:24). Rename to `groupAtMessageHandler`. [rule N6]
D27 · Navigability · Scattered collaborators · ×1
  • Scattered collaborators — 42 % of calls cross a namespace and only 56 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
D31 · IaC & Container Security · Low IaC · ×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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
DM5 · Encapsulated state · Mutable entity · ×1
  • Mutable entity: HistoryRecorder internal/adapters/storage/file/history/history.go:126 — `HistoryRecorder` exposes publicly writable state (Documents).
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:5 — No static application security testing detected. For this repository's stack, add gosec / govulncheck (or golangci-lint) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 3 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation REDACTED:16 — `REDACTED` 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 rollback/health safety · ×1
  • No rollback/health safety REDACTED:69 — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate REDACTED:69 — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
PF1 · Benchmark discipline · Benchmarks don't track allocations · ×1
  • Benchmarks don't track allocations internal/runtime/mdiff/mdiff_bench_test.go — A Go testing.B suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured.
R7 · Dead Code · Unused export 'sendSteering' · ×1
  • Unused export 'sendSteering' web/src/api/chat.ts:30 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getTemplateVars' · ×1
  • Unused export 'getTemplateVars' web/src/api/config.ts:20 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'listProviders' · ×1
  • Unused export 'listProviders' web/src/api/providers.ts:4 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'createSession' · ×1
  • Unused export 'createSession' web/src/api/sessions.ts:10 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'updateSessionAgent' · ×1
  • Unused export 'updateSessionAgent' web/src/api/sessions.ts:43 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'streamQueue' · ×1
  • Unused export 'streamQueue' web/src/api/stream.ts:41 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ActivityList' · ×1
  • Unused export 'ActivityList' web/src/features/chat/MessageList.tsx:771 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'approvalDecisionLabel' · ×1
  • Unused export 'approvalDecisionLabel' web/src/features/chat/timeline.ts:60 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'truncateText' · ×1
  • Unused export 'truncateText' web/src/lib/format.ts:26 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'setAgents' · ×1
  • Unused module-local declaration 'setAgents' web/src/features/config/configModel.ts:118 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
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/29 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 · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 2/3 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~0.4 `!` null assertions per 1k TypeScript source lines — 6 assertion(s) across the 16806 source line(s) of the 97 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/features/chat/openui/fieldState.tsx (3), web/src/features/chat/MessageList.tsx (1), web/src/features/schedules/notifications.ts (1). 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.
Minor — 27 finding(s)
D12 · Dependency Hygiene · Outdated · ×27
  • Outdated: charm.land/bubbles/v2 — `charm.land/bubbles/v2` is required at v2.0.0 in REDACTED, but v2.2.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/bubbles/v2@v2.2.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: charm.land/bubbletea/v2 — `charm.land/bubbletea/v2` is required at v2.0.1 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/glamour/v2 — `charm.land/glamour/v2` is required at v2.0.0 in REDACTED, but v2.0.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/glamour/v2@v2.0.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.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/lipgloss/v2@v2.1.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/JohannesKaufmann/html-to-markdown/v2 — `github.com/JohannesKaufmann/html-to-markdown/v2` is required at v2.5.0 in REDACTED, but v2.5.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/JohannesKaufmann/html-to-markdown/v2@v2.5.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/PuerkitoBio/goquery — `github.com/PuerkitoBio/goquery` is required at v1.10.3 in REDACTED, but v1.14.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/PuerkitoBio/goquery@v1.14.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/alecthomas/chroma/v2 — `github.com/alecthomas/chroma/v2` is required at v2.20.0 in REDACTED, but v2.27.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/alecthomas/chroma/v2@v2.27.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/bmatcuk/doublestar/v4 — `github.com/bmatcuk/doublestar/v4` is required at v4.10.0 in REDACTED, but v4.10.4 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/bmatcuk/doublestar/v4@v4.10.4 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/cloudwego/eino-ext/components/model/ark — `github.com/cloudwego/eino-ext/components/model/ark` is required at v0.1.68 in REDACTED, but v0.1.72 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-ext/components/model/ark@v0.1.72 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/cloudwego/eino-ext/components/model/deepseek — `github.com/cloudwego/eino-ext/components/model/deepseek` is required at v0.1.6 in REDACTED, but v0.1.7 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-ext/components/model/deepseek@v0.1.7 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/cloudwego/eino-ext/components/tool/mcp — `github.com/cloudwego/eino-ext/components/tool/mcp` is required at v0.0.8 in REDACTED, but v0.0.9 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-ext/components/tool/mcp@v0.0.9 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/gin-gonic/gin — `github.com/gin-gonic/gin` is required at v1.11.0 in REDACTED, but v1.12.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/gin-gonic/gin@v1.12.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/go-git/go-git/v5 — `github.com/go-git/go-git/v5` is required at v5.16.4 in REDACTED, but v5.19.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/go-git/go-git/v5@v5.19.3 && 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 v0.43.2 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. This crosses a major version — v0 releases carry no compatibility promise, so read the changelog before taking it. Run `go get github.com/mark3labs/mcp-go@v1.5.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/mattn/go-runewidth — `github.com/mattn/go-runewidth` is required at v0.0.20 in REDACTED, but v0.0.31 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/mattn/go-runewidth@v0.0.31 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/pelletier/go-toml/v2 — `github.com/pelletier/go-toml/v2` is required at v2.2.4 in REDACTED, but v2.4.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/pelletier/go-toml/v2@v2.4.3 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/pkg/sftp — `github.com/pkg/sftp` is required at v1.13.10 in REDACTED, but v1.13.12 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/pkg/sftp@v1.13.12 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/pterm/pterm — `github.com/pterm/pterm` is required at v0.12.82 in REDACTED, but v0.12.84 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/pterm/pterm@v0.12.84 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/urfave/cli/v3 — `github.com/urfave/cli/v3` is required at v3.7.0 in REDACTED, but v3.14.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/urfave/cli/v3@v3.14.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/xuri/excelize/v2 — `github.com/xuri/excelize/v2` is required at v2.10.0 in REDACTED, but v2.11.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/xuri/excelize/v2@v2.11.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.uber.org/zap — `go.uber.org/zap` is required at v1.27.1 in REDACTED, but v1.28.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.uber.org/zap@v1.28.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/oauth2 — `golang.org/x/oauth2` is required at v0.35.0 in REDACTED, but v0.38.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/oauth2@v0.38.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sync — `golang.org/x/sync` is required at v0.24.0 in REDACTED, but v0.25.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/sync@v0.25.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.
  • + 2 more in this group — see findings.md.

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-af5c41bd9061457c9d390195b0c1589b/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-af5c41bd9061457c9d390195b0c1589b/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=260" --report-format json --report-path /tmp/watchdog-gitleaks-af5c41bd9061457c9d390195b0c1589b/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-af5c41bd9061457c9d390195b0c1589b/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 .36artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .28artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .9artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 4 file(s) — `internal/adapters/storage/file/share/preview.go`, `internal/adapters/storage/file/share/session.go`, `internal/app/config/config.go`, `web/tailwind.config.ts` — 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 01a1e845-d303-7790-8493-0dcf6cddc222 · 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